wispcss 0.0.1 → 1.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/CHANGELOG.md +78 -0
- package/LICENSE +49 -0
- package/README.md +386 -0
- package/README.zh-CN.md +385 -0
- package/dist/wispcss.css +42758 -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 +72 -8
- package/script-gen-color.js +148 -0
- package/script-mini.js +77 -0
- package/script-prefix.js +398 -0
- package/skill.md +575 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script to add id attributes to h2 elements in demo html files.
|
|
3
|
+
* id values represent the section's purpose/type, not literal h2 text.
|
|
4
|
+
*/
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
|
|
8
|
+
const examplesDir = __dirname;
|
|
9
|
+
const files = fs.readdirSync(examplesDir).filter(f => f.startsWith('demo-') && f.endsWith('.html'));
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Determine id from h2 text and context.
|
|
13
|
+
* Maps section headings to meaningful feature-type identifiers.
|
|
14
|
+
*/
|
|
15
|
+
function h2ToId(text) {
|
|
16
|
+
const t = text.trim();
|
|
17
|
+
|
|
18
|
+
// --- Sections that should NOT have an id (documentation, not a demo section) ---
|
|
19
|
+
if (/^notes$/i.test(t)) return null;
|
|
20
|
+
|
|
21
|
+
// --- Common section patterns ---
|
|
22
|
+
|
|
23
|
+
// Basic / Base / Default
|
|
24
|
+
if (/^basic\s+usage$/i.test(t)) return 'basic';
|
|
25
|
+
if (/^base\s*$/i.test(t)) return 'base';
|
|
26
|
+
if (/^default\s*$/i.test(t) && !/blockquote|style|layout/i.test(t)) return 'default';
|
|
27
|
+
if (/^default\s+blockquote$/i.test(t)) return 'default';
|
|
28
|
+
|
|
29
|
+
// Elements
|
|
30
|
+
if (/^button\s+elements$/i.test(t)) return 'elements';
|
|
31
|
+
if (/^all\s+elements$/i.test(t)) return 'elements';
|
|
32
|
+
|
|
33
|
+
// Input types (form page etc.)
|
|
34
|
+
if (/^text\s+inputs$/i.test(t)) return 'text-inputs';
|
|
35
|
+
if (/^numeric\s*(&|and)\s*time$/i.test(t)) return 'numeric-time';
|
|
36
|
+
if (/^selection\s+controls$/i.test(t)) return 'selection-controls';
|
|
37
|
+
if (/^file\s*(&|and)\s*buttons$/i.test(t)) return 'file-buttons';
|
|
38
|
+
|
|
39
|
+
// Sizes
|
|
40
|
+
if (/^size(s?)\s*(\(.*?\))?$/i.test(t)) return 'sizes';
|
|
41
|
+
if (/^size\s+variants$/i.test(t)) return 'sizes';
|
|
42
|
+
if (/^dynamic\s+size\b/i.test(t)) return 'dynamic-size';
|
|
43
|
+
if (/^sizes\s*\(.*?\)/i.test(t)) return 'sizes';
|
|
44
|
+
|
|
45
|
+
// Shapes
|
|
46
|
+
if (/^shape(s?)\s*(\(.*?\))?$/i.test(t)) return 'shapes';
|
|
47
|
+
if (/^all\s+shapes$/i.test(t)) return 'shapes';
|
|
48
|
+
if (/^shape\s+modifiers$/i.test(t)) return 'shapes';
|
|
49
|
+
if (/^shape\s+transitions/i.test(t)) return 'shape-transitions';
|
|
50
|
+
|
|
51
|
+
// Colors
|
|
52
|
+
if (/^theme\s+colors/i.test(t)) return 'theme-colors';
|
|
53
|
+
if (/^custom\s+colors$/i.test(t)) return 'custom-colors';
|
|
54
|
+
if (/^solid\s+theme\s+colors/i.test(t)) return 'theme-colors-solid';
|
|
55
|
+
if (/^primary\s+colors$/i.test(t)) return 'primary-colors';
|
|
56
|
+
if (/^status\s+colors$/i.test(t)) return 'status-colors';
|
|
57
|
+
if (/^neutral\s+colors$/i.test(t)) return 'neutral-colors';
|
|
58
|
+
if (/^color\s+schemes$/i.test(t)) return 'color-schemes';
|
|
59
|
+
|
|
60
|
+
// Color sub-sections
|
|
61
|
+
if (/^colors?\s*[:—]\s*/i.test(t)) {
|
|
62
|
+
const sub = t.replace(/^colors?\s*[:——]\s*/i, '').toLowerCase().replace(/\s+/g, '-').replace(/[()]/g, '');
|
|
63
|
+
return `colors-${sub}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Variants
|
|
67
|
+
if (/^variant(s?)\s*(\(.*?\))?$/i.test(t)) return 'variants';
|
|
68
|
+
if (/^visual\s+variants/i.test(t)) return 'variants';
|
|
69
|
+
if (/^shortcut\s+variant/i.test(t)) return 'variant-shortcuts';
|
|
70
|
+
if (/^style\s+variants/i.test(t)) return 'style-variants';
|
|
71
|
+
if (/^layout\s+variants/i.test(t)) return 'layout-variants';
|
|
72
|
+
if (/^shorthand\s+compound\s+variants/i.test(t)) return 'compound-variants';
|
|
73
|
+
|
|
74
|
+
// Combinations / Use cases
|
|
75
|
+
if (/^use\s+cases?$/i.test(t)) return 'use-cases';
|
|
76
|
+
if (/^combinations?$/i.test(t)) return 'combinations';
|
|
77
|
+
if (/^variant\s*\+\s*shape\s+combinations/i.test(t)) return 'combinations';
|
|
78
|
+
if (/^color\s*\+\s*size\s+combination/i.test(t)) return 'combination';
|
|
79
|
+
if (/^size\s*\+\s*ratio\s+combinations/i.test(t)) return 'size-ratio-combinations';
|
|
80
|
+
|
|
81
|
+
// Layout
|
|
82
|
+
if (/^layout(s?)\s*(\(.*?\))?$/i.test(t)) return 'layout';
|
|
83
|
+
if (/^layout\s+alignment$/i.test(t)) return 'layout-alignment';
|
|
84
|
+
|
|
85
|
+
// Direction
|
|
86
|
+
if (/^direction(s?)\s*(\(.*?\))?$/i.test(t)) return 'direction';
|
|
87
|
+
if (/^directions$/i.test(t)) return 'direction';
|
|
88
|
+
|
|
89
|
+
// Width
|
|
90
|
+
if (/^width\s*(variants)?$/i.test(t)) return 'width';
|
|
91
|
+
if (/^scale\s+width$/i.test(t)) return 'scale-width';
|
|
92
|
+
if (/^dynamic\s+width$/i.test(t)) return 'dynamic-width';
|
|
93
|
+
|
|
94
|
+
// States
|
|
95
|
+
if (/^state(s?)$/i.test(t)) return 'states';
|
|
96
|
+
|
|
97
|
+
// Hover effects
|
|
98
|
+
if (/^hover\s+effects?\b/i.test(t)) {
|
|
99
|
+
const sub = t.replace(/^hover\s+effects?\s*[:—]\s*/i, '').toLowerCase()
|
|
100
|
+
.replace(/[()']/g, '').trim();
|
|
101
|
+
return `hover-${sub}`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Poster specific
|
|
105
|
+
if (/^placeholder\b/i.test(t)) return 'placeholder';
|
|
106
|
+
if (/^aspect\s+ratio/i.test(t)) return 'aspect-ratio';
|
|
107
|
+
if (/^caption$/i.test(t)) return 'caption';
|
|
108
|
+
if (/^marker$/i.test(t)) return 'marker';
|
|
109
|
+
|
|
110
|
+
// Dialog
|
|
111
|
+
if (/^open\s+methods$/i.test(t)) return 'open-methods';
|
|
112
|
+
|
|
113
|
+
// Features
|
|
114
|
+
if (/^features?$/i.test(t)) return 'features';
|
|
115
|
+
if (/^text\s+features?$/i.test(t)) return 'text-features';
|
|
116
|
+
if (/^fixed\s+nodes?$/i.test(t)) return 'fixed-nodes';
|
|
117
|
+
|
|
118
|
+
// Separators
|
|
119
|
+
if (/^separators?$/i.test(t)) return 'separators';
|
|
120
|
+
|
|
121
|
+
// Line styles
|
|
122
|
+
if (/^line\s+styles?$/i.test(t)) return 'line-styles';
|
|
123
|
+
|
|
124
|
+
// Vertical divider
|
|
125
|
+
if (/^vertical\s+divider/i.test(t)) return 'vertical';
|
|
126
|
+
|
|
127
|
+
// Radius
|
|
128
|
+
if (/^radius$/i.test(t)) return 'radius';
|
|
129
|
+
|
|
130
|
+
// Animation specific names (they ARE the feature type)
|
|
131
|
+
const animNames = [
|
|
132
|
+
'rotation', 'remind', 'float', 'bounce', 'blink', 'heartbeat',
|
|
133
|
+
'shake', 'fade', 'ease', 'spring', 'scale', 'fly', 'rotate',
|
|
134
|
+
];
|
|
135
|
+
const animMatch = t.match(new RegExp(`^(${animNames.join('|')})\\b`, 'i'));
|
|
136
|
+
if (animMatch) {
|
|
137
|
+
const prefix = animMatch[1].toLowerCase();
|
|
138
|
+
const suffix = t.replace(new RegExp(`^${animMatch[1]}\\s*`, 'i'), '').replace(/[()]/g, '').trim();
|
|
139
|
+
if (!suffix) return prefix;
|
|
140
|
+
return `${prefix}-${suffix.toLowerCase().replace(/\s+/g, '-')}`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Dynamic duration
|
|
144
|
+
if (/^dynamic\s+duration/i.test(t)) return 'dynamic-duration';
|
|
145
|
+
|
|
146
|
+
// Configuration
|
|
147
|
+
if (/^configuration$/i.test(t)) return 'configuration';
|
|
148
|
+
if (/^controls$/i.test(t)) return 'controls';
|
|
149
|
+
if (/^color\s+swatches$/i.test(t)) return 'color-swatches';
|
|
150
|
+
|
|
151
|
+
// Button variants
|
|
152
|
+
if (/^base\s+variants?\s*\+?\s*color/i.test(t)) return 'variants-color';
|
|
153
|
+
if (/^btn-link/i.test(t)) return 'btn-link';
|
|
154
|
+
if (/^link\s+cjk/i.test(t)) return 'link-cjk';
|
|
155
|
+
|
|
156
|
+
// Tabs/segments
|
|
157
|
+
if (/^fill\s+mode/i.test(t)) return 'fill';
|
|
158
|
+
if (/^justify\s+(mode|content)/i.test(t)) return 'justify';
|
|
159
|
+
if (/^variant\s+style/i.test(t)) return 'variant-style';
|
|
160
|
+
|
|
161
|
+
// Underline styles
|
|
162
|
+
if (/^underline\s*\(/i.test(t)) return 'underline-default';
|
|
163
|
+
if (/^underline-/i.test(t)) {
|
|
164
|
+
const m = t.match(/^underline-(\w+)/);
|
|
165
|
+
if (m) return `underline-${m[1].toLowerCase()}`;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Two markup structures
|
|
169
|
+
if (/^two\s+markup/i.test(t)) return 'markup-structures';
|
|
170
|
+
if (/^custom\s+messages/i.test(t)) return 'custom-messages';
|
|
171
|
+
|
|
172
|
+
// Replacement / cancel etc for ellipsis
|
|
173
|
+
if (/^cancel\b/i.test(t)) return 'cancel';
|
|
174
|
+
if (/^reserve\s+height/i.test(t)) return 'reserve';
|
|
175
|
+
if (/^fadeout/i.test(t)) return 'fadeout';
|
|
176
|
+
if (/^single\s+line$/i.test(t)) return 'single-line';
|
|
177
|
+
if (/^multi-line/i.test(t)) return 'multi-line';
|
|
178
|
+
|
|
179
|
+
// Flip
|
|
180
|
+
if (/^flip$/i.test(t)) return 'flip';
|
|
181
|
+
|
|
182
|
+
// Open (hollow) fill
|
|
183
|
+
if (/^open\s+\(hollow\)\s+fill/i.test(t)) return 'hollow';
|
|
184
|
+
|
|
185
|
+
// Language auto-detection
|
|
186
|
+
if (/^language\s+auto/i.test(t)) return 'auto-detection';
|
|
187
|
+
if (/^manual\s+classes/i.test(t)) return 'manual-classes';
|
|
188
|
+
if (/^comparison\s+with/i.test(t)) return 'comparison';
|
|
189
|
+
|
|
190
|
+
// Ghost variant
|
|
191
|
+
if (/^ghost\s+variant/i.test(t)) return 'ghost';
|
|
192
|
+
|
|
193
|
+
// Popup positions
|
|
194
|
+
if (/^popup\s+positions/i.test(t)) return 'popup-positions';
|
|
195
|
+
|
|
196
|
+
// Panel content
|
|
197
|
+
if (/^panel\s+content/i.test(t)) return 'panel-content';
|
|
198
|
+
|
|
199
|
+
// Submenu
|
|
200
|
+
if (/^submenu/i.test(t)) return 'submenu';
|
|
201
|
+
|
|
202
|
+
// With bubble / shell / etc
|
|
203
|
+
if (/^with\s+(bubble|shell|input)/i.test(t)) return `with-${t.match(/with\s+(\w+)/i)[1].toLowerCase()}`;
|
|
204
|
+
|
|
205
|
+
// Berformance / flush mount
|
|
206
|
+
if (/^flush\s+mount/i.test(t)) return 'flush';
|
|
207
|
+
|
|
208
|
+
// Nested replies
|
|
209
|
+
if (/^nested\s+replies/i.test(t)) return 'nested-replies';
|
|
210
|
+
if (/^media\s+content/i.test(t)) return 'media-content';
|
|
211
|
+
if (/^quoted\s+reply/i.test(t)) return 'quoted-reply';
|
|
212
|
+
if (/^rich\s+content/i.test(t)) return 'rich-content';
|
|
213
|
+
|
|
214
|
+
// Specific feature names (preserve as-is, kebab-case)
|
|
215
|
+
if (/^real-world\s+usage/i.test(t)) return 'real-world';
|
|
216
|
+
|
|
217
|
+
// For "Morph animation"
|
|
218
|
+
if (/^morph\s+animation/i.test(t)) return 'morph';
|
|
219
|
+
if (/^animation$/i.test(t)) return 'animation';
|
|
220
|
+
|
|
221
|
+
// Card examples
|
|
222
|
+
if (/^card\s+examples/i.test(t)) return 'card-examples';
|
|
223
|
+
|
|
224
|
+
// Background types
|
|
225
|
+
if (/^geometric\s+textures/i.test(t)) return 'geometric';
|
|
226
|
+
if (/^whisper\b/i.test(t)) return 'whisper';
|
|
227
|
+
if (/^tint\b/i.test(t)) return 'tint';
|
|
228
|
+
if (/^blend\b/i.test(t)) return 'blend';
|
|
229
|
+
if (/^aurora\b/i.test(t)) return 'aurora';
|
|
230
|
+
if (/^layered\s+backgrounds/i.test(t)) return 'layered';
|
|
231
|
+
|
|
232
|
+
// ** Icons
|
|
233
|
+
if (/^icon\s+types\s+comparison/i.test(t)) return 'icon-types';
|
|
234
|
+
if (/^with\s+icons/i.test(t)) return 'with-icons';
|
|
235
|
+
|
|
236
|
+
// ** Markup structures (validate)
|
|
237
|
+
if (/^i18n\s+variables/i.test(t)) return 'i18n-variables';
|
|
238
|
+
|
|
239
|
+
// Borderless mode
|
|
240
|
+
if (/^borderless\s+mode/i.test(t)) return 'borderless';
|
|
241
|
+
|
|
242
|
+
// Dark variant
|
|
243
|
+
if (/^dark\s+variant/i.test(t)) return 'dark';
|
|
244
|
+
|
|
245
|
+
// Selection
|
|
246
|
+
if (/^default\s+(&|and)\s+selection/i.test(t)) return 'default-selection';
|
|
247
|
+
|
|
248
|
+
// Any other - convert to kebab case, strip parentheticals
|
|
249
|
+
return t
|
|
250
|
+
.toLowerCase()
|
|
251
|
+
.replace(/[()]/g, '')
|
|
252
|
+
.replace(/[:]/g, '')
|
|
253
|
+
.replace(/[''`]/g, '')
|
|
254
|
+
.replace(/\+/g, 'plus')
|
|
255
|
+
.replace(/[&]+/g, 'and')
|
|
256
|
+
.replace(/[^a-z0-9\u4e00-\u9fff\s-]/g, '')
|
|
257
|
+
.trim()
|
|
258
|
+
.replace(/\s+/g, '-')
|
|
259
|
+
.replace(/-+/g, '-')
|
|
260
|
+
.replace(/^-|-$/g, '');
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Process each file
|
|
264
|
+
files.forEach(file => {
|
|
265
|
+
const filePath = path.join(examplesDir, file);
|
|
266
|
+
let content = fs.readFileSync(filePath, 'utf-8');
|
|
267
|
+
const original = content;
|
|
268
|
+
|
|
269
|
+
// Match h2 that does NOT already have an id attribute
|
|
270
|
+
content = content.replace(/<h2>(?!.*\bid=)([^<]+)<\/h2>/g, (match, text) => {
|
|
271
|
+
const id = h2ToId(text);
|
|
272
|
+
if (!id) return match; // Skip (e.g. "Notes")
|
|
273
|
+
return `<h2 id="${id}">${text}</h2>`;
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
if (content !== original) {
|
|
277
|
+
fs.writeFileSync(filePath, content, 'utf-8');
|
|
278
|
+
console.log(`✓ ${file}`);
|
|
279
|
+
} else {
|
|
280
|
+
console.log(`- ${file} (no changes)`);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
console.log('\nDone.');
|
|
@@ -0,0 +1,188 @@
|
|
|
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>Actions - WispCSS Demo</title>
|
|
10
|
+
<style>
|
|
11
|
+
.box{
|
|
12
|
+
border:1px solid var(--color-title-bd);
|
|
13
|
+
border-radius:var(--default-border-radius);
|
|
14
|
+
padding:1rem;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<h1>Actions Component</h1>
|
|
21
|
+
<p>Action bar for footer areas (card / dialog / modal) with start, center and end aligned groups.</p>
|
|
22
|
+
|
|
23
|
+
<h2>Notes</h2>
|
|
24
|
+
<div class="section">
|
|
25
|
+
<ul>
|
|
26
|
+
<li>Use <code>.actions</code> as the container; child groups use <code>.actions-start</code>, <code>.actions-center</code> and <code>.actions-end</code>.</li>
|
|
27
|
+
<li>Each group lays its content in a row with a consistent gap, so text, buttons, checkboxes and other inline content can be mixed freely.</li>
|
|
28
|
+
<li>An empty <code>.actions</code> bar is hidden automatically.</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<h2 id="basic">Basic usage</h2>
|
|
33
|
+
<div class="section">
|
|
34
|
+
<div>
|
|
35
|
+
<h3>Default (start / center / end)</h3>
|
|
36
|
+
<div class="box">
|
|
37
|
+
<div class="actions">
|
|
38
|
+
<div class="actions-start">
|
|
39
|
+
<label class="check"><input type="checkbox" /> Check it</label>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="actions-center">1/4</div>
|
|
42
|
+
<div class="actions-end">
|
|
43
|
+
<button>Cancel</button>
|
|
44
|
+
<button class="btn-primary">Confirm</button>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<h2 id="contents">Content types</h2>
|
|
52
|
+
<div class="section">
|
|
53
|
+
<div>
|
|
54
|
+
<h3>Text + buttons</h3>
|
|
55
|
+
<div class="box">
|
|
56
|
+
<div class="actions">
|
|
57
|
+
<div class="actions-start"><span class="text-caption">3 items selected</span></div>
|
|
58
|
+
<div class="actions-center"><span class="text-caption">Page 1 of 9</span></div>
|
|
59
|
+
<div class="actions-end">
|
|
60
|
+
<button>Cancel</button>
|
|
61
|
+
<button class="btn-primary">Confirm</button>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div>
|
|
67
|
+
<h3>Checkbox group</h3>
|
|
68
|
+
<div class="box">
|
|
69
|
+
<div class="actions">
|
|
70
|
+
<div class="actions-start">
|
|
71
|
+
<label class="check"><input type="checkbox" /> Select all</label>
|
|
72
|
+
<label class="check"><input type="checkbox" checked /> Auto save</label>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="actions-end">
|
|
75
|
+
<button>Reset</button>
|
|
76
|
+
<button class="btn-primary">Save</button>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<h3>Switch + Ghost button </h3>
|
|
83
|
+
<div class="box">
|
|
84
|
+
<div class="actions">
|
|
85
|
+
<div class="actions-start">
|
|
86
|
+
<span>Enable notifications</span>
|
|
87
|
+
<label class="switch"><input type="checkbox" checked /></label>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<div class="actions-end">
|
|
91
|
+
<button class="btn-ghost">Discard</button>
|
|
92
|
+
<button class="btn-primary">Apply</button>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div>
|
|
99
|
+
<h3>Single-line ellipsis text</h3>
|
|
100
|
+
<div class="box">
|
|
101
|
+
<div class="actions">
|
|
102
|
+
<div class="actions-start">
|
|
103
|
+
<div class="ellipsis">This is a two-line truncation demo. When text exceeds two lines, the rest is cut off and an ellipsis is shown. This keeps the layout tidy and is very useful for card summaries and article lists.</div>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="actions-end">
|
|
106
|
+
<button class="btn-primary">Confirm</button>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div>
|
|
113
|
+
<h3>Two-line ellipsis text</h3>
|
|
114
|
+
<div class="box">
|
|
115
|
+
<div class="actions">
|
|
116
|
+
<div class="actions-start">
|
|
117
|
+
<div class="ellipsis-2">This is a two-line truncation demo. When text exceeds two lines, the rest is cut off and an ellipsis is shown. This keeps the layout tidy and is very useful for card summaries and article lists.</div>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="actions-end">
|
|
120
|
+
<button class="btn-primary">Confirm</button>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<div>
|
|
127
|
+
<h3>Buttons at both ends</h3>
|
|
128
|
+
<div class="box">
|
|
129
|
+
<div class="actions">
|
|
130
|
+
<div class="actions-start">
|
|
131
|
+
<button>Back</button>
|
|
132
|
+
</div>
|
|
133
|
+
<div class="actions-end">
|
|
134
|
+
|
|
135
|
+
<button class="btn-primary">Next</button>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<div>
|
|
142
|
+
<h3>Buttons centered</h3>
|
|
143
|
+
<div class="box">
|
|
144
|
+
<div class="actions">
|
|
145
|
+
<div class="actions-center">
|
|
146
|
+
<button>Back</button>
|
|
147
|
+
<button class="btn-primary">Next</button>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
<div>
|
|
155
|
+
<h3>Avatar + tool icons</h3>
|
|
156
|
+
<div class="box">
|
|
157
|
+
<div class="actions">
|
|
158
|
+
<div class="actions-start">
|
|
159
|
+
<span class="avatar avatar-circle avatar-6"><img src="https://unpkg.com/@codady/resource/image/earth01_sm.jpg" /></span>
|
|
160
|
+
<span>Shared with 2 people</span>
|
|
161
|
+
</div>
|
|
162
|
+
<div class="actions-end">
|
|
163
|
+
<span class="tools">
|
|
164
|
+
<span><span class="icon icon-check"></span></span>
|
|
165
|
+
<span><span class="icon icon-close"></span></span>
|
|
166
|
+
</span>
|
|
167
|
+
<button class="btn-primary">Invite</button>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<h2 id="empty">Empty state</h2>
|
|
175
|
+
<div class="section">
|
|
176
|
+
<div>
|
|
177
|
+
<h3>Empty actions bar is hidden</h3>
|
|
178
|
+
<div class="box">
|
|
179
|
+
<div class="actions"></div>
|
|
180
|
+
<p class="text-caption">The empty <code>.actions</code> div above renders no space.</p>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<script src="./demo-utils.js"></script>
|
|
186
|
+
</body>
|
|
187
|
+
|
|
188
|
+
</html>
|