wispcss 0.0.0-stage → 1.0.4
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/CHANGELOG.md +74 -0
- package/LICENSE +49 -0
- package/README.md +385 -2
- package/README.zh-CN.md +385 -0
- package/dist/wispcss.css +45823 -0
- package/dist/wispcss.min.css +2 -0
- package/examples/add-h2-ids.cjs +284 -0
- package/examples/demo-actions.html +188 -0
- package/examples/demo-alarm.html +219 -0
- package/examples/demo-animation.html +399 -0
- package/examples/demo-aura.html +195 -0
- package/examples/demo-avatar.html +279 -0
- package/examples/demo-background.html +284 -0
- package/examples/demo-badge.html +398 -0
- package/examples/demo-blob.html +307 -0
- package/examples/demo-blockquote.html +190 -0
- package/examples/demo-bookmark.html +243 -0
- package/examples/demo-breadcrumb.html +179 -0
- package/examples/demo-btns.html +349 -0
- package/examples/demo-bubble.html +215 -0
- package/examples/demo-buoy.html +187 -0
- package/examples/demo-button-icon.html +231 -0
- package/examples/demo-button-link.html +177 -0
- package/examples/demo-button.html +361 -0
- package/examples/demo-callout.html +601 -0
- package/examples/demo-check.html +323 -0
- package/examples/demo-code.html +212 -0
- package/examples/demo-color.html +545 -0
- package/examples/demo-comment.html +510 -0
- package/examples/demo-deform.html +229 -0
- package/examples/demo-dialog.html +932 -0
- package/examples/demo-divider.html +208 -0
- package/examples/demo-drawer.html +623 -0
- package/examples/demo-dropmenu.html +382 -0
- package/examples/demo-droppanel.html +354 -0
- package/examples/demo-ellipsis.html +145 -0
- package/examples/demo-emphasis.html +146 -0
- package/examples/demo-empty.html +112 -0
- package/examples/demo-entry.html +219 -0
- package/examples/demo-field.html +359 -0
- package/examples/demo-file.html +206 -0
- package/examples/demo-flag.html +225 -0
- package/examples/demo-form.html +201 -0
- package/examples/demo-gilt.html +170 -0
- package/examples/demo-heading.html +93 -0
- package/examples/demo-icon.html +164 -0
- package/examples/demo-input.html +300 -0
- package/examples/demo-kbd.html +202 -0
- package/examples/demo-lamp.html +248 -0
- package/examples/demo-link.html +142 -0
- package/examples/demo-normalize.html +366 -0
- package/examples/demo-otp.html +277 -0
- package/examples/demo-pagination.html +562 -0
- package/examples/demo-position.html +205 -0
- package/examples/demo-poster.html +384 -0
- package/examples/demo-pre - /345/211/257/346/234/254.html" +169 -0
- package/examples/demo-pre.html +205 -0
- package/examples/demo-preset.html +344 -0
- package/examples/demo-progress.html +303 -0
- package/examples/demo-range.html +211 -0
- package/examples/demo-rank.html +270 -0
- package/examples/demo-rating.html +251 -0
- package/examples/demo-reset.html +105 -0
- package/examples/demo-segment.html +436 -0
- package/examples/demo-select.html +332 -0
- package/examples/demo-shadow.html +152 -0
- package/examples/demo-shell.html +377 -0
- package/examples/demo-shimmer.html +217 -0
- package/examples/demo-size.html +149 -0
- package/examples/demo-skeleton.html +143 -0
- package/examples/demo-sketch.html +213 -0
- package/examples/demo-spacer.html +150 -0
- package/examples/demo-spinner.html +220 -0
- package/examples/demo-stats.html +165 -0
- package/examples/demo-status.html +212 -0
- package/examples/demo-step.html +240 -0
- package/examples/demo-styles.css +14 -0
- package/examples/demo-summary.html +128 -0
- package/examples/demo-swatch.html +253 -0
- package/examples/demo-switch.html +223 -0
- package/examples/demo-table.html +339 -0
- package/examples/demo-tag.html +318 -0
- package/examples/demo-text.html +91 -0
- package/examples/demo-theme.html +167 -0
- package/examples/demo-tools.html +152 -0
- package/examples/demo-transition.html +169 -0
- package/examples/demo-tree.html +929 -0
- package/examples/demo-underline.html +76 -0
- package/examples/demo-utils.js +131 -0
- package/examples/demo-validate.html +120 -0
- package/examples/index.html +149 -0
- package/package.json +73 -3
- package/script-gen-color.js +148 -0
- package/script-mini.js +78 -0
- package/script-prefix.js +398 -0
- package/skill.md +575 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
+
<link id="wispcss-css" rel="stylesheet" href="../dist/wispcss.css">
|
|
8
|
+
<link rel="stylesheet" href="./demo-styles.css">
|
|
9
|
+
<title>Btns - WispCSS Demo</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<h1>Btns Component</h1>
|
|
14
|
+
<p>Button group with shapes, sizes, widths, directions, flush mount, and grid layout.</p>
|
|
15
|
+
|
|
16
|
+
<h2>Notes</h2>
|
|
17
|
+
<div class="section">
|
|
18
|
+
<ul>
|
|
19
|
+
<li>Use class <code>.btns</code> as a container. Child elements are automatically styled as button group items.</li>
|
|
20
|
+
<li>Mark the active item with <code>data-selected="true"</code>. Use <code>[disabled]</code> for disabled items.</li>
|
|
21
|
+
<li>Combining <code>.btns-flush</code> with direction classes (<code>.btns-top</code>, <code>.btns-start</code>, <code>.btns-end</code>) enables seamless edge fitting.</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<h2 id="basic">Basic usage</h2>
|
|
26
|
+
<div class="section">
|
|
27
|
+
<div>
|
|
28
|
+
<h3>Default btns</h3>
|
|
29
|
+
<span class="btns">
|
|
30
|
+
<button data-selected="true">Left</button>
|
|
31
|
+
<button>Center</button>
|
|
32
|
+
<button>Right</button>
|
|
33
|
+
</span>
|
|
34
|
+
<span class="btns">
|
|
35
|
+
<a data-selected="true" class="btn">Link A</a>
|
|
36
|
+
<a class="btn">Link C</a>
|
|
37
|
+
<a class="btn">Link B</a>
|
|
38
|
+
</span>
|
|
39
|
+
</div>
|
|
40
|
+
<div>
|
|
41
|
+
<h3>Disabled item</h3>
|
|
42
|
+
<span class="btns">
|
|
43
|
+
<button data-selected="true">Edit</button>
|
|
44
|
+
<button disabled>Delete</button>
|
|
45
|
+
<button>Export</button>
|
|
46
|
+
</span>
|
|
47
|
+
</div>
|
|
48
|
+
<div>
|
|
49
|
+
<h3>With icons</h3>
|
|
50
|
+
<span class="btns">
|
|
51
|
+
<button data-selected="true">⭐ Favorite</button>
|
|
52
|
+
<button><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" > <path d="M18 3a5 5 0 0 1 5 5v8a5 5 0 0 1 -5 5h-12a5 5 0 0 1 -5 -5v-8a5 5 0 0 1 5 -5zm-9 6v6a1 1 0 0 0 1.514 .857l5 -3a1 1 0 0 0 0 -1.714l-5 -3a1 1 0 0 0 -1.514 .857z" /> </svg> Files</button>
|
|
53
|
+
<button><span class="icon icon-check"></span> Settings</button>
|
|
54
|
+
</span>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<h2 id="shapes">Shapes</h2>
|
|
59
|
+
<div class="section">
|
|
60
|
+
<div>
|
|
61
|
+
<h3>Default</h3>
|
|
62
|
+
<span class="btns">
|
|
63
|
+
<button data-selected="true">Default</button>
|
|
64
|
+
<button>Option</button>
|
|
65
|
+
<button>Option</button>
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
68
|
+
<div>
|
|
69
|
+
<h3>Rounded (<code>.btns-rounded</code>)</h3>
|
|
70
|
+
<span class="btns btns-rounded">
|
|
71
|
+
<button data-selected="true">Rounded</button>
|
|
72
|
+
<button>Option</button>
|
|
73
|
+
<button>Option</button>
|
|
74
|
+
</span>
|
|
75
|
+
</div>
|
|
76
|
+
<div>
|
|
77
|
+
<h3>Circle (<code>.btns-pill</code>)</h3>
|
|
78
|
+
<span class="btns btns-pill">
|
|
79
|
+
<button data-selected="true">Circle</button>
|
|
80
|
+
<button>Option</button>
|
|
81
|
+
<button>Option</button>
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
<div>
|
|
85
|
+
<h3>Square (<code>.btns-square</code>)</h3>
|
|
86
|
+
<span class="btns btns-square">
|
|
87
|
+
<button data-selected="true">Square</button>
|
|
88
|
+
<button>Option</button>
|
|
89
|
+
<button>Option</button>
|
|
90
|
+
</span>
|
|
91
|
+
</div>
|
|
92
|
+
<div>
|
|
93
|
+
<h3>Fluid (<code>.btns-fluid</code>)</h3>
|
|
94
|
+
<span class="btns btns-fluid">
|
|
95
|
+
<button data-selected="true">Fluid</button>
|
|
96
|
+
<button>Option</button>
|
|
97
|
+
<button>Option</button>
|
|
98
|
+
</span>
|
|
99
|
+
</div>
|
|
100
|
+
<div>
|
|
101
|
+
<h3>Shape comparison</h3>
|
|
102
|
+
<span class="btns"><button data-selected="true">Def</button><button>Opt</button></span>
|
|
103
|
+
<span class="btns btns-rounded"><button data-selected="true">Rnd</button><button>Opt</button></span>
|
|
104
|
+
<span class="btns btns-pill"><button data-selected="true">Cir</button><button>Opt</button></span>
|
|
105
|
+
<span class="btns btns-square"><button data-selected="true">Sqr</button><button>Opt</button></span>
|
|
106
|
+
<span class="btns btns-fluid"><button data-selected="true">Flu</button><button>Opt</button></span>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<h2 id="width">Width</h2>
|
|
111
|
+
<div class="section">
|
|
112
|
+
<div>
|
|
113
|
+
<h3>Grid (<code>.btns-full</code>) — equal width</h3>
|
|
114
|
+
<span class="btns btns-full">
|
|
115
|
+
<button data-selected="true">Home</button>
|
|
116
|
+
<button>Products</button>
|
|
117
|
+
<button>Services</button>
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
<div>
|
|
121
|
+
<h3>Scale (<code>.btns-scale</code>) — fixed width</h3>
|
|
122
|
+
<span class="btns btns-scale">
|
|
123
|
+
<button data-selected="true">Home</button>
|
|
124
|
+
<button>Products</button>
|
|
125
|
+
<button>Services</button>
|
|
126
|
+
</span>
|
|
127
|
+
</div>
|
|
128
|
+
<div>
|
|
129
|
+
<h3>Scale multiplier (<code>.btns-scale-2</code>) — 2x width</h3>
|
|
130
|
+
<span class="btns btns-scale-2">
|
|
131
|
+
<button data-selected="true">Home</button>
|
|
132
|
+
<button>Products</button>
|
|
133
|
+
<button>Services</button>
|
|
134
|
+
</span>
|
|
135
|
+
</div>
|
|
136
|
+
<div>
|
|
137
|
+
<h3>Scale custom (<code>.btns-scale-[3]</code>) — 3x width</h3>
|
|
138
|
+
<span class="btns btns-scale-[3]">
|
|
139
|
+
<button data-selected="true">Home</button>
|
|
140
|
+
<button>Products</button>
|
|
141
|
+
<button>Services</button>
|
|
142
|
+
</span>
|
|
143
|
+
</div>
|
|
144
|
+
<div>
|
|
145
|
+
<h3>Button ratio (<code>.btn-ratio</code>) — 1:1 square</h3>
|
|
146
|
+
<span class="btns">
|
|
147
|
+
<button data-selected="true" class="btn-ratio">H</button>
|
|
148
|
+
<button class="btn-ratio">P</button>
|
|
149
|
+
<button class="btn-ratio">S</button>
|
|
150
|
+
</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div>
|
|
153
|
+
<h3>Custom button ratio (<code>.btn-ratio-*</code>) — N:1</h3>
|
|
154
|
+
<span class="btns">
|
|
155
|
+
<button data-selected="true" class="btn-ratio-3">Home</button>
|
|
156
|
+
<button class="btn-ratio-5">Products</button>
|
|
157
|
+
<button class="btn-ratio-4">Services</button>
|
|
158
|
+
</span>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<h2 id="direction">Direction</h2>
|
|
163
|
+
<div class="section">
|
|
164
|
+
<div>
|
|
165
|
+
<h3>Bottom (default)</h3>
|
|
166
|
+
<span class="btns">
|
|
167
|
+
<button data-selected="true">A</button>
|
|
168
|
+
<button>B</button>
|
|
169
|
+
<button>C</button>
|
|
170
|
+
</span>
|
|
171
|
+
</div>
|
|
172
|
+
<div>
|
|
173
|
+
<h3>Top (<code>.btns-top</code>)</h3>
|
|
174
|
+
<span class="btns btns-top">
|
|
175
|
+
<button data-selected="true">A</button>
|
|
176
|
+
<button>B</button>
|
|
177
|
+
<button>C</button>
|
|
178
|
+
</span>
|
|
179
|
+
</div>
|
|
180
|
+
<div>
|
|
181
|
+
<h3>Start (<code>.btns-start</code>) — vertical, left-to-right</h3>
|
|
182
|
+
<span class="btns btns-start">
|
|
183
|
+
<button data-selected="true">Top</button>
|
|
184
|
+
<button>Middle</button>
|
|
185
|
+
<button>Bottom</button>
|
|
186
|
+
</span>
|
|
187
|
+
</div>
|
|
188
|
+
<div>
|
|
189
|
+
<h3>End (<code>.btns-end</code>) — vertical, right-to-left</h3>
|
|
190
|
+
<span class="btns btns-end">
|
|
191
|
+
<button data-selected="true">Top</button>
|
|
192
|
+
<button>Middle</button>
|
|
193
|
+
<button>Bottom</button>
|
|
194
|
+
</span>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<h2 id="flush">Flush mount</h2>
|
|
199
|
+
<div class="section">
|
|
200
|
+
<div>
|
|
201
|
+
<h3>Bottom flush (<code>.btns-flush</code>)</h3>
|
|
202
|
+
<div style="padding-top:50px;border:1px solid var(--color-title-bd);border-radius:var(--default-border-radius)">
|
|
203
|
+
<span class="btns btns-flush">
|
|
204
|
+
<button data-selected="true">Left</button>
|
|
205
|
+
<button>Center</button>
|
|
206
|
+
<button>Right</button>
|
|
207
|
+
</span>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
<div>
|
|
211
|
+
<h3>Top flush (<code>.btns-top.btns-flush</code>)</h3>
|
|
212
|
+
<div style="padding-bottom:50px;border:1px solid var(--color-title-bd);border-radius:var(--default-border-radius)">
|
|
213
|
+
<span class="btns btns-top btns-flush">
|
|
214
|
+
<button data-selected="true">Left</button>
|
|
215
|
+
<button>Center</button>
|
|
216
|
+
<button>Right</button>
|
|
217
|
+
</span>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
<div>
|
|
221
|
+
<h3>Start flush (<code>.btns-start.btns-flush</code>) — vertical left</h3>
|
|
222
|
+
<div style="height:160px;border:1px solid var(--color-title-bd);border-radius:var(--default-border-radius)" class="flex">
|
|
223
|
+
<span class="btns btns-start btns-flush">
|
|
224
|
+
<button data-selected="true">Top</button>
|
|
225
|
+
<button>Middle</button>
|
|
226
|
+
<button>Bottom</button>
|
|
227
|
+
</span>
|
|
228
|
+
<div class="flex-1"></div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
<div>
|
|
232
|
+
<h3>End flush (<code>.btns-end.btns-flush</code>) — vertical right</h3>
|
|
233
|
+
<div style="height:160px;border:1px solid var(--color-title-bd);border-radius:var(--default-border-radius)" class="flex">
|
|
234
|
+
<div class="flex-1"></div>
|
|
235
|
+
<span class="btns btns-end btns-flush">
|
|
236
|
+
<button data-selected="true">Top</button>
|
|
237
|
+
<button>Middle</button>
|
|
238
|
+
<button>Bottom</button>
|
|
239
|
+
</span>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<h2 id="sizes">Sizes (btns-4 ~ btns-15)</h2>
|
|
245
|
+
<div class="section">
|
|
246
|
+
<div>
|
|
247
|
+
<h3>Extra small: 4 ~ 7</h3>
|
|
248
|
+
<span class="btns btns-4"><button data-selected="true">4</button><button>Opt</button><button>Opt</button></span>
|
|
249
|
+
<span class="btns btns-5"><button data-selected="true">5</button><button>Opt</button><button>Opt</button></span>
|
|
250
|
+
<span class="btns btns-6"><button data-selected="true">6</button><button>Opt</button><button>Opt</button></span>
|
|
251
|
+
<span class="btns btns-7"><button data-selected="true">7</button><button>Opt</button><button>Opt</button></span>
|
|
252
|
+
</div>
|
|
253
|
+
<div>
|
|
254
|
+
<h3>Small: 8 ~ 9</h3>
|
|
255
|
+
<span class="btns btns-8"><button data-selected="true">8</button><button>Opt</button><button>Opt</button></span>
|
|
256
|
+
<span class="btns btns-9"><button data-selected="true">9</button><button>Opt</button><button>Opt</button></span>
|
|
257
|
+
</div>
|
|
258
|
+
<div>
|
|
259
|
+
<h3>Medium: 10 ~ 11</h3>
|
|
260
|
+
<span class="btns btns-10"><button data-selected="true">10</button><button>Opt</button><button>Opt</button></span>
|
|
261
|
+
<span class="btns btns-11"><button data-selected="true">11</button><button>Opt</button><button>Opt</button></span>
|
|
262
|
+
</div>
|
|
263
|
+
<div>
|
|
264
|
+
<h3>Large: 12 ~ 13</h3>
|
|
265
|
+
<span class="btns btns-12"><button data-selected="true">12</button><button>Opt</button><button>Opt</button></span>
|
|
266
|
+
<span class="btns btns-13"><button data-selected="true">13</button><button>Opt</button><button>Opt</button></span>
|
|
267
|
+
</div>
|
|
268
|
+
<div>
|
|
269
|
+
<h3>Extra large: 14 ~ 15</h3>
|
|
270
|
+
<span class="btns btns-14"><button data-selected="true">14</button><button>Opt</button><button>Opt</button></span>
|
|
271
|
+
<span class="btns btns-15"><button data-selected="true">15</button><button>Opt</button><button>Opt</button></span>
|
|
272
|
+
</div>
|
|
273
|
+
<div>
|
|
274
|
+
<h3>All sizes (4 ~ 15)</h3>
|
|
275
|
+
<span class="btns btns-4"><button data-selected="true">4</button><button>Opt</button></span>
|
|
276
|
+
<span class="btns btns-5"><button data-selected="true">5</button><button>Opt</button></span>
|
|
277
|
+
<span class="btns btns-6"><button data-selected="true">6</button><button>Opt</button></span>
|
|
278
|
+
<span class="btns btns-7"><button data-selected="true">7</button><button>Opt</button></span>
|
|
279
|
+
<span class="btns btns-8"><button data-selected="true">8</button><button>Opt</button></span>
|
|
280
|
+
<span class="btns btns-9"><button data-selected="true">9</button><button>Opt</button></span>
|
|
281
|
+
<span class="btns btns-10"><button data-selected="true">10</button><button>Opt</button></span>
|
|
282
|
+
<span class="btns btns-11"><button data-selected="true">11</button><button>Opt</button></span>
|
|
283
|
+
<span class="btns btns-12"><button data-selected="true">12</button><button>Opt</button></span>
|
|
284
|
+
<span class="btns btns-13"><button data-selected="true">13</button><button>Opt</button></span>
|
|
285
|
+
<span class="btns btns-14"><button data-selected="true">14</button><button>Opt</button></span>
|
|
286
|
+
<span class="btns btns-15"><button data-selected="true">15</button><button>Opt</button></span>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<h2 id="use-cases">Use cases</h2>
|
|
291
|
+
<div class="section">
|
|
292
|
+
<div>
|
|
293
|
+
<h3>Segmented control</h3>
|
|
294
|
+
<span class="btns btns-rounded">
|
|
295
|
+
<button data-selected="true">Day</button>
|
|
296
|
+
<button>Week</button>
|
|
297
|
+
<button>Month</button>
|
|
298
|
+
<button>Year</button>
|
|
299
|
+
</span>
|
|
300
|
+
</div>
|
|
301
|
+
<div>
|
|
302
|
+
<h3>View switcher</h3>
|
|
303
|
+
<span class="btns btns-pill">
|
|
304
|
+
<button data-selected="true">📱 List</button>
|
|
305
|
+
<button>📊 Grid</button>
|
|
306
|
+
<button>📋 Detail</button>
|
|
307
|
+
</span>
|
|
308
|
+
</div>
|
|
309
|
+
<div>
|
|
310
|
+
<h3>Equal-width nav</h3>
|
|
311
|
+
<span class="btns btns-full">
|
|
312
|
+
<button data-selected="true">Home</button>
|
|
313
|
+
<button>Products</button>
|
|
314
|
+
<button>Services</button>
|
|
315
|
+
<button>About</button>
|
|
316
|
+
</span>
|
|
317
|
+
</div>
|
|
318
|
+
<div>
|
|
319
|
+
<h3>Vertical nav</h3>
|
|
320
|
+
<span class="btns btns-start">
|
|
321
|
+
<button data-selected="true">🏠 Home</button>
|
|
322
|
+
<button>📦 Products</button>
|
|
323
|
+
<button>📞 Contact</button>
|
|
324
|
+
</span>
|
|
325
|
+
</div>
|
|
326
|
+
<div>
|
|
327
|
+
<h3>Flush tab bar</h3>
|
|
328
|
+
<div style="padding-bottom:50px;border:1px solid var(--color-title-bd);border-radius:var(--default-border-radius)">
|
|
329
|
+
<span class="btns btns-top btns-flush">
|
|
330
|
+
<button data-selected="true">Recommended</button>
|
|
331
|
+
<button>Trending</button>
|
|
332
|
+
<button>Latest</button>
|
|
333
|
+
</span>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
<div>
|
|
337
|
+
<h3>Size + shape combo</h3>
|
|
338
|
+
<span class="btns btns-7 btns-pill"><button data-selected="true">S</button><button>M</button><button>L</button></span>
|
|
339
|
+
<span class="btns btns-10 btns-rounded"><button data-selected="true">S</button><button>M</button><button>L</button></span>
|
|
340
|
+
<span class="btns btns-13 btns-square"><button data-selected="true">S</button><button>M</button><button>L</button></span>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
<p>Note: Child buttons within <code>.btns</code> support all <code>btn-*</code> utilities (variants, colors, shapes, sizes, widths such as <code>btn-ratio</code>, <code>btn-ratio-*</code>, etc.). See the <a href="./demo-button.html">Button demo</a> for details.</p>
|
|
345
|
+
|
|
346
|
+
<script src="./demo-utils.js"></script>
|
|
347
|
+
</body>
|
|
348
|
+
|
|
349
|
+
</html>
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
+
<link id="wispcss-css" rel="stylesheet" href="../dist/wispcss.css">
|
|
8
|
+
<link rel="stylesheet" href="./demo-styles.css">
|
|
9
|
+
<style>
|
|
10
|
+
.bubble-demo-box{
|
|
11
|
+
display:inline-block;
|
|
12
|
+
width:300px;
|
|
13
|
+
height:160px;
|
|
14
|
+
margin-block:40px;
|
|
15
|
+
margin-inline-end:40px;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
18
|
+
<title>Bubble - WispCSS Demo</title>
|
|
19
|
+
</head>
|
|
20
|
+
|
|
21
|
+
<body>
|
|
22
|
+
<h1>Bubble Component</h1>
|
|
23
|
+
<p>Popover bubble container with directional arrows, visual variants, and theme colors.</p>
|
|
24
|
+
|
|
25
|
+
<h2>Notes</h2>
|
|
26
|
+
<div class="section">
|
|
27
|
+
<ul>
|
|
28
|
+
<li>Use class <code>.bubble</code> on a container. Direction classes control arrow placement.</li>
|
|
29
|
+
<li>Prefer shorthand compound variants like <code>bubble-outline-primary</code> over <code>bubble-outline bubble-primary</code> — smaller CSS output.</li>
|
|
30
|
+
<li>Set custom radius via <code>--bubble-border-radius</code> on the element.</li>
|
|
31
|
+
</ul>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<h2 id="basic">Basic usage</h2>
|
|
35
|
+
<div class="section">
|
|
36
|
+
<div>
|
|
37
|
+
<h3>Default bubble</h3>
|
|
38
|
+
<div class="bubble-demo-box bubble bubble-bottom" >
|
|
39
|
+
<p class="p-4">Default bubble with bottom arrow</p>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<div>
|
|
43
|
+
<h3>Custom radius</h3>
|
|
44
|
+
<div class="bubble-demo-box bubble bubble-bottom" style="--bubble-border-radius:12px">
|
|
45
|
+
<p class="p-4">Rounded bubble (12px)</p>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div>
|
|
49
|
+
<h3>Rich content</h3>
|
|
50
|
+
<div class="bubble-demo-box bubble bubble-bottom" >
|
|
51
|
+
<div class="p-4">
|
|
52
|
+
<h4 style="margin:0 0 8px 0;font-size:1rem">Title</h4>
|
|
53
|
+
<p style="margin:0;font-size:0.875rem">Detailed content inside the bubble.</p>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<h2 id="direction">Direction</h2>
|
|
60
|
+
<div class="section">
|
|
61
|
+
<div>
|
|
62
|
+
<h3>Bottom</h3>
|
|
63
|
+
<div class="bubble-demo-box bubble bubble-bottom" ><p class="p-4">Bottom</p></div>
|
|
64
|
+
<div class="bubble-demo-box bubble bubble-bottom-start" ><p class="p-4">Bottom-start</p></div>
|
|
65
|
+
<div class="bubble-demo-box bubble bubble-bottom-end" ><p class="p-4">Bottom-end</p></div>
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<h3>Top</h3>
|
|
69
|
+
<div class="bubble-demo-box bubble bubble-top" ><p class="p-4">Top</p></div>
|
|
70
|
+
<div class="bubble-demo-box bubble bubble-top-start" ><p class="p-4">Top-start</p></div>
|
|
71
|
+
<div class="bubble-demo-box bubble bubble-top-end" ><p class="p-4">Top-end</p></div>
|
|
72
|
+
</div>
|
|
73
|
+
<div>
|
|
74
|
+
<h3>Start (left)</h3>
|
|
75
|
+
<div class="bubble-demo-box bubble bubble-start" ><p class="p-4">Start</p></div>
|
|
76
|
+
<div class="bubble-demo-box bubble bubble-start-top" ><p class="p-4">Start-top</p></div>
|
|
77
|
+
<div class="bubble-demo-box bubble bubble-start-bottom" ><p class="p-4">Start-bottom</p></div>
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
<h3>End (right)</h3>
|
|
81
|
+
<div class="bubble-demo-box bubble bubble-end" ><p class="p-4">End</p></div>
|
|
82
|
+
<div class="bubble-demo-box bubble bubble-end-top" ><p class="p-4">End-top</p></div>
|
|
83
|
+
<div class="bubble-demo-box bubble bubble-end-bottom" ><p class="p-4">End-bottom</p></div>
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
<h3>Center (no arrow)</h3>
|
|
87
|
+
<div class="bubble-demo-box bubble bubble-center"><p class="p-4">Absolute centered, no arrow</p></div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<h2 id="variants">Variants</h2>
|
|
92
|
+
<div class="section">
|
|
93
|
+
<div>
|
|
94
|
+
<h3>Default (border)</h3>
|
|
95
|
+
<div class="bubble-demo-box bubble bubble-bottom" ><p class="p-4">Default</p></div>
|
|
96
|
+
</div>
|
|
97
|
+
<div>
|
|
98
|
+
<h3>Outline (<code>.bubble-outline</code>) — high contrast</h3>
|
|
99
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-outline" ><p class="p-4">Outline</p></div>
|
|
100
|
+
</div>
|
|
101
|
+
<div>
|
|
102
|
+
<h3>Solid (<code>.bubble-solid</code>) — dark fill</h3>
|
|
103
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-solid" ><p class="p-4" style="color:var(--bubble-color)">Solid</p></div>
|
|
104
|
+
</div>
|
|
105
|
+
<div>
|
|
106
|
+
<h3>Subtle (<code>.bubble-subtle</code>) — borderless tint</h3>
|
|
107
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-subtle" ><p class="p-4">Subtle</p></div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<h2 id="theme-colors">Theme colors (default style)</h2>
|
|
112
|
+
<div class="section">
|
|
113
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-primary" ><p class="p-4">Primary</p></div>
|
|
114
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-secondary" ><p class="p-4">Secondary</p></div>
|
|
115
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-tertiary" ><p class="p-4">Tertiary</p></div>
|
|
116
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-success" ><p class="p-4">Success</p></div>
|
|
117
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-error" ><p class="p-4">Error</p></div>
|
|
118
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-info" ><p class="p-4">Info</p></div>
|
|
119
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-warning" ><p class="p-4">Warning</p></div>
|
|
120
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-highlight" ><p class="p-4">Highlight</p></div>
|
|
121
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-ink" ><p class="p-4">Ink</p></div>
|
|
122
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-title" ><p class="p-4">Title</p></div>
|
|
123
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-description" ><p class="p-4">Description</p></div>
|
|
124
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-caption" ><p class="p-4">Caption</p></div>
|
|
125
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-placeholder" ><p class="p-4">Disabled</p></div>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<h2 id="compound-variants">Shorthand compound variants</h2>
|
|
129
|
+
<div class="section">
|
|
130
|
+
<div>
|
|
131
|
+
<h3>Muted (<code>.bubble-muted-*</code>) — light border</h3>
|
|
132
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-muted-primary" ><p class="p-4">Primary</p></div>
|
|
133
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-muted-success" ><p class="p-4">Success</p></div>
|
|
134
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-muted-error" ><p class="p-4">Error</p></div>
|
|
135
|
+
</div>
|
|
136
|
+
<div>
|
|
137
|
+
<h3>Outline (<code>.bubble-outline-*</code>)</h3>
|
|
138
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-outline-primary" ><p class="p-4">Primary</p></div>
|
|
139
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-outline-success" ><p class="p-4">Success</p></div>
|
|
140
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-outline-error" ><p class="p-4">Error</p></div>
|
|
141
|
+
</div>
|
|
142
|
+
<div>
|
|
143
|
+
<h3>Solid (<code>.bubble-solid-*</code>)</h3>
|
|
144
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-solid-primary" ><p class="p-4" style="color:var(--bubble-color)">Primary</p></div>
|
|
145
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-solid-success" ><p class="p-4" style="color:var(--bubble-color)">Success</p></div>
|
|
146
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-solid-error" ><p class="p-4" style="color:var(--bubble-color)">Error</p></div>
|
|
147
|
+
</div>
|
|
148
|
+
<div>
|
|
149
|
+
<h3>Subtle (<code>.bubble-subtle-*</code>) — borderless tint</h3>
|
|
150
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-subtle-primary" ><p class="p-4">Primary</p></div>
|
|
151
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-subtle-success" ><p class="p-4">Success</p></div>
|
|
152
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-subtle-error" ><p class="p-4">Error</p></div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<h2 id="custom-colors">Custom colors</h2>
|
|
157
|
+
<p>Multiple color formats are supported:</p>
|
|
158
|
+
<ul>
|
|
159
|
+
<li>1. Theme semantic colors, e.g. <code>*-error</code>, <code>*-error-hover</code></li>
|
|
160
|
+
<li>2. Tailwind built-in colors, e.g. <code>*-indigo-500</code></li>
|
|
161
|
+
<li>3. Raw color values, e.g. <code>*-[#ff0000]</code></li>
|
|
162
|
+
<li>4. CSS named colors, e.g. <code>*-[red]</code>, <code>*-[green]</code></li>
|
|
163
|
+
</ul>
|
|
164
|
+
<div class="section">
|
|
165
|
+
<div>
|
|
166
|
+
<h3>Solid with Tailwind colors</h3>
|
|
167
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-solid-green-500" ><p class="p-4" style="color:var(--bubble-color)">green-500</p></div>
|
|
168
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-solid-green-800" ><p class="p-4" style="color:var(--bubble-color)">green-800</p></div>
|
|
169
|
+
</div>
|
|
170
|
+
<div>
|
|
171
|
+
<h3>Outline with Tailwind colors</h3>
|
|
172
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-red-500" ><p class="p-4">red-500</p></div>
|
|
173
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-red-800" ><p class="p-4">red-800</p></div>
|
|
174
|
+
</div>
|
|
175
|
+
<div>
|
|
176
|
+
<h3>Muted with Tailwind colors</h3>
|
|
177
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-muted-red-500" ><p class="p-4">red-500</p></div>
|
|
178
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-muted-red-100" ><p class="p-4">red-100</p></div>
|
|
179
|
+
</div>
|
|
180
|
+
<div>
|
|
181
|
+
<h3>Subtle with Tailwind colors</h3>
|
|
182
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-subtle-blue-500" ><p class="p-4">blue-500</p></div>
|
|
183
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-subtle-blue-100" ><p class="p-4">blue-100</p></div>
|
|
184
|
+
</div>
|
|
185
|
+
<div>
|
|
186
|
+
<h3>Raw color values</h3>
|
|
187
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-solid-[blue]" ><p class="p-4" style="color:var(--bubble-color)">[blue]</p></div>
|
|
188
|
+
<div class="bubble-demo-box bubble bubble-bottom bubble-solid-[#ff0000]" ><p class="p-4" style="color:var(--bubble-color)">[#ff0000]</p></div>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<h2 id="use-cases">Use cases</h2>
|
|
193
|
+
<div class="section">
|
|
194
|
+
<div>
|
|
195
|
+
<h3>Tooltip</h3>
|
|
196
|
+
<div class="bubble-demo-box bubble bubble-top bubble-solid" ><p class="p-4" style="color:var(--bubble-color);font-size:0.875rem">This is a tooltip</p></div>
|
|
197
|
+
</div>
|
|
198
|
+
<div>
|
|
199
|
+
<h3>Success notification</h3>
|
|
200
|
+
<div class="bubble-demo-box bubble bubble-end bubble-success" ><p class="p-4">Operation completed</p></div>
|
|
201
|
+
</div>
|
|
202
|
+
<div>
|
|
203
|
+
<h3>Error notification</h3>
|
|
204
|
+
<div class="bubble-demo-box bubble bubble-start bubble-error" ><p class="p-4">Operation failed</p></div>
|
|
205
|
+
</div>
|
|
206
|
+
<div>
|
|
207
|
+
<h3>Warning notification</h3>
|
|
208
|
+
<div class="bubble-demo-box bubble bubble-top bubble-solid-highlight" ><p class="p-4" style="color:var(--bubble-color)">Password expires soon</p></div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<script src="./demo-utils.js"></script>
|
|
213
|
+
</body>
|
|
214
|
+
|
|
215
|
+
</html>
|