-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into r/private-css-vars
- Loading branch information
Showing
51 changed files
with
412 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+9 Bytes
(100%)
...s/bitmaps_reference/iTwinUI_footer_State_hover_and_focus_dark_0_viewport_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3 Bytes
(100%)
...itmaps_reference/iTwinUI_footer_State_hover_and_focus_hc_dark_0_viewport_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16 Bytes
(100%)
...tmaps_reference/iTwinUI_footer_State_hover_and_focus_hc_light_0_viewport_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4 Bytes
(100%)
.../bitmaps_reference/iTwinUI_footer_State_hover_and_focus_light_0_viewport_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6 Bytes
(100%)
...itmaps_reference/iTwinUI_footer_Type_visible_in_viewport_dark_0_viewport_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4 Bytes
(100%)
...aps_reference/iTwinUI_footer_Type_visible_in_viewport_hc_dark_0_viewport_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14 Bytes
(100%)
...ps_reference/iTwinUI_footer_Type_visible_in_viewport_hc_light_0_viewport_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5 Bytes
(100%)
...tmaps_reference/iTwinUI_footer_Type_visible_in_viewport_light_0_viewport_0_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...cypress-visual-screenshots/baseline/Footer.test.ts-Appended Custom Elements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13 Bytes
(100%)
apps/react-workshop/cypress-visual-screenshots/baseline/Footer.test.ts-Basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4 Bytes
(100%)
...ct-workshop/cypress-visual-screenshots/baseline/Footer.test.ts-Bottom Fixed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4 Bytes
(100%)
...-workshop/cypress-visual-screenshots/baseline/Footer.test.ts-Custom Content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13 Bytes
(100%)
...-screenshots/baseline/Footer.test.ts-Customized Default And Custom Elements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+269 Bytes
(100%)
...ct-workshop/cypress-visual-screenshots/baseline/Table.test.ts-Custom Filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+64 Bytes
(100%)
apps/react-workshop/cypress-visual-screenshots/baseline/Table.test.ts-Filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14 Bytes
(100%)
.../react-workshop/cypress-visual-screenshots/baseline/Table.test.ts-Localized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: Label | ||
description: Label components can be used to associate text with form inputs. | ||
thumbnail: #TODO | ||
--- | ||
|
||
<p>{frontmatter.description}</p> | ||
|
||
## Usage | ||
|
||
`Label` corresponds to an HTML `<label>` and can be linked to an `Input` by matching `Label`'s `htmlFor` with `Input`'s `id` for better accessibility, ensuring assistive technologies correctly identify their relationship. | ||
|
||
<LiveExample src='Label.main.jsx'> | ||
<AllExamples.LabelMainExample client:load /> | ||
</LiveExample> | ||
|
||
### Required | ||
|
||
To make the form field required, you can pass the `required` prop. This also adds the `*` next to the label. | ||
|
||
<LiveExample src='Label.required.jsx'> | ||
<AllExamples.LabelRequiredExample client:load /> | ||
</LiveExample> | ||
|
||
### Display style | ||
|
||
There are two available display styles: | ||
|
||
- `"block"` (default): places the label and the other fields on separate lines without adding any extra spacing. | ||
- `"inline"`: displays the label inline with other elements by adding a right margin to it. | ||
|
||
<LiveExample src='Label.displayStyles.jsx'> | ||
<AllExamples.LabelDisplayStylesExample client:load /> | ||
</LiveExample> | ||
|
||
## Props | ||
|
||
<PropsTable path='@itwin/itwinui-react/esm/core/Label/Label.d.ts' /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title: Text | ||
description: Text components offer various text formatting options for applications. | ||
thumbnail: Typography | ||
--- | ||
|
||
<p>{frontmatter.description}</p> | ||
|
||
## Usage | ||
|
||
`Text` is a [polymorphic](#polymorphic-only-semantics-and-not-size) typography component that can be used to render any kind of text as any kind of element. | ||
|
||
<LiveExample src='Text.main.jsx'> | ||
<AllExamples.TextMainExample client:load /> | ||
</LiveExample> | ||
|
||
By default, the `Text` component renders a `<div>` element with the regular `"body"` size. The visuals of this component are completely separate from its semantics, which helps ensure proper [heading structure](https://www.w3.org/WAI/tutorials/page-structure/headings/). | ||
|
||
- **Visuals**: The `variant` prop can be used to customize the the size (e.g. `variant="subheading"`). | ||
- **Semantics**: The polymorphic `as` prop can be used to render a different element (e.g. `as="h2"`). | ||
|
||
### Variant (Only size and not semantics) | ||
|
||
The `variant` prop can be used to determine the size of the text. The available variants are (from largest to smallest): | ||
|
||
1. `"headline"`. | ||
2. `"title"`. | ||
3. `"subheading"`. | ||
4. `"leading"`. | ||
5. `"body"` (default). | ||
6. `"smaller"`. | ||
|
||
<LiveExample src='Text.variant.jsx'> | ||
<AllExamples.TextVariantExample client:load /> | ||
</LiveExample> | ||
|
||
Please note that the `variant` prop only affects the visual size and is completely decoupled from the semantics, which can be controlled using the `as` prop (see below). | ||
|
||
### Polymorphic (Only semantics and not size) | ||
|
||
The `Text` component supports the polymorphic `as` prop, which can be used to change the underlying HTML element. This is useful when you want to render the text as a specific heading level while maintaining a desired size. | ||
|
||
<LiveExample src='Text.polymorphic.jsx' truncate={false}> | ||
<AllExamples.TextPolymorphicExample client:load /> | ||
</LiveExample> | ||
|
||
### Muted | ||
|
||
To achieve a muted or desaturated text effect, the `isMuted` prop can be passed into the component. Muted text helps differentiating less important information as well as enhancing the overall readability. | ||
|
||
<LiveExample src='Text.muted.jsx' truncate={false}> | ||
<AllExamples.TextMutedExample client:load /> | ||
</LiveExample> | ||
|
||
### Skeleton | ||
|
||
To indicate that content is loading and will be available soon, you can use the `isSkeleton` prop along with the `variant` prop. This will display a placeholder for any text that is still loading. If no `variant` is specified, the skeleton will default to the size of `"body"` text. | ||
|
||
<LiveExample src='Text.skeleton.jsx'> | ||
<AllExamples.TextSkeletonExample client:load /> | ||
</LiveExample> | ||
|
||
## Props | ||
|
||
<PropsTable path='@itwin/itwinui-react/esm/core/Typography/Text.d.ts' /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,14 @@ | ||
--- | ||
title: Typography | ||
description: | ||
description: Typography components provide consistency in text styling across the application. | ||
thumbnail: Typography | ||
--- | ||
|
||
<p>{frontmatter.description}</p> | ||
|
||
<Placeholder componentPageName='text--basic' /> | ||
## Components | ||
|
||
## Text | ||
The documentation for typography components has been split into the following pages: | ||
|
||
<LiveExample src='Text.main.jsx' truncate={false}> | ||
<AllExamples.TextMainExample client:load /> | ||
</LiveExample> | ||
|
||
### Props | ||
|
||
<PropsTable path='@itwin/itwinui-react/esm/core/Typography/Text.d.ts' /> | ||
|
||
## Label | ||
|
||
<Placeholder componentPageName='label--basic' /> | ||
|
||
<LiveExample src='Label.main.jsx' truncate={false}> | ||
<AllExamples.LabelMainExample client:load /> | ||
</LiveExample> | ||
|
||
### Props | ||
|
||
<PropsTable path='@itwin/itwinui-react/esm/core/Label/Label.d.ts' /> | ||
- [Label](/docs/label) | ||
- [Text](/docs/text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.demo-container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--iui-size-xs); | ||
width: 300px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 { InputGrid, Input, Label, LabeledSelect } from '@itwin/itwinui-react'; | ||
|
||
export default () => { | ||
return ( | ||
<div className='demo-container'> | ||
<InputGrid> | ||
<Label displayStyle='block'>Block label</Label> | ||
<Input /> | ||
</InputGrid> | ||
<InputGrid labelPlacement='inline'> | ||
<Label displayStyle='inline'>Inline label</Label> | ||
<Input /> | ||
</InputGrid> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.demo-container { | ||
width: 300px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 { Input, Label } from '@itwin/itwinui-react'; | ||
|
||
export default () => { | ||
return ( | ||
<div className='demo-container'> | ||
<Label htmlFor='text-input' required> | ||
Name: | ||
</Label> | ||
<Input id='text-input' placeholder='Enter name' /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 { Flex, Text } from '@itwin/itwinui-react'; | ||
|
||
export default () => { | ||
return ( | ||
<Flex flexDirection='column'> | ||
<Text>This is a regular text</Text> | ||
<Text isMuted>This is a muted text</Text> | ||
</Flex> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 { Text } from '@itwin/itwinui-react'; | ||
|
||
export default () => { | ||
return ( | ||
<Text variant='subheading' as='h1'> | ||
This is a subheading rendered as an h1. | ||
</Text> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 { Flex, Text } from '@itwin/itwinui-react'; | ||
|
||
export default () => { | ||
return ( | ||
<Flex flexDirection='column'> | ||
<Text isSkeleton variant='headline'> | ||
This is a skeleton text | ||
</Text> | ||
<Text isSkeleton variant='title'> | ||
This is a skeleton text | ||
</Text> | ||
<Text isSkeleton variant='subheading'> | ||
This is a skeleton text | ||
</Text> | ||
<Text isSkeleton variant='leading'> | ||
This is a skeleton text | ||
</Text> | ||
<Text isSkeleton>This is a skeleton text</Text> | ||
<Text isSkeleton variant='small'> | ||
This is a skeleton text | ||
</Text> | ||
</Flex> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 { Flex, Text } from '@itwin/itwinui-react'; | ||
|
||
export default () => { | ||
return ( | ||
<Flex flexDirection='column'> | ||
<Text variant='headline'>This is a headline</Text> | ||
<Text variant='title'>This is a title</Text> | ||
<Text variant='subheading'>This is a subheading</Text> | ||
<Text variant='leading'>This is a leading</Text> | ||
<Text>This is a body</Text> | ||
<Text variant='small'>This is a small text</Text> | ||
</Flex> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
.demo-tree { | ||
width: min(100%, 260px); | ||
height: 100%; | ||
width: 260px; | ||
overflow: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.