igniteui-astro-components 0.0.7 → 0.0.9
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/package.json +4 -2
- package/src/assets/icons/open-link-blank.svg +1 -1
- package/src/assets/logos/code-sandbox.svg +14 -0
- package/src/assets/logos/stackblitz.svg +13 -0
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +3 -3
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +13 -4
- package/src/components/DocsSidebar/DocsSidebar.astro +19 -8
- package/src/components/DocsSidebar/DocsSidebar.scss +140 -3
- package/src/components/DocsSidebar/SidebarFilterInput.astro +3 -4
- package/src/components/DocsSidebar/SidebarFilterInput.scss +9 -6
- package/src/components/DocsSidebar/SidebarLabel.astro +25 -4
- package/src/components/DocsSidebar/toTreeNodes.ts +1 -1
- package/src/components/DocsSubHeader/DocsSubHeader.astro +128 -302
- package/src/components/DocsSubHeader/DocsSubHeader.scss +115 -18
- package/src/components/DocsToc/DocsToc.astro +15 -7
- package/src/components/DocsToc/DocsToc.scss +10 -11
- package/src/components/DocsTree/DocsTree.astro +9 -0
- package/src/components/DocsTree/docs-tree.scss +146 -118
- package/src/components/GlobalNavBar/GlobalNavBar.module.scss +16 -1
- package/src/components/LicenseIndicator/LicenseIndicator.astro +19 -0
- package/src/components/LicenseIndicator/LicenseIndicator.scss +5 -0
- package/src/components/MobileTocToggle/MobileTocToggle.astro +96 -0
- package/src/components/MobileTocToggle/MobileTocToggle.scss +74 -0
- package/src/components/Search/Search.astro +45 -15
- package/src/components/Search/Search.scss +21 -40
- package/src/components/SearchAdvanced/SearchAdvanced.astro +196 -355
- package/src/components/SearchAdvanced/SearchAdvanced.scss +208 -0
- package/src/components/mdx/ApiRef/README.md +1 -1
- package/src/components/mdx/DocsAside/DocsAside.astro +37 -32
- package/src/components/mdx/DocsAside/DocsAside.scss +106 -35
- package/src/components/mdx/Sample/Sample.astro +55 -45
- package/src/components/mdx/Sample/Sample.scss +173 -30
- package/src/integration.ts +7 -0
- package/src/layouts/DocsLayout/DocsLayout.astro +81 -21
- package/src/layouts/DocsLayout/DocsLayout.scss +251 -46
- package/src/lib/sidebar/helpers.ts +14 -1
- package/src/lib/sidebar/types.ts +5 -7
- package/src/plugins/rehype-heading-anchors.ts +74 -0
- package/src/plugins/rehype-table-wrapper.ts +49 -0
- package/src/plugins/remark-docfx.ts +0 -0
- package/src/scripts/sample-widget.ts +107 -114
- package/src/styles/global/_breakpoints.scss +15 -37
- package/src/styles/global/_code-blocks.scss +1 -1
- package/src/styles/global/_component-themes.scss +99 -18
- package/src/styles/global/_index.scss +2 -2
- package/src/styles/global/_markdown.scss +552 -78
- package/src/styles/global/_palette.scss +8 -0
- package/src/styles/global/_search-shared.scss +272 -0
- package/src/styles/global/_type-scale.scss +2 -2
- package/src/styles/global/_variables.scss +55 -13
- package/src/styles/theme.scss +98 -11
- package/src/assets/icons/copy-clipboard.svg +0 -3
- package/src/assets/icons/filter-clear.svg +0 -1
- package/src/styles/custom.scss +0 -20
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
@use 'igniteui-theming' as *;
|
|
2
|
+
@use '../../styles/global/search-shared' as *;
|
|
3
|
+
|
|
4
|
+
@layer components {
|
|
5
|
+
api-search-advanced { display: contents; }
|
|
6
|
+
|
|
7
|
+
.igd-search-dialog {
|
|
8
|
+
--border-radius: 0;
|
|
9
|
+
--background: var(--igd-layout-sections-bg);
|
|
10
|
+
--transition-duration: 150ms;
|
|
11
|
+
|
|
12
|
+
border: none;
|
|
13
|
+
|
|
14
|
+
&::part(base) {
|
|
15
|
+
@include search-dialog-base-styles;
|
|
16
|
+
|
|
17
|
+
&:focus-visible {
|
|
18
|
+
outline: none;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&::part(content) {
|
|
23
|
+
padding: 0;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&::part(backdrop) {
|
|
30
|
+
@include search-dialog-backdrop;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&[open]::part(backdrop) {
|
|
34
|
+
@include search-dialog-backdrop-open;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
igc-input {
|
|
38
|
+
height: 100%;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
igc-input::part(container) {
|
|
42
|
+
border: 0;
|
|
43
|
+
height: 100%;
|
|
44
|
+
padding: 0 rem(16px) !important;
|
|
45
|
+
border-block-end: none !important;
|
|
46
|
+
|
|
47
|
+
&:focus-within {
|
|
48
|
+
box-shadow:
|
|
49
|
+
0 0 0 1px var(--igd-accent),
|
|
50
|
+
inset 0 1px 0 var(--igd-accent),
|
|
51
|
+
inset 0 -1px 0 var(--igd-accent),
|
|
52
|
+
inset -1px 0 0 var(--igd-accent);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.search-trigger {
|
|
58
|
+
color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.igd-search-icon {
|
|
62
|
+
color: light-dark(var(--ig-gray-900), var(--ig-gray-500));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// TODO BUG IN THE TAB COMPONENT
|
|
66
|
+
igc-tabs::part(inner) {
|
|
67
|
+
flex-grow: 1;
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
igc-tabs {
|
|
72
|
+
igc-divider {
|
|
73
|
+
margin-block: rem(26px);
|
|
74
|
+
|
|
75
|
+
&:last-of-type {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// TODO Log issue in the component this is not suppose to be affected by the ig-typography
|
|
82
|
+
igc-tab::part(content) {
|
|
83
|
+
@include type-style('subtitle-1') {
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.igd-search-tabs {
|
|
89
|
+
--item-background: var(--igd-layout-sections-bg);
|
|
90
|
+
--indicator-color: transparent;
|
|
91
|
+
--button-color: var(--igd-accent);
|
|
92
|
+
--button-hover-color: var(--igd-accent);
|
|
93
|
+
--button-background: var(--igd-layout-sections-bg);
|
|
94
|
+
--button-hover-background: var(--igd-layout-sections-bg);
|
|
95
|
+
--border-color: var(--igd-layout-sections-bg);
|
|
96
|
+
--border-color--hover: var(--igd-layout-sections-bg);
|
|
97
|
+
--border-radius: 0;
|
|
98
|
+
|
|
99
|
+
flex: 1 1 auto;
|
|
100
|
+
min-height: 0;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
|
|
105
|
+
&::part(base) {
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
height: 100%;
|
|
109
|
+
min-height: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
igc-tab {
|
|
113
|
+
--item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-700));
|
|
114
|
+
--item-background: var(--igd-layout-sections-bg);
|
|
115
|
+
--item-hover-background: var(--igd-layout-sections-bg);
|
|
116
|
+
--item-hover-color: var(--igd-accent);
|
|
117
|
+
--item-active-color: var(--igd-accent);
|
|
118
|
+
--item-active-hover-color: var(--igd-accent);
|
|
119
|
+
--item-icon-color: var(--igd-accent);
|
|
120
|
+
--item-active-icon-color: var(--igd-accent);
|
|
121
|
+
--item-active-hover-icon-color: var(--igd-accent);
|
|
122
|
+
--item-hover-icon-color: var(--igd-accent);
|
|
123
|
+
--item-active-background: var(--igd-layout-sections-bg);
|
|
124
|
+
--item-active-hover-background: var(--igd-layout-sections-bg);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
igc-tab::part(content),
|
|
128
|
+
igc-tab::part(base) {
|
|
129
|
+
@include type-style('overline') {
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
igc-tab::part(tab-body) {
|
|
135
|
+
overflow-y: auto;
|
|
136
|
+
flex: 1 1 auto;
|
|
137
|
+
min-height: 0;
|
|
138
|
+
padding-block: rem(26px);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.igd-search-header {
|
|
143
|
+
display: flex;
|
|
144
|
+
min-height: rem(75px);
|
|
145
|
+
padding-inline-start: rem(16px);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.igd-search-scope {
|
|
149
|
+
flex-shrink: 0;
|
|
150
|
+
align-self: center;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.igd-search-input {
|
|
154
|
+
--input-prefix-background: transparent;
|
|
155
|
+
--input-prefix-background--focused: transparent;
|
|
156
|
+
--input-prefix-background--filled: transparent;
|
|
157
|
+
|
|
158
|
+
--input-suffix-background: transparent;
|
|
159
|
+
--input-suffix-background--focused: transparent;
|
|
160
|
+
--input-suffix-background--filled: transparent;
|
|
161
|
+
|
|
162
|
+
width: 100%;
|
|
163
|
+
min-width: 0;
|
|
164
|
+
flex: 1 1 auto;
|
|
165
|
+
|
|
166
|
+
&::part(input) {
|
|
167
|
+
@include type-style('body-2') {
|
|
168
|
+
margin: 0;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.igd-search-clear {
|
|
174
|
+
--foreground: light-dark(var(--ig-gray-900), var(--ig-gray-900));
|
|
175
|
+
--backgroind-hover: transparent;
|
|
176
|
+
--hover-foreground: var(--igd-accent);
|
|
177
|
+
--focus-hover-foreground: var(--igd-accent);
|
|
178
|
+
--focus-foreground: var(--igd-accent);
|
|
179
|
+
--active-foreground: var(--igd-accent);
|
|
180
|
+
--shadow-color: transparent;
|
|
181
|
+
--background: transparent;
|
|
182
|
+
--hover-background: transparent;
|
|
183
|
+
--focus-background: transparent;
|
|
184
|
+
--focus-hover-background: transparent;
|
|
185
|
+
--active-background: transparent;
|
|
186
|
+
--border-color: transparent;
|
|
187
|
+
--border-radius: 0;
|
|
188
|
+
|
|
189
|
+
&::part(base) {
|
|
190
|
+
&::after {
|
|
191
|
+
display: none;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&::part(focused) {
|
|
196
|
+
--foreground: var(--igd-accent);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.igd-search-tab-count {
|
|
201
|
+
color: light-dark(var(--ig-gray-500), var(--ig-gray-300));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
igc-divider {
|
|
205
|
+
--color: light-dark(var(--ig-gray-400), var(--ig-gray-300));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
@@ -39,7 +39,7 @@ import ApiRef from 'igniteui-astro-components/components/mdx/ApiRef.astro';
|
|
|
39
39
|
|
|
40
40
|
## Platform context
|
|
41
41
|
|
|
42
|
-
Same as `ApiLink` — resolved from the `
|
|
42
|
+
Same as `ApiLink` — resolved from the `Platform` env var via `getPlatformContext()`.
|
|
43
43
|
|
|
44
44
|
When a page mixes types from different packages or different kinds, use separate `<ApiRef>` blocks:
|
|
45
45
|
|
|
@@ -2,53 +2,58 @@
|
|
|
2
2
|
import './DocsAside.scss';
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
type?: 'note' | 'info' | 'warning';
|
|
6
|
+
title?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
/** Override icon name from the 'docs' collection. */
|
|
10
|
+
icon?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const { type = 'note', title,
|
|
13
|
+
const { type = 'note', title, icon, class: className } = Astro.props;
|
|
14
14
|
|
|
15
15
|
const defaultLabels: Record<string, string> = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
danger: 'Danger',
|
|
16
|
+
note: 'Note',
|
|
17
|
+
info: 'Info',
|
|
18
|
+
warning: 'Warning',
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
const defaultIcons: Record<string, string> = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
danger: 'warning',
|
|
22
|
+
note: 'note',
|
|
23
|
+
info: 'info',
|
|
24
|
+
warning: 'warning',
|
|
27
25
|
};
|
|
28
26
|
|
|
29
27
|
const label = title ?? defaultLabels[type];
|
|
30
|
-
const resolvedIcon = icon
|
|
31
|
-
const inlineStyle = color ? `--aside-color: ${color};` : undefined;
|
|
28
|
+
const resolvedIcon = icon!==undefined ? icon: defaultIcons[type];
|
|
32
29
|
---
|
|
33
30
|
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
<div
|
|
32
|
+
class:list={ ['igd-aside', `igd-aside--${ type }`, className] }
|
|
33
|
+
aria-label={ label }
|
|
34
|
+
role="note"
|
|
38
35
|
>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
{ resolvedIcon &&
|
|
37
|
+
<igc-icon
|
|
38
|
+
class="igd-aside__icon"
|
|
39
|
+
name={ resolvedIcon }
|
|
40
|
+
collection="docs"
|
|
41
|
+
aria-hidden="true"></igc-icon>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
<span class="igd-aside__title" aria-hidden="true">
|
|
45
|
+
{ label }
|
|
46
|
+
</span>
|
|
47
|
+
|
|
48
|
+
<div class="igd-aside__content">
|
|
49
|
+
<slot/>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
47
52
|
|
|
48
53
|
<script>
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
import { defineComponents, IgcIconComponent } from 'igniteui-webcomponents';
|
|
55
|
+
import '../../../scripts/icon-registry';
|
|
51
56
|
|
|
52
|
-
|
|
57
|
+
defineComponents(IgcIconComponent);
|
|
53
58
|
</script>
|
|
54
59
|
|
|
@@ -1,36 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.aside
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
aspect-ratio: 1;
|
|
30
|
-
flex-shrink: 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.aside-content {
|
|
34
|
-
> :first-child { margin-top: 0; }
|
|
35
|
-
> :last-child { margin-bottom: 0; }
|
|
1
|
+
@use 'igniteui-theming/sass/typography' as *;
|
|
2
|
+
|
|
3
|
+
// STRUCTURE STYLES
|
|
4
|
+
|
|
5
|
+
blockquote {
|
|
6
|
+
border-inline-start-width: var(--igd-aside-border-width);
|
|
7
|
+
border-inline-start-style: var(--igd-aside-border-style);
|
|
8
|
+
padding: var(--igd-aside-padding);
|
|
9
|
+
border-radius: var(--igd-aside-border-radius);
|
|
10
|
+
margin-block-end: var(--igd-aside-margin-bottom);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.igd-aside {
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: auto 1fr;
|
|
16
|
+
align-items: start;
|
|
17
|
+
row-gap: var(--igd-aside-row-gap);
|
|
18
|
+
column-gap: var(--igd-aside-column-gap);
|
|
19
|
+
border-inline-start-width: var(--igd-aside-border-width);
|
|
20
|
+
border-inline-start-style: var(--igd-aside-border-style);
|
|
21
|
+
padding: var(--igd-aside-padding);
|
|
22
|
+
border-radius: var(--igd-aside-border-radius);
|
|
23
|
+
margin-block-end: var(--igd-aside-margin-bottom);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.igd-aside__title {
|
|
27
|
+
grid-row: 1;
|
|
28
|
+
grid-column: 2;
|
|
36
29
|
}
|
|
30
|
+
|
|
31
|
+
.igd-aside__icon {
|
|
32
|
+
grid-column: 1;
|
|
33
|
+
grid-row: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.igd-aside__content {
|
|
37
|
+
grid-column: 2;
|
|
38
|
+
grid-row: 2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// THEME STYLES
|
|
42
|
+
.igd-aside--info {
|
|
43
|
+
border-inline-start-color: var(--igd-aside-info-border);
|
|
44
|
+
background: var(--igd-aside-info-bg);
|
|
45
|
+
|
|
46
|
+
.igd-aside__title {
|
|
47
|
+
color: var(--igd-aside-info-title);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.igd-aside__icon {
|
|
51
|
+
color: var(--igd-aside-info-icon);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.igd-aside__content {
|
|
55
|
+
color: var(--igd-aside-info-content);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.igd-aside--warning {
|
|
60
|
+
border-inline-start-color: var(--igd-aside-warning-border);
|
|
61
|
+
background: var(--igd-aside-warning-bg);
|
|
62
|
+
|
|
63
|
+
.igd-aside__title {
|
|
64
|
+
color: var(--igd-aside-warning-title);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.igd-aside__icon {
|
|
68
|
+
color: var(--igd-aside-warning-icon);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.igd-aside__content {
|
|
72
|
+
color: var(--igd-aside-warning-content);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.igd-aside--note {
|
|
77
|
+
border-inline-start-color: var(--igd-aside-note-border);
|
|
78
|
+
background: var(--igd-aside-note-bg);
|
|
79
|
+
|
|
80
|
+
.igd-aside__title {
|
|
81
|
+
color: var(--igd-aside-note-title);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.igd-aside__icon {
|
|
85
|
+
color: var(--igd-aside-note-icon);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.igd-aside__content {
|
|
89
|
+
color: var(--igd-aside-note-content);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// TYPOGRAPHY STYLES
|
|
94
|
+
.igd-aside__title {
|
|
95
|
+
@include type-style('body-2') {
|
|
96
|
+
font-weight: bold;
|
|
97
|
+
margin: 0;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.igd-aside__content {
|
|
103
|
+
@include type-style('detail-1', false) {
|
|
104
|
+
margin: 0;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
@@ -56,56 +56,66 @@ const exampleTabId = `${widgetId}-example`;
|
|
|
56
56
|
|
|
57
57
|
{iframeOnly ? (
|
|
58
58
|
<>
|
|
59
|
-
<div class="sample-container" style={`height: ${height}px`}>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
style="width: 100%; height: 100%;"
|
|
64
|
-
frameborder="0"
|
|
65
|
-
seamless
|
|
66
|
-
></iframe>
|
|
67
|
-
</div>
|
|
68
|
-
{fullscreenBtn && (
|
|
69
|
-
<button class="full-screen-btn" onclick={`window.open("${iframeSrc}")`}>View in full screen</button>
|
|
70
|
-
)}
|
|
71
|
-
</>
|
|
72
|
-
) : (
|
|
73
|
-
<>
|
|
74
|
-
<div class="code-view"
|
|
75
|
-
id={widgetId}
|
|
76
|
-
data-iframe-src={iframeSrc}
|
|
77
|
-
data-demos-base-url={baseUrl}
|
|
78
|
-
data-github-src={githubSrc}
|
|
79
|
-
data-platform={lower}>
|
|
80
|
-
<div class="code-view-navbar">
|
|
81
|
-
<div class="code-view-tab code-view-tab--active" data-tab-id={exampleTabId}>EXAMPLE</div>
|
|
82
|
-
<span class="fs-button-container" title="Expand to fullscreen"></span>
|
|
83
|
-
</div>
|
|
84
|
-
<div class="code-views-container">
|
|
85
|
-
<div id={exampleTabId}
|
|
86
|
-
class="sample-container code-view-tab-content loading"
|
|
87
|
-
style={`height: ${height}px`}>
|
|
88
|
-
<iframe
|
|
89
|
-
data-src={iframeSrc}
|
|
90
|
-
title={alt || `${name} Example`}
|
|
59
|
+
<div class="igd-sample-container" style={ `height: ${ height }px` }>
|
|
60
|
+
<iframe
|
|
61
|
+
src={ iframeSrc }
|
|
62
|
+
title={ alt || `${ name } Example` }
|
|
91
63
|
style="width: 100%; height: 100%;"
|
|
92
64
|
frameborder="0"
|
|
93
65
|
seamless
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
66
|
+
></iframe>
|
|
67
|
+
{ fullscreenBtn && (
|
|
68
|
+
<div class="igd-code-view__header-actions">
|
|
69
|
+
<igc-icon-button
|
|
70
|
+
name="open-link-blank"
|
|
71
|
+
collection="docs"
|
|
72
|
+
variant="outlined"
|
|
73
|
+
class="igd-full-screen-btn igd-edit-in-btn"
|
|
74
|
+
href={ iframeSrc }
|
|
75
|
+
target="_blank"
|
|
76
|
+
aria-label="Open in full screen"
|
|
77
|
+
></igc-icon-button>
|
|
78
|
+
</div>
|
|
79
|
+
) }
|
|
97
80
|
</div>
|
|
81
|
+
</>
|
|
82
|
+
) : (
|
|
83
|
+
<>
|
|
84
|
+
<div class="igd-code-view"
|
|
85
|
+
id={ widgetId }
|
|
86
|
+
data-iframe-src={ iframeSrc }
|
|
87
|
+
data-demos-base-url={ baseUrl }
|
|
88
|
+
data-github-src={ githubSrc }
|
|
89
|
+
data-platform={ lower }>
|
|
90
|
+
<div class="igd-code-view__inner">
|
|
91
|
+
<igc-tabs id={ `${ widgetId }-tabs` } alignment="start">
|
|
92
|
+
<igc-tab id={ exampleTabId } label="EXAMPLE" selected>
|
|
93
|
+
<div class="igd-sample-container loading" aria-busy="true" style={ `height: ${ height }px` }>
|
|
94
|
+
<igc-circular-progress indeterminate class="sample-loading-indicator" aria-label="Loading sample"></igc-circular-progress>
|
|
95
|
+
<iframe
|
|
96
|
+
data-src={ iframeSrc }
|
|
97
|
+
title={ alt || `${ name } Example` }
|
|
98
|
+
style="width: 100%; height: 100%;"
|
|
99
|
+
frameborder="0"
|
|
100
|
+
seamless
|
|
101
|
+
aria-hidden="true"
|
|
102
|
+
></iframe>
|
|
103
|
+
</div>
|
|
104
|
+
</igc-tab>
|
|
105
|
+
</igc-tabs>
|
|
98
106
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<script>
|
|
102
|
-
// Astro deduplicates module scripts — this runs exactly once per full page load.
|
|
103
|
-
// astro:page-load fires after every client-router navigation AND on the initial
|
|
104
|
-
// page load, so using it as the sole trigger handles both cases without
|
|
105
|
-
// double-initialization.
|
|
106
|
-
import { initSampleWidgets } from '../../../scripts/sample-widget';
|
|
107
|
-
document.addEventListener('astro:page-load', initSampleWidgets);
|
|
108
|
-
</script>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
109
|
</>
|
|
110
110
|
)}
|
|
111
111
|
|
|
112
|
+
<script>
|
|
113
|
+
// Astro deduplicates module scripts — this runs exactly once per full page load.
|
|
114
|
+
// astro:page-load fires after every client-router navigation AND on the initial
|
|
115
|
+
// page load, so using it as the sole trigger handles both cases without
|
|
116
|
+
// double-initialization.
|
|
117
|
+
// Placed outside the iframeOnly conditional so components and icons are always
|
|
118
|
+
// registered (needed for igc-icon-button even in iframeOnly + fullscreenBtn mode).
|
|
119
|
+
import { initSampleWidgets } from '../../../scripts/sample-widget';
|
|
120
|
+
document.addEventListener('astro:page-load', initSampleWidgets);
|
|
121
|
+
</script>
|