diff --git a/apps/website/src/components/LiveExample.astro b/apps/website/src/components/LiveExample.astro index 9c1911a88d5..e928100b28b 100644 --- a/apps/website/src/components/LiveExample.astro +++ b/apps/website/src/components/LiveExample.astro @@ -30,14 +30,7 @@ if (code.includes('Copyright (c) Bentley Systems')) { ---
- - - +
@@ -94,7 +87,7 @@ if (code.includes('Copyright (c) Bentley Systems')) { border-radius: var(--border-radius-1); } - .demo-iui-wrapper { + .demo-box :global([data-iui-theme]) { height: 100%; width: 100%; overflow: auto; diff --git a/examples/InputGroup.checkboxGroup.tsx b/examples/InputGroup.checkboxGroup.tsx index bd2643c1455..b0ac8585de4 100644 --- a/examples/InputGroup.checkboxGroup.tsx +++ b/examples/InputGroup.checkboxGroup.tsx @@ -5,7 +5,7 @@ import * as React from 'react'; import { InputGroup, Checkbox } from '@itwin/itwinui-react'; -export default (args) => { +export default () => { const option1Label = 'Football'; const option2Label = 'Hockey'; const [option1, setOption1] = React.useState(true); @@ -33,32 +33,22 @@ export default (args) => { setOption2(value); }; return ( - + onAllChange(event.target.checked)} label='Select all' indeterminate={isIndeterminate} checked={allOptions} - disabled={args.disabled} - required={args.required} /> setOption1(event.target.checked)} label={option1Label} checked={option1} - disabled={args.disabled} - required={args.required} /> setOption2(event.target.checked)} label={option2Label} checked={option2} - disabled={args.disabled} - required={args.required} /> ); diff --git a/examples/Select.disable.tsx b/examples/Select.disable.tsx index baf10651da4..b57cf2cff4a 100644 --- a/examples/Select.disable.tsx +++ b/examples/Select.disable.tsx @@ -5,34 +5,25 @@ import * as React from 'react'; import { Select } from '@itwin/itwinui-react'; -export default (args) => { - const { - options = [ - { - value: 1, - label: 'Item #1', - }, - { - value: 2, - label: 'Item #2', - }, - { - value: 3, - label: 'Item #3', - }, - ], - placeholder = 'Placeholder text', - ...rest - } = args; - const [value, setValue] = React.useState(undefined); +export default () => { return ( disabled - {...rest} - options={options} - value={value} - onChange={setValue} - placeholder={placeholder} + options={[ + { + value: 1, + label: 'Item #1', + }, + { + value: 2, + label: 'Item #2', + }, + { + value: 3, + label: 'Item #3', + }, + ]} + placeholder={'Placeholder text'} /> ); }; diff --git a/examples/Select.icon.tsx b/examples/Select.icon.tsx index 0b3309f2a1d..117edb83352 100644 --- a/examples/Select.icon.tsx +++ b/examples/Select.icon.tsx @@ -10,36 +10,27 @@ import { SvgSmileyNeutral, } from '@itwin/itwinui-icons-react'; -export default (args) => { - const { - options = [ - { - value: 'happy', - label: 'Happy', - icon: , - }, - { - value: 'neutral', - label: 'Neutral', - icon: , - }, - { - value: 'sad', - label: 'Sad', - icon: , - }, - ], - placeholder = 'How are you today?', - ...rest - } = args; - const [value, setValue] = React.useState(undefined); +export default () => { return ( - - {...rest} - options={options} - value={value} - onChange={setValue} - placeholder={placeholder} + ); }; diff --git a/examples/Select.truncate.tsx b/examples/Select.truncate.tsx index 6a791ed94c9..ce23ccd5849 100644 --- a/examples/Select.truncate.tsx +++ b/examples/Select.truncate.tsx @@ -6,27 +6,23 @@ import * as React from 'react'; import { MenuItem, MiddleTextTruncation, Select } from '@itwin/itwinui-react'; import { useCallback, useState } from 'react'; -export default (args) => { - const { - options = [ - { - value: - 'MyFileWithAReallyLongNameThatWillBeTruncatedBecauseItIsReallyThatLongSoHardToBelieve_FinalVersion_V2.html', - label: - 'MyFileWithAReallyLongNameThatWillBeTruncatedBecauseItIsReallyThatLongSoHardToBelieve_FinalVersion_V2.html', - }, - { - value: 'ShortNameFile.jpg', - label: 'ShortNameFile.jpg', - }, - { - value: 'SomeOtherFile.dgn', - label: 'SomeOtherFile.dgn', - }, - ], - placeholder = 'Placeholder text', - ...rest - } = args; +export default () => { + const options = [ + { + value: + 'MyFileWithAReallyLongNameThatWillBeTruncatedBecauseItIsReallyThatLongSoHardToBelieve_FinalVersion_V2.html', + label: + 'MyFileWithAReallyLongNameThatWillBeTruncatedBecauseItIsReallyThatLongSoHardToBelieve_FinalVersion_V2.html', + }, + { + value: 'ShortNameFile.jpg', + label: 'ShortNameFile.jpg', + }, + { + value: 'SomeOtherFile.dgn', + label: 'SomeOtherFile.dgn', + }, + ]; const [selectedValue, setSelectedValue] = useState( options[0].value, ); @@ -39,12 +35,11 @@ export default (args) => { [], ); return ( - - {...rest} +