igniteui-astro-components 0.0.27 → 0.0.29
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/README.md +82 -74
- package/package.json +16 -2
- package/src/assets/images/anatomy-test.png +0 -0
- package/src/components/CopyCode/CopyCode.astro +21 -7
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +33 -21
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +44 -43
- package/src/components/DocsBreadcrumb/README.md +10 -14
- package/src/components/DocsSidebar/DocsSidebar.astro +47 -45
- package/src/components/DocsSidebar/DocsSidebar.scss +120 -122
- package/src/components/DocsSidebar/README.md +25 -21
- package/src/components/DocsSidebar/SidebarFilterInput.astro +24 -29
- package/src/components/DocsSidebar/SidebarFilterInput.scss +90 -89
- package/src/components/DocsSidebar/SidebarLabel.astro +35 -26
- package/src/components/DocsSidebar/sidebar-filter.ts +93 -56
- package/src/components/DocsSubHeader/DocsSubHeader.astro +256 -195
- package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -178
- package/src/components/DocsSubHeader/README.md +18 -16
- package/src/components/DocsToc/DocsToc.astro +301 -280
- package/src/components/DocsToc/DocsToc.scss +20 -21
- package/src/components/DocsToc/README.md +11 -9
- package/src/components/DocsToc/toTreeNodes.ts +3 -8
- package/src/components/DocsTree/DocsTree.astro +32 -20
- package/src/components/DocsTree/DocsTreeItem.astro +35 -30
- package/src/components/DocsTree/README.md +16 -15
- package/src/components/DocsTree/docs-tree.scss +267 -268
- package/src/components/GlobalFooter/GlobalFooter.astro +10 -10
- package/src/components/GlobalFooter/README.md +3 -2
- package/src/components/GlobalNavBar/GlobalNavBar.astro +4 -2
- package/src/components/GlobalNavBar/GlobalNavBar.module.scss +222 -222
- package/src/components/GlobalNavBar/README.md +3 -2
- package/src/components/LicenseIndicator/LicenseIndicator.astro +7 -5
- package/src/components/LicenseIndicator/LicenseIndicator.scss +3 -3
- package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +16 -17
- package/src/components/MobileSidebarToggle/README.md +3 -2
- package/src/components/MobileTocToggle/MobileTocToggle.astro +75 -61
- package/src/components/MobileTocToggle/MobileTocToggle.scss +65 -59
- package/src/components/Search/README.md +1 -0
- package/src/components/Search/Search.astro +137 -109
- package/src/components/Search/Search.scss +20 -20
- package/src/components/SearchAdvanced/README.md +21 -15
- package/src/components/SearchAdvanced/SearchAdvanced.astro +205 -133
- package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
- package/src/components/mdx/Anatomy/Anatomy.astro +51 -0
- package/src/components/mdx/Anatomy/Anatomy.scss +40 -0
- package/src/components/mdx/ApiLink/ApiLink.astro +133 -113
- package/src/components/mdx/ApiLink/ApiLink.scss +9 -9
- package/src/components/mdx/ApiLink/README.md +26 -22
- package/src/components/mdx/ApiLink/api-link-index.ts +196 -173
- package/src/components/mdx/ApiRef/ApiRef.astro +54 -51
- package/src/components/mdx/ApiRef/README.md +20 -15
- package/src/components/mdx/Badge/Badge.astro +14 -14
- package/src/components/mdx/Badge/Badge.scss +61 -56
- package/src/components/mdx/Badge/README.md +24 -19
- package/src/components/mdx/DocsAside/DocsAside.astro +30 -37
- package/src/components/mdx/DocsAside/DocsAside.scss +82 -82
- package/src/components/mdx/DocsAside/README.md +22 -22
- package/src/components/mdx/Faq/Faq.astro +86 -0
- package/src/components/mdx/Faq/Faq.scss +105 -0
- package/src/components/mdx/Faq/FaqItem.astro +117 -0
- package/src/components/mdx/Faq/README.md +223 -0
- package/src/components/mdx/Faq/types.ts +34 -0
- package/src/components/mdx/PlatformBlock/PlatformBlock.astro +3 -2
- package/src/components/mdx/PlatformBlock/README.md +6 -8
- package/src/components/mdx/Sample/README.md +21 -16
- package/src/components/mdx/Sample/Sample.astro +97 -74
- package/src/components/mdx/Sample/Sample.scss +132 -132
- package/src/content-helper.ts +71 -72
- package/src/content.config.ts +1 -6
- package/src/integration.ts +566 -512
- package/src/layouts/DocsLayout/DocsLayout.astro +228 -182
- package/src/layouts/DocsLayout/DocsLayout.scss +261 -261
- package/src/layouts/DocsLayout/README.md +24 -35
- package/src/lib/nav-helpers.ts +88 -82
- package/src/lib/types.ts +76 -76
- package/src/llms.ts +205 -166
- package/src/platform.ts +312 -162
- package/src/plugins/rehype-heading-anchors.ts +45 -45
- package/src/plugins/rehype-pagefind-ignore.ts +19 -19
- package/src/plugins/rehype-table-wrapper.ts +30 -30
- package/src/plugins/remark-docfx.ts +12 -0
- package/src/plugins/remark-env-vars.ts +12 -4
- package/src/plugins/remark-md-links.ts +10 -4
- package/src/scripts/icon-manifest.ts +13 -5
- package/src/scripts/sample-widget.ts +557 -501
- package/src/sidebar.ts +103 -97
- package/src/styles/global/_code-blocks.scss +43 -44
- package/src/styles/global/_component-themes.scss +151 -153
- package/src/styles/global/_icon-gallery.scss +81 -81
- package/src/styles/global/_index.scss +0 -1
- package/src/styles/global/_markdown.scss +816 -787
- package/src/styles/global/_palette.scss +456 -110
- package/src/styles/global/_search-shared.scss +402 -398
- package/src/styles/global/_type-scale.scss +127 -127
- package/src/styles/global/_variables.scss +138 -111
- package/src/styles/theme.scss +41 -41
- package/src/virtual-modules.d.ts +11 -2
|
@@ -1,73 +1,78 @@
|
|
|
1
1
|
@use 'igniteui-theming/sass/typography' as *;
|
|
2
2
|
|
|
3
3
|
@layer components {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
igc-badge {
|
|
5
|
+
&.preview {
|
|
6
|
+
--background-color: var(--igd-preview-bg);
|
|
7
|
+
--text-color: var(--igd-preview-color);
|
|
8
|
+
--icon-color: var(--igd-preview-color);
|
|
9
|
+
--border-color: var(--igd-preview-border);
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
&.new {
|
|
13
|
+
--background-color: var(--igd-new-bg);
|
|
14
|
+
--text-color: var(--igd-new-color);
|
|
15
|
+
--icon-color: var(--igd-new-color);
|
|
16
|
+
--border-color: var(--igd-new-border);
|
|
17
|
+
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
&.updated {
|
|
20
|
+
--background-color: var(--igd-updated-bg);
|
|
21
|
+
--text-color: var(--igd-updated-color);
|
|
22
|
+
--icon-color: var(--igd-updated-color);
|
|
23
|
+
--border-color: var(--igd-updated-border);
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
&.premium {
|
|
27
|
+
--background-color: var(--igd-premium-bg);
|
|
28
|
+
--text-color: var(--igd-premium-color);
|
|
29
|
+
--icon-color: var(--igd-premium-color);
|
|
30
|
+
--border-color: var(--igd-premium-border);
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
33
|
+
&.opensource {
|
|
34
|
+
--background-color: var(--igd-opensource-bg);
|
|
35
|
+
--text-color: var(--igd-opensource-color);
|
|
36
|
+
--icon-color: var(--igd-opensource-color);
|
|
37
|
+
--border-color: var(--igd-opensource-border);
|
|
39
38
|
}
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
.igd-badge {
|
|
42
|
+
--border-radius: #{rem(4px)};
|
|
43
|
+
--elevation: none;
|
|
44
|
+
vertical-align: middle;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
&::part(base) {
|
|
47
|
+
@include type-style('overline') {
|
|
48
|
+
margin: 0;
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
border-radius: var(--border-radius);
|
|
52
|
+
border-width: rem(1px);
|
|
53
|
+
border-style: solid;
|
|
54
|
+
border-color: var(--border-color);
|
|
55
|
+
}
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
igc-icon {
|
|
58
|
+
--size: #{rem(18px)};
|
|
59
|
+
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
61
|
+
// TODO, This has to be fixed inside the component
|
|
62
|
+
span {
|
|
63
|
+
position: relative;
|
|
64
|
+
padding-inline: rem(3px);
|
|
66
65
|
}
|
|
66
|
+
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
h1,
|
|
69
|
+
h2,
|
|
70
|
+
h3,
|
|
71
|
+
h4,
|
|
72
|
+
h5,
|
|
73
|
+
h6 {
|
|
74
|
+
> .igd-badge {
|
|
75
|
+
align-self: center;
|
|
72
76
|
}
|
|
77
|
+
}
|
|
73
78
|
}
|
|
@@ -10,54 +10,59 @@ import Badge from 'igniteui-astro-components/components/mdx/Badge.astro';
|
|
|
10
10
|
|
|
11
11
|
## Props
|
|
12
12
|
|
|
13
|
-
| Prop
|
|
14
|
-
|
|
15
|
-
| `variant`
|
|
16
|
-
| `class`
|
|
17
|
-
| `aria-hidden` | `boolean \| string`
|
|
18
|
-
| `aria-label`
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
| ------------- | -------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------- |
|
|
15
|
+
| `variant` | `'preview' \| 'new' \| 'updated' \| 'premium' \| 'opensource'` | `'preview'` | Visual variant controlling color. |
|
|
16
|
+
| `class` | `string` | — | Extra CSS classes forwarded to the `igc-badge` element. |
|
|
17
|
+
| `aria-hidden` | `boolean \| string` | — | Hides the badge from assistive technology. Useful for purely decorative badges. |
|
|
18
|
+
| `aria-label` | `string` | — | Override the accessible label. |
|
|
19
19
|
|
|
20
20
|
## Examples
|
|
21
21
|
|
|
22
22
|
```mdx
|
|
23
23
|
{/* Default — preview variant */}
|
|
24
|
+
|
|
24
25
|
<Badge />
|
|
25
26
|
|
|
26
27
|
{/* Explicit variants */}
|
|
28
|
+
|
|
27
29
|
<Badge variant="new" />
|
|
28
30
|
<Badge variant="updated" />
|
|
29
31
|
<Badge variant="premium" />
|
|
30
32
|
<Badge variant="opensource" />
|
|
31
33
|
|
|
32
34
|
{/* Inside a heading */}
|
|
35
|
+
|
|
33
36
|
## My Feature <Badge variant="new" />
|
|
34
37
|
|
|
35
38
|
{/* Custom slot content */}
|
|
39
|
+
|
|
36
40
|
<Badge variant="preview">Coming Soon</Badge>
|
|
37
41
|
|
|
38
42
|
{/* Decorative — hidden from screen readers */}
|
|
43
|
+
|
|
39
44
|
<Badge variant="new" aria-hidden="true" />
|
|
40
45
|
```
|
|
41
46
|
|
|
42
47
|
## Variants
|
|
43
48
|
|
|
44
|
-
| `variant`
|
|
45
|
-
|
|
46
|
-
| `preview`
|
|
47
|
-
| `new`
|
|
48
|
-
| `updated`
|
|
49
|
-
| `premium`
|
|
50
|
-
| `opensource` | Open Source
|
|
49
|
+
| `variant` | Default text | Color token group |
|
|
50
|
+
| ------------ | ------------ | -------------------- |
|
|
51
|
+
| `preview` | Preview | `--igd-preview-*` |
|
|
52
|
+
| `new` | New | `--igd-new-*` |
|
|
53
|
+
| `updated` | Updated | `--igd-updated-*` |
|
|
54
|
+
| `premium` | Premium | `--igd-premium-*` |
|
|
55
|
+
| `opensource` | Open Source | `--igd-opensource-*` |
|
|
51
56
|
|
|
52
57
|
## Styling
|
|
53
58
|
|
|
54
59
|
Colors are driven by CSS custom properties set on the `igc-badge` host:
|
|
55
60
|
|
|
56
|
-
| Property
|
|
57
|
-
|
|
58
|
-
| `--background-color` | Fill color of the badge chip
|
|
59
|
-
| `--text-color`
|
|
60
|
-
| `--icon-color`
|
|
61
|
-
| `--border-color`
|
|
61
|
+
| Property | Purpose |
|
|
62
|
+
| -------------------- | ------------------------------------ |
|
|
63
|
+
| `--background-color` | Fill color of the badge chip |
|
|
64
|
+
| `--text-color` | Label text color |
|
|
65
|
+
| `--icon-color` | Icon color (if an icon is projected) |
|
|
66
|
+
| `--border-color` | Border color of the badge chip |
|
|
62
67
|
|
|
63
68
|
Token values are defined in `Badge.scss` via per-variant classes (`preview`, `new`, `updated`, `premium`, `opensource`) and reference the `--igd-*-bg`, `--igd-*-color`, and `--igd-*-border` theme tokens. The base badge style in `Badge.scss` matches the sidebar badge style so sidebar badges can reuse the component without local badge styling.
|
|
@@ -2,58 +2,51 @@
|
|
|
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
13
|
const { type = 'note', title, icon, class: className } = Astro.props;
|
|
14
14
|
|
|
15
15
|
const defaultLabels: Record<string, string> = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
note: 'Note',
|
|
17
|
+
info: 'Info',
|
|
18
|
+
warning: 'Warning',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const defaultIcons: Record<string, string> = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
note: 'note',
|
|
23
|
+
info: 'info',
|
|
24
|
+
warning: 'warning',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const label = title ?? defaultLabels[type];
|
|
28
|
-
const resolvedIcon = icon!==undefined ? icon: defaultIcons[type];
|
|
28
|
+
const resolvedIcon = icon !== undefined ? icon : defaultIcons[type];
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
<div
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{ label }
|
|
46
|
-
</span>
|
|
47
|
-
|
|
48
|
-
<div class="igd-aside__content">
|
|
49
|
-
<slot/>
|
|
50
|
-
</div>
|
|
31
|
+
<div class:list={['igd-aside', `igd-aside--${type}`, className]} aria-label={label} role="note">
|
|
32
|
+
{
|
|
33
|
+
resolvedIcon && (
|
|
34
|
+
<igc-icon class="igd-aside__icon" name={resolvedIcon} collection="docs" aria-hidden="true" />
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
<span class="igd-aside__title" aria-hidden="true">
|
|
39
|
+
{label}
|
|
40
|
+
</span>
|
|
41
|
+
|
|
42
|
+
<div class="igd-aside__content">
|
|
43
|
+
<slot />
|
|
44
|
+
</div>
|
|
51
45
|
</div>
|
|
52
46
|
|
|
53
47
|
<script>
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
import { defineComponents, IgcIconComponent } from 'igniteui-webcomponents';
|
|
49
|
+
import '../../../scripts/icon-registry';
|
|
56
50
|
|
|
57
|
-
|
|
51
|
+
defineComponents(IgcIconComponent);
|
|
58
52
|
</script>
|
|
59
|
-
|
|
@@ -3,110 +3,110 @@
|
|
|
3
3
|
// STRUCTURE STYLES
|
|
4
4
|
|
|
5
5
|
blockquote {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
11
|
}
|
|
12
12
|
|
|
13
13
|
.igd-aside {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
24
|
}
|
|
25
25
|
|
|
26
26
|
.igd-aside__title {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
@include type-style('h5') {
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
grid-row: 1;
|
|
33
|
+
grid-column: 2;
|
|
34
|
+
align-self: center;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.igd-aside__icon {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
grid-column: 1;
|
|
39
|
+
grid-row: 1;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.igd-aside__content {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
@include type-style('body-1') {
|
|
44
|
+
margin: 0;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
grid-column: 2;
|
|
49
|
+
grid-row: 2;
|
|
50
|
+
|
|
51
|
+
// Make sure that if there is a super long link inside, it won’t break the layout.
|
|
52
|
+
overflow: auto;
|
|
53
|
+
|
|
54
|
+
> p:only-child,
|
|
55
|
+
> p:last-child {
|
|
56
|
+
margin-block-end: 0;
|
|
57
|
+
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// THEME STYLES
|
|
61
61
|
.igd-aside--info {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
border-inline-start-color: var(--igd-aside-info-border);
|
|
63
|
+
background: var(--igd-aside-info-bg);
|
|
64
|
+
|
|
65
|
+
.igd-aside__title {
|
|
66
|
+
color: var(--igd-aside-info-title);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.igd-aside__icon {
|
|
70
|
+
color: var(--igd-aside-info-icon);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.igd-aside__content {
|
|
74
|
+
color: var(--igd-aside-info-content);
|
|
75
|
+
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.igd-aside--warning {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
79
|
+
border-inline-start-color: var(--igd-aside-warning-border);
|
|
80
|
+
background: var(--igd-aside-warning-bg);
|
|
81
|
+
|
|
82
|
+
.igd-aside__title {
|
|
83
|
+
color: var(--igd-aside-warning-title);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.igd-aside__icon {
|
|
87
|
+
color: var(--igd-aside-warning-icon);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.igd-aside__content {
|
|
91
|
+
color: var(--igd-aside-warning-content);
|
|
92
|
+
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.igd-aside--note {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
96
|
+
border-inline-start-color: var(--igd-aside-note-border);
|
|
97
|
+
background: var(--igd-aside-note-bg);
|
|
98
|
+
|
|
99
|
+
.igd-aside__title {
|
|
100
|
+
color: var(--igd-aside-note-title);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.igd-aside__icon {
|
|
104
|
+
color: var(--igd-aside-note-icon);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.igd-aside__content {
|
|
108
|
+
color: var(--igd-aside-note-content);
|
|
109
|
+
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
// TYPOGRAPHY STYLES
|
|
@@ -10,43 +10,43 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
|
|
|
10
10
|
|
|
11
11
|
## Props
|
|
12
12
|
|
|
13
|
-
| Prop
|
|
14
|
-
|
|
15
|
-
| `type`
|
|
16
|
-
| `title` | `string`
|
|
17
|
-
| `color` | `string`
|
|
18
|
-
| `icon`
|
|
19
|
-
| `class` | `string`
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
| ------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `type` | `'note' \| 'tip' \| 'warning' \| 'danger'` | `'note'` | Semantic variant — controls the color accent and default icon. |
|
|
16
|
+
| `title` | `string` | auto | Override the heading text. Defaults to the capitalised `type` name (`Note`, `Tip`, `Warning`, `Danger`). |
|
|
17
|
+
| `color` | `string` | — | Override the accent color via the `--aside-color` CSS custom property. Accepts any valid CSS color value. |
|
|
18
|
+
| `icon` | `string` | auto | Override the icon with raw SVG markup. Pass an empty string `""` to suppress the icon entirely. |
|
|
19
|
+
| `class` | `string` | — | Additional CSS class(es) to add to the `<aside>` element. |
|
|
20
20
|
|
|
21
21
|
## Examples
|
|
22
22
|
|
|
23
23
|
```mdx
|
|
24
24
|
{/* Default note */}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</DocsAside>
|
|
25
|
+
|
|
26
|
+
<DocsAside>This is a general note.</DocsAside>
|
|
28
27
|
|
|
29
28
|
{/* Tip variant */}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</DocsAside>
|
|
29
|
+
|
|
30
|
+
<DocsAside type="tip">Use keyboard shortcuts to speed up your workflow.</DocsAside>
|
|
33
31
|
|
|
34
32
|
{/* Warning with custom title */}
|
|
33
|
+
|
|
35
34
|
<DocsAside type="warning" title="Breaking change">
|
|
36
35
|
The `foo` prop was removed in v2. Use `bar` instead.
|
|
37
36
|
</DocsAside>
|
|
38
37
|
|
|
39
38
|
{/* Danger */}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</DocsAside>
|
|
39
|
+
|
|
40
|
+
<DocsAside type="danger">Deleting this record is irreversible.</DocsAside>
|
|
43
41
|
|
|
44
42
|
{/* Custom accent color */}
|
|
43
|
+
|
|
45
44
|
<DocsAside type="note" color="hsl(280, 80%, 50%)">
|
|
46
45
|
A purple-accented callout.
|
|
47
46
|
</DocsAside>
|
|
48
47
|
|
|
49
48
|
{/* No icon */}
|
|
49
|
+
|
|
50
50
|
<DocsAside type="tip" icon="">
|
|
51
51
|
This tip has no icon.
|
|
52
52
|
</DocsAside>
|
|
@@ -54,12 +54,12 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
|
|
|
54
54
|
|
|
55
55
|
## Variants
|
|
56
56
|
|
|
57
|
-
| `type`
|
|
58
|
-
|
|
59
|
-
| `note`
|
|
60
|
-
| `tip`
|
|
61
|
-
| `warning` | Amber
|
|
62
|
-
| `danger`
|
|
57
|
+
| `type` | Accent color | Default title |
|
|
58
|
+
| --------- | ------------ | ------------- |
|
|
59
|
+
| `note` | Blue | Note |
|
|
60
|
+
| `tip` | Green | Tip |
|
|
61
|
+
| `warning` | Amber | Warning |
|
|
62
|
+
| `danger` | Red | Danger |
|
|
63
63
|
|
|
64
64
|
## Icons
|
|
65
65
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* Faq - a question / answer list built on <igc-accordion>.
|
|
4
|
+
*
|
|
5
|
+
* Two authoring modes, both usable from `.astro` and `.mdx`:
|
|
6
|
+
*
|
|
7
|
+
* 1. Slot mode (preferred in MDX) — nest <FaqItem> children so the answer
|
|
8
|
+
* body can contain rich markdown, links, code blocks, other components.
|
|
9
|
+
* 2. Data mode — pass `items={[{ question, answer }]}`. `answer` is injected
|
|
10
|
+
* as an unsanitized HTML string (see FaqEntry.answer), so it is only
|
|
11
|
+
* suitable for short, static, author-controlled copy.
|
|
12
|
+
*
|
|
13
|
+
* Both modes render into the same <igc-accordion>, so the two can be mixed.
|
|
14
|
+
*
|
|
15
|
+
* Every prop that maps to an underlying Ignite UI property is forwarded
|
|
16
|
+
* verbatim; anything not covered by a named prop is spread onto the
|
|
17
|
+
* <igc-accordion> element (`id`, `data-*`, `aria-*`, …).
|
|
18
|
+
*
|
|
19
|
+
* NOTE on `indicatorPosition`: Astro cannot pass props into slotted children,
|
|
20
|
+
* so the value set here applies to `items` entries only. In slot mode set it
|
|
21
|
+
* per <FaqItem>.
|
|
22
|
+
*/
|
|
23
|
+
import './Faq.scss';
|
|
24
|
+
import FaqItem from './FaqItem.astro';
|
|
25
|
+
import type { FaqEntry, FaqIndicatorPosition } from './types';
|
|
26
|
+
|
|
27
|
+
export type { FaqEntry, FaqIndicatorPosition };
|
|
28
|
+
|
|
29
|
+
export interface Props {
|
|
30
|
+
/** Data-driven entries. Omit and nest <FaqItem> children instead for rich answers. */
|
|
31
|
+
items?: FaqEntry[];
|
|
32
|
+
/**
|
|
33
|
+
* Allows only one question to be expanded at a time.
|
|
34
|
+
* Forwarded to `igc-accordion[single-expand]`.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
singleExpand?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Indicator position forwarded to each panel rendered from `items`.
|
|
40
|
+
* @default 'end'
|
|
41
|
+
*/
|
|
42
|
+
indicatorPosition?: FaqIndicatorPosition;
|
|
43
|
+
/** Extra CSS classes forwarded to the igc-accordion element. */
|
|
44
|
+
class?: string;
|
|
45
|
+
|
|
46
|
+
// Pass-through attributes, enumerated rather than an open
|
|
47
|
+
// `[key: string]: unknown` index signature so a misspelt named prop
|
|
48
|
+
// (`singleExpland`) is still a type error.
|
|
49
|
+
/** Forwarded to the igc-accordion element. */
|
|
50
|
+
id?: string;
|
|
51
|
+
'aria-label'?: string;
|
|
52
|
+
'aria-labelledby'?: string;
|
|
53
|
+
'aria-describedby'?: string;
|
|
54
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const { items, singleExpand = false, indicatorPosition, class: className, ...rest } = Astro.props;
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
<igc-accordion
|
|
61
|
+
class:list={['igd-faq', className]}
|
|
62
|
+
single-expand={singleExpand ? '' : undefined}
|
|
63
|
+
{...rest}
|
|
64
|
+
>
|
|
65
|
+
{
|
|
66
|
+
items?.map((item) => (
|
|
67
|
+
<FaqItem
|
|
68
|
+
question={item.question}
|
|
69
|
+
subtitle={item.subtitle}
|
|
70
|
+
answer={item.answer}
|
|
71
|
+
open={item.open}
|
|
72
|
+
disabled={item.disabled}
|
|
73
|
+
indicatorPosition={item.indicatorPosition ?? indicatorPosition}
|
|
74
|
+
id={item.id}
|
|
75
|
+
/>
|
|
76
|
+
))
|
|
77
|
+
}
|
|
78
|
+
<slot />
|
|
79
|
+
</igc-accordion>
|
|
80
|
+
|
|
81
|
+
<script>
|
|
82
|
+
// Only the accordion — FaqItem.astro registers the panel.
|
|
83
|
+
import { defineComponents, IgcAccordionComponent } from 'igniteui-webcomponents';
|
|
84
|
+
|
|
85
|
+
defineComponents(IgcAccordionComponent);
|
|
86
|
+
</script>
|