@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,104 +1,169 @@
|
|
|
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>
|
|
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>
|
|
9
|
+
<sonic-pop class="inline-block">
|
|
10
|
+
<sonic-button>Notifications</sonic-button>
|
|
26
11
|
<sonic-menu slot="content">
|
|
27
|
-
<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
|
|
|
33
|
-
|
|
25
|
+
## Placement
|
|
34
26
|
|
|
35
|
-
|
|
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`**.
|
|
36
28
|
|
|
37
29
|
<sonic-code>
|
|
38
30
|
<template>
|
|
39
|
-
<
|
|
40
|
-
<sonic-
|
|
41
|
-
|
|
42
|
-
<sonic-menu
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<sonic-
|
|
59
|
-
|
|
60
|
-
<sonic-menu
|
|
61
|
-
|
|
62
|
-
|
|
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>
|
|
63
114
|
</template>
|
|
64
115
|
</sonic-code>
|
|
65
116
|
|
|
66
117
|
## Shadow
|
|
67
118
|
|
|
68
|
-
Default shadow is
|
|
119
|
+
Default **`shadow`** is **`lg`**. The shadow applies to the floating **`content`** panel.
|
|
69
120
|
|
|
70
121
|
<sonic-code>
|
|
71
122
|
<template>
|
|
72
|
-
<
|
|
73
|
-
<sonic-
|
|
74
|
-
|
|
75
|
-
<sonic-menu
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<sonic-
|
|
92
|
-
|
|
93
|
-
<sonic-menu
|
|
94
|
-
|
|
95
|
-
|
|
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>
|
|
96
161
|
</template>
|
|
97
162
|
</sonic-code>
|
|
98
163
|
|
|
99
164
|
## Inline
|
|
100
165
|
|
|
101
|
-
By default
|
|
166
|
+
By default the host is middle-aligned with siblings. Set **`inline`** to baseline-align the trigger inside running text.
|
|
102
167
|
|
|
103
168
|
<sonic-code>
|
|
104
169
|
<template>
|
|
@@ -116,35 +181,50 @@ By default, pop is vertically aligned to the middle. Use `inline` to align it on
|
|
|
116
181
|
</template>
|
|
117
182
|
</sonic-code>
|
|
118
183
|
|
|
119
|
-
##
|
|
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
|
+
|
|
120
188
|
<sonic-code>
|
|
121
189
|
<template>
|
|
122
|
-
<
|
|
123
|
-
<sonic-
|
|
124
|
-
|
|
125
|
-
<sonic-menu
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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>
|
|
134
210
|
</template>
|
|
135
211
|
</sonic-code>
|
|
136
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.
|
|
137
218
|
|
|
138
|
-
## manual
|
|
139
219
|
<sonic-code>
|
|
140
220
|
<template>
|
|
141
221
|
<sonic-pop class="inline-block" manual id="manualPop">
|
|
142
|
-
<sonic-button onclick="alert('
|
|
222
|
+
<sonic-button onclick="alert('Custom action without opening the pop')">Manual trigger</sonic-button>
|
|
143
223
|
<sonic-menu slot="content">
|
|
144
|
-
<sonic-menu-item>
|
|
224
|
+
<sonic-menu-item>It worked!</sonic-menu-item>
|
|
145
225
|
</sonic-menu>
|
|
146
226
|
</sonic-pop>
|
|
147
|
-
<sonic-button onclick="document.getElementById('manualPop').show()" class="ml-5"
|
|
227
|
+
<sonic-button onclick="document.getElementById('manualPop').show()" class="ml-5" variant="outline">
|
|
148
228
|
<sonic-icon name="sparkles" library="custom"></sonic-icon>
|
|
149
229
|
Click to open pop
|
|
150
230
|
</sonic-button>
|
|
@@ -153,48 +233,62 @@ By default, pop is vertically aligned to the middle. Use `inline` to align it on
|
|
|
153
233
|
|
|
154
234
|
## Keep open on select
|
|
155
235
|
|
|
156
|
-
By default, a click inside
|
|
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.
|
|
157
237
|
|
|
158
238
|
<sonic-code>
|
|
159
239
|
<template>
|
|
160
|
-
<
|
|
161
|
-
<sonic-
|
|
162
|
-
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
<sonic-
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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>
|
|
174
256
|
</template>
|
|
175
257
|
</sonic-code>
|
|
176
258
|
|
|
177
|
-
## Keyboard
|
|
259
|
+
## Keyboard and dismissal
|
|
178
260
|
|
|
179
|
-
|
|
180
|
-
|
|
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>
|
|
181
274
|
|
|
182
|
-
##
|
|
275
|
+
## API reference
|
|
183
276
|
|
|
184
|
-
|
|
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()`** |
|
|
185
284
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
```
|
|
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 |
|
|
191
289
|
|
|
192
|
-
|
|
290
|
+
**Methods:** **`show()`** · **`hide()`** on the host element.
|
|
193
291
|
|
|
194
|
-
|
|
292
|
+
**Events:** **`show`** · **`hide`** (non-bubbling **`CustomEvent`**).
|
|
195
293
|
|
|
196
|
-
|
|
197
|
-
sonic-pop::part(content) {
|
|
198
|
-
border-radius: 0;
|
|
199
|
-
}
|
|
200
|
-
```
|
|
294
|
+
**Content attribute:** **`data-on-select="keep"`** on **`content`** or descendants prevents close-on-click inside the panel.
|
|
@@ -1,63 +1,109 @@
|
|
|
1
|
-
# Progress
|
|
1
|
+
# Progress
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shows **task completion** on a **`value`** / **`max`** scale via a native `<progress>` bar. Omit **`value`** for an **indeterminate** loading animation. Put primary copy in the default slot and optional secondary text in **`remaining`**; set **`invert`** when the bar sits on a colored surface such as **`sonic-card`**.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
7
|
+
Set **`value`** from `0` to **`max`** (default `100`). Label text uses the type color.
|
|
6
8
|
|
|
7
9
|
<sonic-code>
|
|
8
10
|
<template>
|
|
9
|
-
|
|
11
|
+
<sonic-progress value="50">50%</sonic-progress>
|
|
10
12
|
</template>
|
|
11
13
|
</sonic-code>
|
|
12
14
|
|
|
15
|
+
## Indeterminate
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
With no **`value`**, the bar animates until progress is known.
|
|
15
18
|
|
|
16
19
|
<sonic-code>
|
|
17
20
|
<template>
|
|
18
|
-
|
|
19
|
-
80% Used <span slot="remaining">20% left</span>
|
|
20
|
-
</sonic-progress>
|
|
21
|
+
<sonic-progress></sonic-progress>
|
|
21
22
|
</template>
|
|
22
23
|
</sonic-code>
|
|
23
24
|
|
|
24
|
-
##
|
|
25
|
+
## Type
|
|
26
|
+
|
|
27
|
+
Semantic color follows **`type`**. With no **`type`**, behavior is `default`.
|
|
25
28
|
|
|
26
29
|
<sonic-code>
|
|
27
30
|
<template>
|
|
28
|
-
<div class="grid gap-3">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</div>
|
|
31
|
+
<div class="grid gap-3">
|
|
32
|
+
<sonic-progress value="50">50%</sonic-progress>
|
|
33
|
+
<sonic-progress type="primary" value="50">50%</sonic-progress>
|
|
34
|
+
<sonic-progress type="neutral" value="50">50%</sonic-progress>
|
|
35
|
+
<sonic-progress type="info" value="50">50%</sonic-progress>
|
|
36
|
+
<sonic-progress type="warning" value="50">50%</sonic-progress>
|
|
37
|
+
<sonic-progress type="success" value="50">50%</sonic-progress>
|
|
38
|
+
<sonic-progress type="danger" value="50">50%</sonic-progress>
|
|
39
|
+
</div>
|
|
37
40
|
</template>
|
|
38
41
|
</sonic-code>
|
|
39
42
|
|
|
40
|
-
##
|
|
43
|
+
## Size
|
|
44
|
+
|
|
45
|
+
Bar height scales with typography via **`size`**. With no **`size`**, font size matches **`md`** (`1rem`).
|
|
41
46
|
|
|
42
47
|
<sonic-code>
|
|
43
48
|
<template>
|
|
44
|
-
<div class="grid gap-3">
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
<div class="grid gap-3">
|
|
50
|
+
<sonic-progress size="2xs" value="25">25%</sonic-progress>
|
|
51
|
+
<sonic-progress size="xs" value="25">25%</sonic-progress>
|
|
52
|
+
<sonic-progress size="sm" value="25">25%</sonic-progress>
|
|
53
|
+
<sonic-progress size="md" value="25">25%</sonic-progress>
|
|
54
|
+
<sonic-progress size="lg" value="25">25%</sonic-progress>
|
|
55
|
+
<sonic-progress size="xl" value="25">25%</sonic-progress>
|
|
56
|
+
<sonic-progress size="2xl" value="25">25%</sonic-progress>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
52
59
|
</sonic-code>
|
|
53
60
|
|
|
61
|
+
## Default and remaining slots
|
|
62
|
+
|
|
63
|
+
The default slot is the main label (left). **`remaining`** is right-aligned with lighter weight—use it for “left to complete” copy.
|
|
64
|
+
|
|
65
|
+
<sonic-code>
|
|
66
|
+
<template>
|
|
67
|
+
<sonic-progress type="danger" value="80">
|
|
68
|
+
80% Used <span slot="remaining">20% left</span>
|
|
69
|
+
</sonic-progress>
|
|
70
|
+
</template>
|
|
71
|
+
</sonic-code>
|
|
54
72
|
|
|
55
73
|
## Invert
|
|
56
74
|
|
|
75
|
+
On tinted backgrounds, **`invert`** adjusts track and fill tokens so the bar stays readable (pair with matching **`type`** on **`sonic-card`** or similar).
|
|
76
|
+
|
|
57
77
|
<sonic-code>
|
|
58
78
|
<template>
|
|
59
|
-
<div class="
|
|
60
|
-
|
|
61
|
-
|
|
79
|
+
<div class="grid gap-3">
|
|
80
|
+
<sonic-card type="info">
|
|
81
|
+
<sonic-progress invert type="info" value="50">50%</sonic-progress>
|
|
82
|
+
</sonic-card>
|
|
83
|
+
<sonic-card type="warning">
|
|
84
|
+
<sonic-progress invert type="warning" value="50">50%</sonic-progress>
|
|
85
|
+
</sonic-card>
|
|
86
|
+
<sonic-card type="success">
|
|
87
|
+
<sonic-progress invert type="success" value="50">50%</sonic-progress>
|
|
88
|
+
</sonic-card>
|
|
89
|
+
<sonic-card type="danger">
|
|
90
|
+
<sonic-progress invert type="danger" value="50">50%</sonic-progress>
|
|
91
|
+
</sonic-card>
|
|
92
|
+
</div>
|
|
62
93
|
</template>
|
|
63
94
|
</sonic-code>
|
|
95
|
+
|
|
96
|
+
## API reference
|
|
97
|
+
|
|
98
|
+
| Attribute | Values | Description |
|
|
99
|
+
|----------|---------|-------------|
|
|
100
|
+
| `value` | number | Completion amount; omit for indeterminate state |
|
|
101
|
+
| `max` | number (default `100`) | Upper bound for **`value`** |
|
|
102
|
+
| `type` | `default` (default) · `primary` · `neutral` · `warning` · `info` · `success` · `danger` | Semantic bar and label color |
|
|
103
|
+
| `size` | `2xs` · `xs` · `sm` · `md` · `lg` · `xl` · `2xl` · `inherit` | Typography scale (bar height follows `em`) |
|
|
104
|
+
| `invert` | boolean | High-contrast tokens on colored backgrounds |
|
|
105
|
+
|
|
106
|
+
| Slot | Description |
|
|
107
|
+
|------|-------------|
|
|
108
|
+
| *(default)* | Primary label below the bar (left) |
|
|
109
|
+
| `remaining` | Secondary label below the bar (right) |
|