igniteui-astro-components 0.0.7 → 0.0.8

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 (48) hide show
  1. package/package.json +4 -2
  2. package/src/assets/icons/open-link-blank.svg +1 -1
  3. package/src/assets/logos/code-sandbox.svg +14 -0
  4. package/src/assets/logos/stackblitz.svg +13 -0
  5. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +1 -1
  6. package/src/components/DocsSidebar/DocsSidebar.astro +15 -8
  7. package/src/components/DocsSidebar/DocsSidebar.scss +152 -2
  8. package/src/components/DocsSidebar/SidebarFilterInput.scss +7 -3
  9. package/src/components/DocsSidebar/SidebarLabel.astro +25 -4
  10. package/src/components/DocsSidebar/toTreeNodes.ts +1 -1
  11. package/src/components/DocsSubHeader/DocsSubHeader.astro +119 -302
  12. package/src/components/DocsSubHeader/DocsSubHeader.scss +111 -11
  13. package/src/components/DocsToc/DocsToc.astro +5 -2
  14. package/src/components/DocsTree/DocsTree.astro +9 -0
  15. package/src/components/DocsTree/docs-tree.scss +139 -118
  16. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +16 -1
  17. package/src/components/LicenseIndicator/LicenseIndicator.astro +19 -0
  18. package/src/components/LicenseIndicator/LicenseIndicator.scss +5 -0
  19. package/src/components/Search/Search.astro +34 -15
  20. package/src/components/Search/Search.scss +10 -42
  21. package/src/components/SearchAdvanced/SearchAdvanced.astro +182 -355
  22. package/src/components/SearchAdvanced/SearchAdvanced.scss +177 -0
  23. package/src/components/mdx/ApiRef/README.md +1 -1
  24. package/src/components/mdx/DocsAside/DocsAside.astro +37 -32
  25. package/src/components/mdx/DocsAside/DocsAside.scss +123 -35
  26. package/src/components/mdx/Sample/Sample.astro +55 -45
  27. package/src/components/mdx/Sample/Sample.scss +173 -30
  28. package/src/integration.ts +7 -0
  29. package/src/layouts/DocsLayout/DocsLayout.astro +58 -16
  30. package/src/layouts/DocsLayout/DocsLayout.scss +51 -6
  31. package/src/lib/sidebar/helpers.ts +14 -1
  32. package/src/lib/sidebar/types.ts +5 -7
  33. package/src/plugins/rehype-heading-anchors.ts +74 -0
  34. package/src/plugins/rehype-table-wrapper.ts +49 -0
  35. package/src/plugins/remark-docfx.ts +0 -0
  36. package/src/scripts/sample-widget.ts +107 -114
  37. package/src/styles/global/_breakpoints.scss +4 -4
  38. package/src/styles/global/_code-blocks.scss +1 -1
  39. package/src/styles/global/_component-themes.scss +118 -18
  40. package/src/styles/global/_index.scss +2 -2
  41. package/src/styles/global/_markdown.scss +444 -32
  42. package/src/styles/global/_palette.scss +7 -0
  43. package/src/styles/global/_search-shared.scss +273 -0
  44. package/src/styles/global/_variables.scss +58 -3
  45. package/src/styles/theme.scss +80 -11
  46. package/src/assets/icons/copy-clipboard.svg +0 -3
  47. package/src/assets/icons/filter-clear.svg +0 -1
  48. package/src/styles/custom.scss +0 -20
