Repository navigation
feat(icon): update samples content #1117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2968491
feat(icon): update samples content
Hristo313 06b49bc
fix(icon): update tailwind sample
Hristo313 44035ec
Merge branch 'vnext' into hhristov/update-icon-samples
Hristo313 cee6911
Merge branch 'vnext' into hhristov/update-icon-samples
Hristo313 d2e662c
Merge branch 'vnext' into hhristov/update-icon-samples
ChronosSF File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,50 @@ | ||
| This folder contains implementation of React application with example of Overview feature using [Icon](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html) component. | ||
|
|
||
|
|
||
| <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
| <body> | ||
| <a target="_blank" href="https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html" rel="noopener noreferrer"> | ||
| <img height="40px" style="border-radius: 0rem" alt="View Docs" src="https://dl.infragistics.com/x/img/browsers/button-docs.png"/> | ||
| </a> | ||
| <a target="_blank" href="./src/index.tsx" rel="noopener noreferrer"> | ||
| <img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="View Code" src="https://dl.infragistics.com/x/img/browsers/button-code.png"/> | ||
| </a> | ||
| <a target="_blank" href="https://www.infragistics.com/react-demos/samples/layouts/icon/overview" rel="noopener noreferrer"> | ||
| <img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://dl.infragistics.com/x/img/browsers/button-run.png"/> | ||
| </a> | ||
| </body> | ||
| </html> | ||
|
|
||
| ## Branches | ||
|
|
||
| > **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-react-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-react-examples/tree/vnext) branch only when you want to contribute new samples to this repository. | ||
|
|
||
| ## Instructions | ||
|
|
||
| Follow these instructions to run this example: | ||
|
|
||
|
|
||
| ``` | ||
| git clone https://github.com/IgniteUI/igniteui-react-examples.git | ||
| cd ./igniteui-react-examples | ||
| git checkout master | ||
| cd ./samples/layouts/icon/overview | ||
| ``` | ||
|
|
||
| open above folder in VS Code or type: | ||
| ``` | ||
| code . | ||
| ``` | ||
|
|
||
| In terminal window, run: | ||
| ``` | ||
| npm install | ||
| npm start | ||
| ``` | ||
|
|
||
| Then open http://localhost:4200/ in your browser | ||
|
|
||
|
|
||
| ## Learn More | ||
|
|
||
| To learn more about **Ignite UI for React** components, check out the [React documentation](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html). |
This file contains hidden or 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,11 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <title>IconOverview</title> | ||
| <link href="https://dl.infragistics.com/x/css/samples/shared.v8.css" rel="stylesheet" /> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/index.tsx"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or 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,42 @@ | ||
| { | ||
| "name": "react-icon-overview", | ||
| "description": "This project provides example of Icon Overview using Infragistics React components", | ||
| "author": "Infragistics", | ||
| "homepage": ".", | ||
| "version": "1.4.0", | ||
| "private": true, | ||
| "scripts": { | ||
| "start": "vite --port 4200", | ||
| "build": "tsc && node --max-old-space-size=4096 node_modules/vite/bin/vite build", | ||
| "preview": "vite preview", | ||
| "test": "vitest" | ||
| }, | ||
| "dependencies": { | ||
| "igniteui-dockmanager": "^2.2.1", | ||
| "igniteui-react": "19.9.0", | ||
| "igniteui-react-core": "19.6.0", | ||
| "igniteui-webcomponents": "~7.4.1", | ||
| "react": "^19.3.0", | ||
| "react-dom": "^19.3.0", | ||
| "tslib": "^2.4.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/jest": "^30.0.0", | ||
| "@types/node": "^24.7.1", | ||
| "@types/react": "^19.3.0", | ||
| "@types/react-dom": "^19.3.0", | ||
| "@vitejs/plugin-react": "^6.1.1", | ||
| "@vitest/browser": "^5.0.2", | ||
| "typescript": "^5.9.3", | ||
| "vite": "^8.3.1", | ||
| "vitest": "^5.0.2", | ||
| "vitest-canvas-mock": "^1.2.0", | ||
| "worker-loader": "^3.0.8" | ||
| }, | ||
| "browserslist": [ | ||
| ">0.2%", | ||
| "not dead", | ||
| "not ie <= 11", | ||
| "not op_mini all" | ||
| ] | ||
| } |
This file contains hidden or 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 @@ | ||
| /* shared styles are loaded from: */ | ||
| /* https://dl.infragistics.com/x/css/samples/shared.v8.css */ | ||
|
|
||
| .sample { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| height: 100%; | ||
| padding: 1rem; | ||
| } | ||
|
|
||
| .menu { | ||
| height: auto; | ||
| } | ||
|
|
||
| .menu igc-nav-drawer-item { | ||
| isolation: isolate; | ||
| } | ||
This file contains hidden or 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,50 @@ | ||
| import { useEffect, useState } from 'react'; | ||
| import ReactDOM from 'react-dom/client'; | ||
| import './index.css'; | ||
| import { IgrIcon, IgrNavDrawer, IgrNavDrawerItem, registerIconFromText } from 'igniteui-react'; | ||
| import 'igniteui-webcomponents/themes/light/bootstrap.css'; | ||
|
|
||
| const icons = [ | ||
| { name: 'home', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>' }, | ||
| { name: 'mail', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>' }, | ||
| { name: 'assignment', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/></svg>' }, | ||
| { name: 'settings', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></svg>' }, | ||
| { name: 'feedback', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 12h-2v-2h2v2zm0-4h-2V6h2v4z"/></svg>' }, | ||
| ]; | ||
|
|
||
| const menuItems = [ | ||
| { label: 'Home', icon: 'home' }, | ||
| { label: 'Inbox', icon: 'mail' }, | ||
| { label: 'Reports', icon: 'assignment' }, | ||
| { label: 'Settings', icon: 'settings' }, | ||
| { label: 'Support', icon: 'feedback' }, | ||
| ]; | ||
|
|
||
| export default function IconOverview() { | ||
| const [activeItem, setActiveItem] = useState<string>('Home'); | ||
|
|
||
| useEffect(() => { | ||
| icons.forEach((icon) => registerIconFromText(icon.name, icon.text, 'material')); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <div className="sample"> | ||
| <IgrNavDrawer className="menu" position="relative" open={true}> | ||
| {menuItems.map((item) => ( | ||
| <IgrNavDrawerItem | ||
| key={item.label} | ||
| active={item.label === activeItem} | ||
| onClick={() => setActiveItem(item.label)} | ||
| > | ||
| <IgrIcon slot="icon" name={item.icon} collection="material" /> | ||
| <span slot="content">{item.label}</span> | ||
| </IgrNavDrawerItem> | ||
| ))} | ||
| </IgrNavDrawer> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| // rendering above component to the React DOM | ||
| const root = ReactDOM.createRoot(document.getElementById('root')!); | ||
| root.render(<IconOverview/>); |
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
samples/layouts/icon/sizing/index.html → samples/layouts/icon/size/index.html
This file contains hidden or 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
4 changes: 2 additions & 2 deletions
4
samples/layouts/icon/sizing/package.json → samples/layouts/icon/size/package.json
This file contains hidden or 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 hidden or 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,42 @@ | ||
| /* shared styles are loaded from: */ | ||
| /* https://dl.infragistics.com/x/css/samples/shared.v8.css */ | ||
|
|
||
| .sample { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| height: 100%; | ||
| padding: 1rem; | ||
| } | ||
|
|
||
| .icon-sizes { | ||
| display: grid; | ||
| grid-auto-flow: column; | ||
| grid-template-rows: auto auto; | ||
| place-items: center; | ||
| column-gap: 4.25rem; | ||
| row-gap: 1.0625rem; | ||
| } | ||
|
|
||
| .icon-sizes igc-icon { | ||
| color: var(--ig-gray-800); | ||
| } | ||
|
|
||
| .size-large { | ||
| --ig-size: var(--ig-size-large); | ||
| } | ||
|
|
||
| .size-medium { | ||
| --ig-size: var(--ig-size-medium); | ||
| } | ||
|
|
||
| .size-small { | ||
| --ig-size: var(--ig-size-small); | ||
| } | ||
|
|
||
| .size-label { | ||
| color: var(--ig-gray-600); | ||
| font-family: "Aktiv Grotesk", Arial, sans-serif; | ||
| font-size: 0.875rem; | ||
| line-height: 1.25rem; | ||
| } |
This file contains hidden or 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,30 @@ | ||
| import { useEffect } from 'react'; | ||
| import ReactDOM from 'react-dom/client'; | ||
| import './index.css'; | ||
| import { IgrIcon, registerIconFromText } from 'igniteui-react'; | ||
| import 'igniteui-webcomponents/themes/light/bootstrap.css'; | ||
|
|
||
| const notificationsIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg>'; | ||
|
|
||
| export default function IconSize() { | ||
| useEffect(() => { | ||
| registerIconFromText('notifications', notificationsIcon, 'material'); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <div className="sample"> | ||
| <div className="icon-sizes"> | ||
| <IgrIcon className="size-large" name="notifications" collection="material" /> | ||
| <span className="size-label">Large</span> | ||
| <IgrIcon className="size-medium" name="notifications" collection="material" /> | ||
| <span className="size-label">Medium</span> | ||
| <IgrIcon className="size-small" name="notifications" collection="material" /> | ||
| <span className="size-label">Small</span> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| // rendering above component to the React DOM | ||
| const root = ReactDOM.createRoot(document.getElementById('root')!); | ||
| root.render(<IconSize/>); |
This file contains hidden or 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,24 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "es2020", | ||
| "lib": [ | ||
| "es2020", | ||
| "dom", | ||
| "dom.iterable" | ||
| ], | ||
| "module": "esnext", | ||
| "moduleResolution": "bundler", | ||
| "jsx": "react-jsx", | ||
| "types": [ | ||
| "vite/client" | ||
| ], | ||
| "strict": true, | ||
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "skipLibCheck": true, | ||
| "noEmit": true | ||
| }, | ||
| "include": [ | ||
| "src" | ||
| ] | ||
| } |
This file contains hidden or 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,12 @@ | ||
| import { defineConfig } from 'vite'; | ||
| import react from '@vitejs/plugin-react'; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [react()], | ||
| build: { | ||
| outDir: 'build' | ||
| }, | ||
| server: { | ||
| open: false | ||
| }, | ||
| }); |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.