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.
Files changed (96) hide show
  1. package/README.md +82 -74
  2. package/package.json +16 -2
  3. package/src/assets/images/anatomy-test.png +0 -0
  4. package/src/components/CopyCode/CopyCode.astro +21 -7
  5. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +33 -21
  6. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +44 -43
  7. package/src/components/DocsBreadcrumb/README.md +10 -14
  8. package/src/components/DocsSidebar/DocsSidebar.astro +47 -45
  9. package/src/components/DocsSidebar/DocsSidebar.scss +120 -122
  10. package/src/components/DocsSidebar/README.md +25 -21
  11. package/src/components/DocsSidebar/SidebarFilterInput.astro +24 -29
  12. package/src/components/DocsSidebar/SidebarFilterInput.scss +90 -89
  13. package/src/components/DocsSidebar/SidebarLabel.astro +35 -26
  14. package/src/components/DocsSidebar/sidebar-filter.ts +93 -56
  15. package/src/components/DocsSubHeader/DocsSubHeader.astro +256 -195
  16. package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -178
  17. package/src/components/DocsSubHeader/README.md +18 -16
  18. package/src/components/DocsToc/DocsToc.astro +301 -280
  19. package/src/components/DocsToc/DocsToc.scss +20 -21
  20. package/src/components/DocsToc/README.md +11 -9
  21. package/src/components/DocsToc/toTreeNodes.ts +3 -8
  22. package/src/components/DocsTree/DocsTree.astro +32 -20
  23. package/src/components/DocsTree/DocsTreeItem.astro +35 -30
  24. package/src/components/DocsTree/README.md +16 -15
  25. package/src/components/DocsTree/docs-tree.scss +267 -268
  26. package/src/components/GlobalFooter/GlobalFooter.astro +10 -10
  27. package/src/components/GlobalFooter/README.md +3 -2
  28. package/src/components/GlobalNavBar/GlobalNavBar.astro +4 -2
  29. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +222 -222
  30. package/src/components/GlobalNavBar/README.md +3 -2
  31. package/src/components/LicenseIndicator/LicenseIndicator.astro +7 -5
  32. package/src/components/LicenseIndicator/LicenseIndicator.scss +3 -3
  33. package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +16 -17
  34. package/src/components/MobileSidebarToggle/README.md +3 -2
  35. package/src/components/MobileTocToggle/MobileTocToggle.astro +75 -61
  36. package/src/components/MobileTocToggle/MobileTocToggle.scss +65 -59
  37. package/src/components/Search/README.md +1 -0
  38. package/src/components/Search/Search.astro +137 -109
  39. package/src/components/Search/Search.scss +20 -20
  40. package/src/components/SearchAdvanced/README.md +21 -15
  41. package/src/components/SearchAdvanced/SearchAdvanced.astro +205 -133
  42. package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
  43. package/src/components/mdx/Anatomy/Anatomy.astro +51 -0
  44. package/src/components/mdx/Anatomy/Anatomy.scss +40 -0
  45. package/src/components/mdx/ApiLink/ApiLink.astro +133 -113
  46. package/src/components/mdx/ApiLink/ApiLink.scss +9 -9
  47. package/src/components/mdx/ApiLink/README.md +26 -22
  48. package/src/components/mdx/ApiLink/api-link-index.ts +196 -173
  49. package/src/components/mdx/ApiRef/ApiRef.astro +54 -51
  50. package/src/components/mdx/ApiRef/README.md +20 -15
  51. package/src/components/mdx/Badge/Badge.astro +14 -14
  52. package/src/components/mdx/Badge/Badge.scss +61 -56
  53. package/src/components/mdx/Badge/README.md +24 -19
  54. package/src/components/mdx/DocsAside/DocsAside.astro +30 -37
  55. package/src/components/mdx/DocsAside/DocsAside.scss +82 -82
  56. package/src/components/mdx/DocsAside/README.md +22 -22
  57. package/src/components/mdx/Faq/Faq.astro +86 -0
  58. package/src/components/mdx/Faq/Faq.scss +105 -0
  59. package/src/components/mdx/Faq/FaqItem.astro +117 -0
  60. package/src/components/mdx/Faq/README.md +223 -0
  61. package/src/components/mdx/Faq/types.ts +34 -0
  62. package/src/components/mdx/PlatformBlock/PlatformBlock.astro +3 -2
  63. package/src/components/mdx/PlatformBlock/README.md +6 -8
  64. package/src/components/mdx/Sample/README.md +21 -16
  65. package/src/components/mdx/Sample/Sample.astro +97 -74
  66. package/src/components/mdx/Sample/Sample.scss +132 -132
  67. package/src/content-helper.ts +71 -72
  68. package/src/content.config.ts +1 -6
  69. package/src/integration.ts +566 -512
  70. package/src/layouts/DocsLayout/DocsLayout.astro +228 -182
  71. package/src/layouts/DocsLayout/DocsLayout.scss +261 -261
  72. package/src/layouts/DocsLayout/README.md +24 -35
  73. package/src/lib/nav-helpers.ts +88 -82
  74. package/src/lib/types.ts +76 -76
  75. package/src/llms.ts +205 -166
  76. package/src/platform.ts +312 -162
  77. package/src/plugins/rehype-heading-anchors.ts +45 -45
  78. package/src/plugins/rehype-pagefind-ignore.ts +19 -19
  79. package/src/plugins/rehype-table-wrapper.ts +30 -30
  80. package/src/plugins/remark-docfx.ts +12 -0
  81. package/src/plugins/remark-env-vars.ts +12 -4
  82. package/src/plugins/remark-md-links.ts +10 -4
  83. package/src/scripts/icon-manifest.ts +13 -5
  84. package/src/scripts/sample-widget.ts +557 -501
  85. package/src/sidebar.ts +103 -97
  86. package/src/styles/global/_code-blocks.scss +43 -44
  87. package/src/styles/global/_component-themes.scss +151 -153
  88. package/src/styles/global/_icon-gallery.scss +81 -81
  89. package/src/styles/global/_index.scss +0 -1
  90. package/src/styles/global/_markdown.scss +816 -787
  91. package/src/styles/global/_palette.scss +456 -110
  92. package/src/styles/global/_search-shared.scss +402 -398
  93. package/src/styles/global/_type-scale.scss +127 -127
  94. package/src/styles/global/_variables.scss +138 -111
  95. package/src/styles/theme.scss +41 -41
  96. package/src/virtual-modules.d.ts +11 -2
