@supersoniks/concorde 5.0.5 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/.github/workflows/ci.yml +21 -0
  2. package/.github-export-ignore +30 -0
  3. package/.tmp-cem/custom-elements.json +13705 -0
  4. package/CONTRIBUTING.md +59 -0
  5. package/DEV.md +54 -0
  6. package/LICENSE +21 -0
  7. package/OPEN_SOURCE_CHECKPOINT.md +133 -0
  8. package/build-infos.json +1 -1
  9. package/concorde-3d.bundle.js +3960 -0
  10. package/concorde-3d.es.js +33433 -0
  11. package/concorde-core.bundle.js +196 -196
  12. package/concorde-core.es.js +3685 -3405
  13. package/concorde-hugging-face-infer.bundle.js +32 -0
  14. package/concorde-hugging-face-infer.es.js +2952 -0
  15. package/concorde-interactive.bundle.js +1157 -0
  16. package/concorde-interactive.es.js +10734 -0
  17. package/concorde-shader.bundle.js +116 -0
  18. package/concorde-shader.es.js +8353 -0
  19. package/concorde-webgpu.bundle.js +307 -0
  20. package/concorde-webgpu.es.js +8627 -0
  21. package/custom-elements-manifest.config.mjs +14 -0
  22. package/dist/concorde-core.bundle.js +196 -196
  23. package/dist/concorde-core.es.js +3685 -3405
  24. package/docs/assets/{index-wVZpLVYW.js → index-D8MVWqY6.js} +1351 -1222
  25. package/docs/assets/index-DiD0qYvE.css +1 -0
  26. package/docs/crawl/core/components/ui/alert/alert.html +71 -172
  27. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +5 -113
  28. package/docs/crawl/core/components/ui/badge/badge.html +79 -157
  29. package/docs/crawl/core/components/ui/button/button.html +0 -1
  30. package/docs/crawl/core/components/ui/captcha/captcha.html +8 -90
  31. package/docs/crawl/core/components/ui/card/card.html +68 -222
  32. package/docs/crawl/core/components/ui/divider/divider.html +31 -117
  33. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +101 -232
  34. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +52 -95
  35. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +38 -97
  36. package/docs/crawl/core/components/ui/form/input/input.html +3 -3
  37. package/docs/crawl/core/components/ui/form/textarea/textarea.html +3 -3
  38. package/docs/crawl/core/components/ui/group/group.html +38 -60
  39. package/docs/crawl/core/components/ui/icon/icon.html +47 -136
  40. package/docs/crawl/core/components/ui/image/image.html +56 -244
  41. package/docs/crawl/core/components/ui/link/link.html +9 -67
  42. package/docs/crawl/core/components/ui/loader/loader.html +23 -97
  43. package/docs/crawl/core/components/ui/menu/menu.html +90 -162
  44. package/docs/crawl/core/components/ui/modal/modal.html +50 -275
  45. package/docs/crawl/core/components/ui/pop/pop.html +66 -260
  46. package/docs/crawl/core/components/ui/progress/progress.html +30 -103
  47. package/docs/crawl/core/components/ui/table/table.html +171 -303
  48. package/docs/crawl/core/components/ui/toast/toast.html +59 -170
  49. package/docs/crawl/core/components/ui/tooltip/tooltip.html +29 -90
  50. package/docs/crawl/docs/_decorators/ancestor-attribute.html +2 -3
  51. package/docs/crawl/docs/_getting-started/concorde-outside.html +3 -3
  52. package/docs/crawl/docs/_getting-started/start.html +1 -1
  53. package/docs/crawl/docs/_getting-started/theming.html +63 -311
  54. package/docs/crawl/hubs/form-components.html +53 -75
  55. package/docs/crawl/index.html +6 -7
  56. package/docs/docs-mock-api-sw.js +0 -2
  57. package/docs/docs-mock-api-sw.js.map +2 -2
  58. package/docs/index.html +7 -9
  59. package/docs/llms-full.txt +456 -1703
  60. package/docs/llms.txt +32 -25
  61. package/docs/sitemap.xml +0 -3
  62. package/docs/src/core/components/functional/fetch/fetch.md +0 -0
  63. package/docs/src/core/components/functional/if/if.md +0 -0
  64. package/docs/src/core/components/functional/list/list.md +0 -0
  65. package/docs/src/core/components/functional/router/router.md +0 -0
  66. package/docs/src/core/components/functional/sdui/sdui.md +0 -0
  67. package/docs/src/core/components/functional/states/states.md +0 -0
  68. package/docs/src/core/components/functional/submit/submit.md +0 -0
  69. package/docs/src/core/components/ui/alert/alert.md +72 -147
  70. package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -85
  71. package/docs/src/core/components/ui/badge/badge.md +80 -141
  72. package/docs/src/core/components/ui/button/button.md +0 -1
  73. package/docs/src/core/components/ui/captcha/captcha.md +6 -65
  74. package/docs/src/core/components/ui/card/card.md +65 -183
  75. package/docs/src/core/components/ui/divider/divider.md +13 -107
  76. package/docs/src/core/components/ui/form/fieldset/fieldset.md +99 -175
  77. package/docs/src/core/components/ui/form/form-actions/form-actions.md +52 -75
  78. package/docs/src/core/components/ui/form/form-layout/form-layout.md +34 -109
  79. package/docs/src/core/components/ui/form/input/input.md +1 -1
  80. package/docs/src/core/components/ui/form/radio/radio.md +0 -0
  81. package/docs/src/core/components/ui/form/select/select.md +0 -0
  82. package/docs/src/core/components/ui/form/switch/switch.md +0 -0
  83. package/docs/src/core/components/ui/form/textarea/textarea.md +1 -1
  84. package/docs/src/core/components/ui/group/group.md +36 -36
  85. package/docs/src/core/components/ui/icon/icon.md +43 -132
  86. package/docs/src/core/components/ui/image/image.md +53 -179
  87. package/docs/src/core/components/ui/link/link.md +7 -45
  88. package/docs/src/core/components/ui/loader/loader.md +22 -79
  89. package/docs/src/core/components/ui/menu/menu.md +92 -133
  90. package/docs/src/core/components/ui/modal/modal.md +47 -163
  91. package/docs/src/core/components/ui/pop/pop.md +64 -262
  92. package/docs/src/core/components/ui/progress/progress.md +30 -76
  93. package/docs/src/core/components/ui/table/table.md +171 -147
  94. package/docs/src/core/components/ui/toast/toast.md +58 -108
  95. package/docs/src/core/components/ui/tooltip/tooltip.md +26 -68
  96. package/docs/src/docs/_core-concept/subscriber.md +0 -0
  97. package/docs/src/docs/_decorators/ancestor-attribute.md +2 -3
  98. package/docs/src/docs/_getting-started/concorde-outside.md +3 -3
  99. package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -0
  100. package/docs/src/docs/_getting-started/pubsub.md +0 -0
  101. package/docs/src/docs/_getting-started/start.md +1 -1
  102. package/docs/src/docs/_getting-started/theming.md +61 -223
  103. package/docs/src/docs/search/docs-search.json +348 -3083
  104. package/docs/src/tsconfig.declarations.json +22 -0
  105. package/docs/src/tsconfig.emit.json +23 -0
  106. package/docs/src/tsconfig.json +3 -63
  107. package/gitlab/job_github_mirror.sh +39 -0
  108. package/package.json +36 -2
  109. package/scripts/generate-sdui-catalog.mjs +250 -0
  110. package/scripts/generate-sdui-catalog.spec.ts +91 -0
  111. package/scripts/github-export.mjs +150 -0
  112. package/scripts/post-build-docs.js +0 -0
  113. package/scripts/post-build.mjs +0 -0
  114. package/scripts/pre-build.mjs +15 -0
  115. package/src/core/components/functional/fetch/fetch.md +0 -0
  116. package/src/core/components/functional/if/if.md +0 -0
  117. package/src/core/components/functional/if/if.ts +0 -0
  118. package/src/core/components/functional/list/list.demo.ts +0 -0
  119. package/src/core/components/functional/list/list.md +0 -0
  120. package/src/core/components/functional/router/router.md +0 -0
  121. package/src/core/components/functional/router/router.ts +0 -0
  122. package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +5 -5
  123. package/src/core/components/functional/sdui/__fixtures__/descriptors.ts +251 -0
  124. package/src/core/components/functional/sdui/__snapshots__/sdui-action.spec.ts.snap +73 -0
  125. package/src/core/components/functional/sdui/__snapshots__/sdui-incremental.spec.ts.snap +50 -0
  126. package/src/core/components/functional/sdui/__snapshots__/sdui-partial.spec.ts.snap +50 -0
  127. package/src/core/components/functional/sdui/__snapshots__/sdui.regression.spec.ts.snap +461 -0
  128. package/src/core/components/functional/sdui/component-catalog.gaps.json +511 -0
  129. package/src/core/components/functional/sdui/component-catalog.json +3103 -0
  130. package/src/core/components/functional/sdui/component-catalog.spec.ts +23 -0
  131. package/src/core/components/functional/sdui/sdui-action.spec.ts +99 -0
  132. package/src/core/components/functional/sdui/sdui-dom-snapshot.ts +61 -0
  133. package/src/core/components/functional/sdui/sdui-extension-points.md +94 -0
  134. package/src/core/components/functional/sdui/sdui-incremental.spec.ts +137 -0
  135. package/src/core/components/functional/sdui/sdui-partial.spec.ts +83 -0
  136. package/src/core/components/functional/sdui/sdui-partial.ts +19 -0
  137. package/src/core/components/functional/sdui/sdui-safe.spec.ts +188 -0
  138. package/src/core/components/functional/sdui/sdui-safe.ts +100 -0
  139. package/src/core/components/functional/sdui/sdui.md +122 -0
  140. package/src/core/components/functional/sdui/sdui.regression.spec.ts +64 -0
  141. package/src/core/components/functional/sdui/sdui.ts +442 -34
  142. package/src/core/components/functional/sdui/types.ts +49 -0
  143. package/src/core/components/functional/states/states.md +0 -0
  144. package/src/core/components/functional/submit/submit.md +0 -0
  145. package/src/core/components/functional/subscriber/subscriber.ts +0 -0
  146. package/src/core/components/functional/value/value.ts +0 -0
  147. package/src/core/components/ui/_css/size.ts +0 -0
  148. package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
  149. package/src/core/components/ui/form/radio/radio.md +0 -0
  150. package/src/core/components/ui/form/select/select.md +0 -0
  151. package/src/core/components/ui/form/switch/switch.md +0 -0
  152. package/src/core/mixins/Subscriber.ts +0 -0
  153. package/src/core/utils/DataBindObserver.ts +0 -0
  154. package/src/core/utils/Objects.ts +0 -0
  155. package/src/core/utils/route.ts +0 -0
  156. package/src/css.d.ts +19 -0
  157. package/src/docs/_core-concept/subscriber.md +0 -0
  158. package/src/docs/_getting-started/my-first-subscriber.md +0 -0
  159. package/src/docs/_getting-started/pubsub.md +0 -0
  160. package/src/docs/example/users.ts +0 -0
  161. package/src/docs/search/page.ts +0 -0
  162. package/src/tsconfig.declarations.json +22 -0
  163. package/src/tsconfig.emit.json +23 -0
  164. package/src/tsconfig.json +90 -0
  165. package/src/tsconfig.tsbuildinfo +1 -1
  166. package/docs/assets/index-CD4WyL6o.css +0 -1
  167. package/docs/crawl/core/components/ui/theme/theme.html +0 -131
  168. package/docs/src/core/components/ui/theme/theme.md +0 -122
