igniteui-cli 15.2.2 → 15.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/build.js +7 -12
- package/package.json +4 -4
- package/templates/blazor/igb/projects/ai-config/files/skills/AGENTS.md +0 -5
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/SKILL.md +2 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/charts.md +7 -35
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/data-display.md +0 -54
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/feedback.md +0 -38
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/form-controls.md +0 -68
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout-manager.md +1 -124
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md +0 -62
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md +1 -1
- package/templates/react/igr-ts/projects/_base/files/package.json +1 -0
- package/templates/react/igr-ts/projects/_base/files/src/app/app.tsx +4 -2
- package/templates/react/igr-ts/projects/_base/files/src/setupTests.ts +12 -0
- package/templates/react/igr-ts/projects/_base/files/styles.css +6 -0
- package/templates/react/igr-ts/projects/_base_with_home/files/index.html +2 -1
- package/templates/react/igr-ts/projects/_base_with_home/files/src/app/home/home.tsx +60 -10
- package/templates/react/igr-ts/projects/_base_with_home/files/src/app/home/style.module.css +79 -20
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +0 -8
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +6 -36
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENT-CATALOGUE.md +8 -142
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/EVENT-HANDLING.md +2 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/SKILL.md +7 -14
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/CSS-THEMING.md +2 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/MCP-SERVER.md +0 -8
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/SKILL.md +2 -2
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/component-mapping.md +60 -74
- package/templates/react/igr-ts/projects/empty/index.js +2 -2
- package/templates/react/igr-ts/projects/side-nav/files/src/app/app-routes.tsx +5 -0
- package/templates/react/igr-ts/projects/side-nav/files/src/app/app.css +82 -0
- package/templates/react/igr-ts/projects/side-nav/files/src/app/app.tsx +104 -0
- package/templates/react/igr-ts/projects/side-nav/files/src/app/home/home.tsx +69 -0
- package/templates/react/igr-ts/projects/side-nav/files/src/app/home/style.module.css +105 -0
- package/templates/react/igr-ts/projects/{top-nav → side-nav}/index.d.ts +2 -2
- package/templates/react/igr-ts/projects/{top-nav → side-nav}/index.js +7 -7
- package/templates/react/igr-ts/projects/side-nav-auth/files/index.html +19 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app-routes.tsx +24 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app.css +84 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app.tsx +124 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/AuthContext.tsx +73 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/AuthGuard.tsx +14 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Login.module.css +93 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Login.tsx +69 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginBar.module.css +42 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginBar.tsx +44 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginDialog.module.css +14 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginDialog.tsx +49 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Register.module.css +74 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Register.tsx +67 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/models/external-login.ts +10 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/models/login.ts +4 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/models/register-info.ts +6 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/models/user.ts +19 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/Profile.module.css +87 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/Profile.tsx +42 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectFacebook.tsx +44 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectGoogle.tsx +40 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectMicrosoft.tsx +40 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/authentication.ts +37 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/external-auth-config.ts +44 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/externalAuth.ts +272 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/fakeBackend.ts +88 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/jwtUtil.ts +10 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/pkce.ts +29 -0
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/services/userStore.ts +39 -0
- package/templates/react/igr-ts/projects/side-nav-auth/index.d.ts +15 -0
- package/templates/react/igr-ts/projects/side-nav-auth/index.js +46 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app-routes.tsx +5 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.css +109 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.test.tsx +20 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.tsx +81 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/home/home.tsx +69 -0
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/home/style.module.css +105 -0
- package/templates/react/igr-ts/projects/side-nav-mini/index.d.ts +15 -0
- package/templates/react/igr-ts/projects/side-nav-mini/index.js +46 -0
- package/templates/react/igr-ts/projects/side-nav-mini-auth/files/src/app/app.css +106 -0
- package/templates/react/igr-ts/projects/side-nav-mini-auth/files/src/app/app.tsx +101 -0
- package/templates/react/igr-ts/projects/side-nav-mini-auth/index.d.ts +15 -0
- package/templates/react/igr-ts/projects/side-nav-mini-auth/index.js +50 -0
- package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app.ts +6 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/styles.css +1 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/index.html +2 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/src/app/home/home.ts +103 -9
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/src/assets/wc.png +0 -0
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-choose-components/SKILL.md +122 -160
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-customize-component-theme/SKILL.md +83 -311
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-customize-component-theme/references/mcp-setup.md +69 -0
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-generate-from-image-design/SKILL.md +4 -1
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-generate-from-image-design/references/component-mapping.md +60 -61
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +15 -11
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-optimize-bundle-size/SKILL.md +23 -274
- package/templates/webcomponents/igc-ts/projects/empty/index.js +1 -1
- package/templates/webcomponents/igc-ts/projects/side-nav/files/index.html +21 -0
- package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app-routing.ts +9 -0
- package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app.ts +192 -22
- package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/home/home.ts +175 -0
- package/templates/webcomponents/igc-ts/projects/side-nav/index.js +1 -1
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/index.html +25 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/app-routing.ts +37 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/app.ts +251 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/login-bar/login-bar.ts +124 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/login-dialog/login-dialog.ts +253 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/models/external-login.ts +10 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/models/login.ts +4 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/models/register-info.ts +6 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/models/user.ts +19 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/authentication.ts +37 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/external-auth-config.ts +44 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/externalAuth.ts +272 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/fakeBackend.ts +88 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/jwtUtil.ts +10 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/pkce.ts +29 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/services/userStore.ts +39 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/profile/profile.ts +142 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/redirect/redirect-facebook.ts +57 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/redirect/redirect-google.ts +53 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/redirect/redirect-microsoft.ts +53 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/index.d.ts +15 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/index.js +46 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/files/src/app/app-routing.ts +13 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/files/src/app/app.ts +238 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/index.d.ts +14 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/index.js +45 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini-auth/files/src/app/app.ts +258 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini-auth/index.d.ts +15 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-mini-auth/index.js +50 -0
- package/templates/react/igr-ts/projects/top-nav/files/src/app/app.css +0 -62
- package/templates/react/igr-ts/projects/top-nav/files/src/app/app.tsx +0 -18
- package/templates/react/igr-ts/projects/top-nav/files/src/components/navigation-header/index.tsx +0 -19
- /package/templates/react/igr-ts/projects/{top-nav → side-nav}/files/src/app/app.test.tsx +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { Outlet, useNavigate, useLocation } from 'react-router-dom';
|
|
3
|
+
import {
|
|
4
|
+
IgrNavDrawer,
|
|
5
|
+
IgrNavDrawerItem,
|
|
6
|
+
IgrIcon,
|
|
7
|
+
registerIcon,
|
|
8
|
+
} from 'igniteui-react';
|
|
9
|
+
import { configureTheme } from 'igniteui-webcomponents';
|
|
10
|
+
import { routes } from './app-routes';
|
|
11
|
+
import 'igniteui-webcomponents/themes/light/material.css';
|
|
12
|
+
import './app.css';
|
|
13
|
+
|
|
14
|
+
configureTheme('material', 'light');
|
|
15
|
+
|
|
16
|
+
const materialIcons = [
|
|
17
|
+
['home', 'action/svg/production/ic_home_24px.svg'],
|
|
18
|
+
['menu', 'navigation/svg/production/ic_menu_24px.svg'],
|
|
19
|
+
['apps', 'navigation/svg/production/ic_apps_24px.svg'],
|
|
20
|
+
['code', 'action/svg/production/ic_code_24px.svg'],
|
|
21
|
+
['build', 'action/svg/production/ic_build_24px.svg'],
|
|
22
|
+
['palette', 'image/svg/production/ic_palette_24px.svg'],
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
25
|
+
materialIcons.forEach(([name, path]) =>
|
|
26
|
+
registerIcon(name, `https://unpkg.com/material-design-icons@3.0.1/${path}`, 'material')
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const navRoutes = routes.filter((r) => r.text);
|
|
30
|
+
|
|
31
|
+
export default function App() {
|
|
32
|
+
const [drawerOpen, setDrawerOpen] = useState(true);
|
|
33
|
+
const navigate = useNavigate();
|
|
34
|
+
const location = useLocation();
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const mq = window.matchMedia('(min-width: 1025px)');
|
|
38
|
+
const update = () => setDrawerOpen(mq.matches);
|
|
39
|
+
update();
|
|
40
|
+
mq.addEventListener('change', update);
|
|
41
|
+
return () => mq.removeEventListener('change', update);
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="app">
|
|
46
|
+
<header className="app__navbar">
|
|
47
|
+
<button
|
|
48
|
+
className="app__menu-button"
|
|
49
|
+
type="button"
|
|
50
|
+
aria-label="Toggle navigation"
|
|
51
|
+
onClick={() => setDrawerOpen(o => !o)}
|
|
52
|
+
>
|
|
53
|
+
<IgrIcon name="menu" collection="material" />
|
|
54
|
+
</button>
|
|
55
|
+
<h1 className="app__title">$(name)</h1>
|
|
56
|
+
</header>
|
|
57
|
+
<div className={!drawerOpen ? 'app__body app--mini' : 'app__body'}>
|
|
58
|
+
<IgrNavDrawer className="app__drawer" open position="relative">
|
|
59
|
+
{navRoutes.map((route) => (
|
|
60
|
+
<IgrNavDrawerItem
|
|
61
|
+
key={route.path}
|
|
62
|
+
active={location.pathname === route.path}
|
|
63
|
+
onClick={() => navigate(route.path)}
|
|
64
|
+
>
|
|
65
|
+
<IgrIcon
|
|
66
|
+
slot="icon"
|
|
67
|
+
name={route.icon || 'apps'}
|
|
68
|
+
collection="material"
|
|
69
|
+
style={location.pathname === route.path ? { color: '#0075D2' } : undefined}
|
|
70
|
+
/>
|
|
71
|
+
<span slot="content">{route.text}</span>
|
|
72
|
+
</IgrNavDrawerItem>
|
|
73
|
+
))}
|
|
74
|
+
</IgrNavDrawer>
|
|
75
|
+
<div className="app__content">
|
|
76
|
+
<Outlet />
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import logo from "/logo.svg";
|
|
2
|
+
import { IgrIcon } from "igniteui-react";
|
|
3
|
+
import styles from "./style.module.css";
|
|
4
|
+
|
|
5
|
+
export default function App() {
|
|
6
|
+
return (
|
|
7
|
+
<main className={styles.home}>
|
|
8
|
+
<div className={styles.intro}>
|
|
9
|
+
<h1 className={styles.header}>Welcome to Ignite UI for React!</h1>
|
|
10
|
+
<p className={styles.description}>
|
|
11
|
+
A routed application shell with a responsive side navigation drawer and curated Ignite UI resources.
|
|
12
|
+
</p>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<img src={logo} className={styles.logo} alt="Ignite UI for React" />
|
|
16
|
+
|
|
17
|
+
<div className={styles.resources} role="navigation" aria-label="Ignite UI resources">
|
|
18
|
+
<a
|
|
19
|
+
className={styles.resource}
|
|
20
|
+
target="_blank"
|
|
21
|
+
rel="noopener noreferrer"
|
|
22
|
+
href="https://www.infragistics.com/products/ignite-ui-react"
|
|
23
|
+
>
|
|
24
|
+
<IgrIcon className={styles.resourceIcon} name="apps" collection="material" />
|
|
25
|
+
<span>
|
|
26
|
+
<strong>Component Demos</strong>
|
|
27
|
+
<small>Browse React components and examples</small>
|
|
28
|
+
</span>
|
|
29
|
+
</a>
|
|
30
|
+
<a
|
|
31
|
+
className={styles.resource}
|
|
32
|
+
target="_blank"
|
|
33
|
+
rel="noopener noreferrer"
|
|
34
|
+
href="https://github.com/IgniteUI/igniteui-react"
|
|
35
|
+
>
|
|
36
|
+
<IgrIcon className={styles.resourceIcon} name="code" collection="material" />
|
|
37
|
+
<span>
|
|
38
|
+
<strong>React Repository</strong>
|
|
39
|
+
<small>Explore Ignite UI for React on GitHub</small>
|
|
40
|
+
</span>
|
|
41
|
+
</a>
|
|
42
|
+
<a
|
|
43
|
+
className={styles.resource}
|
|
44
|
+
target="_blank"
|
|
45
|
+
rel="noopener noreferrer"
|
|
46
|
+
href="https://github.com/IgniteUI/igniteui-cli"
|
|
47
|
+
>
|
|
48
|
+
<IgrIcon className={styles.resourceIcon} name="build" collection="material" />
|
|
49
|
+
<span>
|
|
50
|
+
<strong>Ignite UI CLI</strong>
|
|
51
|
+
<small>Review the CLI source and project tooling</small>
|
|
52
|
+
</span>
|
|
53
|
+
</a>
|
|
54
|
+
<a
|
|
55
|
+
className={styles.resource}
|
|
56
|
+
target="_blank"
|
|
57
|
+
rel="noopener noreferrer"
|
|
58
|
+
href="https://www.figma.com/@infragistics"
|
|
59
|
+
>
|
|
60
|
+
<IgrIcon className={styles.resourceIcon} name="palette" collection="material" />
|
|
61
|
+
<span>
|
|
62
|
+
<strong>Figma UI Kit</strong>
|
|
63
|
+
<small>Open Infragistics design resources</small>
|
|
64
|
+
</span>
|
|
65
|
+
</a>
|
|
66
|
+
</div>
|
|
67
|
+
</main>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
:local(.home) {
|
|
2
|
+
width: 100%;
|
|
3
|
+
max-width: 920px;
|
|
4
|
+
margin: auto;
|
|
5
|
+
padding: 48px 24px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
font-family: "Titillium Web", "Segoe UI", Arial, sans-serif;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:local(.intro) {
|
|
11
|
+
max-width: 720px;
|
|
12
|
+
margin: 0 auto 24px;
|
|
13
|
+
text-align: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:local(.header) {
|
|
17
|
+
margin: 0 0 12px;
|
|
18
|
+
color: #09f;
|
|
19
|
+
font-size: 3rem;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
line-height: 1.2;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:local(.description) {
|
|
25
|
+
margin: 0;
|
|
26
|
+
color: #000;
|
|
27
|
+
font-size: 1.125rem;
|
|
28
|
+
line-height: 1.5;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:local(.logo) {
|
|
32
|
+
display: block;
|
|
33
|
+
width: 500px;
|
|
34
|
+
height: 350px;
|
|
35
|
+
margin: 0 auto 28px;
|
|
36
|
+
max-width: 100%;
|
|
37
|
+
object-fit: contain;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:local(.resources) {
|
|
41
|
+
display: grid;
|
|
42
|
+
grid-template-columns: repeat(2, 300px);
|
|
43
|
+
justify-content: center;
|
|
44
|
+
margin: 0 auto;
|
|
45
|
+
gap: 4px 64px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:local(.resource) {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
min-height: 64px;
|
|
52
|
+
padding: 6px 0;
|
|
53
|
+
color: rgba(0, 0, 0, .74);
|
|
54
|
+
text-align: left;
|
|
55
|
+
text-decoration: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:local(.resource):hover strong {
|
|
59
|
+
text-decoration: underline;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:local(.resourceIcon) {
|
|
63
|
+
flex: 0 0 28px;
|
|
64
|
+
margin-right: 16px;
|
|
65
|
+
color: #09f;
|
|
66
|
+
font-size: 28px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:local(.resource) strong,
|
|
70
|
+
:local(.resource) small {
|
|
71
|
+
display: block;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:local(.resource) strong {
|
|
75
|
+
margin-bottom: 2px;
|
|
76
|
+
color: #731963;
|
|
77
|
+
font-size: 1rem;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:local(.resource) small {
|
|
81
|
+
color: #000;
|
|
82
|
+
font-size: 0.875rem;
|
|
83
|
+
line-height: 1.4;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (max-width: 768px) {
|
|
87
|
+
:local(.home) {
|
|
88
|
+
padding: 32px 16px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:local(.header) {
|
|
92
|
+
font-size: 2.25rem;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:local(.logo) {
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 240px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:local(.resources) {
|
|
101
|
+
grid-template-columns: minmax(0, 300px);
|
|
102
|
+
justify-content: center;
|
|
103
|
+
gap: 4px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProjectTemplate } from "@igniteui/cli-core";
|
|
2
|
+
import { BaseWithHomeIgrTsProject } from "../_base_with_home";
|
|
3
|
+
export declare class SideNavMiniIgrTsProject extends BaseWithHomeIgrTsProject implements ProjectTemplate {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
dependencies: string[];
|
|
8
|
+
framework: string;
|
|
9
|
+
projectType: string;
|
|
10
|
+
hasExtraConfiguration: boolean;
|
|
11
|
+
isHidden: boolean;
|
|
12
|
+
get templatePaths(): string[];
|
|
13
|
+
}
|
|
14
|
+
declare const _default: SideNavMiniIgrTsProject;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SideNavMiniIgrTsProject = void 0;
|
|
27
|
+
const path = __importStar(require("path"));
|
|
28
|
+
const _base_with_home_1 = require("../_base_with_home");
|
|
29
|
+
class SideNavMiniIgrTsProject extends _base_with_home_1.BaseWithHomeIgrTsProject {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.id = "side-nav-mini";
|
|
33
|
+
this.name = "Side navigation + collapsible mini nav";
|
|
34
|
+
this.description = "Side navigation with a collapsible mini (icons-only) variant and responsive breakpoints";
|
|
35
|
+
this.dependencies = [];
|
|
36
|
+
this.framework = "react";
|
|
37
|
+
this.projectType = "igr-ts";
|
|
38
|
+
this.hasExtraConfiguration = false;
|
|
39
|
+
this.isHidden = false;
|
|
40
|
+
}
|
|
41
|
+
get templatePaths() {
|
|
42
|
+
return [...super.templatePaths, path.join(__dirname, "files")];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.SideNavMiniIgrTsProject = SideNavMiniIgrTsProject;
|
|
46
|
+
exports.default = new SideNavMiniIgrTsProject();
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
.app {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-flow: column nowrap;
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.app__navbar {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
flex: 0 0 auto;
|
|
12
|
+
height: 56px;
|
|
13
|
+
padding: 0 16px;
|
|
14
|
+
background: #239ef0;
|
|
15
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, .24);
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
position: relative;
|
|
18
|
+
z-index: 10;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.app__navbar-spacer {
|
|
22
|
+
flex: 1 1 auto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.app__menu-button {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
width: 40px;
|
|
30
|
+
height: 40px;
|
|
31
|
+
padding: 0;
|
|
32
|
+
color: #000;
|
|
33
|
+
border: 0;
|
|
34
|
+
background: transparent;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.app__menu-button igc-icon {
|
|
39
|
+
font-size: 24px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.app__title {
|
|
43
|
+
margin: 0 0 0 16px;
|
|
44
|
+
color: #000;
|
|
45
|
+
font-size: 1.25rem;
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
line-height: 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.app__body {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex: 1 1 auto;
|
|
53
|
+
min-height: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.app__drawer {
|
|
57
|
+
flex: 0 0 auto;
|
|
58
|
+
height: 100%;
|
|
59
|
+
--menu-full-width: 280px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
igc-nav-drawer-item[active]::part(base) {
|
|
63
|
+
background: #e0f2ff;
|
|
64
|
+
color: #0075d2;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
igc-nav-drawer-item[active] igc-icon {
|
|
68
|
+
color: #0075d2;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.app--mini .app__drawer {
|
|
72
|
+
--menu-full-width: 68px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
igc-nav-drawer.app__drawer::part(base) {
|
|
76
|
+
transition: width 0.3s ease-out;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.app--mini igc-nav-drawer-item::part(base) {
|
|
81
|
+
justify-content: center;
|
|
82
|
+
width: 40px;
|
|
83
|
+
min-height: 40px;
|
|
84
|
+
padding: 0;
|
|
85
|
+
margin: 4px auto;
|
|
86
|
+
border-radius: 8px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.app--mini igc-nav-drawer-item::part(content) {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.app__content {
|
|
94
|
+
flex: 1 1 auto;
|
|
95
|
+
min-width: 0;
|
|
96
|
+
overflow: auto;
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
align-items: flex-start;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (max-width: 1024px) {
|
|
103
|
+
.app__menu-button {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
2
|
+
import { Outlet, useNavigate, useLocation } from 'react-router-dom';
|
|
3
|
+
import {
|
|
4
|
+
IgrNavDrawer,
|
|
5
|
+
IgrNavDrawerItem,
|
|
6
|
+
IgrIcon,
|
|
7
|
+
registerIcon,
|
|
8
|
+
} from 'igniteui-react';
|
|
9
|
+
import { configureTheme } from 'igniteui-webcomponents';
|
|
10
|
+
import { AuthProvider, useAuth } from './authentication/AuthContext';
|
|
11
|
+
import { LoginBar } from './authentication/components/LoginBar';
|
|
12
|
+
import { routes } from './app-routes';
|
|
13
|
+
import 'igniteui-webcomponents/themes/light/material.css';
|
|
14
|
+
import './app.css';
|
|
15
|
+
|
|
16
|
+
configureTheme('material', 'light');
|
|
17
|
+
|
|
18
|
+
const materialIcons = [
|
|
19
|
+
['home', 'action/svg/production/ic_home_24px.svg'],
|
|
20
|
+
['menu', 'navigation/svg/production/ic_menu_24px.svg'],
|
|
21
|
+
['apps', 'navigation/svg/production/ic_apps_24px.svg'],
|
|
22
|
+
['code', 'action/svg/production/ic_code_24px.svg'],
|
|
23
|
+
['build', 'action/svg/production/ic_build_24px.svg'],
|
|
24
|
+
['palette', 'image/svg/production/ic_palette_24px.svg'],
|
|
25
|
+
['account_circle', 'action/svg/production/ic_account_circle_24px.svg'],
|
|
26
|
+
['lock', 'action/svg/production/ic_lock_24px.svg'],
|
|
27
|
+
['assignment_ind', 'action/svg/production/ic_assignment_ind_24px.svg'],
|
|
28
|
+
] as const;
|
|
29
|
+
|
|
30
|
+
materialIcons.forEach(([name, path]) =>
|
|
31
|
+
registerIcon(name, `https://unpkg.com/material-design-icons@3.0.1/${path}`, 'material')
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
function AppContent() {
|
|
35
|
+
const [drawerOpen, setDrawerOpen] = useState(true);
|
|
36
|
+
const navigate = useNavigate();
|
|
37
|
+
const location = useLocation();
|
|
38
|
+
const { currentUser } = useAuth();
|
|
39
|
+
|
|
40
|
+
const navRoutes = useMemo(() => routes.filter((r) => {
|
|
41
|
+
if (!r.text) return false;
|
|
42
|
+
if ((r as any).requiresAuth && !currentUser) return false;
|
|
43
|
+
return true;
|
|
44
|
+
}), [currentUser]);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const mq = window.matchMedia('(min-width: 1025px)');
|
|
48
|
+
const update = () => setDrawerOpen(mq.matches);
|
|
49
|
+
update();
|
|
50
|
+
mq.addEventListener('change', update);
|
|
51
|
+
return () => mq.removeEventListener('change', update);
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className="app">
|
|
56
|
+
<header className="app__navbar">
|
|
57
|
+
<button
|
|
58
|
+
className="app__menu-button"
|
|
59
|
+
type="button"
|
|
60
|
+
aria-label="Toggle navigation"
|
|
61
|
+
onClick={() => setDrawerOpen(o => !o)}
|
|
62
|
+
>
|
|
63
|
+
<IgrIcon name="menu" collection="material" />
|
|
64
|
+
</button>
|
|
65
|
+
<h1 className="app__title">$(name)</h1>
|
|
66
|
+
<div className="app__navbar-spacer" />
|
|
67
|
+
<LoginBar />
|
|
68
|
+
</header>
|
|
69
|
+
<div className={!drawerOpen ? 'app__body app--mini' : 'app__body'}>
|
|
70
|
+
<IgrNavDrawer className="app__drawer" open position="relative">
|
|
71
|
+
{navRoutes.map((route) => (
|
|
72
|
+
<IgrNavDrawerItem
|
|
73
|
+
key={route.path}
|
|
74
|
+
active={location.pathname === route.path}
|
|
75
|
+
onClick={() => navigate(route.path)}
|
|
76
|
+
>
|
|
77
|
+
<IgrIcon
|
|
78
|
+
slot="icon"
|
|
79
|
+
name={route.icon || 'apps'}
|
|
80
|
+
collection="material"
|
|
81
|
+
style={location.pathname === route.path ? { color: '#0075D2' } : undefined}
|
|
82
|
+
/>
|
|
83
|
+
<span slot="content">{route.text}</span>
|
|
84
|
+
</IgrNavDrawerItem>
|
|
85
|
+
))}
|
|
86
|
+
</IgrNavDrawer>
|
|
87
|
+
<div className="app__content">
|
|
88
|
+
<Outlet />
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export default function App() {
|
|
96
|
+
return (
|
|
97
|
+
<AuthProvider>
|
|
98
|
+
<AppContent />
|
|
99
|
+
</AuthProvider>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProjectTemplate } from "@igniteui/cli-core";
|
|
2
|
+
import { SideNavMiniIgrTsProject } from "../side-nav-mini";
|
|
3
|
+
export declare class SideNavMiniAuthIgrTsProject extends SideNavMiniIgrTsProject implements ProjectTemplate {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
dependencies: string[];
|
|
8
|
+
framework: string;
|
|
9
|
+
projectType: string;
|
|
10
|
+
hasExtraConfiguration: boolean;
|
|
11
|
+
isHidden: boolean;
|
|
12
|
+
get templatePaths(): string[];
|
|
13
|
+
}
|
|
14
|
+
declare const _default: SideNavMiniAuthIgrTsProject;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SideNavMiniAuthIgrTsProject = void 0;
|
|
27
|
+
const path = __importStar(require("path"));
|
|
28
|
+
const side_nav_mini_1 = require("../side-nav-mini");
|
|
29
|
+
class SideNavMiniAuthIgrTsProject extends side_nav_mini_1.SideNavMiniIgrTsProject {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.id = "side-nav-mini-auth";
|
|
33
|
+
this.name = "Side navigation (mini) + login";
|
|
34
|
+
this.description = "Collapsible mini side navigation extended with user authentication module";
|
|
35
|
+
this.dependencies = [];
|
|
36
|
+
this.framework = "react";
|
|
37
|
+
this.projectType = "igr-ts";
|
|
38
|
+
this.hasExtraConfiguration = false;
|
|
39
|
+
this.isHidden = true;
|
|
40
|
+
}
|
|
41
|
+
get templatePaths() {
|
|
42
|
+
return [
|
|
43
|
+
...super.templatePaths,
|
|
44
|
+
path.join(__dirname, "../side-nav-auth/files"),
|
|
45
|
+
path.join(__dirname, "files")
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.SideNavMiniAuthIgrTsProject = SideNavMiniAuthIgrTsProject;
|
|
50
|
+
exports.default = new SideNavMiniAuthIgrTsProject();
|
|
@@ -6,6 +6,11 @@ import { routes } from './app-routing.js';
|
|
|
6
6
|
@customElement('app-root')
|
|
7
7
|
export default class App extends LitElement {
|
|
8
8
|
static styles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
min-height: 100vh;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
router-outlet {
|
|
10
15
|
width: 100%;
|
|
11
16
|
}
|
|
@@ -13,7 +18,7 @@ export default class App extends LitElement {
|
|
|
13
18
|
.outer-wrapper {
|
|
14
19
|
display: flex;
|
|
15
20
|
justify-content: center;
|
|
16
|
-
height:
|
|
21
|
+
min-height: 100vh;
|
|
17
22
|
}
|
|
18
23
|
`;
|
|
19
24
|
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
8
|
<title>Ignite UI for Web Components</title>
|
|
9
|
+
<link rel="icon" type="image/png" href="./src/assets/wc.png">
|
|
8
10
|
<link rel="stylesheet" href="./node_modules/igniteui-webcomponents/themes/light/bootstrap.css">
|
|
9
11
|
<link rel="stylesheet" href="./styles.css">
|
|
10
12
|
</head>
|