@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.
- package/.agents/skills/concorde-component-docs/SKILL.md +194 -0
- package/.agents/skills/concorde-component-docs/template.md +45 -0
- package/.tmp-cem/custom-elements.json +13705 -0
- package/ai/cursor/rules/concorde-theme.mdc +1 -1
- package/ai/cursor/rules/concorde.mdc +1 -1
- package/ai/skills/concorde/SKILL.md +1 -1
- package/ai/skills/concorde-theme/SKILL.md +21 -10
- package/build-infos.json +1 -1
- package/concorde-3d.bundle.js +3960 -0
- package/concorde-3d.es.js +33433 -0
- package/concorde-core.bundle.js +507 -513
- package/concorde-core.es.js +4027 -3702
- package/concorde-hugging-face-infer.bundle.js +32 -0
- package/concorde-hugging-face-infer.es.js +2952 -0
- package/concorde-interactive.bundle.js +1157 -0
- package/concorde-interactive.es.js +10734 -0
- package/concorde-shader.bundle.js +116 -0
- package/concorde-shader.es.js +8353 -0
- package/concorde-webgpu.bundle.js +307 -0
- package/concorde-webgpu.es.js +8627 -0
- package/custom-elements-manifest.config.mjs +14 -0
- package/dist/concorde-core.bundle.js +507 -513
- package/dist/concorde-core.es.js +4027 -3702
- package/dist/docs-mock-api-sw.js +2 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/gitlab/job_tests.sh +0 -0
- package/index.html +4 -2
- package/package.json +42 -2
- package/public/docs-mock-api-sw.js +2 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/scripts/generate-sdui-catalog.mjs +250 -0
- package/scripts/generate-sdui-catalog.spec.ts +91 -0
- package/scripts/pre-build.mjs +15 -0
- package/src/core/components/functional/if/if.ts +0 -0
- package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +5 -5
- package/src/core/components/functional/sdui/__fixtures__/descriptors.ts +251 -0
- package/src/core/components/functional/sdui/__snapshots__/sdui-action.spec.ts.snap +73 -0
- package/src/core/components/functional/sdui/__snapshots__/sdui-incremental.spec.ts.snap +50 -0
- package/src/core/components/functional/sdui/__snapshots__/sdui-partial.spec.ts.snap +50 -0
- package/src/core/components/functional/sdui/__snapshots__/sdui.regression.spec.ts.snap +461 -0
- package/src/core/components/functional/sdui/component-catalog.gaps.json +511 -0
- package/src/core/components/functional/sdui/component-catalog.json +3103 -0
- package/src/core/components/functional/sdui/component-catalog.spec.ts +23 -0
- package/src/core/components/functional/sdui/sdui-action.spec.ts +99 -0
- package/src/core/components/functional/sdui/sdui-dom-snapshot.ts +61 -0
- package/src/core/components/functional/sdui/sdui-extension-points.md +94 -0
- package/src/core/components/functional/sdui/sdui-incremental.spec.ts +137 -0
- package/src/core/components/functional/sdui/sdui-partial.spec.ts +83 -0
- package/src/core/components/functional/sdui/sdui-partial.ts +19 -0
- package/src/core/components/functional/sdui/sdui-safe.spec.ts +188 -0
- package/src/core/components/functional/sdui/sdui-safe.ts +100 -0
- package/src/core/components/functional/sdui/sdui.md +122 -0
- package/src/core/components/functional/sdui/sdui.regression.spec.ts +64 -0
- package/src/core/components/functional/sdui/sdui.ts +442 -34
- package/src/core/components/functional/sdui/types.ts +49 -0
- package/src/core/components/functional/value/value.ts +0 -0
- package/src/core/components/ui/_css/align.ts +1 -0
- package/src/core/components/ui/_css/type.ts +86 -8
- package/src/core/components/ui/_i18n/ui-aria-labels.ts +8 -0
- package/src/core/components/ui/alert/alert.md +21 -2
- package/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/src/core/components/ui/badge/badge.md +19 -6
- package/src/core/components/ui/badge/badge.ts +8 -9
- package/src/core/components/ui/button/button.ts +5 -15
- package/src/core/components/ui/captcha/captcha.md +65 -6
- package/src/core/components/ui/card/card.md +73 -10
- package/src/core/components/ui/card/card.ts +24 -22
- package/src/core/components/ui/divider/divider.md +107 -13
- package/src/core/components/ui/divider/divider.ts +40 -33
- package/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/src/core/components/ui/form/fieldset/fieldset.ts +15 -28
- package/src/core/components/ui/form/fieldset/legend.ts +13 -13
- package/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/src/core/components/ui/form/form-actions/form-actions.ts +7 -5
- package/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/src/core/components/ui/form/form-layout/form-layout.ts +27 -24
- package/src/core/components/ui/form/textarea/textarea.ts +4 -3
- package/src/core/components/ui/group/group.md +36 -36
- package/src/core/components/ui/group/group.ts +5 -10
- package/src/core/components/ui/icon/icon.md +132 -43
- package/src/core/components/ui/image/image.md +35 -3
- package/src/core/components/ui/link/link.md +43 -5
- package/src/core/components/ui/loader/loader.md +79 -22
- package/src/core/components/ui/loader/loader.ts +67 -27
- package/src/core/components/ui/loader/styles/fixed.ts +6 -11
- package/src/core/components/ui/menu/menu.md +133 -92
- package/src/core/components/ui/menu/menu.ts +53 -58
- package/src/core/components/ui/modal/modal.md +163 -47
- package/src/core/components/ui/modal/modal.ts +2 -4
- package/src/core/components/ui/pop/pop.md +217 -123
- package/src/core/components/ui/pop/pop.ts +0 -1
- package/src/core/components/ui/progress/progress.md +76 -30
- package/src/core/components/ui/progress/progress.ts +25 -56
- package/src/core/components/ui/table/table-caption.ts +2 -2
- package/src/core/components/ui/table/table-tbody.ts +3 -3
- package/src/core/components/ui/table/table-td.ts +23 -18
- package/src/core/components/ui/table/table-th.ts +8 -8
- package/src/core/components/ui/table/table-tr.ts +4 -4
- package/src/core/components/ui/table/table.md +147 -171
- package/src/core/components/ui/table/table.ts +20 -19
- package/src/core/components/ui/theme/theme-collection/auto.ts +15 -0
- package/src/core/components/ui/theme/theme-collection/core-variables.ts +8 -31
- package/src/core/components/ui/theme/theme-collection/dark.ts +1 -7
- package/src/core/components/ui/theme/theme-collection/light.ts +30 -26
- package/src/core/components/ui/theme/theme.md +122 -0
- package/src/core/components/ui/theme/theme.ts +30 -7
- package/src/core/components/ui/toast/toast-item.ts +6 -9
- package/src/core/components/ui/toast/toast.md +108 -58
- package/src/core/components/ui/toast/types.ts +1 -1
- package/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/src/docs/_getting-started/start.md +1 -1
- package/src/docs/_getting-started/theming.md +223 -61
- package/src/docs/code.ts +125 -58
- package/src/docs/header/header.ts +62 -54
- package/src/docs/mock-api/router.ts +2 -0
- package/src/docs/navigation/navigation.ts +6 -3
- package/src/docs/search/docs-search.json +2504 -399
- package/src/docs/search/markdown-renderer.ts +6 -6
- package/src/docs/search/search.ts +4 -4
- package/src/docs/tailwind/css/tailwind.css +6 -5
- package/src/tsconfig.json +108 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +19 -0
|
@@ -1,71 +1,97 @@
|
|
|
1
1
|
# Tooltip
|
|
2
2
|
|
|
3
|
+
Tooltip shows a short **`label`** on hover (and on focus when the trigger can receive focus). Wrap the trigger in the default slot—buttons, icons, or plain text. Default **`placement`** is **`top`** (center-aligned). An empty **`label`** hides the bubble the same way as **`disabled`**.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
3
7
|
<sonic-code>
|
|
4
8
|
<template>
|
|
5
|
-
<sonic-tooltip label="
|
|
9
|
+
<sonic-tooltip label="Additional context on hover">
|
|
10
|
+
<sonic-button variant="outline">Hover me</sonic-button>
|
|
11
|
+
</sonic-tooltip>
|
|
6
12
|
</template>
|
|
7
13
|
</sonic-code>
|
|
8
14
|
|
|
9
15
|
## Placement
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
Use **`top`** · **`bottom`** · **`left`** · **`right`** for the main axis. Add **`-start`** or **`-end`** to align the bubble along the anchor edge.
|
|
12
18
|
|
|
13
19
|
<sonic-code>
|
|
14
20
|
<template>
|
|
15
|
-
<
|
|
16
|
-
<sonic-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<sonic-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<sonic-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<sonic-
|
|
26
|
-
|
|
21
|
+
<div class="flex flex-wrap gap-2">
|
|
22
|
+
<sonic-tooltip placement="top" label="Top">
|
|
23
|
+
<sonic-button>Top</sonic-button>
|
|
24
|
+
</sonic-tooltip>
|
|
25
|
+
<sonic-tooltip placement="bottom" label="Bottom">
|
|
26
|
+
<sonic-button>Bottom</sonic-button>
|
|
27
|
+
</sonic-tooltip>
|
|
28
|
+
<sonic-tooltip placement="right" label="Right">
|
|
29
|
+
<sonic-button>Right</sonic-button>
|
|
30
|
+
</sonic-tooltip>
|
|
31
|
+
<sonic-tooltip placement="left" label="Left">
|
|
32
|
+
<sonic-button>Left</sonic-button>
|
|
33
|
+
</sonic-tooltip>
|
|
34
|
+
</div>
|
|
27
35
|
</template>
|
|
28
36
|
</sonic-code>
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
### Aligned placements
|
|
39
|
+
|
|
31
40
|
<sonic-code>
|
|
32
41
|
<template>
|
|
33
42
|
<div class="flex gap-3 flex-wrap">
|
|
34
|
-
<sonic-tooltip placement="top-start" label="
|
|
43
|
+
<sonic-tooltip placement="top-start" label="Top start">
|
|
35
44
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Top start</sonic-button>
|
|
36
45
|
</sonic-tooltip>
|
|
37
|
-
<sonic-tooltip placement="top-end" label="
|
|
46
|
+
<sonic-tooltip placement="top-end" label="Top end">
|
|
38
47
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Top end</sonic-button>
|
|
39
48
|
</sonic-tooltip>
|
|
40
|
-
<sonic-tooltip placement="bottom-start" label="
|
|
49
|
+
<sonic-tooltip placement="bottom-start" label="Bottom start">
|
|
41
50
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Bottom start</sonic-button>
|
|
42
51
|
</sonic-tooltip>
|
|
43
|
-
<sonic-tooltip placement="bottom-end" label="
|
|
52
|
+
<sonic-tooltip placement="bottom-end" label="Bottom end">
|
|
44
53
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Bottom end</sonic-button>
|
|
45
54
|
</sonic-tooltip>
|
|
46
|
-
<sonic-tooltip placement="right-start" label="
|
|
55
|
+
<sonic-tooltip placement="right-start" label="Right start">
|
|
47
56
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Right start</sonic-button>
|
|
48
57
|
</sonic-tooltip>
|
|
49
|
-
<sonic-tooltip placement="right-end" label="
|
|
58
|
+
<sonic-tooltip placement="right-end" label="Right end">
|
|
50
59
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Right end</sonic-button>
|
|
51
60
|
</sonic-tooltip>
|
|
52
|
-
<sonic-tooltip placement="left-start" label="
|
|
61
|
+
<sonic-tooltip placement="left-start" label="Left start">
|
|
53
62
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Left start</sonic-button>
|
|
54
63
|
</sonic-tooltip>
|
|
55
|
-
<sonic-tooltip placement="left-end" label="
|
|
64
|
+
<sonic-tooltip placement="left-end" label="Left end">
|
|
56
65
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Left end</sonic-button>
|
|
57
66
|
</sonic-tooltip>
|
|
58
67
|
</div>
|
|
59
68
|
</template>
|
|
60
69
|
</sonic-code>
|
|
61
70
|
|
|
71
|
+
## Label formatting
|
|
72
|
+
|
|
73
|
+
**`label`** supports line breaks (`\n` in markup or multiline text). Lines are trimmed; **` `** is normalized to spaces. **`white-space: pre-line`** preserves breaks in the bubble (max width **18rem**).
|
|
74
|
+
|
|
75
|
+
<sonic-code>
|
|
76
|
+
<template>
|
|
77
|
+
<sonic-tooltip label="First line Second line">
|
|
78
|
+
<sonic-button variant="outline">Multiline label</sonic-button>
|
|
79
|
+
</sonic-tooltip>
|
|
80
|
+
</template>
|
|
81
|
+
</sonic-code>
|
|
62
82
|
|
|
63
83
|
## Focusable
|
|
64
84
|
|
|
85
|
+
On non-interactive triggers, set **`focusable`** so the host gets **`tabindex="0"`** and the tooltip opens on keyboard focus as well as hover.
|
|
86
|
+
|
|
65
87
|
<sonic-code>
|
|
66
88
|
<template>
|
|
67
|
-
<sonic-tooltip
|
|
68
|
-
|
|
89
|
+
<sonic-tooltip
|
|
90
|
+
focusable
|
|
91
|
+
label="The Concorde made its first transatlantic crossing on September 26, 1973"
|
|
92
|
+
>
|
|
93
|
+
<sonic-icon library="iconoir" name="chat-bubble-question"></sonic-icon>
|
|
94
|
+
Focus or hover this text
|
|
69
95
|
</sonic-tooltip>
|
|
70
96
|
</template>
|
|
71
97
|
</sonic-code>
|
|
@@ -74,9 +100,25 @@ By default, tooltip is centered next to its content
|
|
|
74
100
|
|
|
75
101
|
<sonic-code>
|
|
76
102
|
<template>
|
|
77
|
-
<sonic-tooltip disabled label="
|
|
103
|
+
<sonic-tooltip disabled label="Not shown">
|
|
78
104
|
<sonic-button>Tooltip disabled</sonic-button>
|
|
79
105
|
</sonic-tooltip>
|
|
80
106
|
</template>
|
|
81
107
|
</sonic-code>
|
|
82
108
|
|
|
109
|
+
## Accessibility
|
|
110
|
+
|
|
111
|
+
The bubble uses **`popover="hint"`** (non-modal, no pointer capture). Prefer **`focusable`** when the slotted content is not already focusable. When the Popover API is unavailable, the host falls back to the native **`title`** attribute with a single-line label. Opacity transitions respect **`prefers-reduced-motion`**.
|
|
112
|
+
|
|
113
|
+
## API reference
|
|
114
|
+
|
|
115
|
+
| Attribute | Values | Description |
|
|
116
|
+
|----------|---------|-------------|
|
|
117
|
+
| `label` | string | Tooltip copy; whitespace-only values suppress the bubble |
|
|
118
|
+
| `placement` | `top` (default) · `bottom` · `left` · `right` · `top-start` · `top-end` · `bottom-start` · `bottom-end` · `left-start` · `left-end` · `right-start` · `right-end` | Position relative to the trigger; repositions while open |
|
|
119
|
+
| `disabled` | boolean | Suppress show/hide; sets **`tabindex="-1"`** on the host |
|
|
120
|
+
| `focusable` | boolean | Add **`tabindex="0"`** on the host for keyboard access |
|
|
121
|
+
|
|
122
|
+
| Slot | Description |
|
|
123
|
+
|------|-------------|
|
|
124
|
+
| *(default)* | Trigger content (hover target) |
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## What is Concorde?
|
|
4
4
|
|
|
5
5
|
Based on **[lit.dev](https://lit.dev)**, Concorde is a collection of web components for shared apps and websites.
|
|
6
|
-
Build UIs without tying components to a specific host stack, while keeping visual consistency through
|
|
6
|
+
Build UIs without tying components to a specific host stack, while keeping visual consistency through the smallest set of CSS variables needed to define a theme.
|
|
7
7
|
|
|
8
8
|
## Why and use case
|
|
9
9
|
|
|
@@ -1,91 +1,253 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Customization
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Theme-first customization
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Concorde components ship with **default styles** (fallback values in each component and in `<sonic-theme>`).
|
|
6
|
+
You do not need to define any CSS variables to get a usable UI.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
These styles are scoped and do not impact the outside.
|
|
11
|
-
- We use CSS variables as the value of properties intended to be customized from the outside.
|
|
12
|
-
For each variable, we define a default value to have a simple but consistent base style.
|
|
13
|
-
- We only rewrite inheritable properties with hard values if they are truly specific to the component.
|
|
14
|
-
- The `<style>` tag as a direct child can be used as a last resort, especially if there is a need for particularly dynamic customization. Performance is reduced.
|
|
15
|
-
- **During use / from the outside:**
|
|
16
|
-
We define values for **inheritable CSS properties** (e.g., font-\_, color...) using tools like Tailwind.
|
|
17
|
-
We modify the value of **CSS variables** used by the component.
|
|
8
|
+
To align the kit with your brand, override **only the essential theme tokens** on `<sonic-theme>`, on `:root`, or in a project stylesheet.
|
|
9
|
+
Concorde derives radius steps, button/input rounding, shadows, and most per-component layout from these primitives—**do not copy long lists of derived variables** unless you have a specific need.
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
<sonic-code language="html">
|
|
12
|
+
<template>
|
|
13
|
+
<sonic-theme color font class="block bg-base min-h-screen">
|
|
14
|
+
<!-- your app -->
|
|
15
|
+
</sonic-theme>
|
|
16
|
+
</template>
|
|
17
|
+
</sonic-code>
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
<sonic-code language="javascript">
|
|
20
|
+
<template>
|
|
21
|
+
import "@supersoniks/concorde/theme";
|
|
22
|
+
</template>
|
|
23
|
+
</sonic-code>
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
| Attribute | Effect |
|
|
26
|
+
|-----------|--------|
|
|
27
|
+
| *(omit)* \| `theme="custom"` | Default: core tokens + your `--sc-*`; no built-in light/dark palette |
|
|
28
|
+
| `theme="light"` \| `"dark"` \| `"auto"` | Opt-in presets; `auto` follows `prefers-color-scheme` |
|
|
29
|
+
| `class="bg-base block"` (Tailwind) | Page/surface background (`--sc-base`) |
|
|
30
|
+
| `color` | Text color (`--sc-base-content`) |
|
|
31
|
+
| `font` | Base font family/weight (`--sc-font-family-base`, etc.) |
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
Popovers, modals, and toasts mount under the nearest `<sonic-theme>`.
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
## Customization example
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
Example (full brand override on `<sonic-theme>` or `:root`). Set every essential token below; derived radii and shadows still come from the theme engine—only `--sc-rounded` is listed here.
|
|
30
38
|
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
<sonic-code language="css">
|
|
40
|
+
<template>
|
|
41
|
+
sonic-theme {
|
|
42
|
+
/* Semantic fills */
|
|
43
|
+
--sc-primary: #353429;
|
|
44
|
+
--sc-secondary: #f43f5e;
|
|
45
|
+
--sc-info: #7c3aed;
|
|
46
|
+
--sc-danger: #d71839;
|
|
47
|
+
--sc-warning: #f97316;
|
|
48
|
+
--sc-success: #10b981;
|
|
49
|
+
--sc-contrast: #111;
|
|
50
|
+
|
|
51
|
+
/* Text/icons on semantic fills */
|
|
52
|
+
--sc-primary-content: #fff;
|
|
53
|
+
--sc-secondary-content: #fff;
|
|
54
|
+
--sc-info-content: #fff;
|
|
55
|
+
--sc-danger-content: #fff;
|
|
56
|
+
--sc-warning-content: #fff;
|
|
57
|
+
--sc-success-content: #fff;
|
|
58
|
+
--sc-contrast-content: #fff;
|
|
59
|
+
|
|
60
|
+
/* Neutral fills */
|
|
61
|
+
--sc-base: #fff;
|
|
62
|
+
--sc-base-50: #f6f6f5;
|
|
63
|
+
--sc-base-100: #ededec;
|
|
64
|
+
--sc-base-200: #d7d7d4;
|
|
65
|
+
--sc-base-300: #c8c7c4;
|
|
66
|
+
--sc-base-400: #a8a7a2;
|
|
67
|
+
--sc-base-500: #94938c;
|
|
68
|
+
--sc-base-600: #76756c;
|
|
69
|
+
--sc-base-700: #59584e;
|
|
70
|
+
--sc-base-800: #47463b;
|
|
71
|
+
--sc-base-900: #353429;
|
|
72
|
+
|
|
73
|
+
/* Text/icons on neutral surfaces */
|
|
74
|
+
--sc-base-content: var(--sc-base-900);
|
|
75
|
+
|
|
76
|
+
/* Typography */
|
|
77
|
+
--sc-font-family-base: "Oswald", system-ui, -apple-system, "Segoe UI", Roboto,
|
|
78
|
+
"Helvetica Neue", Arial, sans-serif;
|
|
79
|
+
--sc-headings-font-family: "alternate-gothic-compressed", system-ui, sans-serif;
|
|
80
|
+
--sc-headings-line-height: 1.1;
|
|
81
|
+
--sc-headings-font-weight: bold;
|
|
82
|
+
--sc-headings-text-transform: none;
|
|
83
|
+
|
|
84
|
+
/* Shape (primitive only) */
|
|
85
|
+
--sc-rounded: 0;
|
|
86
|
+
|
|
87
|
+
/* Forms */
|
|
88
|
+
--sc-border-width: 0.2rem;
|
|
89
|
+
--sc-form-height: 2em;
|
|
90
|
+
--sc-input-bg: var(--sc-base);
|
|
91
|
+
--sc-input-color: var(--sc-base-content);
|
|
92
|
+
--sc-input-border-color: var(--sc-input-color);
|
|
93
|
+
--sc-input-active-bg: var(--sc-primary);
|
|
94
|
+
--sc-input-active-color: var(--sc-primary-content);
|
|
95
|
+
--sc-input-active-border-color: var(--sc-primary);
|
|
96
|
+
}
|
|
97
|
+
</template>
|
|
98
|
+
</sonic-code>
|
|
33
99
|
|
|
34
|
-
|
|
100
|
+
<sonic-button href="https://delanfranchi.github.io/concordecolors/"> Palette generator: concordecolors</sonic-button>
|
|
35
101
|
|
|
36
|
-
- It almost always leads to the creation of wrappers to style the content (instead of using `:host`).
|
|
37
|
-
- It is no longer possible to directly add classes to the component or style it from the outside.
|
|
38
|
-
Ultimately, the amount of code to write increases significantly.
|
|
39
102
|
|
|
40
|
-
|
|
103
|
+
**Without these overrides**, components keep Concorde’s per-component fallbacks. Built-in light/dark palettes apply only when you set `theme="light"`, `theme="dark"`, or `theme="auto"`.
|
|
41
104
|
|
|
42
|
-
|
|
43
|
-
To use it, you need to import the following:
|
|
105
|
+
**What we intentionally avoid:** large public `--sc-alert-*` / `--sc-badge-*` APIs or `::part()` styling hooks on most components. Prefer attributes (`type`, `status`, `size`, …) and the theme tokens above.
|
|
44
106
|
|
|
45
|
-
<sonic-code language="javascript">
|
|
46
|
-
<template>
|
|
47
|
-
import { tailwind } from "@supersoniks/concorde/la-billetterie/ui/theme/theme";
|
|
48
|
-
</template>
|
|
49
|
-
</sonic-code>
|
|
50
107
|
|
|
51
|
-
|
|
108
|
+
## Only essential CSS variables (public theme API)
|
|
52
109
|
|
|
53
|
-
|
|
54
|
-
<template>
|
|
55
|
-
static styles = [tailwind];
|
|
56
|
-
</template>
|
|
57
|
-
</sonic-code>
|
|
110
|
+
These are the **smallest set** we recommend customizing. Everything else should stay internal to the theme or to components (`--sc_*` private variables, attributes like `type`, `size`, `variant`).
|
|
58
111
|
|
|
59
|
-
|
|
112
|
+
### Surfaces and foreground
|
|
60
113
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
114
|
+
Tokens **without** a `-content` suffix are **fill / background** colors.
|
|
115
|
+
Tokens **with** `-content` are **text and icons** on top of the matching fill (solid buttons, badges, alerts, etc.).
|
|
116
|
+
|
|
117
|
+
#### Neutral fills
|
|
118
|
+
|
|
119
|
+
| Variable | Role |
|
|
120
|
+
|----------|------|
|
|
121
|
+
| `--sc-base` | Main surface / page background |
|
|
122
|
+
| `--sc-base-50` … `--sc-base-900` | Neutral scale (borders, subtle backgrounds, muted UI) |
|
|
123
|
+
|
|
124
|
+
#### Neutral foreground
|
|
125
|
+
|
|
126
|
+
| Variable | Role |
|
|
127
|
+
|----------|------|
|
|
128
|
+
| `--sc-base-content` | Default body text and icons on neutral surfaces |
|
|
66
129
|
|
|
67
|
-
|
|
130
|
+
#### Semantic fills
|
|
68
131
|
|
|
69
|
-
|
|
132
|
+
| Variable | Role |
|
|
133
|
+
|----------|------|
|
|
134
|
+
| `--sc-primary` | Primary actions, links, emphasis |
|
|
135
|
+
| `--sc-secondary` | Secondary brand accent (when used) |
|
|
136
|
+
| `--sc-info`, `--sc-success`, `--sc-warning`, `--sc-danger` | Status and feedback |
|
|
137
|
+
| `--sc-contrast` | High-contrast fills (e.g. on media) |
|
|
70
138
|
|
|
71
|
-
|
|
139
|
+
#### Semantic foreground
|
|
72
140
|
|
|
73
|
-
|
|
74
|
-
|
|
141
|
+
| Variable | Role |
|
|
142
|
+
|----------|------|
|
|
143
|
+
| `--sc-primary-content`, `--sc-secondary-content`, … | Text/icons on the matching semantic **fill** (`--sc-primary`, etc.) |
|
|
75
144
|
|
|
76
|
-
|
|
145
|
+
### Shape
|
|
77
146
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
147
|
+
| Variable | Role |
|
|
148
|
+
|----------|------|
|
|
149
|
+
| `--sc-rounded` | **Single primitive** corner radius; the theme computes `--sc-rounded-sm`, `--sc-btn-rounded`, `--sc-input-rounded`, etc. |
|
|
81
150
|
|
|
82
|
-
###
|
|
151
|
+
### Typography
|
|
83
152
|
|
|
84
|
-
|
|
153
|
+
| Variable | Role |
|
|
154
|
+
|----------|------|
|
|
155
|
+
| `--sc-font-family-base` | Body UI text |
|
|
156
|
+
| `--sc-font-weight-base`, `--sc-font-style-base` | Optional |
|
|
157
|
+
| `--sc-headings-font-family`, `--sc-headings-line-height`, `--sc-headings-font-weight`, `--sc-headings-text-transform` | Headings (modal titles, etc.) |
|
|
85
158
|
|
|
86
|
-
|
|
87
|
-
- The element and its content can be styled in a traditional manner.
|
|
159
|
+
### Forms (only if you customize inputs globally)
|
|
88
160
|
|
|
89
|
-
|
|
161
|
+
Interactive controls expose a few extra **theme-level** tokens; prefer these over styling individual inputs from outside.
|
|
162
|
+
|
|
163
|
+
| Variable | Role |
|
|
164
|
+
|----------|------|
|
|
165
|
+
| `--sc-border-width` | Default border thickness |
|
|
166
|
+
| `--sc-form-height` | Control height |
|
|
167
|
+
| `--sc-input-bg`, `--sc-input-color`, `--sc-input-border-color` | Default field chrome |
|
|
168
|
+
| `--sc-input-active-bg`, `--sc-input-active-color`, `--sc-input-active-border-color` | Focus/active state |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Tailwind in new components ?
|
|
173
|
+
|
|
174
|
+
Set <code>tailwind.config.js</code> to match concorde style token in your custom component.
|
|
175
|
+
|
|
176
|
+
<sonic-code language="js">
|
|
177
|
+
<template>
|
|
178
|
+
...
|
|
179
|
+
theme: {
|
|
180
|
+
borderRadius: {
|
|
181
|
+
DEFAULT: "var(--sc-rounded)",
|
|
182
|
+
none: "0",
|
|
183
|
+
sm: "var(--sc-rounded-sm)",
|
|
184
|
+
md: "var(--sc-rounded-md)",
|
|
185
|
+
lg: "var(--sc-rounded-lg)",
|
|
186
|
+
xl: "var(--sc-rounded-xl)",
|
|
187
|
+
full: "9999px",
|
|
188
|
+
},
|
|
189
|
+
boxShadow: {
|
|
190
|
+
DEFAULT: "var(--sc-shadow)",
|
|
191
|
+
none: "none",
|
|
192
|
+
sm: "var(--sc-shadow-sm)",
|
|
193
|
+
md: "var(--sc-shadow-md)",
|
|
194
|
+
lg: "var(--sc-shadow-lg)",
|
|
195
|
+
xl: "var(--sc-shadow-xl)",
|
|
196
|
+
},
|
|
197
|
+
colors: {
|
|
198
|
+
transparent: "transparent",
|
|
199
|
+
current: "currentColor",
|
|
200
|
+
content: "var(--sc-base-content)",
|
|
201
|
+
base: "var(--sc-base)",
|
|
202
|
+
neutral: {
|
|
203
|
+
0: "var(--sc-base)",
|
|
204
|
+
50: "var(--sc-base-50)",
|
|
205
|
+
100: "var(--sc-base-100)",
|
|
206
|
+
200: "var(--sc-base-200)",
|
|
207
|
+
300: "var(--sc-base-300)",
|
|
208
|
+
400: "var(--sc-base-400)",
|
|
209
|
+
500: "var(--sc-base-500)",
|
|
210
|
+
600: "var(--sc-base-600)",
|
|
211
|
+
700: "var(--sc-base-700)",
|
|
212
|
+
800: "var(--sc-base-800)",
|
|
213
|
+
900: "var(--sc-base-900)",
|
|
214
|
+
content: "var(--sc-base)",
|
|
215
|
+
},
|
|
216
|
+
primary: {
|
|
217
|
+
DEFAULT: "var(--sc-primary)",
|
|
218
|
+
content: "var(--sc-primary-content)",
|
|
219
|
+
},
|
|
220
|
+
success: {
|
|
221
|
+
DEFAULT: "var(--sc-success)",
|
|
222
|
+
content: "var(--sc-success-content)",
|
|
223
|
+
},
|
|
224
|
+
danger: {
|
|
225
|
+
DEFAULT: "var(--sc-danger)",
|
|
226
|
+
content: "var(--sc-danger-content)",
|
|
227
|
+
},
|
|
228
|
+
warning: {
|
|
229
|
+
DEFAULT: "var(--sc-warning)",
|
|
230
|
+
content: "var(--sc-warning-content)",
|
|
231
|
+
},
|
|
232
|
+
info: {
|
|
233
|
+
DEFAULT: "var(--sc-info)",
|
|
234
|
+
content: "var(--sc-info-content)",
|
|
235
|
+
},
|
|
236
|
+
contrast: {
|
|
237
|
+
DEFAULT: "var(--sc-contrast)",
|
|
238
|
+
content: "var(--sc-contrast-content)",
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
extend: {
|
|
242
|
+
borderWidth: {
|
|
243
|
+
DEFAULT: "var(--sc-border-width)",
|
|
244
|
+
},
|
|
245
|
+
fontFamily: {
|
|
246
|
+
headings: ["var(--sc-headings-font-family, var(--sc-font-family-base, sans-serif))"],
|
|
247
|
+
body: ["var(--sc-font-family-base)"],
|
|
248
|
+
monospace: ["var(--sc-font-family-monospace, monospace)"],
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
</template>
|
|
252
|
+
</sonic-code>
|
|
90
253
|
|
|
91
|
-
ℹ️ **Note:** Specifically in this case, it may be useful to set the `display` property to `contents`.
|