@@ -1,62 +1,68 @@
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.
1
+ ## Modal
8
2
 
9
3
  <sonic-code>
10
4
  <template>
11
5
  <sonic-button onclick="document.getElementById('modalExample').show()">
12
- Open modal
6
+ Simple modal
13
7
  </sonic-button>
14
8
  <sonic-modal id="modalExample">
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>
9
+ <sonic-modal-title
10
+ >Lorem ipsum dolor sit amet <sonic-badge type="danger" size="sm">+33</sonic-badge></sonic-modal-title
11
+ >
12
+ <sonic-modal-subtitle>Donec sed vestibulum augue.</sonic-modal-subtitle>
20
13
  <sonic-modal-content>
21
- Download the CSV now or review the summary in your dashboard before sharing.
14
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget quam eu mi luctus faucibus.
22
15
  </sonic-modal-content>
23
16
  <sonic-modal-actions formDataProvider="ModalMiniForm">
24
- <sonic-button minWidth="8rem" value="true" name="click">
25
- Save draft
17
+ <sonic-button FormCheckable minWidth="8rem" value="true" name="click">
18
+ Click don't close
26
19
  </sonic-button>
27
- <sonic-button minWidth="8rem" type="success" hideModal>Download</sonic-button>
20
+ <sonic-button minWidth="8rem" type="success" hideModal>Confirm</sonic-button>
28
21
  </sonic-modal-actions>