@@ -2,157 +2,156 @@
2
2
  @use '../../styles/global/search-shared' as *;
3
3
 
4
4
  @layer components {
5
- .igd-search-shell {
6
- grid-template-rows: auto calc(100% - (var(--search-header-footer-height) * 1));
7
- }
8
-
9
- api-search-advanced {
10
- display: contents;
11
-
12
- #search-scope-trigger-icon {
13
- margin-inline-start: rem(16px);
14
- }
15
- }
16
-
17
- // TODO BUG IN THE TAB COMPONENT
18
- igc-tabs::part(inner) {
19
- flex-grow: 1;
20
- }
21
-
22
- igc-tabs {
23
- igc-divider {
24
- margin-block: rem(16px) rem(24px);
25
-
26
- &:last-of-type {
27
- display: none;
28
- }
29
- }
30
- }
31
-
32
- // TODO Log issue in the component this is not suppose to be affected by the ig-typography
33
- igc-tab::part(content) {
34
- @include type-style('subtitle-1') {
35
- margin: 0;
36
- }
37
- }
38
-
39
- .igd-search-tabs {
40
- --item-background: var(--igd-layout-sections-bg);
41
- --button-color: var(--igd-accent);
42
- --button-hover-color: var(--igd-accent);
43
- --button-background: var(--igd-layout-sections-bg);
44
- --button-hover-background: var(--igd-layout-sections-bg);
45
- --border-color: var(--igd-layout-sections-bg);
46
- --border-color--hover: var(--igd-layout-sections-bg);
47
- --border-radius: 0;
48
-
49
- flex: 1 1 auto;
50
- min-height: 0;
51
- overflow: hidden;
52
- display: flex;
53
- flex-direction: column;
54
-
55
- &::part(base) {
56
- display: flex;
57
- flex-direction: column;
58
- height: 100%;
59
- min-height: 0;
60
- }
61
-
62
- igc-tab {
63
- --item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-700));
64
- --item-background: var(--igd-layout-sections-bg);
65
- --item-hover-background: var(--igd-layout-sections-bg);
66
- --item-hover-color: var(--igd-accent);
67
- --item-active-color: var(--igd-accent);
68
- --item-active-hover-color: var(--igd-accent);
69
- --item-icon-color: var(--igd-accent);
70
- --item-active-icon-color: var(--igd-accent);
71
- --item-active-hover-icon-color: var(--igd-accent);
72
- --item-hover-icon-color: var(--igd-accent);
73
- --item-active-background: var(--igd-layout-sections-bg);
74
- --item-active-hover-background: var(--igd-layout-sections-bg);
75
- }
76
-
77
- igc-tab::part(content),
78
- igc-tab::part(base) {
79
- @include type-style('body-2') {
80
- margin: 0;
81
- }
82
- }
83
-
84
- igc-tab::part(base) {
85
- gap: rem(4px);
86
- }
87
-
88
- igc-tab::part(tab-body) {
89
- overflow-y: auto;
90
- flex: 1 1 auto;
91
- min-height: 0;
92
- padding-block: rem(16px);
93
- padding-inline: 0;
94
- border-block-start: var(--igd-app-outline);
95
- }
96
- }
97
-
98
- .igd-search-tab-count {
99
- color: light-dark(var(--ig-gray-400), var(--ig-gray-300));
100
-
101
- &::before {
102
- content: '(';
103
- }
104
- &::after {
105
- content: ')';
106
- }
107
- }
108
-
109
- .igd-search-refine-hint {
110
- @include type-style('caption') {
111
- margin: 0;
112
- }
113
-
114
- padding-inline-start: calc(#{rem(26px)} + #{rem(16px)});
115
- margin-block-start: rem(16px);
116
- color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
117
- }
118
-
119
- .igd-search-refine-hint {
120
- @include type-style('caption') {
121
- margin: 0;
122
- }
123
-
124
- padding-inline-start: calc(#{rem(26px)} + #{rem(16px)});
125
- margin-block-start: rem(16px);
126
- color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
127
- }
128
-
129
- igc-divider {
130
- --color: light-dark(var(--ig-gray-200), var(--ig-gray-300));
131
- }
132
-
133
- .igd-search-scope {
134
- max-width: rem(250px);
135
-
136
- &::part(native-input) {
137
- min-width: 0;
138
- overflow: hidden;
139
- text-overflow: ellipsis;
140
- white-space: nowrap;
141
- }
142
- }
143
-
144
- .igd-search-scope-tooltip {
145
- --ig-tooltip-background: #D2DBE8;
146
- --ig-tooltip-text-color: #112031;
147
- --ig-tooltip-border-radius: #{rem(4px)};
148
-
149
- &::part(base) {
150
- font-family: var(--igd-font-sans);
151
- font-size: #{rem(12px)};
152
- font-weight: 500;
153
- line-height: #{rem(18px)};
154
- letter-spacing: 0;
155
- }
156
- }
157
- }
5
+ .igd-search-shell {
6
+ grid-template-rows: auto calc(100% - (var(--search-header-footer-height) * 1));
7
+ }
8
+
9
+ api-search-advanced {
10
+ display: contents;
11
+
12
+ #search-scope-trigger-icon {
13
+ margin-inline-start: rem(16px);
14
+ }
15
+ }
16
+
17
+ // TODO BUG IN THE TAB COMPONENT
18
+ igc-tabs::part(inner) {
19
+ flex-grow: 1;
20
+ }
21
+
22
+ igc-tabs {
23
+ igc-divider {
24
+ margin-block: rem(16px) rem(24px);
25
+
26
+ &:last-of-type {
27
+ display: none;
28
+ }
29
+ }
30
+ }
31
+
32
+ // TODO Log issue in the component this is not suppose to be affected by the ig-typography
33
+ igc-tab::part(content) {
34
+ @include type-style('subtitle-1') {
35
+ margin: 0;
36
+ }
37
+ }
38
+
39
+ .igd-search-tabs {
40
+ --item-background: var(--igd-layout-sections-bg);
41
+ --button-color: var(--igd-accent);
42
+ --button-hover-color: var(--igd-accent);
43
+ --button-background: var(--igd-layout-sections-bg);
44
+ --button-hover-background: var(--igd-layout-sections-bg);
45
+ --border-color: var(--igd-layout-sections-bg);
46
+ --border-color--hover: var(--igd-layout-sections-bg);
47
+ --border-radius: 0;
48
+
49
+ flex: 1 1 auto;
50
+ min-height: 0;
51
+ overflow: hidden;
52
+ display: flex;
53
+ flex-direction: column;
54
+
55
+ &::part(base) {
56
+ display: flex;
57
+ flex-direction: column;
58
+ height: 100%;
59
+ min-height: 0;
60
+ }
61
+
62
+ igc-tab {
63
+ --item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-700));
64
+ --item-background: var(--igd-layout-sections-bg);
65
+ --item-hover-background: var(--igd-layout-sections-bg);
66
+ --item-hover-color: var(--igd-accent);
67
+ --item-active-color: var(--igd-accent);
68
+ --item-active-hover-color: var(--igd-accent);
69
+ --item-icon-color: var(--igd-accent);
70
+ --item-active-icon-color: var(--igd-accent);
71
+ --item-active-hover-icon-color: var(--igd-accent);
72
+ --item-hover-icon-color: var(--igd-accent);
73
+ --item-active-background: var(--igd-layout-sections-bg);
74
+ --item-active-hover-background: var(--igd-layout-sections-bg);
75
+ }
76
+
77
+ igc-tab::part(content),
78
+ igc-tab::part(base) {
79
+ @include type-style('body-2') {
80
+ margin: 0;
81
+ }
82
+ }
83
+
84
+ igc-tab::part(base) {
85
+ gap: rem(4px);
86
+ }
158
87
 
