Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into date-range-picker-…
Browse files Browse the repository at this point in the history
…ux-enhancements
  • Loading branch information
stowball committed Jan 7, 2025
2 parents 20a65db + 6c7351c commit ea8a1f4
Show file tree
Hide file tree
Showing 475 changed files with 2,761 additions and 2,697 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-coats-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ag.ds-next/react': patch
---

loading: Announce `'fullscreen'` `LoadingBlanket` assertively.
8 changes: 8 additions & 0 deletions .changeset/little-jars-search.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions .changeset/many-dancers-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@ag.ds-next/react': minor
'@ag.ds-next/docs': minor
---

task-list: Add new `'notRequired'` status.
5 changes: 5 additions & 0 deletions .changeset/plop-create-ProgressNotRequired.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ag.ds-next/react': minor
---

icon: Created new icon, ProgressNotRequiredIcon.
25 changes: 13 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down Expand Up @@ -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: [
{
Expand Down
4 changes: 2 additions & 2 deletions .storybook/components/LinkComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const LinkComponent = forwardRef<HTMLAnchorElement, LinkComponentProps>(
// Regex finds links starting with: `http://` | `https://` | `//`
const hrefAsString = typeof href === 'string' ? href : href?.pathname;
if (hrefAsString && /^(https?:\/\/|\/\/)/i.test(hrefAsString)) {
return <a ref={ref} href={hrefAsString} {...props} />;
return <a href={hrefAsString} ref={ref} {...props} />;
}

return <Link ref={ref} href={href} {...props} />;
return <Link href={href} ref={ref} {...props} />;
}
);
6 changes: 3 additions & 3 deletions .storybook/components/PageTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ export function PageTemplate({
<Stack palette="dark">
<Header
background="bodyAlt"
logo={<Logo />}
heading="Export Service"
logo={<Logo />}
subline="Supporting Australian agricultural exports"
/>
<MainNav
activePath="#home"
focusMode={focusMode}
id="main-nav"
activePath="#home"
items={[
{ label: 'Home', href: '#home' },
{ label: 'Category', href: '#category' },
Expand All @@ -56,6 +56,7 @@ export function PageTemplate({
<Footer background="bodyAlt">
<nav aria-label="footer">
<LinkList
horizontal
links={[
{ label: 'Home', href: '/' },
{
Expand All @@ -71,7 +72,6 @@ export function PageTemplate({
href: 'https://github.com/agriculturegovau/agds-starter-kit',
},
]}
horizontal
/>
</nav>
<FooterDivider />
Expand Down
6 changes: 3 additions & 3 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ const preview: Preview = {
const theme = storybookThemes[context.globals.brand as StorybookThemes];
const palette = context.globals.palette;
return (
<Core theme={theme} linkComponent={LinkComponent}>
<Core linkComponent={LinkComponent} theme={theme}>
<Box
width="100%"
background="body"
minHeight="100vh"
palette={palette}
background="body"
width="100%"
>
<Story />
</Box>
Expand Down
24 changes: 12 additions & 12 deletions .storybook/stories/DataFiltering/ListFiltering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export const ListFiltering = () => {
<Columns>
<Column columnSpan={{ xs: 12, md: 4, lg: 3 }}>
<Stack
gap={1}
css={{
// This margin ensures that the left and column align nicely on desktop
[tokens.mediaQuery.min.md]: { marginTop: '3.5rem' },
}}
gap={1}
>
<FilterSidebar
activeFiltersCount={activeFiltersCount}
Expand All @@ -57,7 +57,6 @@ export const ListFiltering = () => {
<FilterServicesSelect block />
<DateRangePicker
fromLabel="Registered from"
toLabel="Registered to"
hideOptionalLabel
onChange={(requestDate) => setFilter({ requestDate })}
onFromInputChange={(from) =>
Expand All @@ -70,6 +69,7 @@ export const ListFiltering = () => {
requestDate: { ...filters.requestDate, to },
})
}
toLabel="Registered to"
value={filters.requestDate}
/>
</FormStack>
Expand All @@ -80,36 +80,36 @@ export const ListFiltering = () => {
</Stack>
</Column>
<Column
as="main"
aria-label="List of establishments"
id="main-content"
tabIndex={-1}
css={{ '&:focus': { outline: 'none' } }}
as="main"
columnSpan={{ xs: 12, md: 8 }}
columnStart={{ lg: 5 }}
css={{ '&:focus': { outline: 'none' } }}
id="main-content"
tabIndex={-1}
>
<Stack gap={2}>
<Flex
flexDirection={{ xs: 'column', md: 'row' }}
justifyContent={{ xs: 'flex-start', md: 'space-between' }}
alignItems={{ xs: 'flex-start', md: 'flex-end' }}
gap={1}
paddingBottom={{ md: 1 }}
borderBottom
borderBottomWidth={{ xs: 'none', md: 'sm' }}
flexDirection={{ xs: 'column', md: 'row' }}
gap={1}
justifyContent={{ xs: 'flex-start', md: 'space-between' }}
paddingBottom={{ md: 1 }}
>
<Text
as="h2"
lineHeight="heading"
fontSize="md"
fontWeight={{
xs: 'normal',
md: 'bold',
}}
lineHeight="heading"
>
{tableCaption}
</Text>
<div role="status" css={visuallyHiddenStyles}>
<div css={visuallyHiddenStyles} role="status">
{loading ? 'Loading audits' : ''}
</div>
<SortBySelect />
Expand Down
6 changes: 3 additions & 3 deletions .storybook/stories/DataFiltering/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const FilterAndSelectSmall = {
table.
</Text>
</Callout>
<TableFilteringSmall selectable={true} />
<TableFilteringSmall selectable />
</Stack>
</PageContent>
</DataProvider>
Expand Down Expand Up @@ -153,7 +153,7 @@ export const FilterAndSelectMedium = {
button is pressed.
</Text>
</Callout>
<TableFilteringMedium selectable={true} />
<TableFilteringMedium selectable />
</Stack>
</PageContent>
</DataProvider>
Expand Down Expand Up @@ -221,7 +221,7 @@ export const FilterAndSelectLarge = {
area next to the button which opens the drawer.
</Text>
</Callout>
<TableFilteringLarge selectable={true} />
<TableFilteringLarge selectable />
</Stack>
</PageContent>
</DataProvider>
Expand Down
8 changes: 4 additions & 4 deletions .storybook/stories/DataFiltering/TableFilteringLarge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,29 @@ export const TableFilteringLarge = ({
<FilterBarGroup>
<FilterSearchInput />
<Button
iconBefore={FilterIcon}
onClick={openDrawer}
variant="secondary"
iconBefore={FilterIcon}
>
Show filters
</Button>
</FilterBarGroup>
<SortBySelect />
</FilterBar>
<DashboardFilterDrawer
isDrawerOpen={isDrawerOpen}
closeDrawer={closeDrawer}
isDrawerOpen={isDrawerOpen}
/>
<ActiveFilters />
</FilterRegion>
{selectable && (
<Box padding={1} borderBottom>
<Box borderBottom padding={1}>
<DataTableSelectAllCheckbox />
</Box>
)}
<DataTable
ref={tableRef}
headingId={headingId}
ref={tableRef}
selectable={selectable}
/>
</Stack>
Expand Down
19 changes: 9 additions & 10 deletions .storybook/stories/DataFiltering/TableFilteringMedium.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,14 @@ export const TableFilteringMedium = ({
<FilterSearchInput />
<FilterStatusSelect />
<Button
onClick={toggleIsOpen}
variant="secondary"
iconBefore={FilterIcon}
iconAfter={isOpen ? ChevronUpIcon : ChevronDownIcon}
// accessibility
aria-label="more filters"
id={buttonId}
aria-controls={bodyId}
aria-expanded={isOpen}
aria-label="more filters"
iconAfter={isOpen ? ChevronUpIcon : ChevronDownIcon}
iconBefore={FilterIcon}
id={buttonId}
onClick={toggleIsOpen}
variant="secondary"
>
{isOpen ? 'Hide filters' : 'Show filters'}
</Button>
Expand All @@ -84,19 +83,19 @@ export const TableFilteringMedium = ({
</Box>
</FilterBar>
<FilterAccordion
id={bodyId}
ariaLabelledBy={buttonId}
id={bodyId}
isOpen={isOpen}
/>
<ActiveFilters />
</FilterRegion>

{selectable && (
<Box paddingLeft={0.75} paddingY={0.75} borderBottom>
<Box borderBottom paddingLeft={0.75} paddingY={0.75}>
<DataTableSelectAllCheckbox />
</Box>
)}
<DataTable selectable={selectable} headingId={headingId} />
<DataTable headingId={headingId} selectable={selectable} />
</Stack>
<DashboardPagination />
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion .storybook/stories/DataFiltering/TableFilteringSmall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const TableFilteringSmall = ({
</FilterBar>
</FilterRegion>
{selectable && (
<Box paddingLeft={0.75} paddingY={0.75} borderBottom>
<Box borderBottom paddingLeft={0.75} paddingY={0.75}>
<DataTableSelectAllCheckbox />
</Box>
)}
Expand Down
6 changes: 3 additions & 3 deletions .storybook/stories/DataFiltering/components/ActiveFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ export const ActiveFilters = () => {
}

return (
<Flex flexWrap="wrap" gap={0.75} alignItems="flex-end">
<Flex alignItems="flex-end" flexWrap="wrap" gap={0.75}>
<Tags
heading={<Text fontWeight="bold">Active filters</Text>}
items={tags}
/>
<Button
iconAfter={CloseIcon}
onClick={resetFilters}
size="sm"
variant="text"
onClick={resetFilters}
iconAfter={CloseIcon}
>
Clear filters
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ export const DashboardFilterDrawer = ({
}}
>
<Drawer
title="Filter by"
isOpen={isDrawerOpen}
onClose={cancel}
actions={
<ButtonGroup>
<Button onClick={applyFilters}>Apply filters</Button>
<Button variant="secondary" onClick={clearFilters}>
<Button onClick={clearFilters} variant="secondary">
Clear filters
</Button>
<Button variant="tertiary" onClick={cancel}>
<Button onClick={cancel} variant="tertiary">
Cancel
</Button>
</ButtonGroup>
}
isOpen={isDrawerOpen}
onClose={cancel}
title="Filter by"
>
<Stack gap={3}>
<Fieldset legend="Fieldset">
Expand All @@ -112,10 +112,10 @@ export const DashboardFilterDrawer = ({
<FilterAssigneeSelect block />
<DateRangePicker
fromLabel="Registered from"
toLabel="Registered to"
onChange={(requestDate) =>
setFormState({ ...formState, requestDate })
}
toLabel="Registered to"
value={formState.requestDate}
/>
</FormStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ export const DashboardPagination = () => {
return (
<PaginationButtons
currentPage={displayText.page}
onChange={(page) => 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({
Expand All @@ -56,6 +55,7 @@ export const DashboardPagination = () => {
perPage,
})
}
totalPages={totalPages}
/>
);
};
Expand Down
Loading

0 comments on commit ea8a1f4

Please sign in to comment.