29
22
  </sonic-modal>
30
23
  </template>
31
24
  </sonic-code>
32
25
 
33
- ## Scrollable content
34
26
 
35
- Long copy scrolls inside the dialog. Default **`maxHeight`** is `90vh`. Default **`align`** is `left`.
27
+ ## Long text
36
28
 
37
29
  <sonic-code>
38
30
  <template>
39
- <sonic-button onclick="document.getElementById('modalText').show()">Venue details</sonic-button>
31
+ <sonic-button onclick="document.getElementById('modalText').show()"> Long text </sonic-button>
40
32
  <sonic-modal align="left" id="modalText">
41
- <sonic-modal-title>Hours and tickets</sonic-modal-title>
33
+ <sonic-modal-title>Infos et tarifs </sonic-modal-title>
42
34
  <sonic-modal-content>
43
35
  <div class="prose">
44
36
  <p>
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.
37
+ <strong>Horaires d’ouverture </strong><br />
38
+ Du mercredi au samedi de 13h30 à 19h et le dimanche de 13h30 à 18h<br />
39
+ + horaires spécifiques pour événements ou festivals&nbsp;
47
40
  </p>
48
41
  <p>
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.
42
+ <strong> Billetterie&nbsp;<br /></strong>
43
+ La participation à certains événements et activités est soumise à un système de billetterie avec achats ou
44
+ réservations disponibles en ligne ou au guichet.&nbsp;&nbsp;<strong><br /></strong>
51
45
  </p>
