diff --git a/src/pattern-library/components/patterns/data/AspectRatioPage.js b/src/pattern-library/components/patterns/data/AspectRatioPage.tsx similarity index 93% rename from src/pattern-library/components/patterns/data/AspectRatioPage.js rename to src/pattern-library/components/patterns/data/AspectRatioPage.tsx index 88683173..280ad637 100644 --- a/src/pattern-library/components/patterns/data/AspectRatioPage.js +++ b/src/pattern-library/components/patterns/data/AspectRatioPage.tsx @@ -8,25 +8,15 @@ export default function AspectRatioPage() { title="AspectRatio" intro={

- AspectRatio lays out content with a specified aspect - ratio. + AspectRatio is a simple component that controls the + aspect ratio of its first direct child.

} > - -

- AspectRatio is a new simple component. -

-
- -

- AspectRatio controls the aspect ratio and containment - of its first direct child. -

- -

- DataTable is a new composite component loosely based - upon the legacy Table component. -

- -

- Because API changes to this component are so extensive, it should - be considered a new component. -

-
-
- diff --git a/src/pattern-library/components/patterns/data/IconsPage.js b/src/pattern-library/components/patterns/data/IconsPage.tsx similarity index 79% rename from src/pattern-library/components/patterns/data/IconsPage.js rename to src/pattern-library/components/patterns/data/IconsPage.tsx index 328ff145..dc4f0a3d 100644 --- a/src/pattern-library/components/patterns/data/IconsPage.js +++ b/src/pattern-library/components/patterns/data/IconsPage.tsx @@ -7,23 +7,11 @@ export default function IconsPage() { return ( Icons are simple, standalone components.

} + intro={ +

Icons are simple, standalone components that wrap SVG source.

+ } > - -

- These standalone icon components are new. These are intended to - replace the single legacy Icon component. -

- - - - It is no longer necessary to import SVG source nor registration - functions from this package to use icons. - - - -
@@ -35,9 +23,8 @@ export default function IconsPage() {
- {Object.keys(Icons).map(iconName => { - const IconComponent = - Icons[/** @type {keyof Icons} */ (iconName)]; + {(Object.keys(Icons) as Array).map(iconName => { + const IconComponent = Icons[iconName]; return (
} > - -

- ScrollBox is a re-implementation of the legacy - component Scrollbox (note casing change). -

- - - - Watch out! The casing of this {"component's"}{' '} - name has changed: - - Scrollbox - {' '} - ➜ ScrollBox - - - Prop: - - withHeader - {' '} - ➜ No longer supported. Use Scroll components - directly to add header-like non-scrolling content. - - - Prop: - - classes - {' '} - ➜ no longer supported. Use Scroll-family components - directly for more customization - - - -
- @@ -146,12 +111,6 @@ export default function ScrollBoxPage() {

} > - -

- Scroll is a new component. -

-
- @@ -208,12 +167,6 @@ export default function ScrollBoxPage() {

} > - -

- ScrollContent is a new component. -

-
- @@ -249,12 +202,6 @@ export default function ScrollBoxPage() { } > - -

- ScrollContainer is a new component. -

-
- diff --git a/src/pattern-library/components/patterns/data/TablePage.js b/src/pattern-library/components/patterns/data/TablePage.tsx similarity index 95% rename from src/pattern-library/components/patterns/data/TablePage.js rename to src/pattern-library/components/patterns/data/TablePage.tsx index 5cb3bdaa..00bd8ea1 100644 --- a/src/pattern-library/components/patterns/data/TablePage.js +++ b/src/pattern-library/components/patterns/data/TablePage.tsx @@ -22,17 +22,6 @@ export default function TablePage() { } > - -

- Table, TableHead, TableBody,{' '} - TableRow and TableCell are new components. -

-

- Table is a presentational component, and, as such, is - not equivalent to the legacy Table component. -

-
- } > - -

- Thumbnail is a reimplementation of a legacy component - with the same name. -

- - - - - Prop name:{' '} - - classes - {' '} - ➜ No longer supported. Style a parent container instead, or use{' '} - AspectRatio directly - - - Prop name:{' '} - - isLoading - {' '} - ➜ loading - - - Prop values for size:{' '} - - {"'small'"},{"'medium'"}, - {"'large'"} - {' '} - ➜ Use {"'sm'"}, {"'md'"}, or{' '} - {"'lg'"} - - - Prop ratio (default {'"16/9"'}) ➜ All - content is constrained to this aspect ratio - - - -
- diff --git a/src/pattern-library/components/patterns/feedback/ModalPage.tsx b/src/pattern-library/components/patterns/feedback/ModalPage.tsx index af903adc..71ac48b6 100644 --- a/src/pattern-library/components/patterns/feedback/ModalPage.tsx +++ b/src/pattern-library/components/patterns/feedback/ModalPage.tsx @@ -93,80 +93,17 @@ export default function ModalPage() {

} > - - -

- Modal is a presentational component that combines - aspects of legacy Modal and Dialog{' '} - components. -

+ This is an interim implementation of a modal dialog that conforms to updated styling and API conventions. It does not yet fully implement an accessible dialog. It routes focus, but does not trap or restore focus, e.g.

-

- This implementation should, however, provide a more flexible and - simplified API compared to its legacy counterpart. -

- - - - Prop removed:{' '} - - contentClass - {' '} - ➜ use classes instead to style the outer container. - - - Prop removed:{' '} - - cancelLabel - {' '} - ➜ A cancel button is no longer automatically added when a close - handler is present. Pass a cancel button with the other buttons - in the buttons prop instead, and label it however - you like. - - - Prop name:{' '} - - onCancel - {' '} - ➜ onClose: This prop is forwarded to{' '} - Panel and its naming more clearly indicates that - its purpose is to handle the closing of the modal. - - - Props removed:{' '} - - withCancelButton - {' '} - and{' '} - - withCloseButton - - ➜ Cancel buttons are no longer automatically rendered based on - the presence of the close handler. A close button will now - always be rendered if onClose is provided. - - - icon prop: Now takes an IconComponent{' '} - instead of a string. - - - initialFocus prop: Set to {"'manual'"}{' '} - to opt out of automatic focus routing (formerly{' '} - null). - - - Optional width prop - - - -
- + } + > diff --git a/src/pattern-library/components/patterns/feedback/SpinnerPage.js b/src/pattern-library/components/patterns/feedback/SpinnerPage.tsx similarity index 73% rename from src/pattern-library/components/patterns/feedback/SpinnerPage.js rename to src/pattern-library/components/patterns/feedback/SpinnerPage.tsx index 3f8ccb6e..90a11a58 100644 --- a/src/pattern-library/components/patterns/feedback/SpinnerPage.js +++ b/src/pattern-library/components/patterns/feedback/SpinnerPage.tsx @@ -31,41 +31,6 @@ export default function SpinnerPage() {

} > - -

- Spinner is a new reimplementation of a legacy component - of the same name. -

- - - - - Prop:{' '} - - classes - {' '} - removed - - - Prop values for size:{' '} - - {"'small'"},{"'medium'"}, - {"'large'"} - {' '} - ➜ Use {"'sm'"}, {"'md'"}, or{' '} - {"'lg'"} - - - Default size:{' '} - - {"'medium'"} - {' '} - ➜ {"'sm'"} - - - -
- diff --git a/src/pattern-library/components/patterns/input/ButtonPage.js b/src/pattern-library/components/patterns/input/ButtonPage.tsx similarity index 70% rename from src/pattern-library/components/patterns/input/ButtonPage.js rename to src/pattern-library/components/patterns/input/ButtonPage.tsx index dd1359e9..df921b49 100644 --- a/src/pattern-library/components/patterns/input/ButtonPage.js +++ b/src/pattern-library/components/patterns/input/ButtonPage.tsx @@ -30,68 +30,6 @@ export default function ButtonPage() {

} > - -

- Button is a new component that re-implements the{' '} - LabeledButton legacy component.{' '} -

- - - - Prop name:{' '} - - buttonRef - {' '} - ➜ elementRef - - - Prop:{' '} - - iconPosition - {' '} - ➜ Icons are always positioned left - - - Prop: icon,{' '} - - {'{string}'} - {' '} - ➜ Now takes {'{IconComponent}'} - - - Prop: variant value{' '} - - {"'dark'"}: - {' '} - This is no longer a standard variant ➜ Use{' '} - ButtonBase instead. - - - Prop: variant default value{' '} - - {"'normal'"} - {' '} - ➜ {"'secondary'"} - - - Prop: size values{' '} - - {"'small'"} - - ,{' '} - - {"'medium'"} - {' '} - , - - {"'large'"} - {' '} - ➜ {"'xs'"}, {"'sm'"},{' '} - {"'md'"}, {"'lg'"} - - - -
@@ -198,73 +136,6 @@ export default function ButtonPage() {

} > - -

- IconButton is a reimplementation of an existing legacy - component with the same name. -

- - - - - Prop name:{' '} - - buttonRef - {' '} - ➜ elementRef - - - Prop: icon,{' '} - - {'{string}'} - {' '} - ➜ Now takes {'{IconComponent}'} - - - Prop: variant value{' '} - - {"'light'"}: - {' '} - This is no longer a standard variant ➜ Use{' '} - ButtonBase instead - - - Prop: variant default value{' '} - - {"'normal'"} - {' '} - ➜ {"'secondary'"} - - - Prop: size values{' '} - - {"'small'"} - - ,{' '} - - {"'medium'"} - {' '} - , - - {"'large'"} - {' '} - ➜ {"'xs'"}, {"'sm'"},{' '} - {"'md'"}, {"'lg'"} - - - Prop: size value{' '} - - {"'small'"} - {' '} - ➜ use {"'xs'"} instead: the padding/spacing values - have been adjusted such that all Button components are - harmonized. {"IconButton's"}{' '} - {"'small'"} size was inconsistent with the{' '} - {"'sm'"} size for other Buttons. - - - -
@@ -444,12 +315,6 @@ export default function ButtonPage() { } > - -

- ButtonBase is a new component. -

-
- diff --git a/src/pattern-library/components/patterns/input/CheckboxPage.js b/src/pattern-library/components/patterns/input/CheckboxPage.tsx similarity index 64% rename from src/pattern-library/components/patterns/input/CheckboxPage.js rename to src/pattern-library/components/patterns/input/CheckboxPage.tsx index 29807c18..20602f88 100644 --- a/src/pattern-library/components/patterns/input/CheckboxPage.js +++ b/src/pattern-library/components/patterns/input/CheckboxPage.tsx @@ -7,9 +7,8 @@ import Next from '../../LibraryNext'; export default function CheckboxPage() { const [checked, setChecked] = useState(false); - /** @param {Event} e */ - const handleControlledChange = e => { - setChecked(/** @type {HTMLInputElement} */ (e.target).checked); + const handleControlledChange = (e: Event) => { + setChecked((e.target! as HTMLInputElement).checked); }; return ( } > - -

- Checkbox combines the functionality of both the{' '} - Checkbox and LabeledCheckbox legacy - components. -

- - - - - Prop name:{' '} - - onToggle - {' '} - ➜ Use onChange instead - - - Prop:{' '} - - inputRef - {' '} - ➜ elementRef - - - The presence of prop checked now configures{' '} - Checkbox as a controlled component. - - - Prop defaultChecked - - - Now accepts HTML attributes allowed for HTMLInput{' '} - elements. - - - Prop id is no longer required - - - - - - - - Prop:{' '} - - containerClasses - {' '} - ➜ this is now a composite component (does not take extra CSS{' '} - classes) - - - -
- diff --git a/src/pattern-library/components/patterns/input/InputGroupPage.tsx b/src/pattern-library/components/patterns/input/InputGroupPage.tsx index 76c394fc..b870021b 100644 --- a/src/pattern-library/components/patterns/input/InputGroupPage.tsx +++ b/src/pattern-library/components/patterns/input/InputGroupPage.tsx @@ -22,12 +22,6 @@ export default function InputGroupPage() {

} > - -

- InputGroup is a new component based loosely on the - legacy TextInputWithButton component. -

-
diff --git a/src/pattern-library/components/patterns/input/InputPage.js b/src/pattern-library/components/patterns/input/InputPage.tsx similarity index 80% rename from src/pattern-library/components/patterns/input/InputPage.js rename to src/pattern-library/components/patterns/input/InputPage.tsx index 152e03b9..2ec888c7 100644 --- a/src/pattern-library/components/patterns/input/InputPage.js +++ b/src/pattern-library/components/patterns/input/InputPage.tsx @@ -21,28 +21,6 @@ export default function InputPage() {

} > - -

- Input is new component modeled after the{' '} - TextInput legacy component. -

- - - - - Prop name:{' '} - - inputRef - {' '} - ➜ elementRef - - - The input element now stretches to fill all - available horizontal space - - - -
diff --git a/src/pattern-library/components/patterns/input/SelectPage.tsx b/src/pattern-library/components/patterns/input/SelectPage.tsx index 1f70efeb..1a242edd 100644 --- a/src/pattern-library/components/patterns/input/SelectPage.tsx +++ b/src/pattern-library/components/patterns/input/SelectPage.tsx @@ -43,11 +43,6 @@ export default function SelectPage() {

} > - -

- Select is a new component. -

-
diff --git a/src/pattern-library/components/patterns/layout/CardPage.tsx b/src/pattern-library/components/patterns/layout/CardPage.tsx index ab106ed9..da9c5e16 100644 --- a/src/pattern-library/components/patterns/layout/CardPage.tsx +++ b/src/pattern-library/components/patterns/layout/CardPage.tsx @@ -30,51 +30,6 @@ export default function CardPage() {

} > - -

- Card is a re-implementation of a legacy component of - the same name. CardContent, CardHeader,{' '} - CardTitle and CardActions are new - components. -

- - - - - Card no longer provides padding or spacing around - content. Use Card in combination with{' '} - CardContent for spacing. - - - Card no longer provides styling for the{' '} - clean theme. Use classes to apply - theme styles. - - - Card no longer provides styling for the{' '} - .is-focused class. Use the active prop - instead. - - - Prop name:{' '} - - containerRef - {' '} - ➜ elementRef - - - variant: raised (default) or{' '} - flat. The flat variant disables any - dimensionality or shadows. - - - active (boolean): Sets hover-style shadows on{' '} - Card. Must be combined with raised{' '} - variant. - - - -
diff --git a/src/pattern-library/components/patterns/layout/OverlayPage.js b/src/pattern-library/components/patterns/layout/OverlayPage.tsx similarity index 91% rename from src/pattern-library/components/patterns/layout/OverlayPage.js rename to src/pattern-library/components/patterns/layout/OverlayPage.tsx index a9de3668..f2aa4fed 100644 --- a/src/pattern-library/components/patterns/layout/OverlayPage.js +++ b/src/pattern-library/components/patterns/layout/OverlayPage.tsx @@ -33,13 +33,6 @@ export default function OverlayPage() {

} > - -

- Overlay is a new component based on a design pattern - used in legacy modals and FullScreenSpinner components. -

-
- diff --git a/src/pattern-library/components/patterns/layout/PanelPage.tsx b/src/pattern-library/components/patterns/layout/PanelPage.tsx index eb01a4bf..4b3e15bd 100644 --- a/src/pattern-library/components/patterns/layout/PanelPage.tsx +++ b/src/pattern-library/components/patterns/layout/PanelPage.tsx @@ -24,28 +24,6 @@ export default function PanelPage() {

} > - -

- Panel is a re-implementation of a legacy component with - the same name. -

- - - - - Prop icon:{' '} - - {'{string}'} - {' '} - ➜ now takes {'{IconComponent}'} - - - Prop containerRef - - - -
- diff --git a/src/pattern-library/components/patterns/navigation/LinkButtonPage.js b/src/pattern-library/components/patterns/navigation/LinkButtonPage.tsx similarity index 81% rename from src/pattern-library/components/patterns/navigation/LinkButtonPage.js rename to src/pattern-library/components/patterns/navigation/LinkButtonPage.tsx index a60f7fba..0929f4b7 100644 --- a/src/pattern-library/components/patterns/navigation/LinkButtonPage.js +++ b/src/pattern-library/components/patterns/navigation/LinkButtonPage.tsx @@ -21,42 +21,6 @@ export default function LinkButtonPage() {

} > - -

- LinkButton is a re-implementation of a legacy component - with the same name. -

- - -

- LinkButton styling approach has changed. Instead of - defining its own inconsistent set of variants, it - applies the same design patterns as Link. Most - styling control is handled by the color and{' '} - underline props. -

- - - Prop name:{' '} - - buttonRef - {' '} - ➜ elementRef - - - Most variant values have been removed - - - Prop name:{' '} - - className - {' '} - ➜ No longer supported - - -
-
- diff --git a/src/pattern-library/components/patterns/navigation/LinkPage.js b/src/pattern-library/components/patterns/navigation/LinkPage.tsx similarity index 80% rename from src/pattern-library/components/patterns/navigation/LinkPage.js rename to src/pattern-library/components/patterns/navigation/LinkPage.tsx index e10a3631..a5df9c5b 100644 --- a/src/pattern-library/components/patterns/navigation/LinkPage.js +++ b/src/pattern-library/components/patterns/navigation/LinkPage.tsx @@ -22,36 +22,6 @@ export default function LinkPage() {

} > - -

- Link is a reimplementation of an existing legacy - component with the same name. -

- - - - - Prop name:{' '} - - linkRef - {' '} - ➜ elementRef - - - - className - {' '} - ➜ no longer supported; use LinkBase instead - - - color, underline props - - - LinkBase component - - - -
@@ -139,12 +109,6 @@ export default function LinkPage() { } > - -

- LinkBase is a new component. -

-
- diff --git a/src/pattern-library/components/patterns/navigation/PointerButtonPage.js b/src/pattern-library/components/patterns/navigation/PointerButtonPage.tsx similarity index 96% rename from src/pattern-library/components/patterns/navigation/PointerButtonPage.js rename to src/pattern-library/components/patterns/navigation/PointerButtonPage.tsx index 289a4dc2..897700bd 100644 --- a/src/pattern-library/components/patterns/navigation/PointerButtonPage.js +++ b/src/pattern-library/components/patterns/navigation/PointerButtonPage.tsx @@ -31,12 +31,6 @@ export default function PointerButtonPage() {

} > - -

- PointerButton is a new component. -

-
- diff --git a/src/pattern-library/components/patterns/navigation/TabPage.js b/src/pattern-library/components/patterns/navigation/TabPage.tsx similarity index 98% rename from src/pattern-library/components/patterns/navigation/TabPage.js rename to src/pattern-library/components/patterns/navigation/TabPage.tsx index a2ed59c7..02d5d0ad 100644 --- a/src/pattern-library/components/patterns/navigation/TabPage.js +++ b/src/pattern-library/components/patterns/navigation/TabPage.tsx @@ -37,12 +37,6 @@ export default function TabPage() {

} > - -

- Tab is a new component. -

-
-