@supersoniks/concorde 5.0.4 → 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 +528 -534
- package/concorde-core.es.js +4257 -4212
- package/dist/concorde-core.bundle.js +528 -534
- package/dist/concorde-core.es.js +4257 -4212
- 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-D8MVWqY6.js → index-wVZpLVYW.js} +1221 -1350
- package/docs/crawl/core/components/ui/alert/alert.html +172 -71
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +113 -5
- package/docs/crawl/core/components/ui/badge/badge.html +157 -79
- package/docs/crawl/core/components/ui/button/button.html +1 -0
- package/docs/crawl/core/components/ui/captcha/captcha.html +90 -8
- package/docs/crawl/core/components/ui/card/card.html +222 -68
- 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/form/input/input.html +3 -3
- package/docs/crawl/core/components/ui/form/textarea/textarea.html +3 -3
- 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 +244 -56
- package/docs/crawl/core/components/ui/link/link.html +67 -9
- 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 +260 -66
- 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/concorde-outside.html +3 -3
- 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 +75 -53
- 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 +9 -7
- package/docs/llms-full.txt +1703 -456
- package/docs/llms.txt +25 -32
- package/docs/sitemap.xml +3 -0
- package/docs/src/core/components/functional/fetch/fetch.md +0 -0
- package/docs/src/core/components/functional/if/if.md +0 -0
- package/docs/src/core/components/functional/list/list.md +0 -0
- package/docs/src/core/components/functional/router/router.md +0 -0
- package/docs/src/core/components/functional/sdui/sdui.md +0 -0
- package/docs/src/core/components/functional/states/states.md +0 -0
- package/docs/src/core/components/functional/submit/submit.md +0 -0
- package/docs/src/core/components/ui/alert/alert.md +147 -72
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/src/core/components/ui/badge/badge.md +141 -80
- package/docs/src/core/components/ui/button/button.md +1 -0
- package/docs/src/core/components/ui/captcha/captcha.md +65 -6
- package/docs/src/core/components/ui/card/card.md +183 -65
- 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/form/input/input.md +1 -1
- package/docs/src/core/components/ui/form/radio/radio.md +0 -0
- package/docs/src/core/components/ui/form/select/select.md +0 -0
- package/docs/src/core/components/ui/form/switch/switch.md +0 -0
- package/docs/src/core/components/ui/form/textarea/textarea.md +1 -1
- 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 +179 -53
- package/docs/src/core/components/ui/link/link.md +45 -7
- 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 +262 -64
- 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/_core-concept/subscriber.md +0 -0
- package/docs/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/docs/src/docs/_getting-started/concorde-outside.md +3 -3
- package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -0
- package/docs/src/docs/_getting-started/pubsub.md +0 -0
- 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 +3083 -348
- package/docs/src/tsconfig.json +63 -3
- package/gitlab/job_tests.sh +0 -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/scripts/post-build-docs.js +0 -0
- package/scripts/post-build.mjs +0 -0
- package/src/core/components/functional/fetch/fetch.md +0 -0
- package/src/core/components/functional/if/if.md +0 -0
- package/src/core/components/functional/list/list.demo.ts +0 -0
- package/src/core/components/functional/list/list.md +0 -0
- package/src/core/components/functional/router/router.md +0 -0
- package/src/core/components/functional/router/router.ts +0 -0
- package/src/core/components/functional/sdui/sdui.md +0 -0
- package/src/core/components/functional/states/states.md +0 -0
- package/src/core/components/functional/submit/submit.md +0 -0
- package/src/core/components/functional/subscriber/subscriber.ts +0 -0
- package/src/core/components/ui/_css/align.ts +1 -0
- package/src/core/components/ui/_css/size.ts +0 -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/altchaStyles.ts +0 -0
- 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/radio/radio.md +0 -0
- package/src/core/components/ui/form/select/select.md +0 -0
- package/src/core/components/ui/form/switch/switch.md +0 -0
- 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/mixins/Subscriber.ts +0 -0
- package/src/core/utils/DataBindObserver.ts +0 -0
- package/src/core/utils/Objects.ts +0 -0
- package/src/core/utils/route.ts +0 -0
- package/src/docs/_core-concept/subscriber.md +0 -0
- package/src/docs/_getting-started/my-first-subscriber.md +0 -0
- package/src/docs/_getting-started/pubsub.md +0 -0
- 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/example/users.ts +0 -0
- 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/page.ts +0 -0
- 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/.github/workflows/ci.yml +0 -21
- package/.github-export-ignore +0 -30
- package/CONTRIBUTING.md +0 -59
- package/DEV.md +0 -54
- package/LICENSE +0 -21
- package/OPEN_SOURCE_CHECKPOINT.md +0 -133
- package/docs/assets/index-DiD0qYvE.css +0 -1
- package/docs/src/tsconfig.declarations.json +0 -22
- package/docs/src/tsconfig.emit.json +0 -23
- package/gitlab/job_github_mirror.sh +0 -39
- package/scripts/github-export.mjs +0 -150
- package/src/css.d.ts +0 -19
- package/src/tsconfig.declarations.json +0 -22
- package/src/tsconfig.emit.json +0 -23
|
@@ -1,68 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
# Modal
|
|
2
|
+
|
|
3
|
+
**`sonic-modal`** presents focused content in a `<dialog>` overlay with backdrop, enter/exit animation, and a built-in close control. Compose **`sonic-modal-title`** / **`sonic-modal-subtitle`** / **`sonic-modal-content`** / **`sonic-modal-actions`**, or use the default slot. Call **`show()`** on the element to open; use **`hideModal`** on action buttons or **`hide()`** from script. Set **`forceAction`** when dismissal must go through explicit actions only. Imperative dialogs: **`Modal.create()`** (also **`window.SonicModal`**).
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
7
|
+
Click the trigger to open. **`sonic-modal-actions`** lays out footer buttons; **`hideModal`** closes the modal on click. Scope form state with **`formDataProvider`** on **`sonic-modal-actions`** so child **`sonic-button`** elements share one publisher.
|
|
2
8
|
|
|
3
9
|
<sonic-code>
|
|
4
10
|
<template>
|
|
5
11
|
<sonic-button onclick="document.getElementById('modalExample').show()">
|
|
6
|
-
|
|
12
|
+
Open modal
|
|
7
13
|
</sonic-button>
|
|
8
14
|
<sonic-modal id="modalExample">
|
|
9
|
-
<sonic-modal-title
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
<sonic-modal-title>
|
|
16
|
+
Export ready
|
|
17
|
+
<sonic-badge type="success" size="sm">New</sonic-badge>
|
|
18
|
+
</sonic-modal-title>
|
|
19
|
+
<sonic-modal-subtitle>Your report finished processing.</sonic-modal-subtitle>
|
|
13
20
|
<sonic-modal-content>
|
|
14
|
-
|
|
21
|
+
Download the CSV now or review the summary in your dashboard before sharing.
|
|
15
22
|
</sonic-modal-content>
|
|
16
23
|
<sonic-modal-actions formDataProvider="ModalMiniForm">
|
|
17
|
-
<sonic-button
|
|
18
|
-
|
|
24
|
+
<sonic-button minWidth="8rem" value="true" name="click">
|
|
25
|
+
Save draft
|
|
19
26
|
</sonic-button>
|
|
20
|
-
<sonic-button minWidth="8rem" type="success" hideModal>
|
|
27
|
+
<sonic-button minWidth="8rem" type="success" hideModal>Download</sonic-button>
|
|
21
28
|
</sonic-modal-actions>
|
|
22
29
|
</sonic-modal>
|
|
23
30
|
</template>
|
|
24
31
|
</sonic-code>
|
|
25
32
|
|
|
33
|
+
## Scrollable content
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
Long copy scrolls inside the dialog. Default **`maxHeight`** is `90vh`. Default **`align`** is `left`.
|
|
28
36
|
|
|
29
37
|
<sonic-code>
|
|
30
38
|
<template>
|
|
31
|
-
<sonic-button onclick="document.getElementById('modalText').show()">
|
|
39
|
+
<sonic-button onclick="document.getElementById('modalText').show()">Venue details</sonic-button>
|
|
32
40
|
<sonic-modal align="left" id="modalText">
|
|
33
|
-
<sonic-modal-title>
|
|
41
|
+
<sonic-modal-title>Hours and tickets</sonic-modal-title>
|
|
34
42
|
<sonic-modal-content>
|
|
35
43
|
<div class="prose">
|
|
36
44
|
<p>
|
|
37
|
-
<strong>
|
|
38
|
-
|
|
39
|
-
+ horaires spécifiques pour événements ou festivals
|
|
45
|
+
<strong>Opening hours</strong><br />
|
|
46
|
+
Wednesday–Saturday, 1:30 p.m.–7:00 p.m.; Sunday, 1:30 p.m.–6:00 p.m.
|
|
40
47
|
</p>
|
|
41
48
|
<p>
|
|
42
|
-
<strong>
|
|
43
|
-
|
|
44
|
-
réservations disponibles en ligne ou au guichet. <strong><br /></strong>
|
|
49
|
+
<strong>Ticketing</strong><br />
|
|
50
|
+
Some events require online or box-office reservations. Prices vary by event; booking ahead is recommended when capacity is limited.
|
|
45
51
|
</p>
|
|
46
52
|
<p>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
conseillé de réserver les billets en avance pour s’assurer une place.
|
|
53
|
+
<strong>Contact</strong><br />
|
|
54
|
+
tickets@example.com · +33 3 28 33 48 33
|
|
50
55
|
</p>
|
|
51
56
|
<p>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<p>
|
|
56
|
-
<strong>+ d’infos <br /></strong>billetterie@laconditionpublique.com <br />+33 (0)328334833
|
|
57
|
-
</p>
|
|
58
|
-
<br />
|
|
59
|
-
<p>
|
|
60
|
-
<strong>Accès <br /></strong>14, place Faidherbe <br />59100 Roubaix <br />Métro / Tram : Arrêt
|
|
61
|
-
Eurotéléport, Ligne 2 <br />Bus / V’Lille : Arrêt Condition Publique
|
|
62
|
-
</p>
|
|
63
|
-
<p>
|
|
64
|
-
Accès handicapés : nous contacter avant votre venue au 03 28 33 48 33 ou par mail
|
|
65
|
-
billetterie@laconditionpublique.com
|
|
57
|
+
<strong>Access</strong><br />
|
|
58
|
+
14 Place Faidherbe, 59100 Roubaix<br />
|
|
59
|
+
Metro line 2, Eurotéléport stop
|
|
66
60
|
</p>
|
|
67
61
|
</div>
|
|
68
62
|
</sonic-modal-content>
|
|
@@ -72,33 +66,44 @@
|
|
|
72
66
|
|
|
73
67
|
## Force action
|
|
74
68
|
|
|
69
|
+
With **`forceAction`**, backdrop click, Escape, and the default close button are disabled. Provide **`sonic-modal-actions`** (or **`sonic-modal-close`**) so users can finish the flow.
|
|
70
|
+
|
|
75
71
|
<sonic-code>
|
|
76
72
|
<template>
|
|
77
|
-
<sonic-button onclick="document.getElementById('force').show()">
|
|
73
|
+
<sonic-button onclick="document.getElementById('force').show()">Cookie consent</sonic-button>
|
|
78
74
|
<sonic-modal forceAction id="force">
|
|
79
|
-
<sonic-modal-title>
|
|
75
|
+
<sonic-modal-title>Allow analytics cookies?</sonic-modal-title>
|
|
80
76
|
<sonic-modal-content>
|
|
81
|
-
|
|
77
|
+
We use cookies to measure traffic and improve the product. You can change this later in settings.
|
|
82
78
|
</sonic-modal-content>
|
|
83
|
-
<sonic-modal-actions
|
|
84
|
-
<sonic-button hideModal minWidth="8rem">
|
|
85
|
-
<sonic-button hideModal minWidth="8rem" type="success">
|
|
79
|
+
<sonic-modal-actions>
|
|
80
|
+
<sonic-button hideModal minWidth="8rem">Decline</sonic-button>
|
|
81
|
+
<sonic-button hideModal minWidth="8rem" type="success">Accept</sonic-button>
|
|
86
82
|
</sonic-modal-actions>
|
|
87
83
|
</sonic-modal>
|
|
88
|
-
</sonic-modal>
|
|
89
84
|
</template>
|
|
90
85
|
</sonic-code>
|
|
91
86
|
|
|
92
87
|
## Custom dimensions
|
|
93
88
|
|
|
89
|
+
Set **`width`** / **`height`** / **`maxWidth`** / **`maxHeight`** (CSS lengths). On narrow viewports the panel becomes a bottom sheet. Use **`rounded="none"`** for edge-to-edge media.
|
|
90
|
+
|
|
94
91
|
<sonic-code>
|
|
95
92
|
<template>
|
|
96
|
-
<sonic-button onclick="document.getElementById('CustomWidth').show()">
|
|
97
|
-
<sonic-modal
|
|
93
|
+
<sonic-button onclick="document.getElementById('CustomWidth').show()">Image preview</sonic-button>
|
|
94
|
+
<sonic-modal
|
|
95
|
+
rounded="none"
|
|
96
|
+
maxHeight="50vh"
|
|
97
|
+
maxWidth="90vw"
|
|
98
|
+
width="100%"
|
|
99
|
+
height="100%"
|
|
100
|
+
id="CustomWidth"
|
|
101
|
+
>
|
|
98
102
|
<sonic-image
|
|
99
103
|
cover
|
|
100
104
|
objectPosition="center 20%"
|
|
101
105
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
106
|
+
alt="View from an airplane window"
|
|
102
107
|
></sonic-image>
|
|
103
108
|
</sonic-modal>
|
|
104
109
|
</template>
|
|
@@ -106,14 +111,125 @@
|
|
|
106
111
|
|
|
107
112
|
## Fullscreen
|
|
108
113
|
|
|
114
|
+
**`fullscreen`** fills the viewport and hides the backdrop.
|
|
115
|
+
|
|
109
116
|
<sonic-code>
|
|
110
117
|
<template>
|
|
111
|
-
<sonic-button onclick="document.getElementById('Fullscreen').show()">
|
|
118
|
+
<sonic-button onclick="document.getElementById('Fullscreen').show()">Fullscreen</sonic-button>
|
|
112
119
|
<sonic-modal fullscreen id="Fullscreen">
|
|
113
120
|
<sonic-image
|
|
114
121
|
cover
|
|
115
122
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
123
|
+
alt="View from an airplane window"
|
|
116
124
|
></sonic-image>
|
|
117
125
|
</sonic-modal>
|
|
118
126
|
</template>
|
|
119
|
-
</sonic-code>
|
|
127
|
+
</sonic-code>
|
|
128
|
+
|
|
129
|
+
## Programmatic creation
|
|
130
|
+
|
|
131
|
+
Use **`Modal.create(options)`** when there is no modal in the template—for confirmations, toasts that need a follow-up, or one-off flows from script. The modal is appended to the nearest **`sonic-theme`** pop container (same as declarative modals), opened automatically, and returns the **`sonic-modal`** instance. Set **`removeOnHide: true`** to detach it from the DOM after close. In the browser, **`window.SonicModal`** is the same class after the module loads.
|
|
132
|
+
|
|
133
|
+
Pass **`title`** / **`subtitle`** / **`content`** / **`actions`** as HTML strings (or Lit template results from application code). Put **`hideModal`** on action buttons in the **`actions`** string so clicks close the dialog.
|
|
134
|
+
|
|
135
|
+
<sonic-code>
|
|
136
|
+
<template>
|
|
137
|
+
<sonic-button
|
|
138
|
+
onclick="window.SonicModal.create({
|
|
139
|
+
title: 'Send invite?',
|
|
140
|
+
subtitle: 'The recipient can join immediately.',
|
|
141
|
+
content: 'We will email an invitation to alex@example.com.',
|
|
142
|
+
actions: '<sonic-button hideModal minWidth=\'8rem\'>Cancel</sonic-button><sonic-button hideModal minWidth=\'8rem\' type=\'success\'>Send</sonic-button>',
|
|
143
|
+
removeOnHide: true
|
|
144
|
+
})"
|
|
145
|
+
>
|
|
146
|
+
Open programmatic modal
|
|
147
|
+
</sonic-button>
|
|
148
|
+
</template>
|
|
149
|
+
</sonic-code>
|
|
150
|
+
|
|
151
|
+
<sonic-code language="javascript">
|
|
152
|
+
<template>
|
|
153
|
+
import { Modal } from "@supersoniks/concorde/core/components/ui/modal/modal";
|
|
154
|
+
|
|
155
|
+
const modal = Modal.create({
|
|
156
|
+
title: "Delete project?",
|
|
157
|
+
subtitle: "This cannot be undone.",
|
|
158
|
+
content: "<p>All files in <strong>Acme HQ</strong> will be removed.</p>",
|
|
159
|
+
actions: `
|
|
160
|
+
<sonic-button hideModal minWidth="8rem">Cancel</sonic-button>
|
|
161
|
+
<sonic-button hideModal minWidth="8rem" type="danger">Delete</sonic-button>
|
|
162
|
+
`,
|
|
163
|
+
removeOnHide: true,
|
|
164
|
+
forceAction: false,
|
|
165
|
+
maxWidth: "min(100vw, 28rem)",
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
modal.addEventListener("hidden", () => {
|
|
169
|
+
console.log("Modal removed from the DOM");
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// Or close from script: await modal.hide(); await modal.dispose();
|
|
173
|
+
</template>
|
|
174
|
+
</sonic-code>
|
|
175
|
+
|
|
176
|
+
## API reference
|
|
177
|
+
|
|
178
|
+
### `sonic-modal`
|
|
179
|
+
|
|
180
|
+
| Attribute | Values | Description |
|
|
181
|
+
|----------|---------|-------------|
|
|
182
|
+
| `align` | `left` (default) · `center` · `right` | Align title and slotted content |
|
|
183
|
+
| `maxWidth` | CSS length (default `min(100vw, 40rem)`) | Dialog max width |
|
|
184
|
+
| `maxHeight` | CSS length (default `90vh`) | Scrollable body max height |
|
|
185
|
+
| `width` | CSS length (default `100%`) | Dialog width |
|
|
186
|
+
| `height` | CSS length (default `fit-content`) | Dialog height |
|
|
187
|
+
| `paddingX` · `paddingY` | CSS length | Override content padding (`--sc-modal-px` / `--sc-modal-py`) |
|
|
188
|
+
| `zIndex` | CSS number | Stacking order (default `990`) |
|
|
189
|
+
| `effect` | `slide` (default) · `fade` · `none` | Open/close animation |
|
|
190
|
+
| `fullscreen` | boolean | Full viewport; no backdrop |
|
|
191
|
+
| `forceAction` | boolean | Disable overlay, Escape, and default close button |
|
|
192
|
+
| `noCloseButton` | boolean | Hide built-in close when not **`forceAction`** |
|
|
193
|
+
| `closeButtonType` | **`sonic-button`** `type` | Style of built-in close |
|
|
194
|
+
| `visible` | boolean | When toggled, opens or closes the dialog |
|
|
195
|
+
| `removeOnHide` | boolean | Remove element from DOM after close |
|
|
196
|
+
| `removeHashOnHide` | boolean | Clear URL hash on close |
|
|
197
|
+
| `closeOnLocationChange` | boolean | Close when app location changes |
|
|
198
|
+
| `resetDataProviderOnHide` | string | Reset named **`formDataProvider`** on close |
|
|
199
|
+
| `rounded` | `none` | Square dialog corners (useful for full-bleed media) |
|
|
200
|
+
|
|
201
|
+
| Slot | Description |
|
|
202
|
+
|------|-------------|
|
|
203
|
+
| *(default)* | Additional markup alongside structured children |
|
|
204
|
+
|
|
205
|
+
| Event | Description |
|
|
206
|
+
|-------|-------------|
|
|
207
|
+
| `show` | Fired when open animation completes |
|
|
208
|
+
| `hide` | Fired when close starts |
|
|
209
|
+
| `hidden` | Fired when close finishes |
|
|
210
|
+
|
|
211
|
+
Methods: **`show()`** · **`hide()`** · **`dispose()`** (hide and remove). Static **`Modal.create(options)`** appends a modal to the theme pop container and opens it. **`options`** / **`styleSheet`** are JavaScript-only.
|
|
212
|
+
|
|
213
|
+
### `sonic-modal-title` · `sonic-modal-subtitle` · `sonic-modal-content`
|
|
214
|
+
|
|
215
|
+
| Slot | Description |
|
|
216
|
+
|------|-------------|
|
|
217
|
+
| *(default)* | Title, subtitle, or main body content |
|
|
218
|
+
|
|
219
|
+
### `sonic-modal-actions`
|
|
220
|
+
|
|
221
|
+
| Slot | Description |
|
|
222
|
+
|------|-------------|
|
|
223
|
+
| *(default)* | Footer actions (typically **`sonic-button`**) |
|
|
224
|
+
|
|
225
|
+
Put **`hideModal`** on a **`sonic-button`** to close the parent modal on click. Ancestor **`formDataProvider`** on this element is inherited by child form controls.
|
|
226
|
+
|
|
227
|
+
### `sonic-modal-close`
|
|
228
|
+
|
|
229
|
+
Rendered automatically unless **`forceAction`** or **`noCloseButton`** is set. Calls **`hide()`** on the parent modal.
|
|
230
|
+
|
|
231
|
+
| Attribute | Values | Description |
|
|
232
|
+
|----------|---------|-------------|
|
|
233
|
+
| `type` | **`sonic-button`** `type` | Close button color |
|
|
234
|
+
| `reset` | string | Passed to inner **`sonic-button`** **`reset`** |
|
|
235
|
+
| `translation` | UI label object | Overrides default close **`aria-label`** |
|
|
@@ -1,96 +1,294 @@
|
|
|
1
1
|
# Pop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**`sonic-pop`** anchors floating panels to a trigger: put the control in the **default slot** and the panel in **`slot="content"`** (menus, forms, custom markup). Click toggles open/closed unless **`manual`** is set; default **`placement`** is **`bottom`** (start-aligned). Position updates while open and flips inside the viewport when space is tight.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
4
7
|
<sonic-code>
|
|
5
8
|
<template>
|
|
6
|
-
<sonic-pop class="inline-block"
|
|
7
|
-
<sonic-button>
|
|
8
|
-
<sonic-menu slot="content">
|
|
9
|
-
<sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
|
|
10
|
-
</sonic-menu>
|
|
11
|
-
</sonic-pop>
|
|
12
|
-
<sonic-pop class="inline-block" placement="right">
|
|
13
|
-
<sonic-button>Right</sonic-button>
|
|
9
|
+
<sonic-pop class="inline-block">
|
|
10
|
+
<sonic-button>Notifications</sonic-button>
|
|
14
11
|
<sonic-menu slot="content">
|
|
15
|
-
<sonic-menu-item
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</sonic-pop>
|
|
24
|
-
<sonic-pop class="inline-block" placement="bottom">
|
|
25
|
-
<sonic-button>Bottom</sonic-button>
|
|
26
|
-
<sonic-menu slot="content">
|
|
27
|
-
<sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
|
|
12
|
+
<sonic-menu-item>
|
|
13
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
14
|
+
Notifications
|
|
15
|
+
</sonic-menu-item>
|
|
16
|
+
<sonic-menu-item>
|
|
17
|
+
<sonic-icon library="iconoir" name="settings" slot="prefix"></sonic-icon>
|
|
18
|
+
Settings
|
|
19
|
+
</sonic-menu-item>
|
|
28
20
|
</sonic-menu>
|
|
29
21
|
</sonic-pop>
|
|
30
22
|
</template>
|
|
31
23
|
</sonic-code>
|
|
32
24
|
|
|
25
|
+
## Placement
|
|
26
|
+
|
|
27
|
+
Use **`top`** · **`bottom`** · **`left`** · **`right`** for the main axis. Add **`-start`** · **`-center`** · **`-end`** to align along the trigger edge. With no align suffix, content aligns to **`start`**. Legacy space syntax (`placement="bottom center"`) still works but is deprecated—prefer **`bottom-center`**.
|
|
28
|
+
|
|
29
|
+
<sonic-code>
|
|
30
|
+
<template>
|
|
31
|
+
<div class="flex flex-wrap gap-2">
|
|
32
|
+
<sonic-pop class="inline-block" placement="left">
|
|
33
|
+
<sonic-button>Left</sonic-button>
|
|
34
|
+
<sonic-menu slot="content">
|
|
35
|
+
<sonic-menu-item>
|
|
36
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
37
|
+
Notifications
|
|
38
|
+
</sonic-menu-item>
|
|
39
|
+
</sonic-menu>
|
|
40
|
+
</sonic-pop>
|
|
41
|
+
<sonic-pop class="inline-block" placement="right">
|
|
42
|
+
<sonic-button>Right</sonic-button>
|
|
43
|
+
<sonic-menu slot="content">
|
|
44
|
+
<sonic-menu-item>
|
|
45
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
46
|
+
Notifications
|
|
47
|
+
</sonic-menu-item>
|
|
48
|
+
</sonic-menu>
|
|
49
|
+
</sonic-pop>
|
|
50
|
+
<sonic-pop class="inline-block" placement="top">
|
|
51
|
+
<sonic-button>Top</sonic-button>
|
|
52
|
+
<sonic-menu slot="content">
|
|
53
|
+
<sonic-menu-item>
|
|
54
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
55
|
+
Notifications
|
|
56
|
+
</sonic-menu-item>
|
|
57
|
+
</sonic-menu>
|
|
58
|
+
</sonic-pop>
|
|
59
|
+
<sonic-pop class="inline-block" placement="bottom">
|
|
60
|
+
<sonic-button>Bottom</sonic-button>
|
|
61
|
+
<sonic-menu slot="content">
|
|
62
|
+
<sonic-menu-item>
|
|
63
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
64
|
+
Notifications
|
|
65
|
+
</sonic-menu-item>
|
|
66
|
+
</sonic-menu>
|
|
67
|
+
</sonic-pop>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
</sonic-code>
|
|
71
|
+
|
|
72
|
+
### Center-aligned sides
|
|
73
|
+
|
|
74
|
+
<sonic-code>
|
|
75
|
+
<template>
|
|
76
|
+
<div class="flex flex-wrap gap-2">
|
|
77
|
+
<sonic-pop class="inline-block" placement="bottom-center">
|
|
78
|
+
<sonic-button>Bottom center</sonic-button>
|
|
79
|
+
<sonic-menu slot="content">
|
|
80
|
+
<sonic-menu-item>
|
|
81
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
82
|
+
Notifications
|
|
83
|
+
</sonic-menu-item>
|
|
84
|
+
</sonic-menu>
|
|
85
|
+
</sonic-pop>
|
|
86
|
+
<sonic-pop class="inline-block" placement="top-center">
|
|
87
|
+
<sonic-button>Top center</sonic-button>
|
|
88
|
+
<sonic-menu slot="content">
|
|
89
|
+
<sonic-menu-item>
|
|
90
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
91
|
+
Notifications
|
|
92
|
+
</sonic-menu-item>
|
|
93
|
+
</sonic-menu>
|
|
94
|
+
</sonic-pop>
|
|
95
|
+
<sonic-pop class="inline-block" placement="left-center">
|
|
96
|
+
<sonic-button>Left center</sonic-button>
|
|
97
|
+
<sonic-menu slot="content">
|
|
98
|
+
<sonic-menu-item>
|
|
99
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
100
|
+
Notifications
|
|
101
|
+
</sonic-menu-item>
|
|
102
|
+
</sonic-menu>
|
|
103
|
+
</sonic-pop>
|
|
104
|
+
<sonic-pop class="inline-block" placement="right-center">
|
|
105
|
+
<sonic-button>Right center</sonic-button>
|
|
106
|
+
<sonic-menu slot="content">
|
|
107
|
+
<sonic-menu-item>
|
|
108
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
109
|
+
Notifications
|
|
110
|
+
</sonic-menu-item>
|
|
111
|
+
</sonic-menu>
|
|
112
|
+
</sonic-pop>
|
|
113
|
+
</div>
|
|
114
|
+
</template>
|
|
115
|
+
</sonic-code>
|
|
116
|
+
|
|
33
117
|
## Shadow
|
|
118
|
+
|
|
119
|
+
Default **`shadow`** is **`lg`**. The shadow applies to the floating **`content`** panel.
|
|
120
|
+
|
|
34
121
|
<sonic-code>
|
|
35
122
|
<template>
|
|
36
|
-
<
|
|
37
|
-
<sonic-
|
|
38
|
-
|
|
39
|
-
<sonic-menu
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<sonic-
|
|
56
|
-
|
|
57
|
-
<sonic-menu
|
|
58
|
-
|
|
59
|
-
|
|
123
|
+
<div class="flex flex-wrap gap-2">
|
|
124
|
+
<sonic-pop class="inline-block" shadow="none" placement="top">
|
|
125
|
+
<sonic-button>None</sonic-button>
|
|
126
|
+
<sonic-menu slot="content">
|
|
127
|
+
<sonic-menu-item>
|
|
128
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
129
|
+
Notifications
|
|
130
|
+
</sonic-menu-item>
|
|
131
|
+
</sonic-menu>
|
|
132
|
+
</sonic-pop>
|
|
133
|
+
<sonic-pop class="inline-block" shadow="sm" placement="top">
|
|
134
|
+
<sonic-button>Small</sonic-button>
|
|
135
|
+
<sonic-menu slot="content">
|
|
136
|
+
<sonic-menu-item>
|
|
137
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
138
|
+
Notifications
|
|
139
|
+
</sonic-menu-item>
|
|
140
|
+
</sonic-menu>
|
|
141
|
+
</sonic-pop>
|
|
142
|
+
<sonic-pop class="inline-block" shadow="md" placement="top">
|
|
143
|
+
<sonic-button>Medium</sonic-button>
|
|
144
|
+
<sonic-menu slot="content">
|
|
145
|
+
<sonic-menu-item>
|
|
146
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
147
|
+
Notifications
|
|
148
|
+
</sonic-menu-item>
|
|
149
|
+
</sonic-menu>
|
|
150
|
+
</sonic-pop>
|
|
151
|
+
<sonic-pop class="inline-block" shadow="lg" placement="top">
|
|
152
|
+
<sonic-button>Large</sonic-button>
|
|
153
|
+
<sonic-menu slot="content">
|
|
154
|
+
<sonic-menu-item>
|
|
155
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
156
|
+
Notifications
|
|
157
|
+
</sonic-menu-item>
|
|
158
|
+
</sonic-menu>
|
|
159
|
+
</sonic-pop>
|
|
160
|
+
</div>
|
|
60
161
|
</template>
|
|
61
162
|
</sonic-code>
|
|
62
163
|
|
|
63
|
-
##
|
|
164
|
+
## Inline
|
|
165
|
+
|
|
166
|
+
By default the host is middle-aligned with siblings. Set **`inline`** to baseline-align the trigger inside running text.
|
|
167
|
+
|
|
64
168
|
<sonic-code>
|
|
65
169
|
<template>
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
<sonic-
|
|
69
|
-
<sonic-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
170
|
+
<p>
|
|
171
|
+
The Concorde flew from Paris to
|
|
172
|
+
<sonic-pop inline>
|
|
173
|
+
<sonic-button variant="link">New York</sonic-button>
|
|
174
|
+
<sonic-menu slot="content">
|
|
175
|
+
<sonic-menu-item>See flights</sonic-menu-item>
|
|
176
|
+
<sonic-menu-item>Book a seat</sonic-menu-item>
|
|
177
|
+
</sonic-menu>
|
|
178
|
+
</sonic-pop>
|
|
179
|
+
in about 3.5 hours.
|
|
180
|
+
</p>
|
|
181
|
+
</template>
|
|
182
|
+
</sonic-code>
|
|
183
|
+
|
|
184
|
+
## No toggle
|
|
185
|
+
|
|
186
|
+
With **`noToggle`**, a click on the trigger still opens the pop but does not close it when it is already open. Use **`hide()`** or an outside click to dismiss.
|
|
187
|
+
|
|
188
|
+
<sonic-code>
|
|
189
|
+
<template>
|
|
190
|
+
<div class="flex flex-wrap gap-2">
|
|
191
|
+
<sonic-pop class="inline-block" noToggle>
|
|
192
|
+
<sonic-button>No toggle on click</sonic-button>
|
|
193
|
+
<sonic-menu slot="content">
|
|
194
|
+
<sonic-menu-item>
|
|
195
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
196
|
+
Notifications
|
|
197
|
+
</sonic-menu-item>
|
|
198
|
+
</sonic-menu>
|
|
199
|
+
</sonic-pop>
|
|
200
|
+
<sonic-pop class="inline-block">
|
|
201
|
+
<sonic-button>Default toggle on click</sonic-button>
|
|
202
|
+
<sonic-menu slot="content">
|
|
203
|
+
<sonic-menu-item>
|
|
204
|
+
<sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>
|
|
205
|
+
Notifications
|
|
206
|
+
</sonic-menu-item>
|
|
207
|
+
</sonic-menu>
|
|
208
|
+
</sonic-pop>
|
|
209
|
+
</div>
|
|
78
210
|
</template>
|
|
79
211
|
</sonic-code>
|
|
80
212
|
|
|
213
|
+
## Manual control
|
|
214
|
+
|
|
215
|
+
Set **`manual`** to disable built-in click and keyboard toggle on the trigger. Call **`show()`** and **`hide()`** on the element instead. The pop dispatches **`show`** when it opens and **`hide`** when it closes.
|
|
216
|
+
|
|
217
|
+
Click **Click to open pop** to open the panel programmatically.
|
|
81
218
|
|
|
82
|
-
## manual
|
|
83
219
|
<sonic-code>
|
|
84
220
|
<template>
|
|
85
221
|
<sonic-pop class="inline-block" manual id="manualPop">
|
|
86
|
-
<sonic-button onclick="alert('
|
|
222
|
+
<sonic-button onclick="alert('Custom action without opening the pop')">Manual trigger</sonic-button>
|
|
87
223
|
<sonic-menu slot="content">
|
|
88
|
-
<sonic-menu-item>
|
|
224
|
+
<sonic-menu-item>It worked!</sonic-menu-item>
|
|
89
225
|
</sonic-menu>
|
|
90
226
|
</sonic-pop>
|
|
91
|
-
<sonic-button onclick="document.getElementById('manualPop').show()" class="ml-5"
|
|
227
|
+
<sonic-button onclick="document.getElementById('manualPop').show()" class="ml-5" variant="outline">
|
|
92
228
|
<sonic-icon name="sparkles" library="custom"></sonic-icon>
|
|
93
229
|
Click to open pop
|
|
94
230
|
</sonic-button>
|
|
95
231
|
</template>
|
|
96
|
-
</sonic-code>
|
|
232
|
+
</sonic-code>
|
|
233
|
+
|
|
234
|
+
## Keep open on select
|
|
235
|
+
|
|
236
|
+
By default, a click inside **`content`** closes the pop (same as an outside click). Set **`data-on-select="keep"`** on the panel or a descendant to keep it open while selecting checkboxes, toggles, or menu items.
|
|
237
|
+
|
|
238
|
+
<sonic-code>
|
|
239
|
+
<template>
|
|
240
|
+
<div class="flex flex-wrap gap-2">
|
|
241
|
+
<sonic-pop class="inline-block">
|
|
242
|
+
<sonic-button>Closes on select</sonic-button>
|
|
243
|
+
<div slot="content" class="grid gap-2 p-3">
|
|
244
|
+
<sonic-checkbox>Option A</sonic-checkbox>
|
|
245
|
+
<sonic-checkbox>Option B</sonic-checkbox>
|
|
246
|
+
</div>
|
|
247
|
+
</sonic-pop>
|
|
248
|
+
<sonic-pop class="inline-block">
|
|
249
|
+
<sonic-button>Stays open on select</sonic-button>
|
|
250
|
+
<div slot="content" class="grid gap-2 p-3" data-on-select="keep">
|
|
251
|
+
<sonic-checkbox>Option A</sonic-checkbox>
|
|
252
|
+
<sonic-checkbox>Option B</sonic-checkbox>
|
|
253
|
+
</div>
|
|
254
|
+
</sonic-pop>
|
|
255
|
+
</div>
|
|
256
|
+
</template>
|
|
257
|
+
</sonic-code>
|
|
258
|
+
|
|
259
|
+
## Keyboard and dismissal
|
|
260
|
+
|
|
261
|
+
**`ArrowDown`** on the trigger opens the pop when it is closed. **`Escape`** closes the most recently opened pop (capture phase, before ancestors such as **`sonic-modal`**) and returns focus to that trigger. Multiple pops on the page stack in open order for Escape.
|
|
262
|
+
|
|
263
|
+
<sonic-code>
|
|
264
|
+
<template>
|
|
265
|
+
<sonic-pop class="inline-block">
|
|
266
|
+
<sonic-button>Focus me — ArrowDown opens, Escape closes</sonic-button>
|
|
267
|
+
<sonic-menu slot="content">
|
|
268
|
+
<sonic-menu-item>First item</sonic-menu-item>
|
|
269
|
+
<sonic-menu-item>Second item</sonic-menu-item>
|
|
270
|
+
</sonic-menu>
|
|
271
|
+
</sonic-pop>
|
|
272
|
+
</template>
|
|
273
|
+
</sonic-code>
|
|
274
|
+
|
|
275
|
+
## API reference
|
|
276
|
+
|
|
277
|
+
| Attribute | Values | Description |
|
|
278
|
+
|----------|---------|-------------|
|
|
279
|
+
| `placement` | `bottom` (default) · `top` · `left` · `right` · `top-start` · `top-center` · `top-end` · `bottom-start` · `bottom-center` · `bottom-end` · `left-start` · `left-center` · `left-end` · `right-start` · `right-center` · `right-end` | Side and alignment relative to the trigger; repositions while open and flips within the viewport |
|
|
280
|
+
| `shadow` | `none` · `sm` · `md` · `lg` (default `lg`) | Box shadow on the **`content`** panel |
|
|
281
|
+
| `inline` | boolean | Baseline-align the host for inline triggers |
|
|
282
|
+
| `noToggle` | boolean | When open, trigger click does not close the pop |
|
|
283
|
+
| `manual` | boolean | Disable default trigger toggle; use **`show()`** / **`hide()`** |
|
|
284
|
+
|
|
285
|
+
| Slot | Description |
|
|
286
|
+
|------|-------------|
|
|
287
|
+
| *(default)* | Trigger; listens for **`click`** and **`keydown`** (`ArrowDown` opens when closed) unless **`manual`** |
|
|
288
|
+
| `content` | Floating panel; receives focus **`tabindex="0"`** while open |
|
|
289
|
+
|
|
290
|
+
**Methods:** **`show()`** · **`hide()`** on the host element.
|
|
291
|
+
|
|
292
|
+
**Events:** **`show`** · **`hide`** (non-bubbling **`CustomEvent`**).
|
|
293
|
+
|
|
294
|
+
**Content attribute:** **`data-on-select="keep"`** on **`content`** or descendants prevents close-on-click inside the panel.
|