52
46
  <p>
53
- <strong>Contact</strong><br />
54
- tickets@example.com · +33 3 28 33 48 33
47
+ Les tarifs (Tarif plein / Tarif Réduit / Tarif Spécifique) sont indiqués pour chaque événement et peuvent
48
+ varier selon la nature de l’événement. Les tarifs sont identiques en ligne et au guichet. Il est néanmoins
49
+ conseillé de réserver les billets en avance pour s’assurer une place.
55
50
  </p>
56
51
  <p>
57
- <strong>Access</strong><br />
58
- 14 Place Faidherbe, 59100 Roubaix<br />
59
- Metro line 2, Eurotéléport stop
52
+ L’accès au Skatepark, Fablab et Halle C sont soumis à adhésions. Les adhésions sont gratuites et
53
+ nominatives. Elle donnent accès aux espaces dans la limite des places disponibles.
54
+ </p>
55
+ <p>
56
+ <strong>+ d’infos <br /></strong>billetterie@laconditionpublique.com <br />+33 (0)328334833&nbsp;
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&nbsp;
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
60
66
  </p>
61
67
  </div>
62
68
  </sonic-modal-content>
@@ -66,44 +72,33 @@ Long copy scrolls inside the dialog. Default **`maxHeight`** is `90vh`. Default
66
72
 
