-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 193-review-textinput
- Loading branch information
Showing
9 changed files
with
141 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,4 +109,6 @@ typings/ | |
|
||
.angular | ||
|
||
packages/components/src/components.d.ts | ||
packages/components/src/components.d.ts | ||
|
||
.angular |
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,19 +1,45 @@ | ||
import './App.css'; | ||
|
||
import Button from './components/Button/button'; | ||
|
||
import TextField from './components/TextFIeld/TextField'; | ||
|
||
import ProgressBar from './components/ProgressBar/ProgressBar'; | ||
|
||
import SearchBar from './components/SearchBar/SearchBar'; | ||
import Accordion from './components/Accordion/Accordion'; | ||
|
||
|
||
function App() { | ||
|
||
|
||
|
||
|
||
return ( | ||
<div> | ||
<TextField /> | ||
<h1 className="header">Stencil Framework integration - React + JS</h1> | ||
|
||
<h2>Search Bar</h2> | ||
<SearchBar /> | ||
<br /> | ||
|
||
<h2>Button</h2> | ||
<Button /> | ||
<br /> | ||
|
||
<h2>Progress Bar</h2> | ||
<ProgressBar /> | ||
<br /> | ||
|
||
<h2>Text Field</h2> | ||
<TextField /> | ||
<br /> | ||
|
||
<h2>Accordion</h2> | ||
<Accordion /> | ||
|
||
</div> | ||
|
||
) | ||
} | ||
|
||
export default App; |
33 changes: 33 additions & 0 deletions
33
examples/wrapper-components/react-javascript/src/components/Accordion/Accordion.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
examples/wrapper-components/react-javascript/src/components/Button/button.js
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,13 @@ | ||
import React from 'react'; | ||
import { IfxButton } from '@infineon/infineon-design-system-react'; | ||
|
||
function Button() { | ||
return ( | ||
<div > | ||
<IfxButton color='primary'>Yes</IfxButton> | ||
<IfxButton color='secondary'>No</IfxButton> | ||
</div> | ||
) | ||
} | ||
|
||
export default Button; |
28 changes: 23 additions & 5 deletions
28
examples/wrapper-components/react-javascript/src/components/ProgressBar/ProgressBar.js
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,12 +1,30 @@ | ||
import React from 'react'; | ||
import { IfxProgressBar } from '@infineon/infineon-design-system-react'; | ||
import React, { useState } from 'react'; | ||
import { IfxProgressBar, IfxButton } from '@infineon/infineon-design-system-react'; | ||
|
||
function ProgressBar() { | ||
const [progressValue, setProgressValue] = useState(25); | ||
|
||
// Define your methods here | ||
const updateProgressOnClick = () => { | ||
setProgressValue((currentValue) => { | ||
console.log("updating progress-bar value ", progressValue) | ||
if (currentValue < 100) { | ||
return currentValue + 10; | ||
} else { | ||
return 10; | ||
} | ||
}); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<IfxProgressBar value={50} showLabel={true}></IfxProgressBar> | ||
</div> | ||
<IfxProgressBar value={progressValue} showLabel={true}></IfxProgressBar> | ||
<IfxButton onClick={updateProgressOnClick} variant="outline" href="" target="_blank" color="primary" size="s" | ||
disabled={false} icon={false}> | ||
Update Progress | ||
</IfxButton> | ||
</div > | ||
); | ||
} | ||
|
||
export default ProgressBar; | ||
export default ProgressBar; |
18 changes: 18 additions & 0 deletions
18
examples/wrapper-components/react-javascript/src/components/SearchBar/SearchBar.js
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,18 @@ | ||
import React from 'react'; | ||
import { IfxSearchBar } from '@infineon/infineon-design-system-react'; | ||
|
||
function SearchBar() { | ||
const handleSearch = (event) => { | ||
console.log("handling search: ", event.detail?.detail) | ||
}; | ||
return ( | ||
<div > | ||
<IfxSearchBar onIfxChange={handleSearch} style={{ width: '100%' }} show-close-button="true"></IfxSearchBar> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
export default SearchBar; | ||
|
||
|
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