From 7ea33913c23227a93851338325f2fadd556d0a74 Mon Sep 17 00:00:00 2001 From: Matt Stow Date: Fri, 20 Dec 2024 12:56:26 +1100 Subject: [PATCH 1/4] icon: Created new icon, ProgressNotRequiredIcon (#1919) --- .changeset/plop-create-ProgressNotRequired.md | 5 +++++ docs/components/designSystemComponents.tsx | 1 + .../src/icon/__snapshots__/Icon.test.tsx.snap | 21 +++++++++++++++++++ .../icon/icons/ProgressNotRequiredIcon.tsx | 6 ++++++ packages/react/src/icon/index.ts | 1 + packages/react/src/icon/utils.tsx | 2 ++ 6 files changed, 36 insertions(+) create mode 100644 .changeset/plop-create-ProgressNotRequired.md create mode 100644 packages/react/src/icon/icons/ProgressNotRequiredIcon.tsx diff --git a/.changeset/plop-create-ProgressNotRequired.md b/.changeset/plop-create-ProgressNotRequired.md new file mode 100644 index 000000000000..53eadbca0127 --- /dev/null +++ b/.changeset/plop-create-ProgressNotRequired.md @@ -0,0 +1,5 @@ +--- +'@ag.ds-next/react': minor +--- + +icon: Created new icon, ProgressNotRequiredIcon. diff --git a/docs/components/designSystemComponents.tsx b/docs/components/designSystemComponents.tsx index 22f584c3c6dd..bfda28164450 100644 --- a/docs/components/designSystemComponents.tsx +++ b/docs/components/designSystemComponents.tsx @@ -128,6 +128,7 @@ export { PrintIcon, ProgressBlockedIcon, ProgressDoingIcon, + ProgressNotRequiredIcon, ProgressTodoIcon, ScrollbarArrowLeftIcon, ScrollbarArrowRightIcon, diff --git a/packages/react/src/icon/__snapshots__/Icon.test.tsx.snap b/packages/react/src/icon/__snapshots__/Icon.test.tsx.snap index b776d9a7a576..43fa01ad0a76 100644 --- a/packages/react/src/icon/__snapshots__/Icon.test.tsx.snap +++ b/packages/react/src/icon/__snapshots__/Icon.test.tsx.snap @@ -1288,6 +1288,27 @@ exports[`Icon ProgressDoingIcon renders correctly 1`] = ` `; +exports[`Icon ProgressNotRequiredIcon renders correctly 1`] = ` +
+ +
+`; + exports[`Icon ProgressPausedIcon renders correctly 1`] = `
, + 'ProgressNotRequiredIcon' +); diff --git a/packages/react/src/icon/index.ts b/packages/react/src/icon/index.ts index 827826dd0404..3ae3de80ddca 100644 --- a/packages/react/src/icon/index.ts +++ b/packages/react/src/icon/index.ts @@ -60,6 +60,7 @@ export { PlusIcon } from './icons/PlusIcon'; export { PrintIcon } from './icons/PrintIcon'; export { ProgressBlockedIcon } from './icons/ProgressBlockedIcon'; export { ProgressDoingIcon } from './icons/ProgressDoingIcon'; +export { ProgressNotRequiredIcon } from './icons/ProgressNotRequiredIcon'; export { ProgressPausedIcon } from './icons/ProgressPausedIcon'; export { ProgressTodoIcon } from './icons/ProgressTodoIcon'; export { ScrollbarArrowLeftIcon } from './icons/ScrollbarArrowLeftIcon'; diff --git a/packages/react/src/icon/utils.tsx b/packages/react/src/icon/utils.tsx index 5396035a9b4e..8126e148043e 100644 --- a/packages/react/src/icon/utils.tsx +++ b/packages/react/src/icon/utils.tsx @@ -53,6 +53,7 @@ import { PlusIcon } from './icons/PlusIcon'; import { PrintIcon } from './icons/PrintIcon'; import { ProgressBlockedIcon } from './icons/ProgressBlockedIcon'; import { ProgressDoingIcon } from './icons/ProgressDoingIcon'; +import { ProgressNotRequiredIcon } from './icons/ProgressNotRequiredIcon'; import { ProgressPausedIcon } from './icons/ProgressPausedIcon'; import { ProgressTodoIcon } from './icons/ProgressTodoIcon'; import { ScrollbarArrowLeftIcon } from './icons/ScrollbarArrowLeftIcon'; @@ -130,6 +131,7 @@ export const allIcons = { PrintIcon, ProgressBlockedIcon, ProgressDoingIcon, + ProgressNotRequiredIcon, ProgressPausedIcon, ProgressTodoIcon, ScrollbarArrowLeftIcon, From ddbcf4aa6de61589dc8349c259a02534aacdab8e Mon Sep 17 00:00:00 2001 From: writetosalman Date: Fri, 3 Jan 2025 09:41:59 +1100 Subject: [PATCH 2/4] TaskList: task list to support `notRequired` status (#1884) Co-authored-by: Matt Stow --- .changeset/many-dancers-invent.md | 6 ++++++ packages/react/src/task-list/TaskList.stories.tsx | 4 ++-- packages/react/src/task-list/TaskListItem.tsx | 7 +++++++ packages/react/src/task-list/docs/overview.mdx | 11 ++++++++++- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .changeset/many-dancers-invent.md diff --git a/.changeset/many-dancers-invent.md b/.changeset/many-dancers-invent.md new file mode 100644 index 000000000000..173b36eb9d8e --- /dev/null +++ b/.changeset/many-dancers-invent.md @@ -0,0 +1,6 @@ +--- +'@ag.ds-next/react': minor +'@ag.ds-next/docs': minor +--- + +task-list: Add new `'notRequired'` status. diff --git a/packages/react/src/task-list/TaskList.stories.tsx b/packages/react/src/task-list/TaskList.stories.tsx index 54ff163470f7..4dc93e7ac242 100644 --- a/packages/react/src/task-list/TaskList.stories.tsx +++ b/packages/react/src/task-list/TaskList.stories.tsx @@ -33,8 +33,8 @@ const exampleLinkItems: TaskListProps['items'] = [ { href: '#', label: 'Export', - message: 'Short description of the task', - status: 'todo', + message: 'This step is no longer required based on your selection criteria', + status: 'notRequired', }, { href: '#', diff --git a/packages/react/src/task-list/TaskListItem.tsx b/packages/react/src/task-list/TaskListItem.tsx index beb45856295a..20e869cddad4 100644 --- a/packages/react/src/task-list/TaskListItem.tsx +++ b/packages/react/src/task-list/TaskListItem.tsx @@ -3,6 +3,7 @@ import { Flex } from '../flex'; import { Text } from '../text'; import { TextLink } from '../text-link'; import { + ProgressNotRequiredIcon, ProgressDoingIcon, SuccessFilledIcon, ProgressTodoIcon, @@ -75,6 +76,7 @@ const TaskListItem = ({ ...props }: TaskListItemProps) => { const { icon: Icon, iconColor, label } = statusMap[status]; + return (
  • + + + notRequired + + No longer required + + The task is no longer required based on your selection criteria. + + From 55637c9875988f6b2d2a1de83d072ac77c75d113 Mon Sep 17 00:00:00 2001 From: Matt Stow Date: Mon, 6 Jan 2025 09:36:50 +1100 Subject: [PATCH 3/4] loading: Announce fullscreen LoadingBlanket assertively (#1916) --- .changeset/itchy-coats-argue.md | 5 +++++ packages/react/src/loading/LoadingBlanket.tsx | 4 +++- packages/react/src/loading/LoadingBlanketLabel.tsx | 8 ++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changeset/itchy-coats-argue.md diff --git a/.changeset/itchy-coats-argue.md b/.changeset/itchy-coats-argue.md new file mode 100644 index 000000000000..56d78ebcc535 --- /dev/null +++ b/.changeset/itchy-coats-argue.md @@ -0,0 +1,5 @@ +--- +'@ag.ds-next/react': patch +--- + +loading: Announce `'fullscreen'` `LoadingBlanket` assertively. diff --git a/packages/react/src/loading/LoadingBlanket.tsx b/packages/react/src/loading/LoadingBlanket.tsx index cbffdd18fd02..debe83359742 100644 --- a/packages/react/src/loading/LoadingBlanket.tsx +++ b/packages/react/src/loading/LoadingBlanket.tsx @@ -18,7 +18,9 @@ export const LoadingBlanket = ({ - {label} + + {label} + ); diff --git a/packages/react/src/loading/LoadingBlanketLabel.tsx b/packages/react/src/loading/LoadingBlanketLabel.tsx index 7de85b31561c..ab817562d3fd 100644 --- a/packages/react/src/loading/LoadingBlanketLabel.tsx +++ b/packages/react/src/loading/LoadingBlanketLabel.tsx @@ -3,10 +3,14 @@ import { Text } from '../text'; export type LoadingBlanketLabelProps = { children: ReactNode; + role: 'alert' | 'status'; }; -export const LoadingBlanketLabel = ({ children }: LoadingBlanketLabelProps) => ( - +export const LoadingBlanketLabel = ({ + children, + role, +}: LoadingBlanketLabelProps) => ( + {children} ); From 6c7351c58dba507f7b838c6fefe288eeef072332 Mon Sep 17 00:00:00 2001 From: Matt Stow Date: Mon, 6 Jan 2025 16:38:16 +1100 Subject: [PATCH 4/4] chore: Added react/jsx-sort-props eslint rule & sorted all props (#1920) --- .changeset/little-jars-search.md | 8 + .eslintrc.js | 25 +-- .storybook/components/LinkComponent.tsx | 4 +- .storybook/components/PageTemplate.tsx | 6 +- .storybook/preview.tsx | 6 +- .../stories/DataFiltering/ListFiltering.tsx | 24 +-- .../stories/DataFiltering/Table.stories.tsx | 6 +- .../DataFiltering/TableFilteringLarge.tsx | 8 +- .../DataFiltering/TableFilteringMedium.tsx | 19 ++- .../DataFiltering/TableFilteringSmall.tsx | 2 +- .../components/ActiveFilters.tsx | 6 +- .../components/DashboardFilterDrawer.tsx | 12 +- .../components/DashboardPagination.tsx | 4 +- .../DataFiltering/components/DataList.tsx | 10 +- .../DataFiltering/components/DataTable.tsx | 24 +-- .../components/DataTableBatchActionsBar.tsx | 10 +- .../DataFiltering/components/DataTableRow.tsx | 4 +- .../components/DataTableSelectAllCheckbox.tsx | 2 +- .../components/FilterAccordion.tsx | 18 +-- .../components/FilterAssigneeSelect.tsx | 18 +-- .../DataFiltering/components/FilterBar.tsx | 16 +- .../components/FilterDestinationsSelect.tsx | 18 +-- .../components/FilterSearchInput.tsx | 8 +- .../components/FilterServicesSelect.tsx | 8 +- .../components/FilterStateSelect.tsx | 12 +- .../components/FilterStatusSelect.tsx | 20 +-- .../DataFiltering/components/SortBySelect.tsx | 18 +-- .../DataLoadingWithCards.stories.tsx | 2 +- .../DataLoading/DataLoadingWithCards.tsx | 8 +- .../DataLoadingWithTable.stories.tsx | 2 +- .../DataLoading/DataLoadingWithTable.tsx | 26 +-- .../stories/FormFields/FormFields.stories.tsx | 34 ++-- .../KitchenSink/KitchenSink.stories.tsx | 152 +++++++++--------- .../ModalAddTrackingNumber.tsx | 20 +-- .../ModalConfirmDelete.tsx | 8 +- .../SelectableTableBatchActions.tsx | 42 ++--- .../TableFilters.tsx | 10 +- .../useNotification.tsx | 4 +- docs/components/AllIconsPlayground.tsx | 10 +- docs/components/Code.tsx | 60 +++---- docs/components/ConditionalFieldContainer.tsx | 2 +- docs/components/DoDontHeading.tsx | 4 +- docs/components/DocumentTitle.tsx | 2 +- docs/components/FigmaLogo.tsx | 8 +- docs/components/GithubLogo.tsx | 12 +- docs/components/LinkComponent.tsx | 4 +- docs/components/PageLayout.tsx | 2 +- docs/components/PageTitle.tsx | 4 +- docs/components/PatternLayout.tsx | 20 +-- docs/components/PictogramCard.tsx | 4 +- docs/components/PkgCardList.tsx | 10 +- docs/components/PkgLayout.tsx | 22 +-- docs/components/SiteFooter.tsx | 2 +- docs/components/SiteHeader.tsx | 6 +- docs/components/StorybookLogo.tsx | 10 +- docs/components/TemplateLayout.tsx | 22 +-- docs/components/TokenCharts.tsx | 24 +-- docs/components/TokenColorTable.tsx | 10 +- docs/components/TokenLayout.tsx | 8 +- docs/components/mdxComponents.tsx | 26 +-- docs/next-env.d.ts | 2 +- docs/pages/_app.tsx | 18 +-- docs/pages/about.tsx | 4 +- .../pages/components/[slug]/accessibility.tsx | 6 +- docs/pages/components/[slug]/code.tsx | 6 +- docs/pages/components/[slug]/content.tsx | 6 +- docs/pages/components/[slug]/index.tsx | 8 +- docs/pages/components/[slug]/rationale.tsx | 6 +- docs/pages/components/index.tsx | 26 +-- docs/pages/content/[slug].tsx | 10 +- docs/pages/content/index.tsx | 8 +- docs/pages/foundations/[slug].tsx | 8 +- docs/pages/foundations/index.tsx | 8 +- docs/pages/foundations/tokens/[slug].tsx | 6 +- docs/pages/foundations/tokens/border.tsx | 8 +- docs/pages/foundations/tokens/colour.tsx | 30 ++-- docs/pages/foundations/tokens/index.tsx | 8 +- docs/pages/foundations/tokens/max-width.tsx | 6 +- docs/pages/foundations/tokens/typography.tsx | 6 +- docs/pages/guides/[slug].tsx | 10 +- .../guides/how-to-write-guidance/[slug].tsx | 12 +- .../guides/how-to-write-guidance/index.tsx | 8 +- docs/pages/guides/index.tsx | 8 +- docs/pages/index.tsx | 20 +-- docs/pages/patterns/[slug].tsx | 6 +- docs/pages/patterns/index.tsx | 8 +- docs/pages/roadmap.tsx | 4 +- docs/pages/templates/[slug].tsx | 8 +- docs/pages/templates/index.tsx | 14 +- docs/pages/updates/[slug].tsx | 6 +- docs/pages/updates/index.tsx | 6 +- .../components/ConditionalFieldContainer.tsx | 2 +- .../FormExampleMultiStep.tsx | 2 +- .../FormExampleMultiStep0.tsx | 16 +- .../FormExampleMultiStep1.tsx | 32 ++-- .../FormExampleMultiStep2.tsx | 12 +- .../FormExampleMultiStep3.tsx | 22 +-- .../FormExampleMultiStep4.tsx | 24 +-- .../FormExampleMultiStepActions.tsx | 16 +- .../FormExampleMultiStepContainer.tsx | 8 +- .../components/FormRequiredFieldsMessage.tsx | 2 +- example-site/components/FormStepTitle.tsx | 8 +- example-site/components/LinkComponent.tsx | 4 +- example-site/components/PageTitle.tsx | 4 +- example-site/components/SiteFooter.tsx | 2 +- example-site/components/SiteHeader.tsx | 4 +- example-site/components/SiteLayout.tsx | 2 +- example-site/components/TemplateBanner.tsx | 6 +- example-site/next-env.d.ts | 2 +- example-site/pages/_app.tsx | 18 +-- example-site/pages/category/index.tsx | 6 +- .../pages/category/subcategory/content.tsx | 14 +- .../pages/category/subcategory/index.tsx | 8 +- .../subcategory/multi-page-form/form.tsx | 2 +- .../subcategory/multi-page-form/index.tsx | 4 +- .../subcategory/multi-page-form/success.tsx | 2 +- .../subcategory/single-page-form-success.tsx | 2 +- .../category/subcategory/single-page-form.tsx | 110 ++++++------- example-site/pages/index.tsx | 18 +-- example-site/pages/sign-in-form.tsx | 20 +-- .../CollapsingSideBar.tsx | 6 +- packages/react/src/_popover/Popover.tsx | 4 +- .../src/a11y/ExternalLinkCallout.test.tsx | 2 +- .../react/src/a11y/VisuallyHidden.test.tsx | 2 +- .../react/src/accordion/Accordion.stories.tsx | 30 ++-- packages/react/src/accordion/Accordion.tsx | 2 +- .../react/src/accordion/AccordionBody.tsx | 6 +- .../react/src/accordion/AccordionItem.tsx | 6 +- .../react/src/accordion/AccordionTitle.tsx | 28 ++-- .../react/src/ag-branding/Logo.stories.tsx | 2 +- packages/react/src/ag-branding/Logo.tsx | 8 +- .../src/app-layout/AppLayout.stories.tsx | 2 +- .../react/src/app-layout/AppLayout.test.tsx | 18 +-- .../react/src/app-layout/AppLayoutContent.tsx | 2 +- .../app-layout/AppLayoutFooter.stories.tsx | 2 +- .../react/src/app-layout/AppLayoutFooter.tsx | 10 +- .../app-layout/AppLayoutHeader.stories.tsx | 4 +- .../src/app-layout/AppLayoutHeaderAccount.tsx | 18 +-- .../AppLayoutHeaderAccountDropdown.tsx | 34 ++-- .../src/app-layout/AppLayoutHeaderBrand.tsx | 20 +-- .../src/app-layout/AppLayoutHeaderNav.tsx | 2 +- .../app-layout/AppLayoutSidebar.stories.tsx | 2 +- .../src/app-layout/AppLayoutSidebarDialog.tsx | 4 +- .../src/app-layout/AppLayoutSidebarNav.tsx | 12 +- packages/react/src/app-layout/test-utils.tsx | 14 +- .../src/autocomplete/Autocomplete.stories.tsx | 14 +- .../src/autocomplete/Autocomplete.test.tsx | 2 +- .../react/src/autocomplete/Autocomplete.tsx | 2 +- packages/react/src/avatar/Avatar.stories.tsx | 18 +-- packages/react/src/avatar/Avatar.tsx | 10 +- packages/react/src/box/Box.stories.tsx | 8 +- packages/react/src/box/Box.tsx | 2 +- .../react/src/breadcrumbs/Breadcrumbs.tsx | 2 +- .../src/breadcrumbs/BreadcrumbsContainer.tsx | 6 +- .../src/breadcrumbs/BreadcrumbsDivider.tsx | 2 +- .../react/src/breadcrumbs/BreadcrumbsItem.tsx | 2 +- .../src/breadcrumbs/BreadcrumbsToggle.tsx | 12 +- packages/react/src/button/BaseButton.tsx | 6 +- packages/react/src/button/Button.test.tsx | 2 +- packages/react/src/button/Button.tsx | 14 +- packages/react/src/button/ButtonGroup.tsx | 4 +- .../react/src/call-to-action/CallToAction.tsx | 10 +- .../react/src/callout/Callout.stories.tsx | 2 +- packages/react/src/callout/Callout.tsx | 10 +- packages/react/src/card/Card.stories.tsx | 36 ++--- packages/react/src/card/Card.test.tsx | 2 +- packages/react/src/card/Card.tsx | 6 +- packages/react/src/card/CardFooter.tsx | 2 +- packages/react/src/card/CardHeader.tsx | 2 +- .../react/src/checkbox/CheckboxContainer.tsx | 8 +- .../react/src/checkbox/CheckboxIndicator.tsx | 10 +- packages/react/src/checkbox/CheckboxInput.tsx | 2 +- packages/react/src/checkbox/CheckboxLabel.tsx | 2 +- packages/react/src/columns/Columns.tsx | 2 +- .../react/src/combobox/Combobox.stories.tsx | 14 +- packages/react/src/combobox/Combobox.test.tsx | 10 +- .../src/combobox/ComboboxAsync.stories.tsx | 18 +-- .../react/src/combobox/ComboboxAsync.test.tsx | 2 +- packages/react/src/combobox/ComboboxAsync.tsx | 8 +- .../combobox/ComboboxAsyncMulti.stories.tsx | 18 +-- .../src/combobox/ComboboxAsyncMulti.test.tsx | 22 +-- .../react/src/combobox/ComboboxAsyncMulti.tsx | 4 +- .../combobox/ComboboxBase/ComboboxBase.tsx | 10 +- .../combobox/ComboboxBase/ComboboxButtons.tsx | 14 +- .../ComboboxBase/ComboboxMultiBase.tsx | 18 +-- .../ComboboxBase/ComboboxSearchIcon.tsx | 4 +- .../src/combobox/ComboboxBase/ComboboxTag.tsx | 16 +- .../src/combobox/ComboboxMulti.stories.tsx | 14 +- .../react/src/combobox/ComboboxMulti.test.tsx | 2 +- packages/react/src/combobox/ComboboxMulti.tsx | 4 +- .../combobox/ComboboxRenderItem.stories.tsx | 2 +- packages/react/src/content/BaseContent.tsx | 10 +- .../control-group/ControlGroup.stories.tsx | 4 +- .../react/src/control-group/ControlGroup.tsx | 12 +- packages/react/src/core/tokens.stories.tsx | 36 ++--- .../src/date-picker/Calendar.stories.tsx | 4 +- packages/react/src/date-picker/Calendar.tsx | 45 +++--- .../src/date-picker/CalendarContainer.tsx | 4 +- .../src/date-picker/DatePicker.stories.tsx | 8 +- .../react/src/date-picker/DatePicker.test.tsx | 30 ++-- packages/react/src/date-picker/DatePicker.tsx | 26 +-- .../react/src/date-picker/DatePickerInput.tsx | 30 ++-- .../DateRangePicker.stories.tsx | 8 +- .../DateRangePicker.test.tsx | 36 ++--- .../src/date-range-picker/DateRangePicker.tsx | 54 +++---- packages/react/src/details/Details.tsx | 10 +- .../src/direction-link/DirectionLink.tsx | 10 +- packages/react/src/drawer/Drawer.stories.tsx | 126 +++++++-------- packages/react/src/drawer/Drawer.test.tsx | 22 +-- packages/react/src/drawer/Drawer.tsx | 4 +- packages/react/src/drawer/DrawerDialog.tsx | 32 ++-- .../dropdown-menu/DropdownMenu.stories.tsx | 80 ++++----- .../src/dropdown-menu/DropdownMenu.test.tsx | 32 ++-- .../src/dropdown-menu/DropdownMenuButton.tsx | 2 +- .../src/dropdown-menu/DropdownMenuGroup.tsx | 14 +- .../src/dropdown-menu/DropdownMenuItem.tsx | 26 +-- .../dropdown-menu/DropdownMenuItemRadio.tsx | 20 +-- .../src/dropdown-menu/DropdownMenuPanel.tsx | 18 +-- packages/react/src/field/Field.stories.tsx | 2 +- packages/react/src/field/Field.test.tsx | 6 +- packages/react/src/field/Field.tsx | 6 +- packages/react/src/field/FieldContainer.tsx | 6 +- packages/react/src/field/FieldHint.tsx | 2 +- packages/react/src/field/FieldLabel.tsx | 2 +- packages/react/src/field/FieldMessage.tsx | 10 +- .../react/src/fieldset/Fieldset.stories.tsx | 46 +++--- packages/react/src/fieldset/Fieldset.test.tsx | 6 +- packages/react/src/fieldset/Fieldset.tsx | 2 +- .../react/src/fieldset/FieldsetContainer.tsx | 2 +- packages/react/src/fieldset/FieldsetHint.tsx | 6 +- .../react/src/fieldset/FieldsetLegend.tsx | 2 +- packages/react/src/file-input/FileInput.tsx | 2 +- .../src/file-upload/FileUpload.stories.tsx | 24 +-- .../react/src/file-upload/FileUpload.test.tsx | 8 +- packages/react/src/file-upload/FileUpload.tsx | 10 +- .../file-upload/FileUploadFileThumbnail.tsx | 12 +- .../filter-sidebar/FilterSidebar.stories.tsx | 16 +- packages/react/src/flex/Flex.stories.tsx | 50 +++--- packages/react/src/flex/Flex.tsx | 4 +- packages/react/src/footer/Footer.tsx | 4 +- packages/react/src/footer/FooterDivider.tsx | 2 +- .../react/src/global-alert/GlobalAlert.tsx | 18 +-- .../global-alert/GlobalAlertCloseButton.tsx | 6 +- .../grouped-fields/GroupedFields.stories.tsx | 20 +-- .../src/grouped-fields/GroupedFields.test.tsx | 2 +- packages/react/src/header/Header.stories.tsx | 2 +- packages/react/src/header/Header.test.tsx | 4 +- packages/react/src/header/Header.tsx | 2 +- packages/react/src/header/HeaderBrand.tsx | 20 +-- packages/react/src/header/HeaderContainer.tsx | 2 +- packages/react/src/heading/Heading.tsx | 16 +- .../HeroBanner/HeroBanner.stories.tsx | 6 +- .../HeroBanner/HeroBanner.test.tsx | 4 +- .../HeroBanner/HeroBannerContent.tsx | 6 +- .../HeroBanner/HeroBannerImage.tsx | 4 +- .../HeroBanner/HeroBannerMobileImage.tsx | 2 +- .../HeroBanner/HeroBannerTitle.tsx | 2 +- .../HeroCategoryBanner.stories.tsx | 6 +- .../HeroCategoryBanner.test.tsx | 4 +- .../HeroCategoryBannerContent.tsx | 6 +- .../HeroCategoryBannerImage.tsx | 4 +- .../HeroCategoryBannerMobileImage.tsx | 2 +- .../HeroCategoryBannerTitle.tsx | 2 +- .../HeroSubcategoryBanner.stories.tsx | 2 +- .../HeroSubcategoryBannerContent.tsx | 2 +- .../HeroSubcategoryBannerTitle.tsx | 2 +- packages/react/src/icon/Icon.stories.tsx | 14 +- .../react/src/icon/icons/AlertFilledIcon.tsx | 4 +- .../react/src/icon/icons/CalendarIcon.tsx | 2 +- packages/react/src/icon/icons/CloseIcon.tsx | 4 +- packages/react/src/icon/icons/CopyIcon.tsx | 2 +- packages/react/src/icon/icons/MinusIcon.tsx | 2 +- packages/react/src/icon/icons/PauseIcon.tsx | 4 +- packages/react/src/icon/icons/SearchIcon.tsx | 2 +- .../src/icon/icons/WarningFilledIcon.tsx | 4 +- .../indicator-dot/IndicatorDot.stories.tsx | 2 +- .../react/src/indicator-dot/IndicatorDot.tsx | 2 +- .../src/inpage-nav/InpageNavContainer.tsx | 6 +- .../react/src/link-list/LinkListContainer.tsx | 2 +- .../src/loading/LoadingBlanket.stories.tsx | 8 +- .../src/loading/LoadingBlanketContainer.tsx | 8 +- .../src/loading/LoadingBlanketContent.tsx | 2 +- packages/react/src/loading/LoadingDots.tsx | 16 +- .../react/src/main-nav/MainNav.stories.tsx | 18 +-- packages/react/src/main-nav/MainNav.test.tsx | 2 +- .../react/src/main-nav/MainNavBottomBar.tsx | 2 +- packages/react/src/main-nav/MainNavDialog.tsx | 14 +- .../src/main-nav/MainNavDialogNavList.tsx | 4 +- packages/react/src/main-nav/MainNavList.tsx | 10 +- .../react/src/main-nav/MainNavListItem.tsx | 2 +- .../src/main-nav/MainNavListItemDropdown.tsx | 42 ++--- .../react/src/main-nav/MainNavMenuButtons.tsx | 40 ++--- packages/react/src/modal/Modal.stories.tsx | 34 ++-- packages/react/src/modal/Modal.test.tsx | 22 +-- packages/react/src/modal/ModalCover.tsx | 2 +- packages/react/src/modal/ModalDialog.tsx | 10 +- packages/react/src/modal/ModalTitle.tsx | 6 +- packages/react/src/page-alert/PageAlert.tsx | 10 +- .../src/page-alert/PageAlertCloseButton.tsx | 6 +- .../react/src/page-alert/PageAlertTitle.tsx | 6 +- .../src/pagination/Pagination.stories.tsx | 4 +- packages/react/src/pagination/Pagination.tsx | 14 +- .../pagination/PaginationButtons.stories.tsx | 4 +- .../src/pagination/PaginationButtons.tsx | 14 +- .../src/pagination/PaginationContainer.tsx | 10 +- .../pagination/PaginationItemDirection.tsx | 24 +-- .../src/pagination/PaginationItemPage.tsx | 38 ++--- .../PaginationItemsPerPageSelect.tsx | 6 +- .../react/src/pagination/PaginationSelect.tsx | 8 +- .../src/password-input/PasswordInput.tsx | 4 +- .../progress-indicator/ProgressIndicator.tsx | 4 +- .../ProgressIndicatorItem.tsx | 6 +- .../ProgressIndicatorList.tsx | 2 +- packages/react/src/prose/Prose.stories.tsx | 2 +- packages/react/src/prose/Prose.tsx | 2 +- packages/react/src/radio/RadioContainer.tsx | 8 +- packages/react/src/radio/RadioIndicator.tsx | 16 +- packages/react/src/radio/RadioInput.tsx | 2 +- packages/react/src/radio/RadioLabel.tsx | 2 +- .../src/search-box/SearchBox.stories.tsx | 2 +- packages/react/src/search-box/SearchBox.tsx | 2 +- .../react/src/search-box/SearchBoxButton.tsx | 6 +- .../react/src/search-box/SearchBoxInput.tsx | 4 +- .../react/src/search-box/SearchBoxLabel.tsx | 2 +- .../src/search-input/SearchInput.stories.tsx | 2 +- .../react/src/search-input/SearchInput.tsx | 18 +-- .../search-input/SearchInputClearButton.tsx | 10 +- .../src/search-input/SearchInputIcon.tsx | 4 +- .../src/section-alert/SectionAlert.test.tsx | 2 +- .../SectionAlertDismissButton.tsx | 6 +- packages/react/src/select/Select.stories.tsx | 6 +- packages/react/src/select/Select.tsx | 16 +- .../react/src/side-nav/SideNav.stories.tsx | 2 +- packages/react/src/side-nav/SideNav.test.tsx | 4 +- packages/react/src/side-nav/SideNavLink.tsx | 18 +-- packages/react/src/skeleton/SkeletonBox.tsx | 16 +- .../src/skeleton/SkeletonHeading.stories.tsx | 2 +- .../src/skeleton/SkeletonText.stories.tsx | 4 +- packages/react/src/skip-link/SkipLinkItem.tsx | 4 +- .../react/src/skip-link/SkipLinks.stories.tsx | 4 +- packages/react/src/stack/Stack.stories.tsx | 56 +++---- packages/react/src/stack/Stack.tsx | 4 +- .../src/status-badge/StatusBadge.stories.tsx | 2 +- .../react/src/status-badge/StatusBadge.tsx | 22 +-- packages/react/src/sub-nav/SubNav.stories.tsx | 4 +- packages/react/src/sub-nav/SubNav.tsx | 4 +- .../react/src/sub-nav/SubNavContainer.tsx | 8 +- packages/react/src/sub-nav/SubNavList.tsx | 6 +- .../react/src/summary-list/SummaryList.tsx | 14 +- packages/react/src/switch/SwitchTrack.tsx | 16 +- packages/react/src/table/Table.stories.tsx | 48 +++--- packages/react/src/table/Table.test.tsx | 16 +- packages/react/src/table/Table.tsx | 20 +-- .../react/src/table/TableBatchActionsBar.tsx | 8 +- packages/react/src/table/TableCaption.tsx | 2 +- packages/react/src/table/TableCell.tsx | 2 +- packages/react/src/table/TableHeader.tsx | 2 +- .../react/src/table/TableHeaderSortable.tsx | 4 +- packages/react/src/table/TableRow.tsx | 2 +- packages/react/src/table/TableScroller.tsx | 16 +- packages/react/src/tabs/TabButton.tsx | 20 +-- packages/react/src/tabs/TabList.tsx | 4 +- packages/react/src/tabs/TabPanel.tsx | 14 +- packages/react/src/tabs/Tabs.stories.tsx | 14 +- packages/react/src/tabs/Tabs.tsx | 2 +- packages/react/src/tags/Tags.stories.tsx | 2 +- packages/react/src/tags/TagsList.tsx | 2 +- .../react/src/task-list/TaskListHeading.tsx | 2 +- packages/react/src/task-list/TaskListItem.tsx | 38 ++--- .../src/text-input/TextInput.stories.tsx | 2 +- packages/react/src/text-input/TextInput.tsx | 10 +- packages/react/src/text-link/TextLink.tsx | 2 +- .../react/src/text-link/TextLinkExternal.tsx | 6 +- packages/react/src/text/Text.tsx | 2 +- .../react/src/textarea/Textarea.stories.tsx | 2 +- packages/react/src/textarea/Textarea.tsx | 10 +- .../src/time-picker/TimePicker.stories.tsx | 2 +- .../react/src/time-picker/TimePicker.test.tsx | 2 +- packages/react/src/time-picker/TimePicker.tsx | 2 +- .../components/ConditionalFieldContainer.tsx | 2 +- yourgov/components/CustomIcons.tsx | 12 +- yourgov/components/ErrorBoundary.tsx | 2 +- .../ApplicationHistory.tsx | 12 +- .../CannotStartAlert.tsx | 2 +- .../FormContainer.tsx | 8 +- .../GettingStartedForm.tsx | 8 +- .../StepActions.tsx | 16 +- .../UploadFileTable.tsx | 2 +- .../steps/FormContainer.tsx | 6 +- .../steps/FormStep1.tsx | 12 +- .../steps/FormStep10.tsx | 6 +- .../steps/FormStep10Review.tsx | 30 ++-- .../steps/FormStep1ChangeDetails.tsx | 32 ++-- .../steps/FormStep2.tsx | 28 ++-- .../steps/FormStep3.tsx | 70 ++++---- .../steps/FormStep4.tsx | 12 +- .../steps/FormStep5.tsx | 44 ++--- .../steps/FormStep6.tsx | 18 +-- .../steps/FormStep7.tsx | 2 +- .../steps/FormStep7AddEmployee.tsx | 14 +- .../steps/FormStep8.tsx | 2 +- .../steps/FormStep9.tsx | 18 +-- .../FormRegisterPetDetails.tsx | 2 +- .../FormRegisterPetDetailsActions.tsx | 16 +- .../FormRegisterPetDetailsContainer.tsx | 8 +- .../FormRegisterPetDetailsStep0.tsx | 10 +- .../FormRegisterPetDetailsStep1.tsx | 32 ++-- .../FormRegisterPetDetailsStep2.tsx | 22 +-- .../FormRegisterPetDetailsStep3.tsx | 12 +- .../FormRegisterPetDetailsStep4.tsx | 18 +-- .../FormRegisterPetPersonalDetails.tsx | 2 +- .../FormRegisterPetPersonalDetailsActions.tsx | 16 +- ...ormRegisterPetPersonalDetailsContainer.tsx | 8 +- .../FormRegisterPetPersonalDetailsStep0.tsx | 54 +++---- .../FormRegisterPetPersonalDetailsStep1.tsx | 56 +++---- .../FormRegisterPetPersonalDetailsStep2.tsx | 22 +-- .../FormRegisterPetPersonalDetailsStep3.tsx | 14 +- .../components/FormRequiredFieldsMessage.tsx | 2 +- yourgov/components/FormStepTitle.tsx | 8 +- yourgov/components/HelpReference.tsx | 10 +- yourgov/components/Layout/AppLayout.tsx | 18 +-- yourgov/components/Layout/SiteLayout.tsx | 6 +- yourgov/components/LinkComponent.tsx | 4 +- yourgov/components/PageTitle.tsx | 4 +- yourgov/components/RegistrationsCardList.tsx | 2 +- .../AccessRequestsTable.tsx | 22 +-- .../ModalConfirmApproveAccess.tsx | 8 +- .../ModalConfirmRejectAccess.tsx | 8 +- .../ModalUnavailableFeature.tsx | 6 +- yourgov/components/Staff/ActiveFilters.tsx | 6 +- .../Staff/DashboardFilterDrawer.tsx | 10 +- .../components/Staff/DashboardPagination.tsx | 4 +- yourgov/components/Staff/DataTable.tsx | 14 +- .../Staff/DataTableBatchActionsBar.tsx | 10 +- yourgov/components/Staff/DataTableRow.tsx | 2 +- .../Staff/DataTableSelectAllCheckbox.tsx | 2 +- yourgov/components/Staff/FilterBar.tsx | 16 +- .../components/Staff/FilterSearchInput.tsx | 8 +- .../components/Staff/FilterStatusSelect.tsx | 18 +-- .../Staff/ModalConfirmChangeRole.tsx | 8 +- .../Staff/ModalConfirmPauseAccess.tsx | 8 +- .../Staff/ModalConfirmRemoveAccess.tsx | 8 +- yourgov/components/Staff/SortBySelect.tsx | 18 +-- .../components/Staff/StaffMembersTable.tsx | 4 +- yourgov/next-env.d.ts | 2 +- yourgov/pages/_app.tsx | 8 +- yourgov/pages/app/dashboard/index.tsx | 14 +- yourgov/pages/app/index.tsx | 6 +- yourgov/pages/app/permits/[slug].tsx | 44 ++--- .../permits/apply-for-new-permit/index.tsx | 26 +-- .../mobile-food-vendor-permit/index.tsx | 6 +- .../success/index.tsx | 6 +- yourgov/pages/app/permits/index.tsx | 6 +- .../app/permits/manage-existing/index.tsx | 2 +- yourgov/pages/app/staff/[slug].tsx | 16 +- yourgov/pages/app/staff/index.tsx | 22 +-- .../app/staff/invite-staff-member/index.tsx | 42 ++--- yourgov/pages/index.tsx | 6 +- .../services/food-drink-hospitality/index.tsx | 28 ++-- .../index.tsx | 14 +- yourgov/pages/services/index.tsx | 14 +- .../pages/services/registrations/index.tsx | 2 +- .../services/registrations/pet/index.tsx | 4 +- .../registrations/pet/task-1/index.tsx | 4 +- .../registrations/pet/task-2/index.tsx | 4 +- yourgov/pages/sign-in.tsx | 22 +-- yourgov/pages/sign-out.tsx | 2 +- 467 files changed, 2724 insertions(+), 2729 deletions(-) create mode 100644 .changeset/little-jars-search.md diff --git a/.changeset/little-jars-search.md b/.changeset/little-jars-search.md new file mode 100644 index 000000000000..7b4c8b500af9 --- /dev/null +++ b/.changeset/little-jars-search.md @@ -0,0 +1,8 @@ +--- +'@ag.ds-next/react': patch +'@ag.ds-next/example-site': patch +'@ag.ds-next/yourgov': patch +'@ag.ds-next/docs': patch +--- + +chore: Added `react/jsx-sort-props` eslint rule and sorted all props. diff --git a/.eslintrc.js b/.eslintrc.js index 044a26c3b361..6c24a6f67d4a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,18 +9,6 @@ module.exports = { 'prettier', ], rules: { - 'no-restricted-imports': [ - 'error', - { - paths: [ - { - name: 'react', - importNames: ['useId'], - message: "Please import 'useId' from '/core' instead.", - }, - ], - }, - ], '@typescript-eslint/ban-types': [ 'error', { @@ -49,6 +37,19 @@ module.exports = { pathGroupsExcludedImportTypes: ['builtin'], }, ], + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: 'react', + importNames: ['useId'], + message: "Please import 'useId' from '/core' instead.", + }, + ], + }, + ], + 'react/jsx-sort-props': ['error'], }, overrides: [ { diff --git a/.storybook/components/LinkComponent.tsx b/.storybook/components/LinkComponent.tsx index 1e0301ddbd80..145f7a3d3cbe 100644 --- a/.storybook/components/LinkComponent.tsx +++ b/.storybook/components/LinkComponent.tsx @@ -15,9 +15,9 @@ export const LinkComponent = forwardRef( // Regex finds links starting with: `http://` | `https://` | `//` const hrefAsString = typeof href === 'string' ? href : href?.pathname; if (hrefAsString && /^(https?:\/\/|\/\/)/i.test(hrefAsString)) { - return ; + return ; } - return ; + return ; } ); diff --git a/.storybook/components/PageTemplate.tsx b/.storybook/components/PageTemplate.tsx index 24dfb7b302bf..0cb1d5caf56c 100644 --- a/.storybook/components/PageTemplate.tsx +++ b/.storybook/components/PageTemplate.tsx @@ -28,14 +28,14 @@ export function PageTemplate({
    } heading="Export Service" + logo={} subline="Supporting Australian agricultural exports" /> diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index a26c26bb9af4..b02f798f70ba 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -102,12 +102,12 @@ const preview: Preview = { const theme = storybookThemes[context.globals.brand as StorybookThemes]; const palette = context.globals.palette; return ( - + diff --git a/.storybook/stories/DataFiltering/ListFiltering.tsx b/.storybook/stories/DataFiltering/ListFiltering.tsx index b841bd911256..b43e0c8c1caf 100644 --- a/.storybook/stories/DataFiltering/ListFiltering.tsx +++ b/.storybook/stories/DataFiltering/ListFiltering.tsx @@ -37,11 +37,11 @@ export const ListFiltering = () => { { setFilter({ requestDate })} onFromInputChange={(from) => @@ -70,6 +69,7 @@ export const ListFiltering = () => { requestDate: { ...filters.requestDate, to }, }) } + toLabel="Registered to" value={filters.requestDate} /> @@ -80,36 +80,36 @@ export const ListFiltering = () => { {tableCaption} -
    +
    {loading ? 'Loading audits' : ''}
    diff --git a/.storybook/stories/DataFiltering/Table.stories.tsx b/.storybook/stories/DataFiltering/Table.stories.tsx index ff6f9118757a..ec761471e2fb 100644 --- a/.storybook/stories/DataFiltering/Table.stories.tsx +++ b/.storybook/stories/DataFiltering/Table.stories.tsx @@ -86,7 +86,7 @@ export const FilterAndSelectSmall = { table. - + @@ -153,7 +153,7 @@ export const FilterAndSelectMedium = { button is pressed. - + @@ -221,7 +221,7 @@ export const FilterAndSelectLarge = { area next to the button which opens the drawer. - + diff --git a/.storybook/stories/DataFiltering/TableFilteringLarge.tsx b/.storybook/stories/DataFiltering/TableFilteringLarge.tsx index 287537d2d87a..6114657de9ea 100644 --- a/.storybook/stories/DataFiltering/TableFilteringLarge.tsx +++ b/.storybook/stories/DataFiltering/TableFilteringLarge.tsx @@ -44,9 +44,9 @@ export const TableFilteringLarge = ({ @@ -54,19 +54,19 @@ export const TableFilteringLarge = ({ {selectable && ( - + )} diff --git a/.storybook/stories/DataFiltering/TableFilteringMedium.tsx b/.storybook/stories/DataFiltering/TableFilteringMedium.tsx index d762cce1472f..7a0920d8e0f7 100644 --- a/.storybook/stories/DataFiltering/TableFilteringMedium.tsx +++ b/.storybook/stories/DataFiltering/TableFilteringMedium.tsx @@ -60,15 +60,14 @@ export const TableFilteringMedium = ({ @@ -84,19 +83,19 @@ export const TableFilteringMedium = ({ {selectable && ( - + )} - + diff --git a/.storybook/stories/DataFiltering/TableFilteringSmall.tsx b/.storybook/stories/DataFiltering/TableFilteringSmall.tsx index cf0722b77938..fe1e4eef0d63 100644 --- a/.storybook/stories/DataFiltering/TableFilteringSmall.tsx +++ b/.storybook/stories/DataFiltering/TableFilteringSmall.tsx @@ -42,7 +42,7 @@ export const TableFilteringSmall = ({ {selectable && ( - + )} diff --git a/.storybook/stories/DataFiltering/components/ActiveFilters.tsx b/.storybook/stories/DataFiltering/components/ActiveFilters.tsx index 0eb3584f32d8..3dcb419033b9 100644 --- a/.storybook/stories/DataFiltering/components/ActiveFilters.tsx +++ b/.storybook/stories/DataFiltering/components/ActiveFilters.tsx @@ -108,16 +108,16 @@ export const ActiveFilters = () => { } return ( - + Active filters} items={tags} /> diff --git a/.storybook/stories/DataFiltering/components/DashboardFilterDrawer.tsx b/.storybook/stories/DataFiltering/components/DashboardFilterDrawer.tsx index 54ace89c7252..a12f3b788235 100644 --- a/.storybook/stories/DataFiltering/components/DashboardFilterDrawer.tsx +++ b/.storybook/stories/DataFiltering/components/DashboardFilterDrawer.tsx @@ -82,20 +82,20 @@ export const DashboardFilterDrawer = ({ }} > - - } + isOpen={isDrawerOpen} + onClose={cancel} + title="Filter by" >
    @@ -112,10 +112,10 @@ export const DashboardFilterDrawer = ({ setFormState({ ...formState, requestDate }) } + toLabel="Registered to" value={formState.requestDate} /> diff --git a/.storybook/stories/DataFiltering/components/DashboardPagination.tsx b/.storybook/stories/DataFiltering/components/DashboardPagination.tsx index 37a2fed96787..50069fbe38c5 100644 --- a/.storybook/stories/DataFiltering/components/DashboardPagination.tsx +++ b/.storybook/stories/DataFiltering/components/DashboardPagination.tsx @@ -41,10 +41,9 @@ export const DashboardPagination = () => { return ( setPagination({ perPage: displayText.perPage, page })} - totalPages={totalPages} itemRangeText={displayText.itemRangeText} itemsPerPage={displayText.perPage} + onChange={(page) => setPagination({ perPage: displayText.perPage, page })} onItemsPerPageChange={(perPage) => setPagination({ page: getValidPage({ @@ -56,6 +55,7 @@ export const DashboardPagination = () => { perPage, }) } + totalPages={totalPages} /> ); }; diff --git a/.storybook/stories/DataFiltering/components/DataList.tsx b/.storybook/stories/DataFiltering/components/DataList.tsx index 591257d5b63e..ba1dba0081e5 100644 --- a/.storybook/stories/DataFiltering/components/DataList.tsx +++ b/.storybook/stories/DataFiltering/components/DataList.tsx @@ -34,7 +34,7 @@ export const DataList = ({ loading, data }: DataListProps) => { data.length > 0 && ( {data.map((item) => ( - + ))} ) @@ -44,8 +44,8 @@ export const DataList = ({ loading, data }: DataListProps) => { {!loading && data.length === 0 && ( <> - - + + No results found Try adjusting your filter options. @@ -64,9 +64,9 @@ type DataListItemProps = { const DataListItem = ({ data }: DataListItemProps) => { return ( - + - +

    {data.businessName}

    diff --git a/.storybook/stories/DataFiltering/components/DataTable.tsx b/.storybook/stories/DataFiltering/components/DataTable.tsx index f5c15b60d57a..dd40929c0205 100644 --- a/.storybook/stories/DataFiltering/components/DataTable.tsx +++ b/.storybook/stories/DataFiltering/components/DataTable.tsx @@ -63,7 +63,7 @@ export const DataTable = forwardRef( return ( - + Failed to load @@ -76,10 +76,10 @@ export const DataTable = forwardRef( if (!loading && data.length === 0) { return ( - + - - + + No results found Try adjusting your filter options. @@ -96,15 +96,15 @@ export const DataTable = forwardRef( Table column headers with buttons are sortable.
    ) : null} -
    +
    {loading ? 'Loading audits' : ''}
    ( return ( {label} @@ -217,11 +217,11 @@ export const DataTable = forwardRef( const rowIndex = index + 2; return ( {businessName} diff --git a/.storybook/stories/DataFiltering/components/DataTableBatchActionsBar.tsx b/.storybook/stories/DataFiltering/components/DataTableBatchActionsBar.tsx index 3ef22bc18bd6..130d52377b3b 100644 --- a/.storybook/stories/DataFiltering/components/DataTableBatchActionsBar.tsx +++ b/.storybook/stories/DataFiltering/components/DataTableBatchActionsBar.tsx @@ -18,26 +18,26 @@ export const DataTableBatchActionsBar = () => { - diff --git a/.storybook/stories/DataFiltering/components/DataTableRow.tsx b/.storybook/stories/DataFiltering/components/DataTableRow.tsx index e2f46bdda731..afdd172d9dea 100644 --- a/.storybook/stories/DataFiltering/components/DataTableRow.tsx +++ b/.storybook/stories/DataFiltering/components/DataTableRow.tsx @@ -20,7 +20,7 @@ export const DataTableRowAssignee = ({ return ( - + {assignee} @@ -78,9 +78,9 @@ export const DataTableRow = ({ toggleRowSelected(itemId)} + size="sm" > {`Select ${businessName}`} diff --git a/.storybook/stories/DataFiltering/components/DataTableSelectAllCheckbox.tsx b/.storybook/stories/DataFiltering/components/DataTableSelectAllCheckbox.tsx index 847ac173260f..7123c58e9634 100644 --- a/.storybook/stories/DataFiltering/components/DataTableSelectAllCheckbox.tsx +++ b/.storybook/stories/DataFiltering/components/DataTableSelectAllCheckbox.tsx @@ -12,10 +12,10 @@ export const DataTableSelectAllCheckbox = () => { } = useSelectAllRows(data); return ( Select all rows diff --git a/.storybook/stories/DataFiltering/components/FilterAccordion.tsx b/.storybook/stories/DataFiltering/components/FilterAccordion.tsx index 22946bc76899..767de80da237 100644 --- a/.storybook/stories/DataFiltering/components/FilterAccordion.tsx +++ b/.storybook/stories/DataFiltering/components/FilterAccordion.tsx @@ -35,31 +35,30 @@ export const FilterAccordion = ({ return ( setFilter({ requestDate })} onFromInputChange={(from) => @@ -72,6 +71,7 @@ export const FilterAccordion = ({ requestDate: { ...filters.requestDate, to }, }) } + toLabel="Registered to" value={filters.requestDate} /> diff --git a/.storybook/stories/DataFiltering/components/FilterAssigneeSelect.tsx b/.storybook/stories/DataFiltering/components/FilterAssigneeSelect.tsx index ace2d3614ae0..7b1fc509873f 100644 --- a/.storybook/stories/DataFiltering/components/FilterAssigneeSelect.tsx +++ b/.storybook/stories/DataFiltering/components/FilterAssigneeSelect.tsx @@ -8,22 +8,22 @@ export const FilterAssigneeSelect = ({ block }: { block?: boolean }) => { return ( { const value = e.target.value; setFilter({ state: value === '' ? undefined : value, }); }} + options={STATE_OPTIONS} + placeholder="All" + value={filters.state || ''} /> ); }; diff --git a/.storybook/stories/DataFiltering/components/FilterStatusSelect.tsx b/.storybook/stories/DataFiltering/components/FilterStatusSelect.tsx index 81d677be7e13..bbcc42aa34a4 100644 --- a/.storybook/stories/DataFiltering/components/FilterStatusSelect.tsx +++ b/.storybook/stories/DataFiltering/components/FilterStatusSelect.tsx @@ -7,18 +7,10 @@ export const FilterStatusSelect = ({ block }: { block?: boolean }) => { return ( { + const [field, order] = e.target.value.split('-'); + setSort({ + field: field as keyof BusinessForAudit, + order: order as 'ASC' | 'DESC', + }); + }} options={[ { value: 'businessName-ASC', @@ -45,14 +53,6 @@ export const SortBySelect = () => { }, ]} value={`${sort.field}-${sort.order}`} - aria-controls={tableId} - onChange={(e) => { - const [field, order] = e.target.value.split('-'); - setSort({ - field: field as keyof BusinessForAudit, - order: order as 'ASC' | 'DESC', - }); - }} /> ); }; diff --git a/.storybook/stories/DataLoading/DataLoadingWithCards.stories.tsx b/.storybook/stories/DataLoading/DataLoadingWithCards.stories.tsx index 04d7543ad2d1..d4aba4b5d28f 100644 --- a/.storybook/stories/DataLoading/DataLoadingWithCards.stories.tsx +++ b/.storybook/stories/DataLoading/DataLoadingWithCards.stories.tsx @@ -26,7 +26,7 @@ export const Basic: Story = { const { data, loading, error } = useFetchStarWarsAPI(); return ( - + ); }, diff --git a/.storybook/stories/DataLoading/DataLoadingWithCards.tsx b/.storybook/stories/DataLoading/DataLoadingWithCards.tsx index 40f22699e95d..f447c4399b52 100644 --- a/.storybook/stories/DataLoading/DataLoadingWithCards.tsx +++ b/.storybook/stories/DataLoading/DataLoadingWithCards.tsx @@ -62,7 +62,7 @@ function ErrorState() { - + Failed to load @@ -83,8 +83,8 @@ function EmptyState() { Star wars planets - - + + No planets found @@ -103,7 +103,7 @@ function FinalState({ items }: { items: NonNullable }) { {items.map((item) => { return ( - + diff --git a/.storybook/stories/DataLoading/DataLoadingWithTable.stories.tsx b/.storybook/stories/DataLoading/DataLoadingWithTable.stories.tsx index a027160de053..4bc70eb178a0 100644 --- a/.storybook/stories/DataLoading/DataLoadingWithTable.stories.tsx +++ b/.storybook/stories/DataLoading/DataLoadingWithTable.stories.tsx @@ -26,7 +26,7 @@ export const Basic: Story = { const { data, loading, error } = useFetchStarWarsAPI(); return ( - + ); }, diff --git a/.storybook/stories/DataLoading/DataLoadingWithTable.tsx b/.storybook/stories/DataLoading/DataLoadingWithTable.tsx index 06f6ceee3fa6..2783d6f4f66e 100644 --- a/.storybook/stories/DataLoading/DataLoadingWithTable.tsx +++ b/.storybook/stories/DataLoading/DataLoadingWithTable.tsx @@ -45,19 +45,19 @@ const tableHeadingId = 'star-wars-planets-table-heading'; function LoadingState() { return ( - + Star wars planets -
    +
    - + ID Name Climate - + Population @@ -93,13 +93,13 @@ function LoadingState() { function ErrorState() { return ( - + Star wars planets - + Failed to load @@ -117,13 +117,13 @@ function ErrorState() { function EmptyState() { return ( - + Star wars planets - - + + No planets found @@ -138,19 +138,19 @@ function EmptyState() { function FinalState({ items }: { items: NonNullable }) { return ( - + Star wars planets -
    +
    - + ID Name Climate - + Population diff --git a/.storybook/stories/FormFields/FormFields.stories.tsx b/.storybook/stories/FormFields/FormFields.stories.tsx index 33d927065028..61e5b5f2f941 100644 --- a/.storybook/stories/FormFields/FormFields.stories.tsx +++ b/.storybook/stories/FormFields/FormFields.stories.tsx @@ -38,7 +38,7 @@ const AllFormFields = ({ message: invalid ? 'Error message' : undefined, }; return ( - +
    e.preventDefault}> @@ -53,13 +53,13 @@ const AllFormFields = ({ Tablet - + Laptop - + Label - + diff --git a/.storybook/stories/SelectableTableBatchActions/ModalConfirmDelete.tsx b/.storybook/stories/SelectableTableBatchActions/ModalConfirmDelete.tsx index e59d01adc346..2e278211efa2 100644 --- a/.storybook/stories/SelectableTableBatchActions/ModalConfirmDelete.tsx +++ b/.storybook/stories/SelectableTableBatchActions/ModalConfirmDelete.tsx @@ -44,19 +44,19 @@ export function ModalConfirmDelete({ return ( - } + isOpen={isOpen} + onClose={onClose} + title={title} > {description} diff --git a/.storybook/stories/SelectableTableBatchActions/SelectableTableBatchActions.tsx b/.storybook/stories/SelectableTableBatchActions/SelectableTableBatchActions.tsx index febc65db0c41..6847e198bbb1 100644 --- a/.storybook/stories/SelectableTableBatchActions/SelectableTableBatchActions.tsx +++ b/.storybook/stories/SelectableTableBatchActions/SelectableTableBatchActions.tsx @@ -102,12 +102,12 @@ export function SelectableTableBatchActions() { {renderNotification()} - + Select all rows @@ -116,7 +116,7 @@ export function SelectableTableBatchActions() { -
    +
    @@ -135,14 +135,14 @@ export function SelectableTableBatchActions() { {paginatedData.map((row) => ( toggleRowSelected(row)} addTrackingNumber={() => addTrackingNumberToRow(row) } deleteRow={() => deleteRow(row)} + isRowSelected={isRowSelected(row)} + item={row} + key={row.id} + onRowSelectToggle={() => toggleRowSelected(row)} /> ))} @@ -156,23 +156,23 @@ export function SelectableTableBatchActions() { @@ -188,7 +188,7 @@ export function SelectableTableBatchActions() { ) : ( - + No certificates found @@ -197,8 +197,8 @@ export function SelectableTableBatchActions() { setDeleteModalOpen(false)} onConfirm={deleteSelectedItems} /> @@ -255,13 +255,13 @@ function Row({ - + {certNumber} {exporter} @@ -270,18 +270,18 @@ function Row({ {amount} - - setDeleteModalOpen(false)} onConfirm={onDeleteConfirm} /> diff --git a/.storybook/stories/SelectableTableBatchActions/TableFilters.tsx b/.storybook/stories/SelectableTableBatchActions/TableFilters.tsx index d24527528740..c48d5501fc06 100644 --- a/.storybook/stories/SelectableTableBatchActions/TableFilters.tsx +++ b/.storybook/stories/SelectableTableBatchActions/TableFilters.tsx @@ -5,24 +5,24 @@ import { Select } from '../../../packages/react/src/select'; export function TableFilters() { return ( - + ); diff --git a/.storybook/stories/SelectableTableBatchActions/useNotification.tsx b/.storybook/stories/SelectableTableBatchActions/useNotification.tsx index 12fef642b67b..11cce5bba1ca 100644 --- a/.storybook/stories/SelectableTableBatchActions/useNotification.tsx +++ b/.storybook/stories/SelectableTableBatchActions/useNotification.tsx @@ -24,11 +24,11 @@ export function useNotification() { if (notification && !notification.dismissed) { return ( dismissNotification()} ref={notification.ref} tabIndex={-1} - tone="success" - onClose={() => dismissNotification()} title={notification.message} + tone="success" /> ); } diff --git a/docs/components/AllIconsPlayground.tsx b/docs/components/AllIconsPlayground.tsx index 66c411e7b359..060b97afdc6e 100644 --- a/docs/components/AllIconsPlayground.tsx +++ b/docs/components/AllIconsPlayground.tsx @@ -14,13 +14,12 @@ export function AllIconsPlayground() { const [size, setSize] = useState('md'); const [weight, setWeight] = useState('regular'); return ( - + setWeight(e.target.value as IconWeight)} options={[ { label: 'Regular', value: 'regular' }, { label: 'Bold', value: 'bold' }, ]} + value={weight} /> diff --git a/docs/components/Code.tsx b/docs/components/Code.tsx index 8af6d2291d8f..5f564577c4a7 100644 --- a/docs/components/Code.tsx +++ b/docs/components/Code.tsx @@ -47,9 +47,9 @@ require('prismjs/components/prism-diff'); const PlaceholderImage = () => ( Grey placeholder image ); @@ -123,7 +123,7 @@ function LiveCode({ // Using `Box` here instead of Code snippets with popovers (date picker, combobox, dropdown menu etc) need overflow return ( - + {exampleContentHeadingType && ( @@ -145,29 +145,29 @@ function LiveCode({ role="region" /> @@ -177,20 +177,15 @@ function LiveCode({ {live.error ? ( {live.error} @@ -229,7 +229,6 @@ const StaticCode = ({ return ( - + {({ className, style, tokens, getLineProps, getTokenProps }) => (
     			
     				
    @@ -321,18 +321,18 @@ export function Code({
     		return (
     			
     				
     			
     		);
     	}
     
    -	return ;
    +	return ;
     }
    diff --git a/docs/components/ConditionalFieldContainer.tsx b/docs/components/ConditionalFieldContainer.tsx
    index d0dd6cfe9ac6..1b5c3fbfad12 100644
    --- a/docs/components/ConditionalFieldContainer.tsx
    +++ b/docs/components/ConditionalFieldContainer.tsx
    @@ -11,10 +11,10 @@ export function ConditionalFieldContainer({
     		
     			{children}
     		
    diff --git a/docs/components/DoDontHeading.tsx b/docs/components/DoDontHeading.tsx
    index 35a426d1366c..e25ab93de455 100644
    --- a/docs/components/DoDontHeading.tsx
    +++ b/docs/components/DoDontHeading.tsx
    @@ -3,7 +3,7 @@ import { SuccessFilledIcon, AlertFilledIcon } from '@ag.ds-next/react/icon';
     
     export const DoHeading = () => (
     	

    - + Do @@ -12,7 +12,7 @@ export const DoHeading = () => ( export const DontHeading = () => (

    - + Don’t diff --git a/docs/components/DocumentTitle.tsx b/docs/components/DocumentTitle.tsx index e7bc861bdf8b..92558dbb7025 100644 --- a/docs/components/DocumentTitle.tsx +++ b/docs/components/DocumentTitle.tsx @@ -11,6 +11,6 @@ export const DocumentTitle = ({ {[title, 'Agriculture Design System'].filter(Boolean).join(' | ')} - {description ? : null} + {description ? : null} ); diff --git a/docs/components/FigmaLogo.tsx b/docs/components/FigmaLogo.tsx index 0230a5d8606f..0620eadc8033 100644 --- a/docs/components/FigmaLogo.tsx +++ b/docs/components/FigmaLogo.tsx @@ -1,13 +1,13 @@ export const FigmaLogo = () => { return ( @@ -17,11 +17,11 @@ export function GithubIcon() { export function GithubLogo() { return ( diff --git a/docs/components/LinkComponent.tsx b/docs/components/LinkComponent.tsx index 70223048631d..8347a359c37f 100644 --- a/docs/components/LinkComponent.tsx +++ b/docs/components/LinkComponent.tsx @@ -18,9 +18,9 @@ export const LinkComponent = forwardRef( hrefAsString && (/^(https?:\/\/|\/\/)/i.test(hrefAsString) || hrefAsString.includes('#')) ) { - return ; + return ; } - return ; + return ; } ); diff --git a/docs/components/PageLayout.tsx b/docs/components/PageLayout.tsx index fb32fadb7b1f..7ca4d556558a 100644 --- a/docs/components/PageLayout.tsx +++ b/docs/components/PageLayout.tsx @@ -39,9 +39,9 @@ export function PageLayout({ diff --git a/docs/components/PageTitle.tsx b/docs/components/PageTitle.tsx index ddb6e21ec56b..4a1dfff9c43a 100644 --- a/docs/components/PageTitle.tsx +++ b/docs/components/PageTitle.tsx @@ -20,8 +20,8 @@ export const PageTitle = ({ {pretext ? ( @@ -31,7 +31,7 @@ export const PageTitle = ({

    {title}

    {introduction ? ( - + {introduction} ) : null} diff --git a/docs/components/PatternLayout.tsx b/docs/components/PatternLayout.tsx index f7d9e7fb5b07..b8e39c5103d9 100644 --- a/docs/components/PatternLayout.tsx +++ b/docs/components/PatternLayout.tsx @@ -27,48 +27,48 @@ export function PatternLayout({ return ( - + {(pattern.figmaTemplateNodeId || pattern.githubTemplatePath || pattern.storybookPath) && ( {pattern.figmaTemplateNodeId && ( View in Figma )} {pattern.storybookPath && ( View in Storybook )} {pattern.githubTemplatePath && ( View in Github diff --git a/docs/components/PictogramCard.tsx b/docs/components/PictogramCard.tsx index ba8c33cceea1..dfacd40b3a36 100644 --- a/docs/components/PictogramCard.tsx +++ b/docs/components/PictogramCard.tsx @@ -15,11 +15,11 @@ export const PictogramCard = ({ - + diff --git a/docs/components/PkgCardList.tsx b/docs/components/PkgCardList.tsx index ed5a85e66c2c..0f1d74c177e2 100644 --- a/docs/components/PkgCardList.tsx +++ b/docs/components/PkgCardList.tsx @@ -15,10 +15,10 @@ export const PkgCardList = ({ items }: { items: Pkg[] }) => ( {items.map(({ title, slug }) => ( ))} @@ -29,10 +29,10 @@ export const PkgCardListEmptyState = ({ }: { onClear?: () => void; }) => ( - + - - + + No components found Try adjusting your filter options. diff --git a/docs/components/PkgLayout.tsx b/docs/components/PkgLayout.tsx index 63c262aebab9..b6e3c28e093f 100644 --- a/docs/components/PkgLayout.tsx +++ b/docs/components/PkgLayout.tsx @@ -31,55 +31,55 @@ export function PkgLayout({ return ( {pkg.figmaGalleryNodeId && ( View in Figma )} {pkg.storybookPath && ( View in Storybook )} View in Github ) } + introduction={pkg.description} + title={pkg.title} /> {!pkg.deprecated && ( diff --git a/docs/components/SiteFooter.tsx b/docs/components/SiteFooter.tsx index 2e937b9ab05e..4ade4239c6eb 100644 --- a/docs/components/SiteFooter.tsx +++ b/docs/components/SiteFooter.tsx @@ -33,7 +33,7 @@ export const SiteFooter = () => {
    diff --git a/docs/components/SiteHeader.tsx b/docs/components/SiteHeader.tsx index b4ec3afb4177..4e8ffd1b8166 100644 --- a/docs/components/SiteHeader.tsx +++ b/docs/components/SiteHeader.tsx @@ -30,14 +30,14 @@ export const SiteHeader = () => {
    } + badgeLabel="Beta" heading="Agriculture Design System" + logo={} subline="Design System for the Export Service" - badgeLabel="Beta" /> diff --git a/docs/components/StorybookLogo.tsx b/docs/components/StorybookLogo.tsx index abcabcd868fa..c1a3e771d82a 100644 --- a/docs/components/StorybookLogo.tsx +++ b/docs/components/StorybookLogo.tsx @@ -1,18 +1,18 @@ export const StorybookLogo = () => ( ); diff --git a/docs/components/TemplateLayout.tsx b/docs/components/TemplateLayout.tsx index 556d44a124f9..a9a69590a57a 100644 --- a/docs/components/TemplateLayout.tsx +++ b/docs/components/TemplateLayout.tsx @@ -28,18 +28,16 @@ export function TemplateLayout({ return ( @@ -47,39 +45,41 @@ export function TemplateLayout({ ) } + introduction={template.description} + title={template.title} /> {(template.figmaTemplateNodeId || template.githubTemplatePath || template.storybookPath) && ( {template.figmaTemplateNodeId && ( View in Figma )} {template.storybookPath && ( View in Storybook )} {template.githubTemplatePath && ( View in Github diff --git a/docs/components/TokenCharts.tsx b/docs/components/TokenCharts.tsx index 6deff64eac84..24610ed89487 100644 --- a/docs/components/TokenCharts.tsx +++ b/docs/components/TokenCharts.tsx @@ -65,17 +65,17 @@ export const BorderWidthTokenChart = () => { const borderWidths = tokens.borderWidth; return ( - + {(Object.entries(borderWidths) as Entries).map( ([token, value]) => { const label = `${token} (${value}px)`; return ( {label} @@ -91,11 +91,11 @@ export const SpacingTokenChart = () => { const spacingTokens: Spacing[] = [0, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 5, 6]; return ( - + {spacingTokens.map((token) => { const label = `${token} (${token * 16}px)`; return ( - + { export const LineHeightTokenChart = () => { const fontSizes = ['xxxl', 'xxl', 'xl', 'lg', 'md', 'sm', 'xs'] as FontSize[]; return ( - + Default {fontSizes.map((size) => ( - + {size.toUpperCase()} ))} @@ -129,7 +129,7 @@ export const LineHeightTokenChart = () => { Heading {fontSizes.map((size) => ( - + {size.toUpperCase()} @@ -141,7 +141,7 @@ export const LineHeightTokenChart = () => { Nospace {fontSizes.map((size) => ( - + {size.toUpperCase()} @@ -252,15 +252,15 @@ export const ShadowTokenChart = () => { ][]; return ( - + {shadowTokens.map(([token, shadow]) => ( {token} {shadow} diff --git a/docs/components/TokenColorTable.tsx b/docs/components/TokenColorTable.tsx index d35312ab577b..663fd4c8d0a1 100644 --- a/docs/components/TokenColorTable.tsx +++ b/docs/components/TokenColorTable.tsx @@ -237,18 +237,18 @@ export const ColorTable = ({
    - + Name - + Value - + Description @@ -258,7 +258,7 @@ export const ColorTable = ({ return ( - + {name} diff --git a/docs/components/TokenLayout.tsx b/docs/components/TokenLayout.tsx index 6f37234d04ab..d2ebd6ede04c 100644 --- a/docs/components/TokenLayout.tsx +++ b/docs/components/TokenLayout.tsx @@ -89,16 +89,16 @@ export const TokenLayout = ({ return ( ({ href, label })), }} - editPath={editPath} - breadcrumbs={getBreadcrumbs(title)} > - + {children} diff --git a/docs/components/mdxComponents.tsx b/docs/components/mdxComponents.tsx index 58dd2d54f01d..a692a67c91e7 100644 --- a/docs/components/mdxComponents.tsx +++ b/docs/components/mdxComponents.tsx @@ -82,12 +82,12 @@ export const mdxComponents: MDXRemoteProps['components'] = { if (!isValidElement(element)) return null; return ( ); @@ -108,14 +108,12 @@ export const mdxComponents: MDXRemoteProps['components'] = { borderColor="muted" css={{ marginTop: mapSpacing(1.5), img: { display: 'block' } }} > - {alt} + {alt} ), ButtonLink, FigmaEmbed: ({ src, title }: { src: string; title: string }) => ( ), @@ -208,9 +208,9 @@ export const mdxComponents: MDXRemoteProps['components'] = { AllIconsPlayground, BackToTop: () => ( Back to top diff --git a/docs/next-env.d.ts b/docs/next-env.d.ts index 4f11a03dc6cc..a4a7b3f5cfa2 100644 --- a/docs/next-env.d.ts +++ b/docs/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/docs/pages/_app.tsx b/docs/pages/_app.tsx index 0ee9d21dccfb..1f8794f820d1 100644 --- a/docs/pages/_app.tsx +++ b/docs/pages/_app.tsx @@ -21,33 +21,31 @@ export default function App({ Component, pageProps }: AppProps) { }, [router.events]); return ( - + {/* Open graph image */} - + {/* Favicons */} - - + + {/* Global Site Tag (gtag.js) - Google Analytics */} {GA_MEASUREMENT_ID ? (