67
73
  ## Force action
68
74
 
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
-
71
75
  <sonic-code>
72
76
  <template>
73
- <sonic-button onclick="document.getElementById('force').show()">Cookie consent</sonic-button>
77
+ <sonic-button onclick="document.getElementById('force').show()"> Force action to close</sonic-button>
74
78
  <sonic-modal forceAction id="force">
75
- <sonic-modal-title>Allow analytics cookies?</sonic-modal-title>
79
+ <sonic-modal-title>Do you want some cookies ? </sonic-modal-title>
76
80
  <sonic-modal-content>
77
- We use cookies to measure traffic and improve the product. You can change this later in settings.
81
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget quam eu mi luctus faucibus.
78
82
  </sonic-modal-content>
79
- <sonic-modal-actions>
80
- <sonic-button hideModal minWidth="8rem">Decline</sonic-button>
81
- <sonic-button hideModal minWidth="8rem" type="success">Accept</sonic-button>
83
+ <sonic-modal-actions >
84
+ <sonic-button hideModal minWidth="8rem"> Nope </sonic-button>
85
+ <sonic-button hideModal minWidth="8rem" type="success">Hell yes !</sonic-button>
82
86
  </sonic-modal-actions>
83
87
  </sonic-modal>
88
+ </sonic-modal>
84
89
  </template>
85
90
  </sonic-code>
86
91
 
87
92
  ## Custom dimensions
88
93
 
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
-
91
94
  <sonic-code>
92
95
  <template>
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
- >
96
+ <sonic-button onclick="document.getElementById('CustomWidth').show()"> Custom width </sonic-button>
97
+ <sonic-modal maxHeight="50vh" maxWidth="90vw" width="100%" height="100%" id="CustomWidth">
102
98
  <sonic-image
103
99
  cover
104
100
  objectPosition="center 20%"
105
101
  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"
107
102
  ></sonic-image>
108
103
  </sonic-modal>
109
104
  </template>
@@ -111,125 +106,14 @@ Set **`width`** / **`height`** / **`maxWidth`** / **`maxHeight`** (CSS lengths).
111
106
 
112
107
  ## Fullscreen
113
108
 
114
- **`fullscreen`** fills the viewport and hides the backdrop.
115
-
116
109
  <sonic-code>
117
110
  <template>
118
- <sonic-button onclick="document.getElementById('Fullscreen').show()">Fullscreen</sonic-button>
111
+ <sonic-button onclick="document.getElementById('Fullscreen').show()"> Fullscreen </sonic-button>
119
112
  <sonic-modal fullscreen id="Fullscreen">
120
113
  <sonic-image
121
114
  cover
122
115
  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"
124
116
  ></sonic-image>
125
117
  </sonic-modal>
