@supersoniks/concorde 5.0.4 → 5.1.0

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 (123) hide show
  1. package/.agents/skills/concorde-component-docs/SKILL.md +194 -0
  2. package/.agents/skills/concorde-component-docs/template.md +45 -0
  3. package/.tmp-cem/custom-elements.json +13705 -0
  4. package/ai/cursor/rules/concorde-theme.mdc +1 -1
  5. package/ai/cursor/rules/concorde.mdc +1 -1
  6. package/ai/skills/concorde/SKILL.md +1 -1
  7. package/ai/skills/concorde-theme/SKILL.md +21 -10
  8. package/build-infos.json +1 -1
  9. package/concorde-3d.bundle.js +3960 -0
  10. package/concorde-3d.es.js +33433 -0
  11. package/concorde-core.bundle.js +507 -513
  12. package/concorde-core.es.js +4027 -3702
  13. package/concorde-hugging-face-infer.bundle.js +32 -0
  14. package/concorde-hugging-face-infer.es.js +2952 -0
  15. package/concorde-interactive.bundle.js +1157 -0
  16. package/concorde-interactive.es.js +10734 -0
  17. package/concorde-shader.bundle.js +116 -0
  18. package/concorde-shader.es.js +8353 -0
  19. package/concorde-webgpu.bundle.js +307 -0
  20. package/concorde-webgpu.es.js +8627 -0
  21. package/custom-elements-manifest.config.mjs +14 -0
  22. package/dist/concorde-core.bundle.js +507 -513
  23. package/dist/concorde-core.es.js +4027 -3702
  24. package/dist/docs-mock-api-sw.js +2 -0
  25. package/dist/docs-mock-api-sw.js.map +2 -2
  26. package/gitlab/job_tests.sh +0 -0
  27. package/index.html +4 -2
  28. package/package.json +42 -2
  29. package/public/docs-mock-api-sw.js +2 -0
  30. package/public/docs-mock-api-sw.js.map +2 -2
  31. package/scripts/generate-sdui-catalog.mjs +250 -0
  32. package/scripts/generate-sdui-catalog.spec.ts +91 -0
  33. package/scripts/pre-build.mjs +15 -0
  34. package/src/core/components/functional/if/if.ts +0 -0
  35. package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +5 -5
  36. package/src/core/components/functional/sdui/__fixtures__/descriptors.ts +251 -0
  37. package/src/core/components/functional/sdui/__snapshots__/sdui-action.spec.ts.snap +73 -0
  38. package/src/core/components/functional/sdui/__snapshots__/sdui-incremental.spec.ts.snap +50 -0
  39. package/src/core/components/functional/sdui/__snapshots__/sdui-partial.spec.ts.snap +50 -0
  40. package/src/core/components/functional/sdui/__snapshots__/sdui.regression.spec.ts.snap +461 -0
  41. package/src/core/components/functional/sdui/component-catalog.gaps.json +511 -0
  42. package/src/core/components/functional/sdui/component-catalog.json +3103 -0
  43. package/src/core/components/functional/sdui/component-catalog.spec.ts +23 -0
  44. package/src/core/components/functional/sdui/sdui-action.spec.ts +99 -0
  45. package/src/core/components/functional/sdui/sdui-dom-snapshot.ts +61 -0
  46. package/src/core/components/functional/sdui/sdui-extension-points.md +94 -0
  47. package/src/core/components/functional/sdui/sdui-incremental.spec.ts +137 -0
  48. package/src/core/components/functional/sdui/sdui-partial.spec.ts +83 -0
  49. package/src/core/components/functional/sdui/sdui-partial.ts +19 -0
  50. package/src/core/components/functional/sdui/sdui-safe.spec.ts +188 -0
  51. package/src/core/components/functional/sdui/sdui-safe.ts +100 -0
  52. package/src/core/components/functional/sdui/sdui.md +122 -0
  53. package/src/core/components/functional/sdui/sdui.regression.spec.ts +64 -0
  54. package/src/core/components/functional/sdui/sdui.ts +442 -34
  55. package/src/core/components/functional/sdui/types.ts +49 -0
  56. package/src/core/components/functional/value/value.ts +0 -0
  57. package/src/core/components/ui/_css/align.ts +1 -0
  58. package/src/core/components/ui/_css/type.ts +86 -8
  59. package/src/core/components/ui/_i18n/ui-aria-labels.ts +8 -0
  60. package/src/core/components/ui/alert/alert.md +21 -2
  61. package/src/core/components/ui/alert-messages/alert-messages.md +85 -0
  62. package/src/core/components/ui/badge/badge.md +19 -6
  63. package/src/core/components/ui/badge/badge.ts +8 -9
  64. package/src/core/components/ui/button/button.ts +5 -15
  65. package/src/core/components/ui/captcha/captcha.md +65 -6
  66. package/src/core/components/ui/card/card.md +73 -10
  67. package/src/core/components/ui/card/card.ts +24 -22
  68. package/src/core/components/ui/divider/divider.md +107 -13
  69. package/src/core/components/ui/divider/divider.ts +40 -33
  70. package/src/core/components/ui/form/fieldset/fieldset.md +175 -99
  71. package/src/core/components/ui/form/fieldset/fieldset.ts +15 -28
  72. package/src/core/components/ui/form/fieldset/legend.ts +13 -13
  73. package/src/core/components/ui/form/form-actions/form-actions.md +75 -52
  74. package/src/core/components/ui/form/form-actions/form-actions.ts +7 -5
  75. package/src/core/components/ui/form/form-layout/form-layout.md +109 -34
  76. package/src/core/components/ui/form/form-layout/form-layout.ts +27 -24
  77. package/src/core/components/ui/form/textarea/textarea.ts +4 -3
  78. package/src/core/components/ui/group/group.md +36 -36
  79. package/src/core/components/ui/group/group.ts +5 -10
  80. package/src/core/components/ui/icon/icon.md +132 -43
  81. package/src/core/components/ui/image/image.md +35 -3
  82. package/src/core/components/ui/link/link.md +43 -5
  83. package/src/core/components/ui/loader/loader.md +79 -22
  84. package/src/core/components/ui/loader/loader.ts +67 -27
  85. package/src/core/components/ui/loader/styles/fixed.ts +6 -11
  86. package/src/core/components/ui/menu/menu.md +133 -92
  87. package/src/core/components/ui/menu/menu.ts +53 -58
  88. package/src/core/components/ui/modal/modal.md +163 -47
  89. package/src/core/components/ui/modal/modal.ts +2 -4
  90. package/src/core/components/ui/pop/pop.md +217 -123
  91. package/src/core/components/ui/pop/pop.ts +0 -1
  92. package/src/core/components/ui/progress/progress.md +76 -30
  93. package/src/core/components/ui/progress/progress.ts +25 -56
  94. package/src/core/components/ui/table/table-caption.ts +2 -2
  95. package/src/core/components/ui/table/table-tbody.ts +3 -3
  96. package/src/core/components/ui/table/table-td.ts +23 -18
  97. package/src/core/components/ui/table/table-th.ts +8 -8
  98. package/src/core/components/ui/table/table-tr.ts +4 -4
  99. package/src/core/components/ui/table/table.md +147 -171
  100. package/src/core/components/ui/table/table.ts +20 -19
  101. package/src/core/components/ui/theme/theme-collection/auto.ts +15 -0
  102. package/src/core/components/ui/theme/theme-collection/core-variables.ts +8 -31
  103. package/src/core/components/ui/theme/theme-collection/dark.ts +1 -7
  104. package/src/core/components/ui/theme/theme-collection/light.ts +30 -26
  105. package/src/core/components/ui/theme/theme.md +122 -0
  106. package/src/core/components/ui/theme/theme.ts +30 -7
  107. package/src/core/components/ui/toast/toast-item.ts +6 -9
  108. package/src/core/components/ui/toast/toast.md +108 -58
  109. package/src/core/components/ui/toast/types.ts +1 -1
  110. package/src/core/components/ui/tooltip/tooltip.md +68 -26
  111. package/src/docs/_getting-started/start.md +1 -1
  112. package/src/docs/_getting-started/theming.md +223 -61
  113. package/src/docs/code.ts +125 -58
  114. package/src/docs/header/header.ts +62 -54
  115. package/src/docs/mock-api/router.ts +2 -0
  116. package/src/docs/navigation/navigation.ts +6 -3
  117. package/src/docs/search/docs-search.json +2504 -399
  118. package/src/docs/search/markdown-renderer.ts +6 -6
  119. package/src/docs/search/search.ts +4 -4
  120. package/src/docs/tailwind/css/tailwind.css +6 -5
  121. package/src/tsconfig.json +108 -0
  122. package/src/tsconfig.tsbuildinfo +1 -1
  123. package/tailwind.config.js +19 -0