88
+ igc-tab::part(tab-body) {
89
+ overflow-y: auto;
90
+ flex: 1 1 auto;
91
+ min-height: 0;
92
+ padding-block: rem(16px);
93
+ padding-inline: 0;
94
+ border-block-start: var(--igd-app-outline);
95
+ }
96
+ }
97
+
98
+ .igd-search-tab-count {
99
+ color: light-dark(var(--ig-gray-400), var(--ig-gray-300));
100
+
101
+ &::before {
102
+ content: '(';
103
+ }
104
+ &::after {
105
+ content: ')';
106
+ }
107
+ }
108
+
109
+ .igd-search-refine-hint {
110
+ @include type-style('caption') {
111
+ margin: 0;
112
+ }
113
+
114
+ padding-inline-start: calc(#{rem(26px)} + #{rem(16px)});
115
+ margin-block-start: rem(16px);
116
+ color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
117
+ }
118
+
119
+ .igd-search-refine-hint {
120
+ @include type-style('caption') {
121
+ margin: 0;
122
+ }
123
+
124
+ padding-inline-start: calc(#{rem(26px)} + #{rem(16px)});
125
+ margin-block-start: rem(16px);
126
+ color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
127
+ }
128
+
129
+ igc-divider {
130
+ --color: light-dark(var(--ig-gray-200), var(--ig-gray-300));
131
+ }
132
+
133
+ .igd-search-scope {
134
+ max-width: rem(250px);
135
+
136
+ &::part(native-input) {
137
+ min-width: 0;
138
+ overflow: hidden;
139
+ text-overflow: ellipsis;
140
+ white-space: nowrap;
141
+ }
142
+ }
143
+
144
+ .igd-search-scope-tooltip {
145
+ --ig-tooltip-background: #d2dbe8;
146
+ --ig-tooltip-text-color: #112031;
147
+ --ig-tooltip-border-radius: #{rem(4px)};
148
+
149
+ &::part(base) {
150
+ font-family: var(--igd-font-sans);
151
+ font-size: #{rem(12px)};
152
+ font-weight: 500;
153
+ line-height: #{rem(18px)};
154
+ letter-spacing: 0;
155
+ }
156
+ }
157
+ }
@@ -0,0 +1,51 @@
1
+ ---
2
+ /**
3
+ * Renders a framed image that illustrates the anatomy of a component.
4
+ *
5
+ * Usage:
6
+ * <Anatomy src="/images/anatomy/button.png" alt="Button anatomy: label, prefix icon, and suffix icon" />
7
+ *
8
+ * The frame is a light-gray, bordered canvas with internal padding. The image
9
+ * inside can never exceed that padding — its max-width is 100% of the frame's
10
+ * content box (the box inside the padding) and its height scales to keep the
11
+ * aspect ratio. The frame is a centering grid, so an image smaller than the
12
+ * frame sits centered rather than pinned to a corner.
13
+ *
14
+ * Accessibility: `alt` is required and propagates to the inner <img>. Anatomy
15
+ * diagrams are informative, so the alt text should describe what the diagram
16
+ * conveys (the parts it labels), not merely name the component. The <img> also
17
+ * gets native lazy loading and async decoding.
18
+ */
19
+ import './Anatomy.scss';
20
+
21
+ interface Props {
22
+ /** The image URL. Required. */
23
+ src: string;
24
+ /**
25
+ * The image's accessible description. Required — it becomes the inner
26
+ * <img>'s `alt`. Describe the parts the diagram labels, e.g.
27
+ * "Button anatomy: label text, optional prefix icon, optional suffix icon".
28
+ */
29
+ alt: string;
30
+ /** Optional extra class(es) forwarded to the frame. */
31
+ class?: string;
32
+ }
33
+
34
+ const { src, alt, class: className } = Astro.props;
35
+
36
+ if (!src?.trim()) {
37
+ throw new Error('<Anatomy> requires a `src` (image URL).');
38
+ }
39
+ // Anatomy diagrams are informative, not decorative — an absent, empty or
40
+ // whitespace-only alt would hide the diagram's meaning from screen-reader
41
+ // users. Fail loudly in dev.
42
+ if (!alt?.trim()) {
43
+ throw new Error(
44
+ '<Anatomy> requires a non-empty `alt` describing the diagram for screen readers.',
45
+ );
46
+ }
47
+ ---
48
+
49
+ <figure class:list={['igd-anatomy', className]}>
50
+ <img class="igd-anatomy__image" src={src} alt={alt} loading="lazy" decoding="async" />
51
+ </figure>
@@ -0,0 +1,40 @@
1
+ @use 'igniteui-theming/sass/typography' as *;
2
+ @use 'igniteui-theming/sass/color' as *;
3
+
4
+ // Framed canvas for component anatomy images. A centering grid so a small image
5
+ // sits in the middle of the frame; padding the image can never spill past
6
+ // because the image's max-width is 100% of the content box (inside the padding)
7
+ // and there is no negative margin to break out of it.
8
+ .igd-anatomy {
9
+ // Retunable from any ancestor, e.g. :root { --igd-anatomy-padding: 32px; }
10
+ --igd-anatomy-padding: #{rem(60px)} #{rem(24px)};
11
+ --igd-anatomy-bg: light-dark(
12
+ #{color($color: gray, $variant: 100, $opacity: 0.8)},
13
+ #{color($color: surface, $variant: 500, $opacity: 0.8)}
14
+ );
15
+ --igd-anatomy-border-color: light-dark(var(--ig-gray-300), var(--ig-surface-700));
16
+ --igd-anatomy-radius: #{rem(4px)};
17
+
18
+ display: grid;
19
+ place-items: center;
20
+ padding: var(--igd-anatomy-padding);
21
+ background-color: var(--igd-anatomy-bg);
22
+ border: rem(1px) solid var(--igd-anatomy-border-color);
23
+ border-radius: var(--igd-anatomy-radius);
24
+ margin: 0 0 rem(26px);
25
+
26
+ // Never let the frame itself overflow its column.
27
+ max-width: 100%;
28
+ overflow: hidden;
29
+ }
30
+
31
+ .igd-anatomy__image {
32
+ display: block;
33
+
34
+ // The image can grow to — but never past — the frame's content box (the
35
+ // area inside the padding). Smaller images keep their intrinsic size and
36
+ // are centered by the grid above.
37
+ max-width: 100%;
38
+ height: auto;
39
+ margin: 0;
40
+ }