@@ -0,0 +1,177 @@
1
+ @use 'igniteui-theming' as *;
2
+ @use '../../styles/global/search-shared' as *;
3
+
4
+ api-search-advanced { display: contents; }
5
+
6
+ .igd-search-dialog {
7
+ --border-radius: 0;
8
+ --background: var(--igd-layout-sections-bg);
9
+ --transition-duration: 150ms;
10
+ border: none;
11
+
12
+ &::part(base) {
13
+ @include search-dialog-base-styles;
14
+
15
+ &:focus-visible {
16
+ outline: none;
17
+ }
18
+ }
19
+
20
+ &::part(content) {
21
+ padding: 0;
22
+ display: flex;
23
+ flex-direction: column;
24
+ height: 100%;
25
+ }
26
+
27
+ &::part(backdrop) {
28
+ @include search-dialog-backdrop;
29
+ }
30
+
31
+ &[open]::part(backdrop) {
32
+ @include search-dialog-backdrop-open;
33
+ }
34
+
35
+ igc-input {
36
+ height: 100%;
37
+
38
+ &::part(container) {
39
+ border: 0;
40
+ padding: 0;
41
+ height: 100%;
42
+ }
43
+ }
44
+
45
+ igc-divider {
46
+ margin-inline: rem(16px);
47
+ }
48
+ }
49
+
50
+ // TODO BUG IN THE TAB COMPONENT
51
+ igc-tabs::part(inner) {
52
+ flex-grow: 1;
53
+ }
54
+
55
+ // TODO Log issue in the component this is not suppose to be affected by the ig-typography
56
+ igc-tab::part(content) {
57
+ @include type-style('subtitle-1') {
58
+ margin: 0;
59
+ }
60
+ }
61
+
62
+ .igd-search-tabs {
63
+ --item-background: var(--igd-layout-sections-bg);
64
+
65
+ flex: 1 1 auto;
66
+ min-height: 0;
67
+ overflow: hidden;
68
+ display: flex;
69
+ flex-direction: column;
70
+
71
+ &::part(base) {
72
+ display: flex;
73
+ flex-direction: column;
74
+ height: 100%;
75
+ min-height: 0;
76
+ }
77
+
78
+ igc-tab {
79
+ --item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-700));
80
+ --item-background: var(--igd-layout-sections-bg);
81
+ --item-hover-background: var(--igd-layout-sections-bg);
82
+ --item-hover-color: var(--igd-accent);
83
+ --item-active-color: var(--igd-accent);
84
+ --item-active-hover-color: var(--igd-accent);
85
+ --item-icon-color: var(--igd-accent);
86
+ --item-active-icon-color: var(--igd-accent);
87
+ --item-active-hover-icon-color: var(--igd-accent);
88
+ --item-hover-icon-color: var(--igd-accent);
89
+ --item-active-background: var(--igd-layout-sections-bg);
90
+ --item-active-hover-background: var(--igd-layout-sections-bg);
91
+ --indicator-color: var(--igd-accent);
92
+ --button-color: var(--igd-accent);
93
+ --button-hover-color: var(--igd-accent);
94
+ --button-background: var(--igd-layout-sections-bg);
95
+ --button-hover-background: var(--igd-layout-sections-bg);
96
+ --border-color: var(--igd-layout-sections-bg);
97
+ --border-color--hover: var(--igd-layout-sections-bg);
98
+ --border-radius: 0;
99
+ }
100
+
101
+ igc-tab::part(content),
102
+ igc-tab::part(base) {
103
+ @include type-style('overline') {
104
+ margin: 0;
105
+ }
106
+ }
107
+
108
+ igc-tab::part(tab-body) {
109
+ overflow-y: auto;
110
+ flex: 1 1 auto;
111
+ min-height: 0;
112
+ padding: rem(26px);
113
+ }
114
+ }
115
+
116
+ .igd-search-header {
117
+ display: flex;
118
+ border-bottom: rem(1px) solid var(--igd-app-outline-color);
119
+ min-height: rem(75px);
120
+ padding-inline: rem(16px);
121
+ }
122
+
123
+ .igd-search-scope {
124
+ flex-shrink: 0;
125
+ align-self: center;
126
+ }
127
+
128
+ .igd-search-input {
129
+ --input-prefix-background: transparent;
130
+ --input-prefix-background--focused: transparent;
131
+ --input-prefix-background--filled: transparent;
132
+
133
+ --input-suffix-background: transparent;
134
+ --input-suffix-background--focused: transparent;
135
+ --input-suffix-background--filled: transparent;
136
+
137
+ width: 100%;
138
+
139
+ &::part(input) {
140
+ @include type-style('body-2') {
141
+ margin: 0;
142
+ }
143
+ }
144
+ }
145
+
146
+ .igd-search-clear {
147
+ --foreground: light-dark(var(--ig-gray-900), var(--ig-gray-900));
148
+ --backgroind-hover: transparent;
149
+ --hover-foreground: var(--igd-accent);
150
+ --focus-hover-foreground: var(--igd-accent);
151
+ --focus-foreground: var(--igd-accent);
152
+ --active-foreground: var(--igd-accent);
153
+ --shadow-color: transparent;
154
+ --background: transparent;
155
+ --hover-background: transparent;
156
+ --focus-background: transparent;
157
+ --focus-hover-background: transparent;
158
+ --active-background: transparent;
159
+ --border-color: transparent;
160
+ --focus-border-color: red;
161
+ --border-radius: 0;
162
+
163
+ &::part(base) {
164
+ &::after {
165
+ display: none;
166
+ }
167
+ }
168
+
169
+ &::part(focused) {
170
+ --foreground: var(--igd-accent);
171
+ }
172
+ }
173
+
174
+ .igd-search-tab-count {
175
+ color: light-dark(var(--ig-gray-500), var(--ig-gray-300));
176
+ }
177
+
@@ -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 `PLATFORM` env var via `getPlatformContext()`.
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
- type?: 'note' | 'tip' | 'warning' | 'danger';
6
- title?: string;
7
- color?: string;
8
- class?: string;
9
- /** Override icon name from the 'docs' collection. */
10
- icon?: string;
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, color, icon, class: className } = Astro.props;
13
+ const { type = 'note', title, icon, class: className } = Astro.props;
14
14
 
