igniteui-astro-components 0.0.10 → 0.0.12
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 +1 -1
- package/src/components/DocsSidebar/DocsSidebar.scss +159 -136
- package/src/components/DocsSidebar/SidebarLabel.astro +2 -2
- package/src/components/DocsToc/DocsToc.scss +1 -1
- package/src/components/DocsTree/DocsTree.astro +30 -0
- package/src/components/DocsTree/docs-tree.scss +4 -1
- package/src/components/Search/Search.astro +160 -87
- package/src/components/Search/Search.scss +10 -22
- package/src/components/SearchAdvanced/SearchAdvanced.scss +3 -110
- package/src/components/mdx/ApiLink/ApiLink.astro +75 -33
- package/src/components/mdx/DocsAside/DocsAside.scss +4 -0
- package/src/components/mdx/Sample/Sample.scss +3 -9
- package/src/layouts/DocsLayout/DocsLayout.astro +4 -2
- package/src/layouts/DocsLayout/DocsLayout.scss +30 -11
- package/src/lib/types.ts +7 -0
- package/src/scripts/sample-widget.ts +13 -16
- package/src/styles/global/_breakpoints.scss +7 -5
- package/src/styles/global/_index.scss +0 -1
- package/src/styles/global/_markdown.scss +16 -3
- package/src/styles/global/_search-shared.scss +145 -40
- package/src/styles/global/_type-scale.scss +1 -1
- package/src/styles/global/_variables.scss +1 -1
- package/src/styles/global/_members.scss +0 -85
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-astro-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Reusable Astro components, layouts, and integrations for Infragistics / Ignite UI documentation sites. Replaces the Starlight defaults with project-specific implementations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -1,155 +1,178 @@
|
|
|
1
1
|
@use 'igniteui-theming/sass/typography' as *;
|
|
2
2
|
|
|
3
3
|
@layer components {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
// Desktop base. On tablet/mobile DocsLayout.scss turns this into a slide-in overlay.
|
|
5
|
+
.docs-sidebar {
|
|
6
|
+
--igd-sidebar-z-index: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
z-index: var(--igd-sidebar-z-index);
|
|
10
|
+
border-inline-end: var(--igd-app-outline);
|
|
11
|
+
padding-inline: var(--igd-padding-md);
|
|
12
|
+
padding-block: calc(var(--igd-padding-lg) + rem(14px));
|
|
13
|
+
background-color: var(--igd-layout-sections-bg);
|
|
14
|
+
position: sticky;
|
|
15
|
+
top: var(--igd-header-height);
|
|
16
|
+
height: calc(100dvh - var(--igd-header-height));
|
|
17
|
+
max-height: 100dvh;
|
|
18
|
+
align-self: start;
|
|
19
|
+
gap: rem(24px);
|
|
20
|
+
|
|
21
|
+
.sidebar-gutter {
|
|
22
|
+
overflow-y: hidden;
|
|
23
|
+
scrollbar-gutter: stable;
|
|
24
|
+
|
|
25
|
+
// This Makes sure the input border is visible
|
|
26
|
+
// This is the height of the input in fluent theme + 8px padding
|
|
27
|
+
// TODO this can be made smart using a css variable to override the original height of the input and used here
|
|
28
|
+
min-height: rem(40px);
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
igc-icon {
|
|
32
|
+
color: light-dark(var(--ig-gray-800), var(--ig-gray-300));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:empty {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Hidden by default. DocsLayout.scss reveals it on tablet/mobile when the sidebar is open.
|
|
42
|
+
.docs-sidebar-backdrop {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sidebar-logo {
|
|
47
|
+
display: none;
|
|
48
|
+
margin-block-end: rem(8px);
|
|
49
|
+
padding-inline-start: rem(20px);
|
|
50
|
+
|
|
51
|
+
> svg {
|
|
52
|
+
width: rem(79px);
|
|
53
|
+
|
|
54
|
+
.logo-type {
|
|
55
|
+
fill: var(--igd-logo-type);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.sidebar-scroll {
|
|
61
|
+
overflow-y: auto;
|
|
24
62
|
scrollbar-gutter: stable;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.sidebar-badge {
|
|
66
|
+
--border-radius: #{rem(4px)};
|
|
67
|
+
--elevation: none;
|
|
68
|
+
|
|
69
|
+
&::part(base) {
|
|
70
|
+
@include type-style('overline') {
|
|
71
|
+
margin: 0;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
border-radius: var(--border-radius);
|
|
75
|
+
border-width: rem(1px);
|
|
76
|
+
border-style: solid;
|
|
77
|
+
border-color: var(--border-color);
|
|
78
|
+
}
|
|
79
|
+
|
|
32
80
|
igc-icon {
|
|
33
|
-
|
|
81
|
+
--size: #{rem(18px)}
|
|
34
82
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
83
|
+
|
|
84
|
+
// TODO, This has to be fixed inside the component
|
|
85
|
+
span {
|
|
86
|
+
position: relative;
|
|
87
|
+
padding-inline: rem(3px);
|
|
38
88
|
}
|
|
39
89
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
90
|
+
|
|
91
|
+
.updated {
|
|
92
|
+
--background-color: var(--igd-updated-bg);
|
|
93
|
+
--text-color: var(--igd-updated-color);
|
|
94
|
+
--icon-color: var(--igd-updated-color);
|
|
95
|
+
--border-color: var(--igd-updated-border);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.new {
|
|
99
|
+
--background-color: var(--igd-new-bg);
|
|
100
|
+
--text-color: var(--igd-new-color);
|
|
101
|
+
--icon-color: var(--igd-new-color);
|
|
102
|
+
--border-color: var(--igd-new-border);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.preview {
|
|
106
|
+
--background-color: var(--igd-preview-bg);
|
|
107
|
+
--text-color: var(--igd-preview-color);
|
|
108
|
+
--icon-color: var(--igd-preview-color);
|
|
109
|
+
--border-color: var(--igd-preview-border);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.premium {
|
|
113
|
+
--background-color: var(--igd-premium-bg);
|
|
114
|
+
--text-color: var(--igd-premium-color);
|
|
115
|
+
--icon-color: var(--igd-premium-color);
|
|
116
|
+
--border-color: var(--igd-premium-border);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.opensource {
|
|
120
|
+
--background-color: var(--igd-opensource-bg);
|
|
121
|
+
--text-color: var(--igd-opensource-color);
|
|
122
|
+
--icon-color: var(--igd-opensource-color);
|
|
123
|
+
--border-color: var(--igd-opensource-border);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.sidebar-premium-icon {
|
|
127
|
+
--size: #{rem(24px)};
|
|
128
|
+
|
|
129
|
+
justify-self: end;
|
|
130
|
+
color: var(--igd-premium-color);
|
|
131
|
+
flex-shrink: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.igd-label-and-badge {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
gap: rem(8px);
|
|
138
|
+
|
|
139
|
+
igc-badge {
|
|
140
|
+
justify-self: end;
|
|
57
141
|
}
|
|
58
142
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.sidebar-scroll {
|
|
62
|
-
overflow-y: auto;
|
|
63
|
-
scrollbar-gutter: stable;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.sidebar-badge {
|
|
67
|
-
--border-radius: #{rem(4px)};
|
|
68
|
-
--elevation: none;
|
|
69
143
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
144
|
+
.docs-tree-group {
|
|
145
|
+
gap: rem(8px);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.group-label-text {
|
|
149
|
+
@include type-style('body-2') {
|
|
150
|
+
margin-block: 0;
|
|
73
151
|
};
|
|
74
152
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
153
|
+
color: light-dark(var(--ig-gray-800), var(--ig-gray-600));
|
|
154
|
+
|
|
155
|
+
&:hover {
|
|
156
|
+
color: var(--igd-accent);
|
|
157
|
+
}
|
|
79
158
|
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.updated {
|
|
83
|
-
--background-color: var(--igd-updated-bg);
|
|
84
|
-
--text-color: var(--igd-updated-color);
|
|
85
|
-
--icon-color: var(--igd-updated-color);
|
|
86
|
-
--border-color: var(--igd-updated-border);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.new {
|
|
90
|
-
--background-color: var(--igd-new-bg);
|
|
91
|
-
--text-color: var(--igd-new-color);
|
|
92
|
-
--icon-color: var(--igd-new-color);
|
|
93
|
-
--border-color: var(--igd-new-border);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.preview {
|
|
97
|
-
--background-color: var(--igd-preview-bg);
|
|
98
|
-
--text-color: var(--igd-preview-color);
|
|
99
|
-
--icon-color: var(--igd-preview-color);
|
|
100
|
-
--border-color: var(--igd-preview-border);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
.premium {
|
|
105
|
-
--background-color: var(--igd-premium-bg);
|
|
106
|
-
--text-color: var(--igd-premium-color);
|
|
107
|
-
--icon-color: var(--igd-premium-color);
|
|
108
|
-
--border-color: var(--igd-premium-border);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.opensource {
|
|
112
|
-
--background-color: var(--igd-opensource-bg);
|
|
113
|
-
--text-color: var(--igd-opensource-color);
|
|
114
|
-
--icon-color: var(--igd-opensource-color);
|
|
115
|
-
--border-color: var(--igd-opensource-border);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.sidebar-premium-icon {
|
|
119
|
-
justify-self: end;
|
|
120
|
-
color: var(--igd-premium-color);
|
|
121
|
-
flex-shrink: 0;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.igd-lable-and-badge {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
gap: rem(4px);
|
|
128
159
|
|
|
129
|
-
igc-
|
|
130
|
-
|
|
160
|
+
igc-tree-item[active] {
|
|
161
|
+
.group-label-text {
|
|
162
|
+
color: var(--igd-accent);
|
|
163
|
+
}
|
|
131
164
|
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.group-label-text {
|
|
135
|
-
@include type-style('body-2') {
|
|
136
|
-
margin: 0;
|
|
137
|
-
};
|
|
138
165
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
gap: rem(4px);
|
|
151
|
-
margin-left: auto;
|
|
152
|
-
}
|
|
153
|
-
|
|
166
|
+
.group-label-count {
|
|
167
|
+
color: light-dark(var(--ig-gray-500), var(--ig-gray-600));
|
|
168
|
+
margin-inline-start: rem(8px)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.igd-badge-container {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
gap: rem(4px);
|
|
175
|
+
margin-left: auto;
|
|
176
|
+
}
|
|
154
177
|
}
|
|
155
178
|
|
|
@@ -28,13 +28,13 @@ const badges = (node.meta?.badges ?? []) as SidebarBadge[];
|
|
|
28
28
|
|
|
29
29
|
{isLeaf ? (
|
|
30
30
|
<>
|
|
31
|
-
<div class="igd-
|
|
31
|
+
<div class="igd-label-and-badge">
|
|
32
32
|
<span class="docs-tree-label">{node.label}</span>
|
|
33
33
|
{badges.length > 0 && (
|
|
34
34
|
<div class="igd-badge-container">
|
|
35
35
|
{badges.filter(b => b.variant !== 'premium').map((badge) => (
|
|
36
36
|
<>
|
|
37
|
-
<igc-badge class={`sidebar-badge ${badge.variant}`} aria-hidden="true">{badge.text}</igc-badge>
|
|
37
|
+
<igc-badge class={`sidebar-badge ${badge.variant}`} aria-hidden="true"><span>{badge.text}</span></igc-badge>
|
|
38
38
|
<span class="visually-hidden">, {badge.text}</span>
|
|
39
39
|
</>
|
|
40
40
|
))}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
max-height: calc(100vh - var(--igd-header-height));
|
|
15
15
|
overflow-y: auto;
|
|
16
16
|
padding: rem(46px) rem(24px);
|
|
17
|
-
border-inline: var(--igd-app-outline);
|
|
17
|
+
border-inline-end: var(--igd-app-outline);
|
|
18
18
|
border-block-end: var(--igd-app-outline);
|
|
19
19
|
background-color: var(--igd-layout-sections-bg);
|
|
20
20
|
}
|
|
@@ -78,6 +78,36 @@ const { nodes, variant, activeId, toggleNodeOnClick, ariaLabel, renderLabel } =
|
|
|
78
78
|
selectActiveTreeItem();
|
|
79
79
|
document.addEventListener('astro:page-load', selectActiveTreeItem);
|
|
80
80
|
|
|
81
|
+
// Restore sidebar focus when navigation was triggered from within the tree.
|
|
82
|
+
// Astro's ClientRouter moves focus to main content on every page-load;
|
|
83
|
+
// this counteracts that for keyboard users browsing the sidebar.
|
|
84
|
+
let focusWasInTree = false;
|
|
85
|
+
|
|
86
|
+
document.addEventListener('astro:before-preparation', () => {
|
|
87
|
+
focusWasInTree = !!document.activeElement?.closest('igc-tree[data-variant="sidebar"]');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
document.addEventListener('astro:page-load', () => {
|
|
91
|
+
if (!focusWasInTree) return;
|
|
92
|
+
focusWasInTree = false;
|
|
93
|
+
customElements.whenDefined('igc-tree-item').then(() => {
|
|
94
|
+
const activeItem = document.querySelector<HTMLElement>(
|
|
95
|
+
'igc-tree[data-variant="sidebar"] igc-tree-item:has(a[aria-current="page"])'
|
|
96
|
+
);
|
|
97
|
+
activeItem?.focus();
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// When clicking a tree link, focus the parent igc-tree-item so that
|
|
102
|
+
// up/down arrow key navigation works immediately after the click.
|
|
103
|
+
// The <a> overlay is position:absolute and captures clicks, but igc-tree's
|
|
104
|
+
// keyboard handler only fires when igc-tree-item itself has focus.
|
|
105
|
+
document.addEventListener('click', (e) => {
|
|
106
|
+
const link = (e.target as Element).closest('igc-tree[data-variant="sidebar"] a.docs-tree-link');
|
|
107
|
+
if (!link) return;
|
|
108
|
+
link.closest<HTMLElement>('igc-tree-item')?.focus();
|
|
109
|
+
}, { capture: true });
|
|
110
|
+
|
|
81
111
|
// Suppress the active-indicator transition during window resize so the
|
|
82
112
|
// anchor-positioned ::before bar doesn't slowly slide to its new position.
|
|
83
113
|
let resizeTimer: ReturnType<typeof setTimeout>;
|
|
@@ -124,6 +124,10 @@ igc-tree-item::part(label) {
|
|
|
124
124
|
width: 100%;
|
|
125
125
|
max-height: 100%;
|
|
126
126
|
padding-block: rem(6px);
|
|
127
|
+
text-overflow: unset;
|
|
128
|
+
white-space: unset;
|
|
129
|
+
word-break: break-all;
|
|
130
|
+
overflow: unset;
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
igc-tree-item[data-has-children] {
|
|
@@ -136,7 +140,6 @@ igc-tree-item[data-has-children] {
|
|
|
136
140
|
|
|
137
141
|
.tree-expand-icon {
|
|
138
142
|
margin-inline-start: auto;
|
|
139
|
-
//margin-inline-end: rem(4px);
|
|
140
143
|
flex-shrink: 0;
|
|
141
144
|
color: inherit;
|
|
142
145
|
transform: rotate(-90deg);
|