diff --git a/apps/website/src/examples/Surface.elevation.tsx b/apps/website/src/examples/Surface.elevation.tsx new file mode 100644 index 00000000000..1280434556c --- /dev/null +++ b/apps/website/src/examples/Surface.elevation.tsx @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + +* Copyright (c) Bentley Systems, Incorporated. All rights reserved. + * See LICENSE.md in the project root for license terms and full copyright notice. + *--------------------------------------------------------------------------------------------*/ +import * as React from 'react'; +import { Surface, Flex } from '@itwin/itwinui-react'; + +export default () => { + const cardStyle = { + display: 'flex', + width: '100px', + padding: '12px', + justifyContent: 'center', + textAlign: 'center', + flex: '1', + }; + return ( + <> + + +

Elevation 0 (0dp)

+
+ +

Elevation 1 (2dp)

+
+ +

Elevation 2 (4dp)

+
+
+ + +

Elevation 3 (8dp)

+
+ +

Elevation 4 (16dp)

+
+ +

Elevation 5 (24dp)

+
+
+ + ); +}; diff --git a/apps/website/src/examples/Surface.custom.tsx b/apps/website/src/examples/Surface.headerfooter.tsx similarity index 100% rename from apps/website/src/examples/Surface.custom.tsx rename to apps/website/src/examples/Surface.headerfooter.tsx diff --git a/apps/website/src/examples/Surface.main.tsx b/apps/website/src/examples/Surface.main.tsx index 89b9d308436..e90cb03be0d 100644 --- a/apps/website/src/examples/Surface.main.tsx +++ b/apps/website/src/examples/Surface.main.tsx @@ -7,8 +7,18 @@ import { Surface } from '@itwin/itwinui-react'; export default () => { return ( - -

Change the elevation prop to adjust the shadow level.

+ +

This is a surface

); }; diff --git a/apps/website/src/examples/Surface.nopadding.tsx b/apps/website/src/examples/Surface.nopadding.tsx new file mode 100644 index 00000000000..b0b3c5daf9e --- /dev/null +++ b/apps/website/src/examples/Surface.nopadding.tsx @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Bentley Systems, Incorporated. All rights reserved. + * See LICENSE.md in the project root for license terms and full copyright notice. + *--------------------------------------------------------------------------------------------*/ +import * as React from 'react'; +import { Surface, Text, Flex, Anchor, Divider } from '@itwin/itwinui-react'; + +export default () => { + const listStyle = { + padding: 'var(--iui-size-s)', + position: 'relative', + } as React.CSSProperties; + const cardStyle = { + maxHeight: '300px', + }; + return ( + + + + Surface with overflow & no body padding + + + + +
    +
  • + Daily log +
  • + +
  • + Inspections +
  • + +
  • + Issues +
  • + +
  • + Observations +
  • + +
  • + RFIs +
  • + +
  • + Weather delay notices +
  • +
+
+
+
+ ); +}; diff --git a/apps/website/src/examples/index.tsx b/apps/website/src/examples/index.tsx index 224f3af0507..3f75d932f69 100644 --- a/apps/website/src/examples/index.tsx +++ b/apps/website/src/examples/index.tsx @@ -154,7 +154,9 @@ export { default as StepperLocalizationExample } from './Stepper.localization'; export { default as StepperLayoutExample } from './Stepper.layout'; export { default as SurfaceMainExample } from './Surface.main'; -export { default as SurfaceCustomExample } from './Surface.custom'; +export { default as SurfaceElevationExample } from './Surface.elevation'; +export { default as SurfaceHeaderFooterExample } from './Surface.headerfooter'; +export { default as SurfaceNoPaddingExample } from './Surface.nopadding'; export { default as TableMainExample } from './Table.main'; diff --git a/apps/website/src/pages/docs/surface.mdx b/apps/website/src/pages/docs/surface.mdx index 49efa6a4299..16df48f3192 100644 --- a/apps/website/src/pages/docs/surface.mdx +++ b/apps/website/src/pages/docs/surface.mdx @@ -9,23 +9,40 @@ group: core import PropsTable from '~/components/PropsTable.astro'; import LiveExample from '~/components/LiveExample.astro'; -import Placeholder from '~/components/Placeholder.astro'; import * as AllExamples from '~/examples';

{frontmatter.description}

- - -## Custom +## Variants + +### Elevation + +Elevation is measured as the distance between surfaces. + + + + + +The distance from the front of one surface to the front of another is measured along the z-axis in density-independent pixels (`dp`) and depicted using drop shadows. + +We support from `0dp` up to `24dp` in elevation with the shadows copying real life, getting larger and more blurred the further they go away from the surface. `0dp` represents the absence of drop shadow. Next are `2dp` and `4dp`, then scaling directly up to `8dp`, `16dp`, to finally reach the maximal elevation of `24dp`. + +### Header & Body The surface component also has customizable subcomponents for header and body - - + + + + +By default, the surface's body component includes padding. This can be disabled using the `isPadded` prop + + + ## Props