15
15
  const defaultLabels: Record<string, string> = {
16
- note: 'Note',
17
- tip: 'Tip',
18
- warning: 'Warning',
19
- danger: 'Danger',
16
+ note: 'Note',
17
+ info: 'Info',
18
+ warning: 'Warning',
20
19
  };
21
20
 
22
21
  const defaultIcons: Record<string, string> = {
23
- note: 'info',
24
- tip: 'rocket',
25
- warning: 'warning',
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 !== undefined ? icon : defaultIcons[type];
31
- const inlineStyle = color ? `--aside-color: ${color};` : undefined;
28
+ const resolvedIcon = icon!==undefined ? icon: defaultIcons[type];
32
29
  ---
33
30
 
34
- <aside
35
- class:list={['aside', `aside--${type}`, className]}
36
- aria-label={label}
37
- style={inlineStyle}
31
+ <div
32
+ class:list={ ['igd-aside', `igd-aside--${ type }`, className] }
33
+ aria-label={ label }
34
+ role="note"
38
35
  >
39
- <p class="aside-title" aria-hidden="true">
40
- {resolvedIcon && <igc-icon class="aside-icon" name={resolvedIcon} collection="docs" aria-hidden="true"></igc-icon>}
41
- {label}
42
- </p>
43
- <section class="aside-content">
44
- <slot />
45
- </section>
46
- </aside>
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
- import { defineComponents, IgcIconComponent } from 'igniteui-webcomponents';
50
- import '../../../scripts/icon-registry';
54
+ import { defineComponents, IgcIconComponent } from 'igniteui-webcomponents';
55
+ import '../../../scripts/icon-registry';
51
56
 
52
- defineComponents(IgcIconComponent);
57
+ defineComponents(IgcIconComponent);
53
58
  </script>
54
59
 
@@ -1,36 +1,124 @@
1
- .aside {
2
- --aside-color: hsl(234, 90%, 60%);
3
- border-inline-start: 0.25rem solid var(--aside-color);
4
- padding: 1rem 1.25rem;
5
- background-color: color-mix(in srgb, var(--aside-color) 8%, transparent);
6
- border-radius: 0 0.375rem 0.375rem 0;
7
- margin: 1.5rem 0;
8
- }
9
-
10
- .aside--note { --aside-color: hsl(234, 90%, 60%); }
11
- .aside--tip { --aside-color: hsl(134, 70%, 38%); }
12
- .aside--warning { --aside-color: hsl(40, 90%, 45%); }
13
- .aside--danger { --aside-color: hsl(0, 85%, 52%); }
14
-
15
- .aside-title {
16
- display: flex;
17
- align-items: center;
18
- gap: 0.4em;
19
- font-weight: 700;
20
- font-size: 1rem;
21
- text-transform: uppercase;
22
- letter-spacing: 0.06em;
23
- color: var(--aside-color);
24
- margin: 0 0 0.5rem;
25
- }
26
-
27
- .aside-icon {
28
- width: 1.4em;
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
+ code {
26
+ color: inherit;
27
+ }
28
+ }
29
+
30
+ .igd-aside__title {
31
+ grid-row: 1;
32
+ grid-column: 2;
33
+ }
34
+
35
+ .igd-aside__icon {
36
+ grid-column: 1;
37
+ grid-row: 1;
38
+ }
39
+
40
+ .igd-aside__content {
41
+ grid-column: 2;
42
+ grid-row: 2;
43
+ }
44
+
45
+ // THEME STYLES
46
+ .igd-aside--info {
47
+ border-inline-start-color: var(--igd-aside-info-border);
48
+ background: var(--igd-aside-info-bg);
49
+
50
+ .igd-aside__title {
51
+ color: var(--igd-aside-info-title);
52
+ }
53
+
54
+ .igd-aside__icon {
55
+ color: var(--igd-aside-info-icon);
56
+ }
57
+
58
+ .igd-aside__content {
59
+ color: var(--igd-aside-info-content);
60
+ }
61
+
62
+ code {
63
+ background: var(--igd-aside-info-code-background);
64
+ }
65
+ }
66
+
67
+ .igd-aside--warning {
68
+ border-inline-start-color: var(--igd-aside-warning-border);
69
+ background: var(--igd-aside-warning-bg);
70
+
71
+ .igd-aside__title {
72
+ color: var(--igd-aside-warning-title);
73
+ }
74
+
75
+ .igd-aside__icon {
76
+ color: var(--igd-aside-warning-icon);
77
+ }
78
+
79
+ .igd-aside__content {
80
+ color: var(--igd-aside-warning-content);
81
+ }
82
+
83
+ code {
84
+ background: var(--igd-aside-warning-code-background);
85
+ }
86
+ }
87
+
88
+ .igd-aside--note {
89
+ border-inline-start-color: var(--igd-aside-note-border);
90
+ background: var(--igd-aside-note-bg);
91
+
92
+ .igd-aside__title {
93
+ color: var(--igd-aside-note-title);
94
+ }
95
+
96
+ .igd-aside__icon {
97
+ color: var(--igd-aside-note-icon);
98
+ }
99
+
100
+ .igd-aside__content {
101
+ color: var(--igd-aside-note-content);
102
+ }
103
+
104
+ code {
105
+ background: var(--igd-aside-note-code-background);
106
+ }
107
+ }
108
+
109
+ // TYPOGRAPHY STYLES
110
+ .ig-typography {
111
+ .igd-aside__title {
112
+ @include type-style('body-2') {
113
+ font-weight: bold;
114
+ margin: 0;
115
+ };
116
+
117
+ }
118
+
119
+ .igd-aside__content {
120
+ @include type-style('detail-1', false) {
121
+ margin: 0;
122
+ }
123
+ }
36
124
  }
@@ -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
- <iframe
61
- src={iframeSrc}
62
- title={alt || `${name} Example`}
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
- ></iframe>
95
- </div>
96
- </div>
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
- <div class="divider--half"></div>
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>