Skip to content

Commit

Permalink
Merge branch 'main' into mayank/skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 committed Feb 16, 2024
2 parents b5c47db + cf3e767 commit e56e53a
Show file tree
Hide file tree
Showing 246 changed files with 1,081 additions and 531 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-hairs-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-variables': minor
---

`data-iui-theme` will now automatically specify an `accent-color` to match the current theme.
5 changes: 5 additions & 0 deletions .changeset/fresh-bananas-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': minor
---

`ThemeProvider` will now automatically specify an `accent-color` to match the current theme.
5 changes: 5 additions & 0 deletions .changeset/neat-walls-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': minor
---

`Select` will now correctly reset its `value` if `null` is passed.
5 changes: 5 additions & 0 deletions .changeset/sour-masks-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Added `width`/`height` attributes to inlined svgs, to make them more resilient in case CSS fails.
24 changes: 4 additions & 20 deletions apps/website/src/components/OpenInCodePen.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,7 @@ const { code, ...rest } = Astro.props;
code.js ||= 'export default () => "hello";';
code.css ||= '';
const css = outdent`
@layer reset, itwinui;
.app-wrapper {
height: 100dvh;
padding: 1rem;
}
${code.css.trim()}
@layer reset {
* {
box-sizing: border-box;
}
body {
margin: 0;
}
}
`;
const css = code.css.trim();
const js = outdent`
${code.js.replace('export default () =>', 'const App = () =>')}
Expand All @@ -36,7 +18,7 @@ const js = outdent`
import { ThemeProvider } from '@itwin/itwinui-react';
createRoot(document.body).render(
<ThemeProvider className='app-wrapper'>
<ThemeProvider style={{height: '100dvh', padding: '1rem'}}>
<App />
</ThemeProvider>
);
Expand All @@ -49,6 +31,7 @@ const js = outdent`
)
.replaceAll(`'react'`, `'https://esm.sh/react@18'`)
.replaceAll(`react-dom`, `https://esm.sh/react-dom@18`);
const html = '<body style="margin: 0"></body>';
---

