@supersoniks/concorde 5.0.3 → 5.0.5
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/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-core.bundle.js +515 -521
- package/concorde-core.es.js +5151 -5056
- package/dist/concorde-core.bundle.js +515 -521
- package/dist/concorde-core.es.js +5151 -5056
- package/dist/docs-mock-api-sw.js +2 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/docs/assets/index-CD4WyL6o.css +1 -0
- package/docs/assets/{index-BnK6OS7w.js → index-wVZpLVYW.js} +815 -808
- package/docs/crawl/core/components/ui/alert/alert.html +76 -5
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +113 -5
- package/docs/crawl/core/components/ui/badge/badge.html +57 -8
- package/docs/crawl/core/components/ui/captcha/captcha.html +90 -8
- package/docs/crawl/core/components/ui/card/card.html +122 -12
- package/docs/crawl/core/components/ui/divider/divider.html +117 -31
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +232 -101
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +95 -52
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +97 -38
- package/docs/crawl/core/components/ui/group/group.html +60 -38
- package/docs/crawl/core/components/ui/icon/icon.html +136 -47
- package/docs/crawl/core/components/ui/image/image.html +118 -6
- package/docs/crawl/core/components/ui/link/link.html +65 -7
- package/docs/crawl/core/components/ui/loader/loader.html +97 -23
- package/docs/crawl/core/components/ui/menu/menu.html +162 -90
- package/docs/crawl/core/components/ui/modal/modal.html +275 -50
- package/docs/crawl/core/components/ui/pop/pop.html +242 -124
- package/docs/crawl/core/components/ui/progress/progress.html +103 -30
- package/docs/crawl/core/components/ui/table/table.html +303 -171
- package/docs/crawl/core/components/ui/theme/theme.html +131 -0
- package/docs/crawl/core/components/ui/toast/toast.html +170 -59
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +90 -29
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +3 -2
- package/docs/crawl/docs/_getting-started/start.html +1 -1
- package/docs/crawl/docs/_getting-started/theming.html +311 -63
- package/docs/crawl/hubs/form-components.html +71 -49
- package/docs/crawl/index.html +7 -6
- package/docs/docs-mock-api-sw.js +2 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +6 -4
- package/docs/llms-full.txt +1468 -405
- package/docs/llms.txt +23 -30
- package/docs/sitemap.xml +3 -0
- package/docs/src/core/components/ui/alert/alert.md +21 -2
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/src/core/components/ui/badge/badge.md +19 -6
- package/docs/src/core/components/ui/captcha/captcha.md +65 -6
- package/docs/src/core/components/ui/card/card.md +73 -10
- package/docs/src/core/components/ui/divider/divider.md +107 -13
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/docs/src/core/components/ui/group/group.md +36 -36
- package/docs/src/core/components/ui/icon/icon.md +132 -43
- package/docs/src/core/components/ui/image/image.md +35 -3
- package/docs/src/core/components/ui/link/link.md +43 -5
- package/docs/src/core/components/ui/loader/loader.md +79 -22
- package/docs/src/core/components/ui/menu/menu.md +133 -92
- package/docs/src/core/components/ui/modal/modal.md +163 -47
- package/docs/src/core/components/ui/pop/pop.md +217 -123
- package/docs/src/core/components/ui/progress/progress.md +76 -30
- package/docs/src/core/components/ui/table/table.md +147 -171
- package/docs/src/core/components/ui/theme/theme.md +122 -0
- package/docs/src/core/components/ui/toast/toast.md +108 -58
- package/docs/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/docs/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/docs/src/docs/_getting-started/start.md +1 -1
- package/docs/src/docs/_getting-started/theming.md +223 -61
- package/docs/src/docs/search/docs-search.json +2504 -399
- package/docs/src/tsconfig.json +18 -0
- package/index.html +4 -2
- package/package.json +7 -1
- package/public/docs-mock-api-sw.js +2 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- 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/core/decorators/subscriber/ancestorAttribute.spec.ts +26 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +3 -4
- package/src/core/utils/AncestorAttributeObserver.ts +183 -70
- package/src/docs/_decorators/ancestor-attribute.md +3 -2
- 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 +18 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +19 -0
- package/docs/assets/index--GpD7R7a.css +0 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Link
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Links **navigate** with inherited typography: internal routes, anchors, or external URLs. The default slot is the anchor label. For in-app routing, pair **`href`** with **`pushstate`**; use **`autoActive`** to reflect the current URL on the host (`active`).
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
4
7
|
<sonic-code>
|
|
5
8
|
<template>
|
|
6
9
|
<sonic-link href="/">Basic link with href attribute</sonic-link>
|
|
@@ -8,27 +11,45 @@
|
|
|
8
11
|
</sonic-code>
|
|
9
12
|
|
|
10
13
|
## Target
|
|
14
|
+
|
|
15
|
+
**`target="_blank"`** opens a new browsing context and sets **`rel="noopener noreferrer"`**.
|
|
16
|
+
|
|
11
17
|
<sonic-code>
|
|
12
18
|
<template>
|
|
13
19
|
<sonic-link href="/" target="_blank">Link with target attribute</sonic-link>
|
|
14
20
|
</template>
|
|
15
21
|
</sonic-code>
|
|
16
22
|
|
|
23
|
+
## Pushstate
|
|
24
|
+
|
|
25
|
+
Set **`pushstate`** on same-origin **`href`** values to intercept clicks and navigate through Concorde’s client router without a full reload.
|
|
26
|
+
|
|
27
|
+
<sonic-code>
|
|
28
|
+
<template>
|
|
29
|
+
<sonic-link href="/#core/components" pushstate>Client navigation (pushstate)</sonic-link>
|
|
30
|
+
</template>
|
|
31
|
+
</sonic-code>
|
|
32
|
+
|
|
17
33
|
## AutoActive
|
|
18
34
|
|
|
35
|
+
Default **`autoActive`** is **`partial`**: the host gets **`active`** when the current URL starts with **`href`**. Style with **`[&[active]]:`** utilities or host selectors.
|
|
36
|
+
|
|
19
37
|
<sonic-code>
|
|
20
38
|
<template>
|
|
21
|
-
<sonic-link href="/#core/components"
|
|
39
|
+
<sonic-link href="/#core/components" class="[&[active]]:text-success">autoActive partial (default)</sonic-link>
|
|
22
40
|
</template>
|
|
23
41
|
</sonic-code>
|
|
24
42
|
|
|
25
|
-
### AutoActive
|
|
43
|
+
### AutoActive strict vs partial
|
|
44
|
+
|
|
45
|
+
**`strict`** requires pathname, search, and hash to match. **`strict-path-only`** matches pathname and hash but ignores search.
|
|
26
46
|
|
|
27
47
|
<sonic-code>
|
|
28
48
|
<template>
|
|
29
49
|
<div class="grid gap-3">
|
|
30
50
|
<sonic-link href="/#core" autoActive="strict" class="[&[active]]:text-success">autoActive strict</sonic-link>
|
|
31
|
-
<sonic-link href="/#core/components/ui/link/link.md/link" autoActive="strict" class="[&[active]]:text-success">autoActive strict</sonic-link>
|
|
51
|
+
<sonic-link href="/#core/components/ui/link/link.md/link" autoActive="strict" class="[&[active]]:text-success">autoActive strict (long href)</sonic-link>
|
|
52
|
+
<sonic-link href="/#core/components" autoActive="strict-path-only" class="[&[active]]:text-success">autoActive strict-path-only</sonic-link>
|
|
32
53
|
</div>
|
|
33
54
|
</template>
|
|
34
55
|
</sonic-code>
|
|
@@ -37,7 +58,24 @@
|
|
|
37
58
|
|
|
38
59
|
<sonic-code>
|
|
39
60
|
<template>
|
|
40
|
-
|
|
61
|
+
<sonic-link href="/#core/components/ui/link/link.md/link" autoActive="disabled" class="[&[active]]:text-success">autoActive disabled</sonic-link>
|
|
41
62
|
</template>
|
|
42
63
|
</sonic-code>
|
|
43
64
|
|
|
65
|
+
## Accessibility
|
|
66
|
+
|
|
67
|
+
The inner **`<a>`** uses **`focus-visible`** outline styling. Set **`data-aria-label`** when the slot text is not sufficient on its own.
|
|
68
|
+
|
|
69
|
+
## API reference
|
|
70
|
+
|
|
71
|
+
| Attribute | Values | Description |
|
|
72
|
+
|----------|---------|-------------|
|
|
73
|
+
| `href` | URL | Link target; without **`href`**, only the slot is rendered (no **`<a>`**) |
|
|
74
|
+
| `target` | e.g. `_blank` | Navigation target; **`_blank`** adds **`rel="noopener noreferrer"`** |
|
|
75
|
+
| `pushstate` | boolean | Intercepts click for Concorde client navigation without reload |
|
|
76
|
+
| `autoActive` | `partial` (default) · `strict` · `strict-path-only` · `disabled` | When the host gets the **`active`** attribute (same-origin **`href`** only) |
|
|
77
|
+
| `data-aria-label` | string | Accessible **`aria-label`** when the slot text is not enough |
|
|
78
|
+
|
|
79
|
+
| Slot | Description |
|
|
80
|
+
|------|-------------|
|
|
81
|
+
| *(default)* | Link content (text, icons) |
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
# Loader
|
|
1
|
+
# Loader
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**`sonic-loader`** shows a loading animation in the page or as a viewport overlay. Default **`mode`** is **`fixed`** (centered overlay). Use **`inline`** inside lists and fetch placeholders. Pair **`noDelay`** when the spinner should appear without the default fade-in wait. For **`sonic-fetch`** / **`sonic-list`**, set the parent **`loader`** attribute instead of embedding a tag manually.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
7
|
+
Inline loaders fit content areas; they use the theme primary color unless **`currentColor`** is set.
|
|
4
8
|
|
|
5
9
|
<sonic-code>
|
|
6
10
|
<template>
|
|
@@ -8,48 +12,101 @@
|
|
|
8
12
|
</template>
|
|
9
13
|
</sonic-code>
|
|
10
14
|
|
|
11
|
-
##
|
|
15
|
+
## Mode
|
|
16
|
+
|
|
17
|
+
**`inline`** — ellipsis animation in the document flow. **`fixed`** — centered overlay (`position: fixed`); default when the tag is omitted.
|
|
12
18
|
|
|
13
19
|
<sonic-code>
|
|
14
20
|
<template>
|
|
15
|
-
<sonic-loader mode="inline"
|
|
21
|
+
<sonic-loader mode="inline"></sonic-loader>
|
|
16
22
|
</template>
|
|
17
23
|
</sonic-code>
|
|
18
24
|
|
|
25
|
+
Use the checkbox below to toggle a **`fixed`** loader over the page (default **`mode`** on **`sonic-loader`**).
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
<docs-lit-demo for="docs-toggle-loader-demo"></docs-lit-demo>
|
|
28
|
+
|
|
29
|
+
## Inline alignment and color
|
|
30
|
+
|
|
31
|
+
**`align`** only affects **`mode="inline"`**: **`left`** · **`center`** (default) · **`right`**. Set **`currentColor`** so dots follow the host `color` (for example on a purple parent).
|
|
21
32
|
|
|
22
33
|
<sonic-code>
|
|
23
34
|
<template>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
<div class="grid gap-4">
|
|
36
|
+
<sonic-loader mode="inline" currentColor style="color: purple;"></sonic-loader>
|
|
37
|
+
<div class="flex flex-col gap-2">
|
|
38
|
+
<sonic-loader mode="inline" align="left"></sonic-loader>
|
|
39
|
+
<sonic-loader mode="inline" align="center"></sonic-loader>
|
|
40
|
+
<sonic-loader mode="inline" align="right"></sonic-loader>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
27
43
|
</template>
|
|
28
44
|
</sonic-code>
|
|
29
45
|
|
|
30
|
-
##
|
|
46
|
+
## `noDelay`
|
|
31
47
|
|
|
32
|
-
|
|
48
|
+
By default **`mode="fixed"`** waits briefly before fading in. **`mode="inline"`** already skips that wait. Set **`noDelay`** on **`fixed`** (or pass **`noDelay: true`** to **`Loader.show()`**) to appear immediately.
|
|
33
49
|
|
|
50
|
+
<sonic-code>
|
|
51
|
+
<template>
|
|
52
|
+
<sonic-loader mode="inline" noDelay></sonic-loader>
|
|
53
|
+
</template>
|
|
54
|
+
</sonic-code>
|
|
55
|
+
|
|
56
|
+
## Accessibility (`announce`)
|
|
57
|
+
|
|
58
|
+
The animation is **`aria-hidden`** by default so screen readers are not spammed on every fetch. Set **`announce`** when the loader is injected **after** user action (for example a global overlay): the host gets **`role="status"`**, **`aria-live="polite"`**, and a localized **`aria-label`** (“Loading” / “Chargement en cours”, …). For in-button loading, prefer **`sonic-button`** **`loading`** and **`aria-busy`** on the control—not on the loader.
|
|
34
59
|
|
|
35
|
-
## Loading button
|
|
36
60
|
<sonic-code>
|
|
37
61
|
<template>
|
|
38
|
-
<sonic-
|
|
62
|
+
<sonic-loader mode="inline" announce></sonic-loader>
|
|
39
63
|
</template>
|
|
40
64
|
</sonic-code>
|
|
41
65
|
|
|
42
|
-
##
|
|
66
|
+
## Show and hide programmatically
|
|
67
|
+
|
|
68
|
+
Import **`Loader`** and call **`Loader.show()`** / **`Loader.hide()`**. **`hide()`** is reference-counted: call it once per **`show()`**. With no **`container`**, the loader is appended to the theme pop container and **`mode`** is always **`fixed`**. Pass **`container`** and **`mode: "inline"`** to mount an inline instance in a specific element.
|
|
43
69
|
|
|
44
70
|
<sonic-code language="javascript">
|
|
45
71
|
<template>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
72
|
+
import { Loader } from "@supersoniks/concorde/core/components/ui/loader/loader";
|
|
73
|
+
|
|
74
|
+
Loader.show({
|
|
75
|
+
mode: "fixed",
|
|
76
|
+
noDelay: false,
|
|
77
|
+
announce: true,
|
|
78
|
+
container: document.querySelector("#foo"),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
Loader.hide();
|
|
54
82
|
</template>
|
|
55
|
-
</sonic-code>
|
|
83
|
+
</sonic-code>
|
|
84
|
+
|
|
85
|
+
## Composition
|
|
86
|
+
|
|
87
|
+
**`sonic-button`** **`loading`** shows an icon spinner and sets **`aria-busy`** on the button. **`sonic-fetch`** and **`sonic-list`** render **`sonic-loader`** when their **`loader`** attribute is set: **`true`** or an empty string maps to **`fixed`**; otherwise use **`inline`** or **`fixed`**.
|
|
88
|
+
|
|
89
|
+
<sonic-code>
|
|
90
|
+
<template>
|
|
91
|
+
<sonic-button loading>Save changes</sonic-button>
|
|
92
|
+
</template>
|
|
93
|
+
</sonic-code>
|
|
94
|
+
|
|
95
|
+
## API reference
|
|
96
|
+
|
|
97
|
+
| Attribute | Values | Description |
|
|
98
|
+
|----------|---------|-------------|
|
|
99
|
+
| `mode` | `inline` · `fixed` (default `fixed`) | Layout: in-flow ellipsis vs viewport-centered overlay |
|
|
100
|
+
| `noDelay` | boolean | Skips the initial fade-in delay before the animation appears |
|
|
101
|
+
| `announce` | boolean | **`role="status"`** and **`aria-live="polite"`** with localized loading label when the loader should be announced |
|
|
102
|
+
| `align` | `left` · `center` · `right` | Horizontal alignment for **`mode="inline"`** only (attribute selector; default centered) |
|
|
103
|
+
| `currentColor` | boolean | Uses `currentColor` for dot fill instead of **`--sc-primary`** |
|
|
104
|
+
|
|
105
|
+
This component has **no slots**. The animation markup is internal.
|
|
106
|
+
|
|
107
|
+
### Static methods
|
|
108
|
+
|
|
109
|
+
| Method | Description |
|
|
110
|
+
|--------|-------------|
|
|
111
|
+
| `Loader.show(conf?)` | Mounts the shared loader instance. **`conf.mode`**, **`conf.noDelay`**, **`conf.announce`**, optional **`conf.container`**. Without **`container`**, uses the theme pop container and forces **`fixed`**. |
|
|
112
|
+
| `Loader.hide()` | Decrements the show counter and removes the instance from the DOM when it reaches zero. |
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
# Menu
|
|
2
2
|
|
|
3
|
+
**`sonic-menu`** lays out navigation or actions as a **`direction`** row or column of **`sonic-menu-item`** entries (ghost **`variant`** and block **`shape`** by default), optional **`sonic-divider`** separators, and overflow content in the **`more`** slot (popover “…” trigger). Set **`href`** / **`pushstate`** / **`autoActive`** on each **`sonic-menu-item`**—same API as **`sonic-button`**—not on the menu host.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
7
|
+
<sonic-code>
|
|
8
|
+
<template>
|
|
9
|
+
<sonic-menu direction="row">
|
|
10
|
+
<sonic-menu-item variant="ghost">
|
|
11
|
+
<sonic-icon library="iconoir" name="home" slot="prefix"></sonic-icon>
|
|
12
|
+
Home
|
|
13
|
+
</sonic-menu-item>
|
|
14
|
+
<sonic-menu-item>
|
|
15
|
+
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
16
|
+
Profile
|
|
17
|
+
</sonic-menu-item>
|
|
18
|
+
<sonic-menu-item type="danger">
|
|
19
|
+
<sonic-icon library="iconoir" name="log-out" slot="prefix"></sonic-icon>
|
|
20
|
+
Log out
|
|
21
|
+
</sonic-menu-item>
|
|
22
|
+
</sonic-menu>
|
|
23
|
+
</template>
|
|
24
|
+
</sonic-code>
|
|
25
|
+
|
|
3
26
|
## Direction
|
|
27
|
+
|
|
28
|
+
Default **`direction`** is **`column`**. Use **`row`** for horizontal toolbars or tabs.
|
|
29
|
+
|
|
4
30
|
<sonic-code>
|
|
5
31
|
<template>
|
|
6
|
-
<sonic-menu direction="row"
|
|
32
|
+
<sonic-menu direction="row">
|
|
7
33
|
<sonic-menu-item variant="ghost">
|
|
8
34
|
<sonic-icon library="iconoir" name="arrow-right" slot="prefix"></sonic-icon>
|
|
9
35
|
Row
|
|
@@ -12,11 +38,11 @@
|
|
|
12
38
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
13
39
|
Profile
|
|
14
40
|
</sonic-menu-item>
|
|
15
|
-
<sonic-menu-item
|
|
41
|
+
<sonic-menu-item>
|
|
16
42
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
17
43
|
History
|
|
18
44
|
</sonic-menu-item>
|
|
19
|
-
<sonic-menu-item
|
|
45
|
+
<sonic-menu-item>
|
|
20
46
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
21
47
|
Orders
|
|
22
48
|
</sonic-menu-item>
|
|
@@ -25,7 +51,7 @@
|
|
|
25
51
|
Log out
|
|
26
52
|
</sonic-menu-item>
|
|
27
53
|
</sonic-menu>
|
|
28
|
-
<sonic-menu direction
|
|
54
|
+
<sonic-menu direction="column">
|
|
29
55
|
<sonic-menu-item variant="ghost">
|
|
30
56
|
<sonic-icon library="iconoir" name="arrow-down" slot="prefix"></sonic-icon>
|
|
31
57
|
Column
|
|
@@ -34,11 +60,11 @@
|
|
|
34
60
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
35
61
|
Profile
|
|
36
62
|
</sonic-menu-item>
|
|
37
|
-
|
|
63
|
+
<sonic-menu-item>
|
|
38
64
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
39
65
|
History
|
|
40
66
|
</sonic-menu-item>
|
|
41
|
-
<sonic-menu-item
|
|
67
|
+
<sonic-menu-item>
|
|
42
68
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
43
69
|
Orders
|
|
44
70
|
</sonic-menu-item>
|
|
@@ -51,90 +77,83 @@
|
|
|
51
77
|
</sonic-code>
|
|
52
78
|
|
|
53
79
|
## Size
|
|
80
|
+
|
|
81
|
+
**`size`** on the menu propagates to items and the **`more`** trigger when they omit their own **`size`**.
|
|
82
|
+
|
|
54
83
|
<sonic-code>
|
|
55
84
|
<template>
|
|
56
85
|
<div class="grid gap-3">
|
|
57
86
|
<sonic-menu size="xs" direction="row">
|
|
58
|
-
<sonic-menu-item>
|
|
59
|
-
XS
|
|
60
|
-
</sonic-menu-item>
|
|
87
|
+
<sonic-menu-item>XS</sonic-menu-item>
|
|
61
88
|
<sonic-menu-item>
|
|
62
89
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
63
90
|
Profile
|
|
64
91
|
</sonic-menu-item>
|
|
65
|
-
<sonic-menu-item
|
|
92
|
+
<sonic-menu-item>
|
|
66
93
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
67
94
|
History
|
|
68
95
|
</sonic-menu-item>
|
|
69
|
-
<sonic-menu-item
|
|
96
|
+
<sonic-menu-item>
|
|
70
97
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
71
98
|
Orders
|
|
72
99
|
</sonic-menu-item>
|
|
73
100
|
</sonic-menu>
|
|
74
101
|
<sonic-menu size="sm" direction="row">
|
|
75
|
-
<sonic-menu-item>
|
|
76
|
-
Small
|
|
77
|
-
</sonic-menu-item>
|
|
102
|
+
<sonic-menu-item>Small</sonic-menu-item>
|
|
78
103
|
<sonic-menu-item>
|
|
79
104
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
80
105
|
Profile
|
|
81
106
|
</sonic-menu-item>
|
|
82
|
-
<sonic-menu-item
|
|
107
|
+
<sonic-menu-item>
|
|
83
108
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
84
109
|
History
|
|
85
110
|
</sonic-menu-item>
|
|
86
|
-
<sonic-menu-item
|
|
111
|
+
<sonic-menu-item>
|
|
87
112
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
88
113
|
Orders
|
|
89
114
|
</sonic-menu-item>
|
|
90
115
|
</sonic-menu>
|
|
91
116
|
<sonic-menu direction="row">
|
|
92
|
-
<sonic-menu-item>
|
|
93
|
-
Medium
|
|
94
|
-
</sonic-menu-item>
|
|
117
|
+
<sonic-menu-item>Medium</sonic-menu-item>
|
|
95
118
|
<sonic-menu-item>
|
|
96
119
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
97
120
|
Profile
|
|
98
121
|
</sonic-menu-item>
|
|
99
|
-
<sonic-menu-item
|
|
122
|
+
<sonic-menu-item>
|
|
100
123
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
101
124
|
History
|
|
102
125
|
</sonic-menu-item>
|
|
103
|
-
<sonic-menu-item
|
|
126
|
+
<sonic-menu-item>
|
|
104
127
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
105
128
|
Orders
|
|
106
129
|
</sonic-menu-item>
|
|
107
130
|
</sonic-menu>
|
|
108
131
|
<sonic-menu size="lg" direction="row">
|
|
109
|
-
<sonic-menu-item>
|
|
110
|
-
Large
|
|
111
|
-
</sonic-menu-item>
|
|
132
|
+
<sonic-menu-item>Large</sonic-menu-item>
|
|
112
133
|
<sonic-menu-item>
|
|
113
134
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
114
135
|
Profile
|
|
115
136
|
</sonic-menu-item>
|
|
116
|
-
<sonic-menu-item
|
|
137
|
+
<sonic-menu-item>
|
|
117
138
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
118
139
|
History
|
|
119
140
|
</sonic-menu-item>
|
|
120
|
-
<sonic-menu-item
|
|
141
|
+
<sonic-menu-item>
|
|
121
142
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
122
143
|
Orders
|
|
123
144
|
</sonic-menu-item>
|
|
124
145
|
</sonic-menu>
|
|
125
146
|
<sonic-menu size="xl" direction="row">
|
|
126
|
-
<sonic-menu-item>
|
|
127
|
-
XL
|
|
128
|
-
</sonic-menu-item>
|
|
147
|
+
<sonic-menu-item>XL</sonic-menu-item>
|
|
129
148
|
<sonic-menu-item>
|
|
130
149
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
131
150
|
Profile
|
|
132
151
|
</sonic-menu-item>
|
|
133
|
-
<sonic-menu-item
|
|
152
|
+
<sonic-menu-item>
|
|
134
153
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
135
154
|
History
|
|
136
155
|
</sonic-menu-item>
|
|
137
|
-
<sonic-menu-item
|
|
156
|
+
<sonic-menu-item>
|
|
138
157
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
139
158
|
Orders
|
|
140
159
|
</sonic-menu-item>
|
|
@@ -144,72 +163,73 @@
|
|
|
144
163
|
</sonic-code>
|
|
145
164
|
|
|
146
165
|
## Shadow
|
|
166
|
+
|
|
167
|
+
Optional **`shadow`** wraps the menu surface (no shadow when omitted).
|
|
168
|
+
|
|
147
169
|
<sonic-code>
|
|
148
170
|
<template>
|
|
149
171
|
<div class="grid gap-3">
|
|
150
172
|
<sonic-menu direction="row">
|
|
151
|
-
<sonic-menu-item>
|
|
152
|
-
None
|
|
153
|
-
</sonic-menu-item>
|
|
173
|
+
<sonic-menu-item>None</sonic-menu-item>
|
|
154
174
|
</sonic-menu>
|
|
155
175
|
<sonic-menu shadow="sm" direction="row">
|
|
156
|
-
<sonic-menu-item>
|
|
157
|
-
Small
|
|
158
|
-
</sonic-menu-item>
|
|
176
|
+
<sonic-menu-item>Small</sonic-menu-item>
|
|
159
177
|
</sonic-menu>
|
|
160
178
|
<sonic-menu shadow="md" direction="row">
|
|
161
|
-
<sonic-menu-item>
|
|
162
|
-
Medium
|
|
163
|
-
</sonic-menu-item>
|
|
179
|
+
<sonic-menu-item>Medium</sonic-menu-item>
|
|
164
180
|
</sonic-menu>
|
|
165
181
|
<sonic-menu shadow="lg" direction="row">
|
|
166
|
-
<sonic-menu-item>
|
|
167
|
-
Large
|
|
168
|
-
</sonic-menu-item>
|
|
182
|
+
<sonic-menu-item>Large</sonic-menu-item>
|
|
169
183
|
</sonic-menu>
|
|
170
184
|
</div>
|
|
171
185
|
</template>
|
|
172
186
|
</sonic-code>
|
|
173
187
|
|
|
174
188
|
## Align
|
|
189
|
+
|
|
190
|
+
**`align`** propagates to items except square / circle **`shape`**.
|
|
191
|
+
|
|
175
192
|
<sonic-code>
|
|
176
193
|
<template>
|
|
177
|
-
<
|
|
178
|
-
<sonic-menu
|
|
179
|
-
<sonic-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
<sonic-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
<sonic-menu
|
|
189
|
-
<sonic-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
<sonic-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
<sonic-menu
|
|
199
|
-
<sonic-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
<sonic-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
194
|
+
<div class="grid gap-3">
|
|
195
|
+
<sonic-menu align="center">
|
|
196
|
+
<sonic-menu-item variant="ghost">
|
|
197
|
+
<sonic-icon library="iconoir" name="home"></sonic-icon>
|
|
198
|
+
Home
|
|
199
|
+
</sonic-menu-item>
|
|
200
|
+
<sonic-menu-item>
|
|
201
|
+
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
202
|
+
Profile
|
|
203
|
+
</sonic-menu-item>
|
|
204
|
+
</sonic-menu>
|
|
205
|
+
<sonic-menu align="left">
|
|
206
|
+
<sonic-menu-item variant="ghost">
|
|
207
|
+
<sonic-icon library="iconoir" name="home"></sonic-icon>
|
|
208
|
+
Home
|
|
209
|
+
</sonic-menu-item>
|
|
210
|
+
<sonic-menu-item>
|
|
211
|
+
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
212
|
+
Profile
|
|
213
|
+
</sonic-menu-item>
|
|
214
|
+
</sonic-menu>
|
|
215
|
+
<sonic-menu align="right">
|
|
216
|
+
<sonic-menu-item variant="ghost">
|
|
217
|
+
<sonic-icon library="iconoir" name="home"></sonic-icon>
|
|
218
|
+
Home
|
|
219
|
+
</sonic-menu-item>
|
|
220
|
+
<sonic-menu-item>
|
|
221
|
+
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
222
|
+
Profile
|
|
223
|
+
</sonic-menu-item>
|
|
224
|
+
</sonic-menu>
|
|
225
|
+
</div>
|
|
207
226
|
</template>
|
|
208
227
|
</sonic-code>
|
|
209
228
|
|
|
229
|
+
## More
|
|
210
230
|
|
|
231
|
+
Assign nodes to **`slot="more"`** to show the overflow popover. The trigger appears only when the slot has content. Icon orientation follows **`direction`** (vertical ellipsis in a row menu).
|
|
211
232
|
|
|
212
|
-
## More
|
|
213
233
|
<sonic-code>
|
|
214
234
|
<template>
|
|
215
235
|
<sonic-menu direction="row">
|
|
@@ -221,20 +241,20 @@
|
|
|
221
241
|
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
222
242
|
Profile
|
|
223
243
|
</sonic-menu-item>
|
|
224
|
-
<sonic-menu-item
|
|
244
|
+
<sonic-menu-item>
|
|
225
245
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
226
246
|
History
|
|
227
247
|
</sonic-menu-item>
|
|
228
|
-
<sonic-menu-item
|
|
248
|
+
<sonic-menu-item>
|
|
229
249
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
230
250
|
Orders
|
|
231
251
|
</sonic-menu-item>
|
|
232
252
|
<sonic-menu slot="more">
|
|
233
|
-
<sonic-menu-item
|
|
253
|
+
<sonic-menu-item>
|
|
234
254
|
<sonic-icon library="iconoir" name="settings" slot="prefix"></sonic-icon>
|
|
235
255
|
Settings
|
|
236
256
|
</sonic-menu-item>
|
|
237
|
-
<sonic-menu-item
|
|
257
|
+
<sonic-menu-item>
|
|
238
258
|
<sonic-icon library="iconoir" name="chat-bubble" slot="prefix"></sonic-icon>
|
|
239
259
|
Messages
|
|
240
260
|
</sonic-menu-item>
|
|
@@ -249,6 +269,9 @@
|
|
|
249
269
|
</sonic-code>
|
|
250
270
|
|
|
251
271
|
## Scrollable
|
|
272
|
+
|
|
273
|
+
With **`scrollable`**, the main slot scrolls with edge fade masks; drag-to-scroll works on pointer devices. When exactly one item is **`active`**, the menu scrolls it into view.
|
|
274
|
+
|
|
252
275
|
<sonic-code>
|
|
253
276
|
<template>
|
|
254
277
|
<sonic-menu direction="row" scrollable>
|
|
@@ -260,14 +283,15 @@
|
|
|
260
283
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
261
284
|
Profile
|
|
262
285
|
</sonic-menu-item>
|
|
263
|
-
<sonic-menu-item
|
|
286
|
+
<sonic-menu-item>
|
|
264
287
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
265
288
|
History
|
|
266
289
|
</sonic-menu-item>
|
|
267
|
-
<sonic-menu-item
|
|
290
|
+
<sonic-menu-item>
|
|
268
291
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
269
292
|
Orders
|
|
270
|
-
</sonic-menu-item>
|
|
293
|
+
</sonic-menu-item>
|
|
294
|
+
<sonic-menu-item variant="ghost">
|
|
271
295
|
<sonic-icon library="iconoir" name="home" slot="prefix"></sonic-icon>
|
|
272
296
|
Home
|
|
273
297
|
</sonic-menu-item>
|
|
@@ -275,14 +299,15 @@
|
|
|
275
299
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
276
300
|
Profile
|
|
277
301
|
</sonic-menu-item>
|
|
278
|
-
<sonic-menu-item
|
|
302
|
+
<sonic-menu-item>
|
|
279
303
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
280
304
|
History
|
|
281
305
|
</sonic-menu-item>
|
|
282
|
-
<sonic-menu-item
|
|
306
|
+
<sonic-menu-item>
|
|
283
307
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
284
308
|
Orders
|
|
285
|
-
</sonic-menu-item>
|
|
309
|
+
</sonic-menu-item>
|
|
310
|
+
<sonic-menu-item variant="ghost">
|
|
286
311
|
<sonic-icon library="iconoir" name="home" slot="prefix"></sonic-icon>
|
|
287
312
|
Home
|
|
288
313
|
</sonic-menu-item>
|
|
@@ -290,28 +315,28 @@
|
|
|
290
315
|
<sonic-icon library="iconoir" name="user" slot="prefix"></sonic-icon>
|
|
291
316
|
Profile
|
|
292
317
|
</sonic-menu-item>
|
|
293
|
-
<sonic-menu-item
|
|
318
|
+
<sonic-menu-item>
|
|
294
319
|
<sonic-icon library="iconoir" name="clock-outline" slot="prefix"></sonic-icon>
|
|
295
320
|
History
|
|
296
321
|
</sonic-menu-item>
|
|
297
|
-
<sonic-menu-item
|
|
322
|
+
<sonic-menu-item>
|
|
298
323
|
<sonic-icon library="iconoir" name="bag" slot="prefix"></sonic-icon>
|
|
299
324
|
Orders
|
|
300
325
|
</sonic-menu-item>
|
|
301
|
-
<sonic-menu-item
|
|
326
|
+
<sonic-menu-item>
|
|
302
327
|
<sonic-icon library="iconoir" name="settings" slot="prefix"></sonic-icon>
|
|
303
328
|
Settings
|
|
304
329
|
</sonic-menu-item>
|
|
305
|
-
<sonic-menu-item
|
|
330
|
+
<sonic-menu-item>
|
|
306
331
|
<sonic-icon library="iconoir" name="chat-bubble" slot="prefix"></sonic-icon>
|
|
307
332
|
Messages
|
|
308
333
|
</sonic-menu-item>
|
|
309
334
|
<sonic-menu slot="more">
|
|
310
|
-
<sonic-menu-item
|
|
335
|
+
<sonic-menu-item>
|
|
311
336
|
<sonic-icon library="iconoir" name="settings" slot="prefix"></sonic-icon>
|
|
312
337
|
Settings
|
|
313
338
|
</sonic-menu-item>
|
|
314
|
-
<sonic-menu-item
|
|
339
|
+
<sonic-menu-item>
|
|
315
340
|
<sonic-icon library="iconoir" name="chat-bubble" slot="prefix"></sonic-icon>
|
|
316
341
|
Messages
|
|
317
342
|
</sonic-menu-item>
|
|
@@ -321,9 +346,25 @@
|
|
|
321
346
|
Log out
|
|
322
347
|
</sonic-menu-item>
|
|
323
348
|
</sonic-menu>
|
|
324
|
-
|
|
349
|
+
</sonic-menu>
|
|
325
350
|
</template>
|
|
326
351
|
</sonic-code>
|
|
327
352
|
|
|
353
|
+
## API reference
|
|
354
|
+
|
|
355
|
+
| Attribute | Values | Description |
|
|
356
|
+
|----------|---------|-------------|
|
|
357
|
+
| `direction` | `column` (default) · `row` | Vertical list or horizontal bar |
|
|
358
|
+
| `align` | `left` (default) · `center` · `right` | Alignment propagated to items (except square / circle **`shape`**) |
|
|
359
|
+
| `size` | `xs` · `sm` · `md` · `lg` · `xl` | Propagated to items and the **`more`** trigger when unset on the item |
|
|
360
|
+
| `shadow` | `sm` · `md` · `lg` | Shadow around the menu; omitted for none |
|
|
361
|
+
| `minWidth` | CSS length | Minimum width of the container (default `0`) |
|
|
362
|
+
| `scrollable` | boolean | Scroll with edge fade; auto-scroll when a single item is **`active`** |
|
|
363
|
+
| `moreShape` | `circle` (default) · `square` | Shape of the **`more`** slot trigger button |
|
|
364
|
+
|
|
365
|
+
| Slot | Description |
|
|
366
|
+
|------|-------------|
|
|
367
|
+
| *(default)* | Visible items: **`sonic-menu-item`**, **`sonic-divider`**, nested **`sonic-menu`** |
|
|
368
|
+
| `more` | Popover content for the “…” control; shown only when the slot has assigned nodes |
|
|
328
369
|
|
|
329
|
-
|
|
370
|
+
**`sonic-menu-item`** extends **`sonic-button`** (defaults: **`variant="ghost"`**, **`shape="block"`**). Use the button docs for **`type`**, **`variant`**, **`href`**, **`pushstate`**, **`autoActive`**, and item slots.
|