package/src/docs/code.ts CHANGED
@@ -18,6 +18,25 @@ import "prismjs/components/prism-bash"; // Language
18
18
  // import "prismjs/components/prism-css"; // Language
19
19
  import "prismjs/components/prism-markup"; // Language
20
20
 
21
+ let normalizeWhitespaceDefaultsApplied = false;
22
+
23
+ function normalizeDocsCodeLanguage(language: string): string {
24
+ return language === "html" ? "markup" : language;
25
+ }
26
+
27
+ function applyNormalizeWhitespaceDefaults(): void {
28
+ if (normalizeWhitespaceDefaultsApplied) return;
29
+ normalizeWhitespaceDefaultsApplied = true;
30
+ Prism.plugins.NormalizeWhitespace.setDefaults({
31
+ "remove-trailing": true,
32
+ "remove-indent": true,
33
+ "left-trim": true,
34
+ "right-trim": true,
35
+ "remove-initial-line-feed": true,
36
+ "tabs-to-tabs": 2,
37
+ });
38
+ }
39
+
21
40
  const tagName = "sonic-code";
22
41
  @customElement(tagName)
23
42
  export class DocsCode extends LitElement {
@@ -38,6 +57,7 @@ export class DocsCode extends LitElement {
38
57
  padding-right: 5rem !important;
39
58
  border: 1px solid var(--sc-base-200);
40
59
  border-radius: var(--sc-rounded);
60
+ margin: 0 !important;
41
61
  }
42
62
  .custom-scroll {
43
63
  overflow: auto !important;
@@ -70,62 +90,95 @@ export class DocsCode extends LitElement {
70
90
  @property({ type: Boolean, reflect: true }) showCode = false;
71
91
  @property({ type: Boolean, reflect: true }) toggleCode = false;
72
92
  @property({ type: Boolean, reflect: true }) noEdit = false;
73
- @property({ type: Boolean, reflect: true }) noOutput = false;
74
93
 
75
94
  @property() language = "markup";
76
- @property() defaultCode?: string;
77
- @property() currentCode?: string;
95
+ @property({ attribute: false }) defaultCode?: string;
96
+ @property({ attribute: false }) currentCode?: string;
97
+ @property({ attribute: false }) codeOutput?: string;
78
98
 
79
- @property() codeOutput?: string;
99
+ @query("#codePreview") codePreview!: HTMLPreElement;
80
100
 
81
- //ELEMENTS
82
- @property() templateEl: HTMLTemplateElement | null;
83
- @query("#codePreview") codePreview;
84
- @query("#codeRender") codeRender;
101
+ private templateEl: HTMLTemplateElement | null = null;
85
102
 
86
- //States
87
103
  @state() codeEdited = false;
88
104
 
89
- /** Aperçu live uniquement pour les blocs markup (évite d’injecter du HTML depuis des exemples JS). */
90
- private get rendersLiveOutput(): boolean {
91
- return this.language === "markup" && !this.noOutput;
105
+ /** Live preview only for markup (avoid injecting HTML from JS/TS examples). */
106
+ private get prismLanguage(): string {
107
+ return normalizeDocsCodeLanguage(this.language);
92
108
  }
93
109
 
94
- // createRenderRoot() {
95
- // return this;
96
- // }
110
+ private get rendersLiveOutput(): boolean {
111
+ return this.prismLanguage === "markup";
112
+ }
97
113
 
98
114
  connectedCallback() {
99
115
  super.connectedCallback();
100
116
  if (!this.toggleCode) {
101
117
  this.showCode = true;
102
118
  }
119
+ this.syncFromTemplate();
120
+ }
121
+
122
+ willUpdate(changedProperties: PropertyValues) {
123
+ if (
124
+ changedProperties.has("language") &&
125
+ changedProperties.get("language") !== undefined
126
+ ) {
127
+ this.applyLanguageChange();
128
+ }
129
+ }
103
130
 
131
+ private normalizeSourceForHighlight(source: string): string {
132
+ applyNormalizeWhitespaceDefaults();
133
+ const nw = Prism.plugins.NormalizeWhitespace;
134
+ return nw
135
+ .normalize(source)
136
+ .replaceAll('=""', "")
137
+ .replaceAll(""", '"')
138
+ .replaceAll('"{', "'{")
139
+ .replaceAll('}"', "}'")
140
+ .replaceAll("&", "&");
141
+ }
142
+
143
+ private highlightSource(source: string): string {
144
+ const lang = this.prismLanguage;
145
+ const grammar = Prism.languages[lang];
146
+ if (!grammar) {
147
+ return source;
148
+ }
149
+ return Prism.highlight(
150
+ this.normalizeSourceForHighlight(source),
151
+ grammar,
152
+ lang,
153
+ );
154
+ }
155
+
156
+ private syncFromTemplate() {
104
157
  this.templateEl = this.querySelector("template");
105
158
  this.defaultCode = this.readTemplateSourceCode();
159
+ this.codeEdited = false;
106
160
 
107
161
  if (this.defaultCode) {
108
- Prism.plugins.NormalizeWhitespace.setDefaults({
109
- "remove-trailing": true,
110
- "remove-indent": true,
111
- "left-trim": true,
112
- "right-trim": true,
113
- "remove-initial-line-feed": true,
114
- "tabs-to-tabs": 2,
115
- });
116
- const nw = Prism.plugins.NormalizeWhitespace;
117
- const normalizedCode = nw
118
- .normalize(this.defaultCode)
119
- .replaceAll('=""', "")
120
- .replaceAll(""", '"')
121
- .replaceAll('"{', "'{")
122
- .replaceAll('}"', "}'")
123
- .replaceAll("&", "&");
124
- this.currentCode = Prism.highlight(
125
- normalizedCode,
126
- Prism.languages[this.language],
127
- this.language,
128
- );
162
+ this.currentCode = this.highlightSource(this.defaultCode);
163
+ } else {
164
+ this.currentCode = undefined;
165
+ }
166
+
167
+ if (this.rendersLiveOutput) {
168
+ this.codeOutput = this.defaultCode;
169
+ } else {
170
+ this.removeOutputSlot();
171
+ }
172
+ }
173
+
174
+ private applyLanguageChange() {
175
+ this.defaultCode = this.readTemplateSourceCode();
176
+ this.codeEdited = false;
177
+
178
+ if (this.defaultCode) {
179
+ this.currentCode = this.highlightSource(this.defaultCode);
180
+ } else {
181
+ this.currentCode = undefined;
129
182
  }
130
183
 
131
184
  if (this.rendersLiveOutput) {
@@ -148,10 +201,10 @@ export class DocsCode extends LitElement {
148
201
  * when the fragment has elements; otherwise textContent (imports, types, etc.).
149
202
  */
150
203
  private readTemplateSourceCode(): string {
151
- const template = this.templateEl;
204
+ const template = this.templateEl ?? this.querySelector("template");
152
205
  if (!template) return "";
153
206
 
154
- if (this.language === "markup") {
207
+ if (this.prismLanguage === "markup") {
155
208
  return this.decodeTemplateEntities(template.innerHTML);
156
209
  }
157
210
 
@@ -160,11 +213,16 @@ export class DocsCode extends LitElement {
160
213
  return template.content.textContent ?? "";
161
214
  }
162
215
 
216
+ private getPreviewPlainText(): string {
217
+ return this.codePreview?.innerText ?? "";
218
+ }
219
+
163
220
  updateCodeRender() {
164
- if (this.defaultCode !== this.currentCode) {
165
- this.codeEdited = true;
221
+ const plain = this.getPreviewPlainText();
222
+ this.codeEdited = plain !== (this.defaultCode ?? "");
223
+ if (this.rendersLiveOutput) {
224
+ this.codeOutput = plain;
166
225
  }
167
- this.codeOutput = this.codePreview?.innerText;
168
226
  }
169
227
 
170
228
  resetCode() {
@@ -173,11 +231,7 @@ export class DocsCode extends LitElement {
173
231
  if (this.defaultCode) {
174
232
  this.currentCode = "";
175
233
  window.requestAnimationFrame(() => {
176
- this.currentCode = Prism.highlight(
177
- this.defaultCode || "",
178
- Prism.languages[this.language],
179
- this.language,
180
- );
234
+ this.currentCode = this.highlightSource(this.defaultCode || "");
181
235
  });
182
236
  }
183
237
  if (this.rendersLiveOutput) {
@@ -189,15 +243,27 @@ export class DocsCode extends LitElement {
189
243
  this.showCode = !this.showCode;
190
244
  }
191
245
 
192
- handleCopyCode(e: Event) {
193
- const text = this.codeOutput ?? this.defaultCode;
194
- if (text) {
195
- navigator.clipboard.writeText(text);
196
- const button = e.currentTarget as HTMLButtonElement;
246
+ private getCopyText(): string {
247
+ if (!this.noEdit) {
248
+ const fromPreview = this.getPreviewPlainText();
249
+ if (fromPreview) return fromPreview;
250
+ }
251
+ return this.codeOutput ?? this.defaultCode ?? "";
252
+ }
253
+
254
+ async handleCopyCode(e: Event) {
255
+ const text = this.getCopyText();
256
+ if (!text) return;
257
+
258
+ const button = e.currentTarget as HTMLButtonElement;
259
+ try {
260
+ await navigator.clipboard.writeText(text);
197
261
  button?.setAttribute("active", "");
198
262
  setTimeout(() => {
199
263
  button?.removeAttribute("active");
200
264
  }, 500);
265
+ } catch {
266
+ // Clipboard unavailable or permission denied.
201
267
  }
202
268
  }
203
269
 
@@ -205,8 +271,7 @@ export class DocsCode extends LitElement {
205
271
  super.updated(changedProperties);
206
272
  if (
207
273
  changedProperties.has("codeOutput") ||
208
- changedProperties.has("language") ||
209
- changedProperties.has("noOutput")
274
+ changedProperties.has("language")
210
275
  ) {
211
276
  this.appendOutput();
212
277
  }
@@ -216,6 +281,7 @@ export class DocsCode extends LitElement {
216
281
  this.querySelector("[slot=output]")?.remove();
217
282
  }
218
283
 
284
+ /** Trusted doc demo markup only — same source as the live preview slot. */
219
285
  appendOutput() {
220
286
  if (!this.rendersLiveOutput) {
221
287
  this.removeOutputSlot();
@@ -231,20 +297,21 @@ export class DocsCode extends LitElement {
231
297
  output.innerHTML = this.codeOutput || "";
232
298
  }
233
299
  }
300
+
234
301
  handleGetSDUI() {
235
302
  SDUIUtils.toJson(this.templateEl?.content.children);
236
303
  }
237
304
 
238
305
  render() {
239
- // ${this.language === "markup" ? html`<div class="py-3">${unsafeHTML(this.codeOutput || "")}</div>` : nothing} //
306
+ const isMarkup = this.prismLanguage === "markup";
240
307
 
241
308
  return html`
242
309
  <div
243
- class="relative ${this.language === "markup"
310
+ class="relative ${isMarkup
244
311
  ? "rounded-md border border-neutral-200 bg-neutral-50/80 dark:border-neutral-700/80 dark:bg-neutral-900/40 p-4"
245
312
  : ""}"
246
313
  >
247
- ${this.language === "markup" && !this.noOutput
314
+ ${isMarkup
248
315
  ? html`<slot name="output" class="block py-3"></slot>`
249
316
  : nothing}
250
317
 
@@ -282,7 +349,7 @@ export class DocsCode extends LitElement {
282
349
  name="check"
283
350
  ></sonic-icon>
284
351
  </sonic-button>
285
- ${this.language == "markup"
352
+ ${isMarkup
286
353
  ? html`<sonic-button
287
354
  size="2xs"
288
355
  shape
@@ -316,7 +383,7 @@ export class DocsCode extends LitElement {
316
383
  <div>
317
384
  <pre
318
385
  id="codePreview"
319
- class="rounded-md custom-scroll language-${this.language} ${!this
386
+ class="rounded-md custom-scroll language-${this.prismLanguage} ${!this
320
387
  .showCode || !this.currentCode
321
388
  ? "hidden"
322
389
  : ""}"
@@ -81,16 +81,21 @@ export class SonicComponent extends Subscriber(LitElement) {
81
81
  viewBox="0 0 66 66"
82
82
  fill="none"
83
83
  xmlns="http://www.w3.org/2000/svg"
84
-
85
84
  >
86
- <circle cx="33" cy="33" r="30" fill="var(--sc-base-content, #000)" />
85
+ <circle
86
+ cx="33"
87
+ cy="33"
88
+ r="30"
89
+ fill="var(--sc-base-content, #000)"
90
+ />
87
91
  <path
88
92
  d="M33.2499 62.03C33.8799 59.24 34.26 56.17 34.39 53.08C34.57 52.78 34.9099 52.6 35.2599 52.64H35.39C35.48 52.64 35.5799 52.64 35.6899 52.64H35.7599C35.7599 52.64 35.7999 52.64 35.8299 52.64C36.2499 52.62 36.6799 52.58 36.9099 52.56C36.9399 52.56 36.9599 52.56 36.9799 52.56C37.0099 52.56 37.0299 52.56 37.0499 52.56H37.0899L37.2099 51.93H37.4799L37.5799 52.4L37.6899 52.49H39.2699L39.39 52.38L39.5099 51.93H39.7899L39.8399 52.21L39.9999 52.29L45.2099 51.86L46.2799 51.29C46.2799 51.29 46.2799 50.85 46.2399 50.25V50.18C46.2399 50.18 46.2399 50.13 46.2399 50.11C46.2099 49.62 46.1399 49.13 46.0399 48.65C45.7899 47.45 45.29 46 42.2 41.58C39.11 37.16 38.04 35.52 35.89 27.63C35.85 27.48 35.8199 27.35 35.7899 27.2C35.1399 24.53 34.6899 22.95 34.5199 22.38V10.89C34.4999 9.60996 34.3999 8.33996 34.2099 7.07996C34.0499 5.97996 33.6099 4.89996 33.3499 3.95996H32.6299C32.3599 4.89996 31.9299 5.97996 31.7699 7.06996C31.5799 8.33996 31.4799 9.60996 31.4599 10.89V22.38C31.2899 22.95 30.8299 24.52 30.1899 27.2C30.1599 27.35 30.1199 27.49 30.0899 27.63C27.9499 35.52 26.8699 37.16 23.7799 41.58C20.6899 46 20.1899 47.45 19.9399 48.65C19.8399 49.13 19.7799 49.62 19.7399 50.11C19.7399 50.13 19.7399 50.16 19.7399 50.18V50.25C19.6999 50.85 19.7 51.29 19.7 51.29L20.7699 51.86L25.9799 52.29L26.14 52.21L26.1899 51.93H26.4799L26.5999 52.38L26.7299 52.49H28.2999L28.4099 52.4L28.5099 51.93H28.7699L28.89 52.56H28.9399C28.9399 52.56 28.9799 52.56 29.0099 52.56C29.0299 52.56 29.0499 52.56 29.0799 52.56C29.3099 52.58 29.7499 52.63 30.1599 52.64C30.1799 52.64 30.2099 52.64 30.2299 52.64H30.2999C30.4099 52.64 30.5099 52.64 30.5999 52.64H30.7299C31.0799 52.6 31.4299 52.77 31.6099 53.08C31.7299 56.17 32.1099 59.24 32.7399 62.03H33.2499Z"
89
93
  fill="var(--sc-base, #fff)"
90
94
  />
91
95
  </svg>
92
96
 
93
- <span class="font-headings text-4xl leading-none inline-block italic font-semibold"
97
+ <span
98
+ class="font-headings text-4xl leading-none inline-block italic font-semibold"
94
99
  >concorde</span
95
100
  >
96
101
  </sonic-link>
@@ -98,11 +103,20 @@ export class SonicComponent extends Subscriber(LitElement) {
98
103
 
99
104
  <div class="ml-auto flex gap-x-3 ">
100
105
  <sonic-button
106
+ class="lg:hidden"
107
+ shape="circle"
108
+ icon
101
109
  @click=${() => (this.searchVisible = !this.searchVisible)}
102
- class="lg:min-w-[19rem]"
110
+ >
111
+ <sonic-icon name="magnifying-glass" library="custom"></sonic-icon>
112
+ </sonic-button>
113
+ <sonic-button
114
+ @click=${() => (this.searchVisible = !this.searchVisible)}
115
+ class="hidden lg:block lg:w-[19rem]"
116
+ shape="block"
103
117
  align="left"
104
118
  >
105
- Quick search...
119
+ Search...
106
120
  <sonic-icon
107
121
  name="magnifying-glass"
108
122
  library="custom"
@@ -112,11 +126,9 @@ export class SonicComponent extends Subscriber(LitElement) {
112
126
 
113
127
  <sonic-pop>
114
128
  <sonic-button shape="circle" variant="ghost" icon>
115
- ${
116
- this.theme == "light"
117
- ? html`<sonic-icon name="sun" library="custom"></sonic-icon>`
118
- : html`<sonic-icon name="moon" library="custom"></sonic-icon>`
119
- }
129
+ ${this.theme == "light"
130
+ ? html`<sonic-icon name="sun" library="custom"></sonic-icon>`
131
+ : html`<sonic-icon name="moon" library="custom"></sonic-icon>`}
120
132
  </sonic-button>
121
133
 
122
134
  <sonic-menu slot="content">
@@ -147,68 +159,64 @@ export class SonicComponent extends Subscriber(LitElement) {
147
159
  </div>
148
160
  </div>
149
161
 
150
-
151
-
152
- ${
153
- this.searchVisible
154
- ? html`
155
- <div
156
- ${animate({
157
- keyframeOptions: {
158
- duration: 250,
159
- },
160
- in: [
161
- {
162
- opacity: 0,
163
- },
164
- ],
165
- out: [
166
- {
167
- opacity: 0,
168
- },
169
- ],
170
- stabilizeOut: true,
171
- })}
172
- class="fixed top-0 w-full left-0 z-[3000] pt-[20vh] flex items-center justify-center "
173
- >
174
- <div
175
- @click=${() => this.hideSearch()}
176
- class="bg-neutral-0 dark:bg-neutral-300 opacity-90 fixed top-0 left-0 w-full h-full "
177
- ></div>
178
-
162
+ ${this.searchVisible
163
+ ? html`
179
164
  <div
180
165
  ${animate({
181
166
  keyframeOptions: {
182
167
  duration: 250,
183
- easing: `cubic-bezier(0.250, 0.250, 0.420, 1.225)`,
184
168
  },
185
169
  in: [
186
170
  {
187
- transform: "translateY(1rem) scale(1.05)",
188
171
  opacity: 0,
189
172
  },
190
173
  ],
191
174
  out: [
192
175
  {
193
- transform: "scale(.90) ",
194
176
  opacity: 0,
195
- duration: 3000,
196
- easing: `ease-in-out`,
197
177
  },
198
178
  ],
199
179
  stabilizeOut: true,
200
180
  })}
201
- class="relative z-20 w-full max-w-[40rem] w-full block "
181
+ class="fixed top-0 w-full left-0 z-[3000] pt-[20vh] flex items-center justify-center "
202
182
  >
203
- <docs-search setFocus class="max-w-[40rem] w-full block">
204
- </docs-search>
183
+ <div
184
+ @click=${() => this.hideSearch()}
185
+ class="bg-neutral-0 dark:bg-neutral-300 opacity-90 fixed top-0 left-0 w-full h-full "
186
+ ></div>
187
+
188
+ <div
189
+ ${animate({
190
+ keyframeOptions: {
191
+ duration: 250,
192
+ easing: `cubic-bezier(0.250, 0.250, 0.420, 1.225)`,
193
+ },
194
+ in: [
195
+ {
196
+ transform: "translateY(1rem) scale(1.05)",
197
+ opacity: 0,
198
+ },
199
+ ],
200
+ out: [
201
+ {
202
+ transform: "scale(.90) ",
203
+ opacity: 0,
204
+ duration: 3000,
205
+ easing: `ease-in-out`,
206
+ },
207
+ ],
208
+ stabilizeOut: true,
209
+ })}
210
+ class="relative z-20 max-w-[30rem] lg:max-w-[35rem] w-full block "
211
+ >
212
+ <docs-search
213
+ setFocus
214
+ class="max-w-[30rem] lg:max-w-[35rem] w-full block"
215
+ >
216
+ </docs-search>
217
+ </div>
205
218
  </div>
206
- </div>
207
- `
208
- : nothing
209
- }
210
- </div>
211
-
212
- </div> `;
219
+ `
220
+ : nothing}`;
213
221
  }
214
222
  }
@@ -186,6 +186,7 @@ export async function handleDocsMockApiRequest(
186
186
  {
187
187
  messages: [
188
188
  {
189
+ type: "public",
189
190
  content: "email and password are required",
190
191
  status: "error",
191
192
  },
@@ -230,6 +231,7 @@ export async function handleDocsMockApiRequest(
230
231
  {
231
232
  messages: [
232
233
  {
234
+ type: "public",
233
235
  content: "email and password query params are required",
234
236
  status: "error",
235
237
  },
@@ -19,7 +19,7 @@ export class DocsNavigation extends LitElement {
19
19
  href: "#docs/_getting-started/my-first-component.md/my-first-component",
20
20
  },
21
21
  {
22
- label: "Adding styles",
22
+ label: "Customization",
23
23
  href: "#docs/_getting-started/theming.md/theming",
24
24
  },
25
25
  "Core concept",
@@ -126,7 +126,10 @@ export class DocsNavigation extends LitElement {
126
126
  label: "Textarea",
127
127
  href: "#core/components/ui/form/textarea/textarea.md/textarea",
128
128
  },
129
- { label: "Theme", href: "#" },
129
+ {
130
+ label: "Theme",
131
+ href: "#core/components/ui/theme/theme.md/theme",
132
+ },
130
133
  { label: "Toast", href: "#core/components/ui/toast/toast.md/toast" },
131
134
  {
132
135
  label: "Tooltip",
@@ -247,7 +250,7 @@ export class DocsNavigation extends LitElement {
247
250
  firstUpdated(properties: PropertyValues) {
248
251
  super.firstUpdated(properties);
249
252
  const activeItem = this.shadowRoot?.querySelector(
250
- 'sonic-menu-item[active]:not([href="#"])'
253
+ 'sonic-menu-item[active]:not([href="#"])',
251
254
  );
252
255
  if (activeItem) {
253
256
  window.queueMicrotask(() => {