126
118
  </template>
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: '&lt;sonic-button hideModal minWidth=\'8rem\'&gt;Cancel&lt;/sonic-button&gt;&lt;sonic-button hideModal minWidth=\'8rem\' type=\'success\'&gt;Send&lt;/sonic-button&gt;',
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`** |
119
+ </sonic-code>
@@ -1,294 +1,96 @@
1
1
  # Pop
2
2
 
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
-
3
+ ## Placement
7
4
  <sonic-code>
8
5
  <template>
9
- <sonic-pop class="inline-block">
10
- <sonic-button>Notifications</sonic-button>
6
+ <sonic-pop class="inline-block" placement="left">
7
+ <sonic-button>Left</sonic-button>
11
8
  <sonic-menu slot="content">
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>
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>
14
+ <sonic-menu slot="content">
15
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
16
+ </sonic-menu>
17
+ </sonic-pop>
18
+ <sonic-pop class="inline-block" placement="top">
19
+ <sonic-button>Top</sonic-button>
20
+ <sonic-menu slot="content">
21
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
22
+ </sonic-menu>
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>
20
28
  </sonic-menu>
21
29
  </sonic-pop>
22
- </template>
23
- </sonic-code>
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
30
  </template>
115
31
  </sonic-code>
116
32
 
117
33
  ## Shadow
118
-
119
- Default **`shadow`** is **`lg`**. The shadow applies to the floating **`content`** panel.
120
-
121
- <sonic-code>
122
- <template>
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>
161
- </template>
162
- </sonic-code>
163
-
164
- ## Inline
165
-
166
- By default the host is middle-aligned with siblings. Set **`inline`** to baseline-align the trigger inside running text.
167
-
168
34
  <sonic-code>
169
35
  <template>
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>
36
+ <sonic-pop class="inline-block" shadow="none" placement='top' >
37
+ <sonic-button>None</sonic-button>
38
+ <sonic-menu slot="content">
39
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
40
+ </sonic-menu>
41
+ </sonic-pop>
42
+ <sonic-pop class="inline-block" shadow="sm" placement='top'>
43
+ <sonic-button>Small</sonic-button>
44
+ <sonic-menu slot="content">
45
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
46
+ </sonic-menu>
47
+ </sonic-pop>
48
+ <sonic-pop class="inline-block" shadow="md" placement='top'>
49
+ <sonic-button>Medium</sonic-button>
50
+ <sonic-menu slot="content">
51
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
52
+ </sonic-menu>
53
+ </sonic-pop>
54
+ <sonic-pop class="inline-block" shadow="lg" placement='top'>
55
+ <sonic-button>Large</sonic-button>
56
+ <sonic-menu slot="content">
57
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
58
+ </sonic-menu>
59
+ </sonic-pop>
181
60
  </template>
182
61
  </sonic-code>
183
62
 
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
-
63
+ ## noToggle
188
64
  <sonic-code>
189
65
  <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>
66
+ <sonic-pop class="inline-block" noToggle>
67
+ <sonic-button>No toggle on click</sonic-button>
68
+ <sonic-menu slot="content">
69
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
70
+ </sonic-menu>
71
+ </sonic-pop>
72
+ <sonic-pop class="inline-block" >
73
+ <sonic-button>Default toggle on click</sonic-button>
74
+ <sonic-menu slot="content">
75
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
76
+ </sonic-menu>
77
+ </sonic-pop>
210
78
  </template>
211
79
  </sonic-code>
212
80
 
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.
218
81
 
82
+ ## manual
219
83
  <sonic-code>
220
84
  <template>
221
85
  <sonic-pop class="inline-block" manual id="manualPop">
222
- <sonic-button onclick="alert('Custom action without opening the pop')">Manual trigger</sonic-button>
86
+ <sonic-button onclick="alert('customAction without opening Pop content')">Manual doesn't open on click</sonic-button>
223
87
  <sonic-menu slot="content">
224
- <sonic-menu-item>It worked!</sonic-menu-item>
88
+ <sonic-menu-item>Hourra !</sonic-menu-item>
225
89
  </sonic-menu>
226
90
  </sonic-pop>
227
- <sonic-button onclick="document.getElementById('manualPop').show()" class="ml-5" variant="outline">
91
+ <sonic-button onclick="document.getElementById('manualPop').show()" class="ml-5" variant="outline">
228
92
  <sonic-icon name="sparkles" library="custom"></sonic-icon>
229
93
  Click to open pop
230
94
  </sonic-button>
231
95
  </template>
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.
96
+ </sonic-code>