diff --git a/apps/site/src/app/articles/[article]/error.tsx b/apps/site/src/app/articles/[article]/error.tsx index 43fbc3b34..32f9b95b4 100644 --- a/apps/site/src/app/articles/[article]/error.tsx +++ b/apps/site/src/app/articles/[article]/error.tsx @@ -5,6 +5,7 @@ import { useEffect } from 'react'; export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { useEffect(() => { // Log the error to an error reporting service + // eslint-disable-next-line no-console console.error(error); }, [error]); diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.component.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.component.tsx index 95952c862..75b124a7b 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.component.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.component.tsx @@ -8,6 +8,7 @@ import { Colors } from '@/components/component-blocks/colors/colors.component'; import { Icons } from '@/components/component-blocks/icons/icons.component'; import { Logos } from '@/components/component-blocks/logos/logos.component'; import { Pictograms } from '@/components/component-blocks/pictograms/pictograms.component'; +import { Symbols } from '@/components/component-blocks/symbols/symbols.component'; import { Section } from '@/components/content-blocks/section'; import { Code, Heading } from '@/components/document-renderer'; import { RelatedInfo } from '@/components/related-info'; @@ -44,6 +45,7 @@ export function DesignContent({ designSections, description, relatedComponents } icons: () => , logos: () => , pictograms: () => , + symbols: () => , colors: props => , }} /> diff --git a/apps/site/src/app/design-system/error.tsx b/apps/site/src/app/design-system/error.tsx index 43fbc3b34..32f9b95b4 100644 --- a/apps/site/src/app/design-system/error.tsx +++ b/apps/site/src/app/design-system/error.tsx @@ -5,6 +5,7 @@ import { useEffect } from 'react'; export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { useEffect(() => { // Log the error to an error reporting service + // eslint-disable-next-line no-console console.error(error); }, [error]); diff --git a/apps/site/src/components/component-blocks/foundation-blocks.tsx b/apps/site/src/components/component-blocks/foundation-blocks.tsx index 7eea39af3..b7d1a98f8 100644 --- a/apps/site/src/components/component-blocks/foundation-blocks.tsx +++ b/apps/site/src/components/component-blocks/foundation-blocks.tsx @@ -2,10 +2,12 @@ import { colors } from './colors/colors.preview'; import { icons } from './icons/icons.preview'; import { logos } from './logos/logos.preview'; import { pictograms } from './pictograms/pictograms.preview'; +import { symbols } from './symbols/symbols.preview'; export const foundationBlocks = { colors, icons, logos, pictograms, + symbols, }; diff --git a/apps/site/src/components/component-blocks/symbols/symbols.component.tsx b/apps/site/src/components/component-blocks/symbols/symbols.component.tsx new file mode 100644 index 000000000..39a00beb7 --- /dev/null +++ b/apps/site/src/components/component-blocks/symbols/symbols.component.tsx @@ -0,0 +1,58 @@ +'use client'; + +import { Grid, Item } from '@westpac/ui/grid'; +import { Input } from '@westpac/ui/input'; +import * as AllLogos from '@westpac/ui/symbol'; +import { ChangeEvent, useCallback, useMemo, useState } from 'react'; + +export const Symbols = () => { + const [search, setSearch] = useState(''); + + const filteredSymbols = useMemo(() => { + return Object.entries(AllLogos).reduce( + (acc: { Logo: React.FC; key: string }[], [logoName, Logo]) => { + if (logoName.toUpperCase().indexOf(search.toUpperCase()) === -1 || !logoName.includes('Symbol')) { + return acc; + } + return [...acc, { key: logoName, Logo }]; + }, + [], + ); + }, [search]); + + const foundText = filteredSymbols.length === 1 ? 'Found 1 symbol' : `Found ${filteredSymbols.length} symbols`; + + const handleOnChange = useCallback(({ target: { value } }: ChangeEvent) => { + setSearch(value); + }, []); + + return ( +
+
+ + +
+ + +
+
+
+
+ + +

{foundText}

+
+ {filteredSymbols.map(({ key, Logo }) => ( + +
+ + {key} +
+
+ ))} +
+
+ ); +}; diff --git a/apps/site/src/components/component-blocks/symbols/symbols.preview.tsx b/apps/site/src/components/component-blocks/symbols/symbols.preview.tsx new file mode 100644 index 000000000..001df305c --- /dev/null +++ b/apps/site/src/components/component-blocks/symbols/symbols.preview.tsx @@ -0,0 +1,11 @@ +import { NotEditable, component } from '@keystatic/core'; + +export const symbols = component({ + preview: () => ( + +
All Symbols
+
+ ), + label: 'Symbols', + schema: {}, +}); diff --git a/apps/site/src/content/design-system/components/symbol/design/third-party-symbols/content.mdoc b/apps/site/src/content/design-system/components/symbol/design/third-party-symbols/content.mdoc index 56a010f03..b888c7521 100644 --- a/apps/site/src/content/design-system/components/symbol/design/third-party-symbols/content.mdoc +++ b/apps/site/src/content/design-system/components/symbol/design/third-party-symbols/content.mdoc @@ -1,47 +1 @@ -Filter by name - -Found 22 symbols - -AmericanExpressSymbol - -AppleStoreInverseSymbol - -AppleStoreSymbol - -BPayLandSymbol - -BPayPortSymbol - -FacebookSymbol - -GooglePlusSymbol - -GoogleStoreSymbol - -InstagramSymbol - -LinkedInSymbol - -MastercardAcceptedSymbol - -MastercardHorizontalSymbol - -MastercardSymbol - -MicrosoftStoreSymbol - -PayIDSymbol - -SlackSymbol - -TwitterSymbol - -VisaBlueSymbol - -VisaSymbol - -VisaWhiteSymbol - -YammerSymbol - -YouTubeSymbol +{% symbols /%} diff --git a/apps/site/src/content/design-system/components/symbol/index.yaml b/apps/site/src/content/design-system/components/symbol/index.yaml index 4c9a4084f..6aef9c260 100644 --- a/apps/site/src/content/design-system/components/symbol/index.yaml +++ b/apps/site/src/content/design-system/components/symbol/index.yaml @@ -8,15 +8,19 @@ design: - title: name: Third Party Symbols slug: third-party-symbols + noTitle: false - title: name: User experience slug: user-experience + noTitle: false - title: name: Visual design slug: visual-design + noTitle: false - title: name: Dos and don’ts slug: dos-and-donts + noTitle: false accessibility: - title: name: Accessibility features @@ -27,3 +31,4 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedInformation: [] diff --git a/helpers/create-package/index.js b/helpers/create-package/index.js index 5d15cdf51..f6651ddf4 100644 --- a/helpers/create-package/index.js +++ b/helpers/create-package/index.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ const shell = require('child_process').execSync; const fs = require('fs'); const readline = require('readline'); diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index c51270286..844ca4cb5 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -50,6 +50,7 @@ module.exports = { ignoredKeys: ['compoundVariants', 'defaultVariants', 'responsiveVariants', 'compoundSlots'], }, ], + 'no-console': 'error', }, settings: { 'import/parsers': { diff --git a/packages/ui/src/components/alert/alert.stories.tsx b/packages/ui/src/components/alert/alert.stories.tsx index 3fa388c17..ef8a81f67 100644 --- a/packages/ui/src/components/alert/alert.stories.tsx +++ b/packages/ui/src/components/alert/alert.stories.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { type Meta, StoryFn, type StoryObj } from '@storybook/react'; import { TelephoneIcon } from '../icon/index.js'; diff --git a/packages/ui/src/components/checkbox-group/checkbox-group.stories.tsx b/packages/ui/src/components/checkbox-group/checkbox-group.stories.tsx index 4ebc5ec6d..54ee61faa 100644 --- a/packages/ui/src/components/checkbox-group/checkbox-group.stories.tsx +++ b/packages/ui/src/components/checkbox-group/checkbox-group.stories.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { type Meta, StoryFn, type StoryObj } from '@storybook/react'; import { CheckboxGroup } from './checkbox-group.component.js'; diff --git a/packages/ui/src/components/date-picker/date-picker.stories.tsx b/packages/ui/src/components/date-picker/date-picker.stories.tsx index 6b22d72d0..e766ab805 100644 --- a/packages/ui/src/components/date-picker/date-picker.stories.tsx +++ b/packages/ui/src/components/date-picker/date-picker.stories.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { type Meta, StoryFn, type StoryObj } from '@storybook/react'; import { useState } from 'react'; diff --git a/packages/ui/src/components/icon/icon.stories.tsx b/packages/ui/src/components/icon/icon.stories.tsx index cd8311adc..7d642cf26 100644 --- a/packages/ui/src/components/icon/icon.stories.tsx +++ b/packages/ui/src/components/icon/icon.stories.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { type Meta, StoryFn, type StoryObj } from '@storybook/react'; import { ChangeEvent, useCallback, useMemo, useState } from 'react'; @@ -35,7 +36,7 @@ const AllIconsExample = (props: AllIcons.IconProps) => { return (
@@ -43,7 +44,7 @@ const AllIconsExample = (props: AllIcons.IconProps) => { {filteredIcons.map(({ key, Icon }) => (