@supersoniks/concorde 3.0.12 → 3.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.
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +129 -124
- package/concorde-core.es.js +1117 -1101
- package/dist/concorde-core.bundle.js +129 -124
- package/dist/concorde-core.es.js +1117 -1101
- package/dist/fonts/ClashGrotesk-Bold.eot +0 -0
- package/dist/fonts/ClashGrotesk-Bold.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Bold.woff +0 -0
- package/dist/fonts/ClashGrotesk-Bold.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Extralight.eot +0 -0
- package/dist/fonts/ClashGrotesk-Extralight.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Extralight.woff +0 -0
- package/dist/fonts/ClashGrotesk-Extralight.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Light.eot +0 -0
- package/dist/fonts/ClashGrotesk-Light.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Light.woff +0 -0
- package/dist/fonts/ClashGrotesk-Light.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Medium.eot +0 -0
- package/dist/fonts/ClashGrotesk-Medium.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Medium.woff +0 -0
- package/dist/fonts/ClashGrotesk-Medium.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Regular.eot +0 -0
- package/dist/fonts/ClashGrotesk-Regular.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Regular.woff +0 -0
- package/dist/fonts/ClashGrotesk-Regular.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Semibold.eot +0 -0
- package/dist/fonts/ClashGrotesk-Semibold.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Semibold.woff +0 -0
- package/dist/fonts/ClashGrotesk-Semibold.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Variable.eot +0 -0
- package/dist/fonts/ClashGrotesk-Variable.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Variable.woff +0 -0
- package/dist/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/dist/img/concorde-icon.svg +5 -0
- package/dist/img/concorde_seuil.png.webp +0 -0
- package/dist/img/concorde_seuil_invert.png +0 -0
- package/index.html +67 -108
- package/package.json +2 -2
- package/public/fonts/ClashGrotesk-Bold.eot +0 -0
- package/public/fonts/ClashGrotesk-Bold.ttf +0 -0
- package/public/fonts/ClashGrotesk-Bold.woff +0 -0
- package/public/fonts/ClashGrotesk-Bold.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Extralight.eot +0 -0
- package/public/fonts/ClashGrotesk-Extralight.ttf +0 -0
- package/public/fonts/ClashGrotesk-Extralight.woff +0 -0
- package/public/fonts/ClashGrotesk-Extralight.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Light.eot +0 -0
- package/public/fonts/ClashGrotesk-Light.ttf +0 -0
- package/public/fonts/ClashGrotesk-Light.woff +0 -0
- package/public/fonts/ClashGrotesk-Light.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Medium.eot +0 -0
- package/public/fonts/ClashGrotesk-Medium.ttf +0 -0
- package/public/fonts/ClashGrotesk-Medium.woff +0 -0
- package/public/fonts/ClashGrotesk-Medium.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Regular.eot +0 -0
- package/public/fonts/ClashGrotesk-Regular.ttf +0 -0
- package/public/fonts/ClashGrotesk-Regular.woff +0 -0
- package/public/fonts/ClashGrotesk-Regular.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Semibold.eot +0 -0
- package/public/fonts/ClashGrotesk-Semibold.ttf +0 -0
- package/public/fonts/ClashGrotesk-Semibold.woff +0 -0
- package/public/fonts/ClashGrotesk-Semibold.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Variable.eot +0 -0
- package/public/fonts/ClashGrotesk-Variable.ttf +0 -0
- package/public/fonts/ClashGrotesk-Variable.woff +0 -0
- package/public/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/public/img/concorde-icon.svg +5 -0
- package/public/img/concorde_seuil.png.webp +0 -0
- package/public/img/concorde_seuil_invert.png +0 -0
- package/src/core/components/ui/menu/menu-item.ts +3 -3
- package/src/core/components/ui/pop/pop.ts +54 -19
- package/src/core/components/ui/theme/theme.ts +28 -22
- package/src/core/components/ui/toast/toast.ts +1 -3
- package/src/core/utils/PublisherProxy.ts +15 -11
- package/src/docs/_core-concept/subscriber.md +1 -1
- package/src/docs/_getting-started/concorde-outside.md +12 -10
- package/src/docs/_getting-started/create-a-component.md +1 -1
- package/src/docs/_getting-started/pubsub.md +1 -1
- package/src/docs/_getting-started/start.md +19 -17
- package/src/docs/docs.ts +1 -0
- package/src/docs/header/header.ts +217 -0
- package/src/docs/navigation/navigation.ts +123 -51
- package/src/docs/search/docs-search.json +85 -100
- package/src/docs/search/page.ts +4 -5
- package/src/docs/search/search.ts +18 -3
- package/src/docs/tailwind/css/tailwind.css +146 -0
- package/tailwind.config.js +19 -24
- package/vite/config.js +19 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {html, LitElement, css} from "lit";
|
|
2
|
-
import {customElement, property} from "lit/decorators.js";
|
|
3
|
-
import {coreVariables} from "@supersoniks/concorde/core/components/ui/theme/theme-collection/core-variables";
|
|
4
|
-
import {light} from "@supersoniks/concorde/core/components/ui/theme/theme-collection/light";
|
|
5
|
-
import {dark} from "@supersoniks/concorde/core/components/ui/theme/theme-collection/dark";
|
|
6
|
-
import {PublisherManager} from "@supersoniks/concorde/utils";
|
|
1
|
+
import { html, LitElement, css } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { coreVariables } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/core-variables";
|
|
4
|
+
import { light } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/light";
|
|
5
|
+
import { dark } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/dark";
|
|
6
|
+
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
7
7
|
|
|
8
8
|
const tagName = "sonic-theme";
|
|
9
9
|
|
|
@@ -40,12 +40,12 @@ export class Theme extends LitElement {
|
|
|
40
40
|
return Theme.instance || document.body;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
@property({type: String, reflect: true})
|
|
43
|
+
@property({ type: String, reflect: true })
|
|
44
44
|
theme = "light";
|
|
45
45
|
|
|
46
|
-
@property({type: Boolean, reflect: true}) background = false;
|
|
47
|
-
@property({type: Boolean, reflect: true}) color = false;
|
|
48
|
-
@property({type: Boolean, reflect: true}) font = false;
|
|
46
|
+
@property({ type: Boolean, reflect: true }) background = false;
|
|
47
|
+
@property({ type: Boolean, reflect: true }) color = false;
|
|
48
|
+
@property({ type: Boolean, reflect: true }) font = false;
|
|
49
49
|
|
|
50
50
|
connectedCallback(): void {
|
|
51
51
|
super.connectedCallback();
|
|
@@ -60,22 +60,25 @@ export class Theme extends LitElement {
|
|
|
60
60
|
const fontUrls: string[] = [];
|
|
61
61
|
for (let i = 0; i < ssLength; i++) {
|
|
62
62
|
const ss = stylesheets[i];
|
|
63
|
-
if (
|
|
63
|
+
if (
|
|
64
|
+
ss.href &&
|
|
65
|
+
(ss.href.includes("googleapis") || ss.href.includes("typekit.net"))
|
|
66
|
+
)
|
|
67
|
+
fontUrls.push(ss.href);
|
|
64
68
|
}
|
|
65
69
|
const theme = {
|
|
66
70
|
variables: this.getCssVariables(),
|
|
67
71
|
fonts: fontUrls,
|
|
68
72
|
};
|
|
69
73
|
PublisherManager.get("sonic-theme")?.set(theme);
|
|
70
|
-
document.querySelectorAll("iframe").forEach(
|
|
71
|
-
(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
74
|
+
document.querySelectorAll("iframe").forEach((elt) =>
|
|
75
|
+
elt.contentWindow?.postMessage(
|
|
76
|
+
{
|
|
77
|
+
type: "SonicTheme",
|
|
78
|
+
...theme,
|
|
79
|
+
},
|
|
80
|
+
"*"
|
|
81
|
+
)
|
|
79
82
|
);
|
|
80
83
|
}
|
|
81
84
|
|
|
@@ -87,8 +90,11 @@ export class Theme extends LitElement {
|
|
|
87
90
|
|
|
88
91
|
getCssVariables() {
|
|
89
92
|
const names: Array<string> = [];
|
|
90
|
-
const stylesheets = [
|
|
91
|
-
|
|
93
|
+
const stylesheets = [
|
|
94
|
+
...Theme.styles.map((s) => s.styleSheet),
|
|
95
|
+
...Array.from(document.styleSheets),
|
|
96
|
+
] as {
|
|
97
|
+
cssRules: { style: string[] }[] | CSSRuleList;
|
|
92
98
|
}[];
|
|
93
99
|
for (const stylesheet of stylesheets) {
|
|
94
100
|
try {
|
|
@@ -207,9 +207,7 @@ export class SonicToast extends LitElement {
|
|
|
207
207
|
|
|
208
208
|
declare const __SONIC_PREFIX__: string;
|
|
209
209
|
if (typeof window !== "undefined") {
|
|
210
|
-
|
|
211
|
-
window.SonicToast = window.SonicToast || SonicToast;
|
|
212
|
-
}
|
|
210
|
+
window.SonicToast = window.SonicToast || SonicToast;
|
|
213
211
|
}
|
|
214
212
|
|
|
215
213
|
/**
|
|
@@ -26,19 +26,23 @@ const queueTaskPromise = async () => {
|
|
|
26
26
|
|
|
27
27
|
declare const __BUILD_DATE__: string;
|
|
28
28
|
declare const __SONIC_PREFIX__: string;
|
|
29
|
+
let SONIC_PREFIX = "sonic";
|
|
29
30
|
|
|
30
31
|
if (typeof __BUILD_DATE__ === "undefined") {
|
|
31
32
|
(window as any).__BUILD_DATE__ = "No build date";
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
// console.log("PublisherProxy.ts loaded", (import.meta as any).env?.MODE);
|
|
36
|
+
|
|
34
37
|
if (typeof __SONIC_PREFIX__ === "undefined") {
|
|
35
|
-
|
|
38
|
+
SONIC_PREFIX = "sonic" + Math.floor(Math.random() * 1000000);
|
|
36
39
|
}
|
|
40
|
+
export const prefix = SONIC_PREFIX;
|
|
37
41
|
|
|
38
42
|
const localStorageDataKey =
|
|
39
|
-
|
|
43
|
+
SONIC_PREFIX == "sonic"
|
|
40
44
|
? "publisher-proxies-data"
|
|
41
|
-
:
|
|
45
|
+
: SONIC_PREFIX + "-publisher-proxies-data";
|
|
42
46
|
|
|
43
47
|
/**
|
|
44
48
|
* Custom Proxy contient les méthodes des publishers retournés par PublisherManager.get(publisherId) qui seront utilisées couramment
|
|
@@ -365,11 +369,11 @@ export class PublisherProxy<T = any> {
|
|
|
365
369
|
PublisherProxy.instances.set(this._instanceCounter_, this);
|
|
366
370
|
const str =
|
|
367
371
|
"<" +
|
|
368
|
-
|
|
372
|
+
SONIC_PREFIX +
|
|
369
373
|
'-publisher-proxy publisher="' +
|
|
370
374
|
this._instanceCounter_ +
|
|
371
375
|
'"></' +
|
|
372
|
-
|
|
376
|
+
SONIC_PREFIX +
|
|
373
377
|
"-publisher-proxy>";
|
|
374
378
|
return str;
|
|
375
379
|
}
|
|
@@ -430,8 +434,6 @@ export class PublisherManager {
|
|
|
430
434
|
}
|
|
431
435
|
}
|
|
432
436
|
resolve(true);
|
|
433
|
-
// compressedData = await this.compress(JSON.stringify(this.localStorageData), "gzip");
|
|
434
|
-
// localStorage.setItem(__SONIC_PREFIX__+"-publisher-proxies-data", compressedData);
|
|
435
437
|
} catch (e) {
|
|
436
438
|
window.requestAnimationFrame(() => {
|
|
437
439
|
resolve(false);
|
|
@@ -832,7 +834,9 @@ class PublisherWebComponent extends HTMLElement {
|
|
|
832
834
|
this.innerHTML = value.toString();
|
|
833
835
|
};
|
|
834
836
|
}
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
837
|
+
try {
|
|
838
|
+
customElements.define(
|
|
839
|
+
SONIC_PREFIX + "-publisher-proxy",
|
|
840
|
+
PublisherWebComponent
|
|
841
|
+
);
|
|
842
|
+
} catch (e) {}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Installation
|
|
2
2
|
|
|
3
3
|
## Starter
|
|
4
4
|
|
|
5
|
-
The easiest way to use Concorde is by using the Concorde starter.
|
|
6
|
-
|
|
5
|
+
The easiest way to use Concorde is by using the Concorde starter.
|
|
7
6
|
The following command creates a new Vite project in TypeScript mode with Tailwind and an example component to get started.
|
|
8
7
|
|
|
9
8
|
<sonic-code language="shell">
|
|
@@ -12,10 +11,12 @@ npx @supersoniks/create-concorde-ts-starter "project_name"
|
|
|
12
11
|
</template>
|
|
13
12
|
</sonic-code>
|
|
14
13
|
|
|
14
|
+
## Brand New Vite Project
|
|
15
|
+
|
|
16
|
+
|
|
15
17
|
For a more manual configuration, you can refer to the following sections. <br/>
|
|
16
18
|
However, the Tailwind configuration is not mentioned at the moment.
|
|
17
19
|
|
|
18
|
-
## Brand New Vite Project
|
|
19
20
|
|
|
20
21
|
### Creating the Project
|
|
21
22
|
|
|
@@ -23,9 +24,11 @@ However, the Tailwind configuration is not mentioned at the moment.
|
|
|
23
24
|
<template>
|
|
24
25
|
# Pure JavaScript project
|
|
25
26
|
yarn create vite --template vanilla-js
|
|
26
|
-
# TypeScript project
|
|
27
|
+
# TypeScript project
|
|
28
|
+
# (it is recommended to use this approach, which installs Lit separately if needed, via "yarn add lit")
|
|
27
29
|
yarn create vite --template vanilla-ts
|
|
28
|
-
# TypeScript + Lit project
|
|
30
|
+
# TypeScript + Lit project
|
|
31
|
+
# (creating new web components, for example, to extend the fetch or subscriber mixins)
|
|
29
32
|
yarn create vite --template lit-ts
|
|
30
33
|
</template>
|
|
31
34
|
</sonic-code>
|
|
@@ -81,8 +84,7 @@ The original paths remain accessible. Shortcut imports are used for the examples
|
|
|
81
84
|
|
|
82
85
|
### Simple Integration in HTML
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
In `main.ts` or `main.js` to be compiled:
|
|
87
|
+
Import needed component in `main.ts` or wherever you want to use it:
|
|
86
88
|
|
|
87
89
|
<sonic-code language="typescript">
|
|
88
90
|
<template>
|
|
@@ -90,7 +92,7 @@ import "@supersoniks/concorde/ui/button";
|
|
|
90
92
|
</template>
|
|
91
93
|
</sonic-code>
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
Then in the render function ofyour component or in the HTML of the web page that includes the compiled JS, use the component as follows:
|
|
94
96
|
|
|
95
97
|
<sonic-code>
|
|
96
98
|
<template>
|
|
@@ -124,7 +126,7 @@ export class SonicComponent extends Fetcher(Subscriber(LitElement)) {
|
|
|
124
126
|
</template>
|
|
125
127
|
</sonic-code>
|
|
126
128
|
|
|
127
|
-
|
|
129
|
+
Import component `main.ts` or `main.js` or any other component that uses it to be compiled
|
|
128
130
|
|
|
129
131
|
<sonic-code language="typescript">
|
|
130
132
|
<template>
|
|
@@ -2,33 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
## What is Concorde ?
|
|
4
4
|
|
|
5
|
-
Based on [lit.dev](https://lit.dev)
|
|
6
|
-
|
|
5
|
+
Based on **[lit.dev](https://lit.dev)**, Concorde is a collection of webcomponents made to build shared components, between apps or websites.
|
|
6
|
+
Develop user interfaces without thinking about the implementation context, where everything is scoped, but preserving graphic consistency by setting the strict minimum of css variables.
|
|
7
7
|
|
|
8
8
|
## Why and use case
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
Instead of
|
|
12
|
-
Webcomponents appeared to be a the perfect solution to guarantee that compatibility with all past, present and futures
|
|
10
|
+
In 2022, Supersoniks wanted to create a new version of his ticketing app, in production un nearly 100 websites. We needed shared components which could be implemented in mobile apps, modern websites, and also old ones made in php, without bundlers or whatever.
|
|
11
|
+
Instead of building a new app for each type of project, which would become impossible to maintain, we've decided to create one app, composed by a few webcomponents wich could easily be recomposed on any website.
|
|
12
|
+
Webcomponents appeared to be a the perfect solution to guarantee that compatibility with all past, present and futures environment, and lit seemed to be the best choice to build them.
|
|
13
13
|
|
|
14
|
-
###
|
|
14
|
+
### Stack
|
|
15
|
+
|
|
16
|
+
* Lit
|
|
17
|
+
* Typescript
|
|
18
|
+
* Vite
|
|
19
|
+
* Tailwind, not in the core, but in the starter kit
|
|
20
|
+
|
|
21
|
+
### Functionnal features and components
|
|
15
22
|
|
|
16
|
-
* Fetching data, lists, queue with lazyload, etc.
|
|
17
23
|
* Data management with Publisher / Subscriber pattern
|
|
24
|
+
* Form management
|
|
25
|
+
* Fetching data, lists, queue with lazyload
|
|
18
26
|
* Data binding
|
|
19
|
-
*
|
|
20
|
-
*
|
|
27
|
+
* Simple router, state component, ...
|
|
28
|
+
* All ui component, with status variations to build an app with a consistent design
|
|
21
29
|
|
|
22
|
-
### Tools
|
|
23
|
-
|
|
24
|
-
* Lit, of course
|
|
25
|
-
* Typescript
|
|
26
|
-
* Vite
|
|
27
|
-
* Tailwind (not in the core, but in the starter kit)
|
|
28
30
|
|
|
29
|
-
## Start a new project
|
|
31
|
+
## Start a new project easily
|
|
30
32
|
|
|
31
|
-
A new project with Vite, Typescript and Tailwind already configured and a simple example of a subscriber component :
|
|
33
|
+
A new project with Vite, Typescript and Tailwind already configured and a simple example of a subscriber component :
|
|
32
34
|
|
|
33
35
|
<sonic-code language="bash">
|
|
34
36
|
<template>
|
package/src/docs/docs.ts
CHANGED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { html, LitElement, nothing } from "lit";
|
|
2
|
+
import { customElement, state } from "lit/decorators.js";
|
|
3
|
+
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
4
|
+
import { tailwind } from "../tailwind";
|
|
5
|
+
import { animate } from "@lit-labs/motion";
|
|
6
|
+
import { Theme } from "@supersoniks/concorde/core/components/ui/theme/theme";
|
|
7
|
+
const tagName = "sonic-docs-header"; // For Astro.build
|
|
8
|
+
@customElement(tagName)
|
|
9
|
+
export class SonicComponent extends Subscriber(LitElement) {
|
|
10
|
+
static styles = [tailwind];
|
|
11
|
+
|
|
12
|
+
@state() theme: "dark" | "light" = "light";
|
|
13
|
+
@state() searchVisible = false;
|
|
14
|
+
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.handleColorScheme();
|
|
17
|
+
super.connectedCallback();
|
|
18
|
+
|
|
19
|
+
// if escape key is pressed and search is visible, hide search
|
|
20
|
+
document.addEventListener("keydown", (e) => {
|
|
21
|
+
if (e.key === "Escape" && this.searchVisible) {
|
|
22
|
+
this.hideSearch();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// ctrl + k to toggle search
|
|
27
|
+
document.addEventListener("keydown", (e) => {
|
|
28
|
+
if (e.ctrlKey && e.key === "k") {
|
|
29
|
+
this.toggleSearch();
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
}
|
|
32
|
+
// command + k to toggle search
|
|
33
|
+
if (e.metaKey && e.key === "k") {
|
|
34
|
+
this.toggleSearch();
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// on hash change, hide search
|
|
40
|
+
window.addEventListener("hashchange", () => {
|
|
41
|
+
this.hideSearch();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
handleColorScheme() {
|
|
46
|
+
const themeComponent = document.querySelector("sonic-theme") as Theme;
|
|
47
|
+
if (
|
|
48
|
+
localStorage.sonicTheme === "dark" ||
|
|
49
|
+
(!("sonicTheme" in localStorage) &&
|
|
50
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches)
|
|
51
|
+
) {
|
|
52
|
+
document.documentElement.setAttribute("data-concorde-theme", "dark");
|
|
53
|
+
document.documentElement.classList.add("dark");
|
|
54
|
+
this.theme = "dark";
|
|
55
|
+
themeComponent.theme = "dark";
|
|
56
|
+
} else {
|
|
57
|
+
document.documentElement.classList.remove("dark");
|
|
58
|
+
document.documentElement.setAttribute("data-concorde-theme", "light");
|
|
59
|
+
this.theme = "light";
|
|
60
|
+
themeComponent.theme = "light";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
setMode(theme: "dark" | "light") {
|
|
65
|
+
localStorage.sonicTheme = theme;
|
|
66
|
+
this.handleColorScheme();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
hideSearch() {
|
|
70
|
+
this.searchVisible = false;
|
|
71
|
+
}
|
|
72
|
+
toggleSearch() {
|
|
73
|
+
this.searchVisible = !this.searchVisible;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
render() {
|
|
77
|
+
return html`<div
|
|
78
|
+
class="flex items-center gap-4 border-b-[.18rem] text-content border-current py-3 sticky top-0 z-40 bg-neutral-0"
|
|
79
|
+
>
|
|
80
|
+
<div class="">
|
|
81
|
+
<sonic-link href="/" class="flex items-end gap-x-1">
|
|
82
|
+
<svg
|
|
83
|
+
class="size-[2.4rem] inline-block rotate-[55deg] "
|
|
84
|
+
viewBox="0 0 66 66"
|
|
85
|
+
fill="none"
|
|
86
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
87
|
+
|
|
88
|
+
>
|
|
89
|
+
<circle cx="33" cy="33" r="30" fill="var(--sc-base-content)" />
|
|
90
|
+
<path
|
|
91
|
+
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"
|
|
92
|
+
fill="var(--sc-base)"
|
|
93
|
+
/>
|
|
94
|
+
</svg>
|
|
95
|
+
|
|
96
|
+
<span class="font-headings text-4xl leading-none inline-block italic font-medium"
|
|
97
|
+
>concorde</span
|
|
98
|
+
>
|
|
99
|
+
</sonic-link>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div class="ml-auto flex gap-x-3 ">
|
|
103
|
+
<sonic-button
|
|
104
|
+
@click=${() => (this.searchVisible = !this.searchVisible)}
|
|
105
|
+
class="lg:min-w-[19rem]"
|
|
106
|
+
align="left"
|
|
107
|
+
>
|
|
108
|
+
Quick search...
|
|
109
|
+
<sonic-icon
|
|
110
|
+
name="magnifying-glass"
|
|
111
|
+
library="custom"
|
|
112
|
+
slot="prefix"
|
|
113
|
+
></sonic-icon>
|
|
114
|
+
</sonic-button>
|
|
115
|
+
|
|
116
|
+
<sonic-pop>
|
|
117
|
+
<sonic-button shape="circle" variant="ghost" icon>
|
|
118
|
+
${
|
|
119
|
+
this.theme == "light"
|
|
120
|
+
? html`<sonic-icon name="sun" library="custom"></sonic-icon>`
|
|
121
|
+
: html`<sonic-icon name="moon" library="custom"></sonic-icon>`
|
|
122
|
+
}
|
|
123
|
+
</sonic-button>
|
|
124
|
+
|
|
125
|
+
<sonic-menu slot="content">
|
|
126
|
+
<sonic-menu-item
|
|
127
|
+
?active="${this.theme == "light"}"
|
|
128
|
+
@click=${() => this.setMode("light")}
|
|
129
|
+
>
|
|
130
|
+
<sonic-icon
|
|
131
|
+
name="sun"
|
|
132
|
+
library="custom"
|
|
133
|
+
slot="prefix"
|
|
134
|
+
></sonic-icon>
|
|
135
|
+
light
|
|
136
|
+
</sonic-menu-item>
|
|
137
|
+
<sonic-menu-item
|
|
138
|
+
?active="${this.theme == "dark"}"
|
|
139
|
+
@click=${() => this.setMode("dark")}
|
|
140
|
+
>
|
|
141
|
+
<sonic-icon
|
|
142
|
+
name="moon"
|
|
143
|
+
library="custom"
|
|
144
|
+
slot="prefix"
|
|
145
|
+
></sonic-icon>
|
|
146
|
+
dark
|
|
147
|
+
</sonic-menu-item>
|
|
148
|
+
</sonic-menu>
|
|
149
|
+
</sonic-pop>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
${
|
|
156
|
+
this.searchVisible
|
|
157
|
+
? html`
|
|
158
|
+
<div
|
|
159
|
+
${animate({
|
|
160
|
+
keyframeOptions: {
|
|
161
|
+
duration: 250,
|
|
162
|
+
},
|
|
163
|
+
in: [
|
|
164
|
+
{
|
|
165
|
+
opacity: 0,
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
out: [
|
|
169
|
+
{
|
|
170
|
+
opacity: 0,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
stabilizeOut: true,
|
|
174
|
+
})}
|
|
175
|
+
class="fixed top-0 w-full left-0 z-[3000] pt-[20vh] flex items-center justify-center "
|
|
176
|
+
>
|
|
177
|
+
<div
|
|
178
|
+
@click=${() => this.hideSearch()}
|
|
179
|
+
class="bg-neutral-0 dark:bg-neutral-300 opacity-90 fixed top-0 left-0 w-full h-full "
|
|
180
|
+
></div>
|
|
181
|
+
|
|
182
|
+
<div
|
|
183
|
+
${animate({
|
|
184
|
+
keyframeOptions: {
|
|
185
|
+
duration: 250,
|
|
186
|
+
easing: `cubic-bezier(0.250, 0.250, 0.420, 1.225)`,
|
|
187
|
+
},
|
|
188
|
+
in: [
|
|
189
|
+
{
|
|
190
|
+
transform: "translateY(1rem) scale(1.05)",
|
|
191
|
+
opacity: 0,
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
out: [
|
|
195
|
+
{
|
|
196
|
+
transform: "scale(.90) ",
|
|
197
|
+
opacity: 0,
|
|
198
|
+
duration: 3000,
|
|
199
|
+
easing: `ease-in-out`,
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
stabilizeOut: true,
|
|
203
|
+
})}
|
|
204
|
+
class="relative z-20 w-full max-w-[40rem] w-full block "
|
|
205
|
+
>
|
|
206
|
+
<docs-search setFocus class="max-w-[40rem] w-full block">
|
|
207
|
+
</docs-search>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
`
|
|
211
|
+
: nothing
|
|
212
|
+
}
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
</div> `;
|
|
216
|
+
}
|
|
217
|
+
}
|