<form
Expand All @@ -67,6 +50,7 @@ const js = outdent`
css_external: 'https://esm.sh/@itwin/itwinui-react@3/styles.css',
css,
js,
html,
}).replace(/"/g, '&quot;')}
/>

Expand Down
3 changes: 3 additions & 0 deletions examples/Alert.main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.demo-alert-wrapper {
min-width: min(100%, 350px);
}
2 changes: 1 addition & 1 deletion examples/Alert.main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Alert } from '@itwin/itwinui-react';

export default () => {
return (
<Alert.Wrapper style={{ minWidth: 'min(100%, 350px)' }}>
<Alert.Wrapper className='demo-alert-wrapper'>
<Alert.Icon />
<Alert.Message>
This is an alert
Expand Down
9 changes: 9 additions & 0 deletions examples/Alert.sticky.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.demo-container {
height: 150px;
overflow: auto;
border: solid 0.5px;
}

.demo-text {
padding: 8px;
}
4 changes: 2 additions & 2 deletions examples/Alert.sticky.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Alert, Text } from '@itwin/itwinui-react';

export default () => {
return (
<div style={{ height: 150, overflow: 'auto', border: 'solid 0.5px' }}>
<div className='demo-container'>
<Alert.Wrapper isSticky>
<Alert.Icon />
<Alert.Message>
Expand All @@ -18,7 +18,7 @@ export default () => {
</Alert.Message>
<Alert.CloseButton onClick={() => console.log('CLOSED')} />
</Alert.Wrapper>
<Text style={{ padding: 8 }}>
<Text className='demo-text'>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
Expand Down
5 changes: 5 additions & 0 deletions examples/Alert.types.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.demo-container {
display: flex;
flex-direction: column;
gap: var(--iui-size-xs);
}
6 changes: 3 additions & 3 deletions examples/Alert.types.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import * as React from 'react';
import { Alert, Flex } from '@itwin/itwinui-react';
import { Alert } from '@itwin/itwinui-react';

export default () => {
return (
<Flex flexDirection='column'>
<div className='demo-container'>
{['positive', 'warning', 'negative'].map((type) => (
<Alert.Wrapper key={type} type={type}>
<Alert.Icon />
Expand All @@ -20,6 +20,6 @@ export default () => {
<Alert.CloseButton onClick={() => console.log('CLOSED')} />
</Alert.Wrapper>
))}
</Flex>
</div>
);
};
3 changes: 3 additions & 0 deletions examples/Avatar.groupoverflowtooltip.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.demo-tooltip {
white-space: pre;
}
5 changes: 5 additions & 0 deletions examples/Avatar.sizes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.demo-container {
display: flex;
gap: var(--iui-size-s);
place-items: center;
}
8 changes: 1 addition & 7 deletions examples/Avatar.sizes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ import { Avatar, getUserColor } from '@itwin/itwinui-react';

export default () => {
return (
<div
style={{
display: 'flex',
gap: 'var(--iui-size-s)',
placeItems: 'center',
}}
>
<div className='demo-container'>
<Avatar
abbreviation='TR'
backgroundColor={getUserColor('Terry Rivers')}
Expand Down
5 changes: 5 additions & 0 deletions examples/Avatar.statuses.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.demo-container {
display: flex;
gap: var(--iui-size-s);
place-items: center;
}
8 changes: 1 addition & 7 deletions examples/Avatar.statuses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ import { Avatar, getUserColor } from '@itwin/itwinui-react';

export default () => {
return (
<div
style={{
display: 'flex',
gap: 'var(--iui-size-s)',
placeItems: 'center',
}}
>
<div className='demo-container'>
<Avatar
abbreviation='TR'
backgroundColor={getUserColor('Terry Rivers')}
Expand Down
4 changes: 4 additions & 0 deletions examples/Avatar.types.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.demo-container {
display: flex;
gap: var(--iui-size-xs);
}
6 changes: 3 additions & 3 deletions examples/Avatar.types.jsx

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/Badge.soft.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.demo-container {
display: flex;
column-gap: 4px;
place-items: center;
flex-wrap: wrap;
justify-content: center;
margin: 10px;
}
11 changes: 1 addition & 10 deletions examples/Badge.soft.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@ import { Badge } from '@itwin/itwinui-react';

export default () => {
return (
<div
style={{
display: 'flex',
columnGap: 4,
placeItems: 'center',
flexWrap: 'wrap',
justifyContent: 'center',
margin: '10px',
}}
>
<div className='demo-container'>
<Badge backgroundColor='skyblue'>Skyblue</Badge>
<Badge backgroundColor='celery'>Celery</Badge>
<Badge backgroundColor='froly'>Froly</Badge>
Expand Down
6 changes: 6 additions & 0 deletions examples/Badge.statuses.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.demo-container {
display: flex;
column-gap: 4px;
place-items: center;
flex-wrap: wrap;
}
9 changes: 1 addition & 8 deletions examples/Badge.statuses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ import { Badge } from '@itwin/itwinui-react';

export default () => {
return (
<div
style={{
display: 'flex',
columnGap: 4,
placeItems: 'center',
flexWrap: 'wrap',
}}
>
<div className='demo-container'>
<Badge>Default</Badge>
<Badge backgroundColor='primary'>Informational</Badge>
<Badge backgroundColor='positive'>Positive</Badge>
Expand Down
7 changes: 7 additions & 0 deletions examples/Breadcrumbs.customOverflowDropdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.demo-container {
inline-size: 75%;
min-inline-size: 150px;
max-inline-size: 425px;
border: 1px solid lightpink;
padding: 8px;
}
10 changes: 1 addition & 9 deletions examples/Breadcrumbs.customOverflowDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ export default () => {
));

return (
<div
style={{
inlineSize: '75%',
minInlineSize: 150,
maxInlineSize: 425,
border: '1px solid lightpink',
padding: 8,
}}
>
<div className='demo-container'>
<Breadcrumbs
overflowButton={(visibleCount) => (
<DropdownMenu
Expand Down
11 changes: 11 additions & 0 deletions examples/Breadcrumbs.extremeTruncation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.demo-container {
inline-size: 75%;
min-inline-size: 150px;
max-inline-size: 425px;
border: 1px solid pink;
padding: 8px;
}

.demo-breadcrumbs-item {
max-width: 90px;
}
20 changes: 6 additions & 14 deletions examples/Breadcrumbs.extremeTruncation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,21 @@ import { Breadcrumbs, MiddleTextTruncation } from '@itwin/itwinui-react';

export default () => {
return (
<div
style={{
inlineSize: '75%',
minInlineSize: 150,
maxInlineSize: 425,
border: '1px solid pink',
padding: 8,
}}
>
<div className='demo-container'>
<Breadcrumbs>
<Breadcrumbs.Item onClick={() => {}} style={{ maxWidth: 90 }}>
<Breadcrumbs.Item onClick={() => {}} className='demo-breadcrumbs-item'>
<MiddleTextTruncation text='Root' endCharsCount={7} />
</Breadcrumbs.Item>
<Breadcrumbs.Item onClick={() => {}} style={{ maxWidth: 90 }}>
<Breadcrumbs.Item onClick={() => {}} className='demo-breadcrumbs-item'>
<MiddleTextTruncation text='My files' endCharsCount={7} />
</Breadcrumbs.Item>
<Breadcrumbs.Item onClick={() => {}} style={{ maxWidth: 90 }}>
<Breadcrumbs.Item onClick={() => {}} className='demo-breadcrumbs-item'>
<MiddleTextTruncation text='Documents' endCharsCount={7} />
</Breadcrumbs.Item>
<Breadcrumbs.Item onClick={() => {}} style={{ maxWidth: 90 }}>
<Breadcrumbs.Item onClick={() => {}} className='demo-breadcrumbs-item'>
<MiddleTextTruncation text='Status reports' endCharsCount={7} />
</Breadcrumbs.Item>
<Breadcrumbs.Item onClick={() => {}} style={{ maxWidth: 90 }}>
<Breadcrumbs.Item onClick={() => {}} className='demo-breadcrumbs-item'>
<MiddleTextTruncation text='December' endCharsCount={7} />
</Breadcrumbs.Item>
</Breadcrumbs>
Expand Down
5 changes: 5 additions & 0 deletions examples/Breadcrumbs.folder.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.demo-container {
display: inline-flex;
width: 418px;
justify-content: center;
}
4 changes: 1 addition & 3 deletions examples/Breadcrumbs.folder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export default () => {
);

return (
<div
style={{ display: 'inline-flex', width: 418, justifyContent: 'center' }}
>
<div className='demo-container'>
<DropdownButton
startIcon={<SvgFolder aria-hidden />}
styleType='borderless'
Expand Down
7 changes: 7 additions & 0 deletions examples/Breadcrumbs.truncation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.demo-container {
inline-size: 75%;
min-inline-size: 150px;
max-inline-size: 450px;
border: 1px solid pink;
padding: 8px;
}
10 changes: 1 addition & 9 deletions examples/Breadcrumbs.truncation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@ import { Breadcrumbs } from '@itwin/itwinui-react';

export default () => {
return (
<div
style={{
inlineSize: '75%',
minInlineSize: 150,
maxInlineSize: 450,
border: '1px solid pink',
padding: 8,
}}
>
<div className='demo-container'>
<Breadcrumbs>
<Breadcrumbs.Item onClick={() => {}}>Root</Breadcrumbs.Item>
<Breadcrumbs.Item onClick={() => {}}>My files</Breadcrumbs.Item>
Expand Down
4 changes: 4 additions & 0 deletions examples/Button.borderless.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.demo-container {
display: flex;
gap: var(--iui-size-xs);
}
6 changes: 3 additions & 3 deletions examples/Button.borderless.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import * as React from 'react';
import { Button, Flex } from '@itwin/itwinui-react';
import { Button } from '@itwin/itwinui-react';
import { SvgAdd, SvgCheckmarkSmall } from '@itwin/itwinui-icons-react';

export default () => {
return (
<Flex>
<div className='demo-container'>
<Button styleType='borderless'>Default</Button>
<Button styleType='borderless' disabled>
Disabled
Expand All @@ -19,6 +19,6 @@ export default () => {
<Button styleType='borderless' endIcon={<SvgCheckmarkSmall />}>
With endIcon
</Button>
</Flex>
</div>
);
};
4 changes: 4 additions & 0 deletions examples/Button.cta.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.demo-container {
display: flex;
gap: var(--iui-size-xs);
}
Loading

0 comments on commit e56e53a

Please sign in to comment.