askrobots / dbbasic-web-native
Public
100+ copy-paste UI components in plain HTML and CSS: no dependencies, no build step.
danq9
Add canonical.html v1.0 - The single source of truth for usability standards
fb6e650
1 year ago
History
component-gallery.html · 92.6 KB · 2066 lines
| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <title>Component Gallery - All States & Variations</title> |
| 7 | <script src="semantic-components.js?v=8"></script> |
| 8 | <script src="voice-system.js"></script> |
| 9 | <script src="context-detection.js"></script> |
| 10 | <script src="attention-ml.js"></script> |
| 11 | <script src="gesture-recognition.js"></script> |
| 12 | <script src="devtools.js?v=6"></script> |
| 13 | <script src="visual-test-suite.js?v=6"></script> |
| 14 | <style> |
| 15 | * { |
| 16 | margin: 0; |
| 17 | padding: 0; |
| 18 | box-sizing: border-box; |
| 19 | } |
| 20 | |
| 21 | body { |
| 22 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; |
| 23 | background: #000; |
| 24 | color: #fff; |
| 25 | line-height: 1.6; |
| 26 | padding: 48px 24px; |
| 27 | } |
| 28 | |
| 29 | .container { |
| 30 | max-width: 1600px; |
| 31 | margin: 0 auto; |
| 32 | } |
| 33 | |
| 34 | header { |
| 35 | margin-bottom: 64px; |
| 36 | text-align: center; |
| 37 | } |
| 38 | |
| 39 | h1 { |
| 40 | font-size: 48px; |
| 41 | font-weight: 900; |
| 42 | margin-bottom: 16px; |
| 43 | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 44 | -webkit-background-clip: text; |
| 45 | -webkit-text-fill-color: transparent; |
| 46 | background-clip: text; |
| 47 | } |
| 48 | |
| 49 | .subtitle { |
| 50 | font-size: 20px; |
| 51 | color: #ababab; /* WCAG AA compliant - 4.6:1 contrast on black */ |
| 52 | } |
| 53 | |
| 54 | /* Component Section */ |
| 55 | .component-section { |
| 56 | margin-bottom: 120px; |
| 57 | } |
| 58 | |
| 59 | .section-header { |
| 60 | margin-bottom: 48px; |
| 61 | padding-bottom: 24px; |
| 62 | border-bottom: 2px solid #38383a; |
| 63 | } |
| 64 | |
| 65 | .section-title { |
| 66 | font-size: 36px; |
| 67 | font-weight: 800; |
| 68 | margin-bottom: 8px; |
| 69 | } |
| 70 | |
| 71 | .section-description { |
| 72 | font-size: 16px; |
| 73 | color: #ababab; |
| 74 | } |
| 75 | |
| 76 | /* Variation Groups */ |
| 77 | .variation-group { |
| 78 | margin-bottom: 64px; |
| 79 | background: #1c1c1e; |
| 80 | border: 1px solid #38383a; |
| 81 | border-radius: 16px; |
| 82 | padding: 32px; |
| 83 | } |
| 84 | |
| 85 | .variation-title { |
| 86 | font-size: 24px; |
| 87 | font-weight: 700; |
| 88 | margin-bottom: 8px; |
| 89 | color: #409cff; /* Lighter blue for WCAG AA compliance: 5.5:1 on #1c1c1e */ |
| 90 | } |
| 91 | |
| 92 | .variation-description { |
| 93 | font-size: 14px; |
| 94 | color: #ababab; |
| 95 | margin-bottom: 24px; |
| 96 | } |
| 97 | |
| 98 | .variation-grid { |
| 99 | display: grid; |
| 100 | gap: 24px; |
| 101 | } |
| 102 | |
| 103 | .grid-1 { grid-template-columns: 1fr; } |
| 104 | .grid-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); } |
| 105 | .grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } |
| 106 | .grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); } |
| 107 | .grid-auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } |
| 108 | |
| 109 | /* Example Cards */ |
| 110 | .example-card { |
| 111 | background: #2c2c2e; |
| 112 | border: 1px solid #38383a; |
| 113 | border-radius: 12px; |
| 114 | padding: 24px; |
| 115 | } |
| 116 | |
| 117 | .example-label { |
| 118 | font-size: 12px; |
| 119 | font-weight: 600; |
| 120 | text-transform: uppercase; |
| 121 | letter-spacing: 1px; |
| 122 | color: #ababab; |
| 123 | margin-bottom: 16px; |
| 124 | } |
| 125 | |
| 126 | .example-content { |
| 127 | display: flex; |
| 128 | flex-direction: column; |
| 129 | gap: 16px; |
| 130 | align-items: flex-start; |
| 131 | } |
| 132 | |
| 133 | .example-code { |
| 134 | width: 100%; |
| 135 | margin-top: 16px; |
| 136 | padding: 16px; |
| 137 | background: #000; |
| 138 | border: 1px solid #38383a; |
| 139 | border-radius: 8px; |
| 140 | font-family: 'Monaco', monospace; |
| 141 | font-size: 12px; |
| 142 | color: #34c759; |
| 143 | overflow-x: auto; |
| 144 | } |
| 145 | |
| 146 | /* State Indicators */ |
| 147 | .state-indicator { |
| 148 | padding: 4px 8px; |
| 149 | border-radius: 4px; |
| 150 | font-size: 11px; |
| 151 | font-weight: 700; |
| 152 | display: inline-block; |
| 153 | margin-bottom: 8px; |
| 154 | } |
| 155 | |
| 156 | .state-default { background: rgba(0, 102, 204, 0.2); color: #ffffff; font-weight: 900; } |
| 157 | .state-hover { background: rgba(0, 102, 204, 0.3); color: #ffffff; font-weight: 900; } |
| 158 | .state-active { background: rgba(0, 102, 204, 0.4); color: #ffffff; font-weight: 900; } |
| 159 | .state-disabled { background: rgba(142, 142, 147, 0.3); color: #ffffff; font-weight: 900; } |
| 160 | .state-focus { background: rgba(52, 199, 89, 0.3); color: #ffffff; font-weight: 900; } |
| 161 | .state-error { background: rgba(255, 59, 48, 0.3); color: #ffffff; font-weight: 900; } |
| 162 | |
| 163 | /* Interactive State Demo Box */ |
| 164 | .state-demo-box { |
| 165 | position: relative; |
| 166 | padding: 32px; |
| 167 | background: #000; |
| 168 | border: 2px solid #38383a; |
| 169 | border-radius: 12px; |
| 170 | text-align: center; |
| 171 | cursor: pointer; |
| 172 | transition: all 0.2s ease; |
| 173 | } |
| 174 | |
| 175 | .state-demo-box.clickable { |
| 176 | cursor: pointer; |
| 177 | } |
| 178 | |
| 179 | .state-demo-box.clickable:hover { |
| 180 | border-color: #409cff !important; |
| 181 | border-width: 2px !important; |
| 182 | background: rgba(64, 156, 255, 0.15) !important; |
| 183 | transform: translateY(-4px) !important; |
| 184 | box-shadow: 0 0 0 2px rgba(64, 156, 255, 0.2), 0 12px 32px rgba(64, 156, 255, 0.3) !important; |
| 185 | } |
| 186 | |
| 187 | .state-demo-box.clickable:active { |
| 188 | transform: scale(0.98); |
| 189 | background: rgba(64, 156, 255, 0.15); |
| 190 | } |
| 191 | |
| 192 | .state-demo-box.selected { |
| 193 | border-color: #34c759 !important; |
| 194 | border-width: 3px !important; |
| 195 | background: rgba(52, 199, 89, 0.2) !important; |
| 196 | box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.4), 0 8px 24px rgba(52, 199, 89, 0.3) !important; |
| 197 | transform: none !important; |
| 198 | } |
| 199 | |
| 200 | .state-demo-box.selected::before { |
| 201 | content: '✓ SELECTED'; |
| 202 | position: absolute; |
| 203 | top: -12px; |
| 204 | right: -12px; |
| 205 | background: #34c759; |
| 206 | color: #000; |
| 207 | padding: 6px 14px; |
| 208 | border-radius: 16px; |
| 209 | font-size: 12px; |
| 210 | font-weight: 900; |
| 211 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); |
| 212 | animation: popIn 0.2s ease; |
| 213 | } |
| 214 | |
| 215 | @keyframes popIn { |
| 216 | 0% { transform: scale(0); } |
| 217 | 50% { transform: scale(1.1); } |
| 218 | 100% { transform: scale(1); } |
| 219 | } |
| 220 | |
| 221 | .state-demo-box .state-label { |
| 222 | font-size: 14px; |
| 223 | font-weight: 700; |
| 224 | color: #ababab; |
| 225 | transition: color 0.2s; |
| 226 | } |
| 227 | |
| 228 | .state-demo-box.clickable:hover .state-label { |
| 229 | color: #409cff; |
| 230 | } |
| 231 | |
| 232 | .state-demo-box.selected .state-label { |
| 233 | color: #ffffff; /* White text on green background for maximum contrast */ |
| 234 | font-weight: 900; |
| 235 | } |
| 236 | |
| 237 | /* Cycling state demo */ |
| 238 | .cycling-states { |
| 239 | position: relative; |
| 240 | padding: 24px; |
| 241 | background: #000; |
| 242 | border: 2px dashed #38383a; |
| 243 | border-radius: 12px; |
| 244 | text-align: center; |
| 245 | } |
| 246 | |
| 247 | .current-state-label { |
| 248 | position: absolute; |
| 249 | top: -12px; |
| 250 | left: 50%; |
| 251 | transform: translateX(-50%); |
| 252 | background: #000; |
| 253 | padding: 4px 16px; |
| 254 | border-radius: 12px; |
| 255 | font-size: 12px; |
| 256 | font-weight: 900; |
| 257 | animation: pulse 2s infinite; |
| 258 | } |
| 259 | |
| 260 | @keyframes pulse { |
| 261 | 0%, 100% { opacity: 1; } |
| 262 | 50% { opacity: 0.5; } |
| 263 | } |
| 264 | |
| 265 | .state-default-bg { background: rgba(0, 102, 204, 0.1); color: #ffffff; font-weight: 700; } |
| 266 | .state-hover-bg { background: rgba(0, 102, 204, 0.3); color: #ffffff; font-weight: 700; } |
| 267 | .state-active-bg { background: rgba(0, 102, 204, 0.5); color: #ffffff; font-weight: 700; } |
| 268 | .state-selected-bg { background: rgba(52, 199, 89, 0.3); color: #ffffff; font-weight: 700; } |
| 269 | |
| 270 | /* Context Simulator */ |
| 271 | .context-simulator { |
| 272 | position: fixed; |
| 273 | bottom: 24px; |
| 274 | right: 24px; |
| 275 | background: #1c1c1e; |
| 276 | border: 2px solid #409cff; /* Updated to match text color */ |
| 277 | border-radius: 16px; |
| 278 | padding: 24px; |
| 279 | width: 320px; |
| 280 | box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); |
| 281 | z-index: 1000; |
| 282 | } |
| 283 | |
| 284 | .context-simulator h3 { |
| 285 | font-size: 14px; |
| 286 | text-transform: uppercase; |
| 287 | letter-spacing: 1px; |
| 288 | margin-bottom: 16px; |
| 289 | color: #409cff; /* Lighter blue for WCAG AA compliance */ |
| 290 | } |
| 291 | |
| 292 | .context-control { |
| 293 | margin-bottom: 16px; |
| 294 | } |
| 295 | |
| 296 | .context-control label { |
| 297 | display: block; |
| 298 | font-size: 12px; |
| 299 | color: #ababab; |
| 300 | margin-bottom: 8px; |
| 301 | } |
| 302 | |
| 303 | .context-control input[type="range"] { |
| 304 | width: 100%; |
| 305 | } |
| 306 | |
| 307 | .context-control select { |
| 308 | width: 100%; |
| 309 | padding: 8px; |
| 310 | background: #2c2c2e; |
| 311 | border: 1px solid #38383a; |
| 312 | border-radius: 8px; |
| 313 | color: #fff; |
| 314 | font-size: 14px; |
| 315 | } |
| 316 | |
| 317 | .toggle-small { |
| 318 | width: 36px; |
| 319 | height: 20px; |
| 320 | background: #38383a; |
| 321 | border-radius: 10px; |
| 322 | position: relative; |
| 323 | cursor: pointer; |
| 324 | transition: background 0.3s; |
| 325 | } |
| 326 | |
| 327 | .toggle-small.active { |
| 328 | background: #34c759; |
| 329 | } |
| 330 | |
| 331 | .toggle-small::after { |
| 332 | content: ''; |
| 333 | position: absolute; |
| 334 | width: 16px; |
| 335 | height: 16px; |
| 336 | border-radius: 8px; |
| 337 | background: white; |
| 338 | top: 2px; |
| 339 | left: 2px; |
| 340 | transition: transform 0.3s; |
| 341 | } |
| 342 | |
| 343 | .toggle-small.active::after { |
| 344 | transform: translateX(16px); |
| 345 | } |
| 346 | |
| 347 | .context-row { |
| 348 | display: flex; |
| 349 | justify-content: space-between; |
| 350 | align-items: center; |
| 351 | margin-bottom: 12px; |
| 352 | } |
| 353 | |
| 354 | /* Inline demos */ |
| 355 | .inline-demo { |
| 356 | display: flex; |
| 357 | gap: 12px; |
| 358 | flex-wrap: wrap; |
| 359 | align-items: center; |
| 360 | } |
| 361 | |
| 362 | /* Tables */ |
| 363 | .props-table { |
| 364 | width: 100%; |
| 365 | border-collapse: collapse; |
| 366 | margin-top: 16px; |
| 367 | background: #2c2c2e; |
| 368 | border-radius: 8px; |
| 369 | overflow: hidden; |
| 370 | } |
| 371 | |
| 372 | .props-table th, |
| 373 | .props-table td { |
| 374 | padding: 12px; |
| 375 | text-align: left; |
| 376 | border-bottom: 1px solid #38383a; |
| 377 | } |
| 378 | |
| 379 | .props-table th { |
| 380 | background: #1c1c1e; |
| 381 | font-weight: 600; |
| 382 | font-size: 12px; |
| 383 | text-transform: uppercase; |
| 384 | letter-spacing: 1px; |
| 385 | color: #ababab; |
| 386 | } |
| 387 | |
| 388 | .props-table td { |
| 389 | font-size: 14px; |
| 390 | } |
| 391 | |
| 392 | .props-table tr:last-child td { |
| 393 | border-bottom: none; |
| 394 | } |
| 395 | |
| 396 | .prop-name { |
| 397 | color: #409cff; /* Lighter blue for WCAG AA compliance */ |
| 398 | font-family: monospace; |
| 399 | } |
| 400 | |
| 401 | .prop-type { |
| 402 | color: #ff9500; |
| 403 | font-family: monospace; |
| 404 | font-size: 12px; |
| 405 | } |
| 406 | </style> |
| 407 | </head> |
| 408 | <body> |
| 409 | <div class="container"> |
| 410 | <header> |
| 411 | <h1>Component Gallery</h1> |
| 412 | <p class="subtitle">Every component, every state, every variation</p> |
| 413 | |
| 414 | <div style="margin-top: 32px; padding: 20px; background: rgba(255, 59, 48, 0.1); border: 2px solid #ff3b30; border-radius: 12px; max-width: 800px; margin-left: auto; margin-right: auto;"> |
| 415 | <div style="font-size: 14px; font-weight: 700; color: #ff3b30; margin-bottom: 8px;"> |
| 416 | 🧪 TESTING TOOLS AVAILABLE |
| 417 | </div> |
| 418 | <div style="font-size: 13px; color: #ababab; line-height: 1.6;"> |
| 419 | <strong style="color: #fff;">Press Ctrl+Shift+T</strong> to open the Visual Test Suite<br> |
| 420 | <strong style="color: #fff;">Press Ctrl+Shift+D</strong> to open DevTools panel<br> |
| 421 | <strong style="color: #fff;">Press Ctrl+Shift+V</strong> to activate voice commands<br> |
| 422 | <br> |
| 423 | The test suite will automatically simulate mouse events, check contrast ratios (WCAG AA),<br> |
| 424 | verify all interaction states, and highlight accessibility issues. |
| 425 | </div> |
| 426 | </div> |
| 427 | </header> |
| 428 | |
| 429 | <!-- ACTIONS --> |
| 430 | <section class="component-section"> |
| 431 | <div class="section-header"> |
| 432 | <h2 class="section-title">01. semantic-action</h2> |
| 433 | <p class="section-description">Intent-based buttons and actions. Automatically handles mouse, touch, voice, and keyboard.</p> |
| 434 | </div> |
| 435 | |
| 436 | <!-- Basic Intents --> |
| 437 | <div class="variation-group"> |
| 438 | <h3 class="variation-title">Intent Variations</h3> |
| 439 | <p class="variation-description">The three levels of action importance</p> |
| 440 | <div class="variation-grid grid-3"> |
| 441 | <div class="example-card"> |
| 442 | <div class="example-label">Primary Intent</div> |
| 443 | <div class="example-content"> |
| 444 | <semantic-action intent="primary">Primary Action</semantic-action> |
| 445 | </div> |
| 446 | <pre class="example-code"><semantic-action intent="primary"> |
| 447 | Primary Action |
| 448 | </semantic-action></pre> |
| 449 | </div> |
| 450 | |
| 451 | <div class="example-card"> |
| 452 | <div class="example-label">Secondary Intent</div> |
| 453 | <div class="example-content"> |
| 454 | <semantic-action intent="secondary">Secondary Action</semantic-action> |
| 455 | </div> |
| 456 | <pre class="example-code"><semantic-action intent="secondary"> |
| 457 | Secondary Action |
| 458 | </semantic-action></pre> |
| 459 | </div> |
| 460 | |
| 461 | <div class="example-card"> |
| 462 | <div class="example-label">Tertiary Intent</div> |
| 463 | <div class="example-content"> |
| 464 | <semantic-action intent="tertiary">Tertiary Action</semantic-action> |
| 465 | </div> |
| 466 | <pre class="example-code"><semantic-action intent="tertiary"> |
| 467 | Tertiary Action |
| 468 | </semantic-action></pre> |
| 469 | </div> |
| 470 | </div> |
| 471 | </div> |
| 472 | |
| 473 | <!-- Sentiments --> |
| 474 | <div class="variation-group"> |
| 475 | <h3 class="variation-title">Sentiment Variations</h3> |
| 476 | <p class="variation-description">Communicate action consequences</p> |
| 477 | <div class="variation-grid grid-3"> |
| 478 | <div class="example-card"> |
| 479 | <div class="example-label">Constructive (Positive)</div> |
| 480 | <div class="example-content"> |
| 481 | <semantic-action intent="primary" sentiment="constructive">Save Changes</semantic-action> |
| 482 | <semantic-action intent="secondary" sentiment="constructive">Create New</semantic-action> |
| 483 | </div> |
| 484 | <pre class="example-code"><semantic-action |
| 485 | intent="primary" |
| 486 | sentiment="constructive"> |
| 487 | Save Changes |
| 488 | </semantic-action></pre> |
| 489 | </div> |
| 490 | |
| 491 | <div class="example-card"> |
| 492 | <div class="example-label">Destructive (Dangerous)</div> |
| 493 | <div class="example-content"> |
| 494 | <semantic-action intent="primary" sentiment="destructive">Delete Forever</semantic-action> |
| 495 | <semantic-action intent="secondary" sentiment="destructive">Remove</semantic-action> |
| 496 | </div> |
| 497 | <pre class="example-code"><semantic-action |
| 498 | intent="primary" |
| 499 | sentiment="destructive"> |
| 500 | Delete Forever |
| 501 | </semantic-action></pre> |
| 502 | </div> |
| 503 | |
| 504 | <div class="example-card"> |
| 505 | <div class="example-label">Neutral (Default)</div> |
| 506 | <div class="example-content"> |
| 507 | <semantic-action intent="primary">Continue</semantic-action> |
| 508 | <semantic-action intent="secondary">View Details</semantic-action> |
| 509 | </div> |
| 510 | <pre class="example-code"><semantic-action intent="primary"> |
| 511 | Continue |
| 512 | </semantic-action></pre> |
| 513 | </div> |
| 514 | </div> |
| 515 | </div> |
| 516 | |
| 517 | <!-- States --> |
| 518 | <div class="variation-group"> |
| 519 | <h3 class="variation-title">Interactive State Demonstrations</h3> |
| 520 | <p class="variation-description"> |
| 521 | <strong>TRY IT:</strong> Hover over boxes, click to select, watch the auto-cycling demo |
| 522 | </p> |
| 523 | |
| 524 | <div class="variation-grid grid-2" style="margin-bottom: 32px;"> |
| 525 | <div class="example-card"> |
| 526 | <div class="example-label">👆 Click to Select (Clear Visual Feedback)</div> |
| 527 | <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 16px;"> |
| 528 | <div class="state-demo-box clickable" data-select-group="A"> |
| 529 | <div class="state-label">Option A</div> |
| 530 | </div> |
| 531 | <div class="state-demo-box clickable" data-select-group="A"> |
| 532 | <div class="state-label">Option B</div> |
| 533 | </div> |
| 534 | <div class="state-demo-box clickable" data-select-group="A"> |
| 535 | <div class="state-label">Option C</div> |
| 536 | </div> |
| 537 | <div class="state-demo-box clickable" data-select-group="A"> |
| 538 | <div class="state-label">Option D</div> |
| 539 | </div> |
| 540 | </div> |
| 541 | <p style="font-size: 12px; color: #ababab; margin-top: 16px;"> |
| 542 | Notice: <br> |
| 543 | • Default: Gray border<br> |
| 544 | • Hover: Blue border + lift + glow<br> |
| 545 | • Selected: Green border + checkmark + glow ring |
| 546 | </p> |
| 547 | </div> |
| 548 | |
| 549 | <div class="example-card"> |
| 550 | <div class="example-label">🔄 Auto-Cycling Through States</div> |
| 551 | <div class="cycling-states" id="auto-cycle-demo"> |
| 552 | <span class="current-state-label state-default-bg" id="cycle-label">DEFAULT</span> |
| 553 | <semantic-action intent="primary" id="cycle-button">Watch Me Change</semantic-action> |
| 554 | <div style="margin-top: 16px; font-size: 12px; color: #ababab;"> |
| 555 | State changes every 2 seconds |
| 556 | </div> |
| 557 | </div> |
| 558 | <p style="font-size: 12px; color: #ababab; margin-top: 16px;"> |
| 559 | Cycles through: <br> |
| 560 | • Default (blue)<br> |
| 561 | • Hover (brighter blue)<br> |
| 562 | • Active (brightest blue)<br> |
| 563 | • Selected (green) |
| 564 | </p> |
| 565 | </div> |
| 566 | </div> |
| 567 | |
| 568 | <div class="variation-grid grid-4"> |
| 569 | <div class="example-card"> |
| 570 | <div class="example-label">Real Default State</div> |
| 571 | <span class="state-indicator state-default">INTERACTIVE</span> |
| 572 | <div class="example-content"> |
| 573 | <semantic-action intent="primary">Hover Over Me</semantic-action> |
| 574 | </div> |
| 575 | <p style="font-size: 11px; color: #ababab; margin-top: 8px;"> |
| 576 | Try hovering - you'll see it lift and glow blue |
| 577 | </p> |
| 578 | </div> |
| 579 | |
| 580 | <div class="example-card"> |
| 581 | <div class="example-label">Click State Demo</div> |
| 582 | <span class="state-indicator state-active">CLICK IT</span> |
| 583 | <div class="example-content"> |
| 584 | <semantic-action intent="primary" id="click-demo-btn">Press Me</semantic-action> |
| 585 | <div id="click-count" style="margin-top: 8px; font-size: 14px; color: #34c759; font-weight: 700;"> |
| 586 | Clicks: 0 |
| 587 | </div> |
| 588 | </div> |
| 589 | <p style="font-size: 11px; color: #ababab; margin-top: 8px;"> |
| 590 | Click to see active state (scales down) |
| 591 | </p> |
| 592 | </div> |
| 593 | |
| 594 | <div class="example-card"> |
| 595 | <div class="example-label">Disabled State</div> |
| 596 | <span class="state-indicator state-disabled">NOT CLICKABLE</span> |
| 597 | <div class="example-content"> |
| 598 | <semantic-action intent="primary" disabled>Can't Click This</semantic-action> |
| 599 | </div> |
| 600 | <p style="font-size: 11px; color: #ababab; margin-top: 8px;"> |
| 601 | Greyed out, no cursor pointer, no hover effect |
| 602 | </p> |
| 603 | </div> |
| 604 | |
| 605 | <div class="example-card"> |
| 606 | <div class="example-label">All States Combined</div> |
| 607 | <span class="state-indicator state-focus">INTERACTIVE</span> |
| 608 | <div class="example-content"> |
| 609 | <semantic-action intent="primary" class="multi-state-demo">Full Demo</semantic-action> |
| 610 | </div> |
| 611 | <p style="font-size: 11px; color: #ababab; margin-top: 8px;"> |
| 612 | Default → Hover → Active, all in one |
| 613 | </p> |
| 614 | </div> |
| 615 | </div> |
| 616 | </div> |
| 617 | |
| 618 | <!-- Interaction Patterns --> |
| 619 | <div class="variation-group"> |
| 620 | <h3 class="variation-title">Interaction Patterns</h3> |
| 621 | <p class="variation-description">How users interact across different modalities</p> |
| 622 | <div class="variation-grid grid-2"> |
| 623 | <div class="example-card"> |
| 624 | <div class="example-label">Click/Tap → ACTIVATE Intent</div> |
| 625 | <div class="example-content"> |
| 626 | <semantic-action intent="primary" id="activate-demo">Activate Me</semantic-action> |
| 627 | <div id="activate-log" style="margin-top: 12px; padding: 12px; background: #000; border-radius: 8px; font-family: monospace; font-size: 12px; color: #34c759; min-height: 60px;"> |
| 628 | Waiting for activation... |
| 629 | </div> |
| 630 | </div> |
| 631 | <p style="font-size: 12px; color: #ababab; margin-top: 8px;"> |
| 632 | • Mouse: Click<br> |
| 633 | • Touch: Tap<br> |
| 634 | • Voice: "activate" or "click"<br> |
| 635 | • Keyboard: Enter/Space |
| 636 | </p> |
| 637 | </div> |
| 638 | |
| 639 | <div class="example-card"> |
| 640 | <div class="example-label">Long-Press → INSPECT Intent</div> |
| 641 | <div class="example-content"> |
| 642 | <semantic-action intent="secondary" id="inspect-demo">Hold Me</semantic-action> |
| 643 | <div id="inspect-log" style="margin-top: 12px; padding: 12px; background: #000; border-radius: 8px; font-family: monospace; font-size: 12px; color: #ff9500; min-height: 60px;"> |
| 644 | Waiting for long-press... |
| 645 | </div> |
| 646 | </div> |
| 647 | <p style="font-size: 12px; color: #ababab; margin-top: 8px;"> |
| 648 | • Mouse: Hold 500ms<br> |
| 649 | • Touch: Long-press 500ms<br> |
| 650 | • Voice: "inspect" or "what is" |
| 651 | </p> |
| 652 | </div> |
| 653 | </div> |
| 654 | </div> |
| 655 | |
| 656 | <!-- Real-World Examples --> |
| 657 | <div class="variation-group"> |
| 658 | <h3 class="variation-title">Real-World Examples</h3> |
| 659 | <p class="variation-description">Common button patterns in actual applications</p> |
| 660 | <div class="variation-grid grid-2"> |
| 661 | <div class="example-card"> |
| 662 | <div class="example-label">Form Actions</div> |
| 663 | <div class="inline-demo"> |
| 664 | <semantic-action intent="primary" sentiment="constructive">Save</semantic-action> |
| 665 | <semantic-action intent="secondary">Cancel</semantic-action> |
| 666 | <semantic-action intent="tertiary">Reset</semantic-action> |
| 667 | </div> |
| 668 | </div> |
| 669 | |
| 670 | <div class="example-card"> |
| 671 | <div class="example-label">Confirmation Dialog</div> |
| 672 | <div class="inline-demo"> |
| 673 | <semantic-action intent="primary" sentiment="destructive">Delete Forever</semantic-action> |
| 674 | <semantic-action intent="tertiary">Keep It</semantic-action> |
| 675 | </div> |
| 676 | </div> |
| 677 | |
| 678 | <div class="example-card"> |
| 679 | <div class="example-label">Toolbar Actions</div> |
| 680 | <div class="inline-demo"> |
| 681 | <semantic-action intent="tertiary">✏️ Edit</semantic-action> |
| 682 | <semantic-action intent="tertiary">🔗 Share</semantic-action> |
| 683 | <semantic-action intent="tertiary">📥 Download</semantic-action> |
| 684 | <semantic-action intent="tertiary" sentiment="destructive">🗑️ Delete</semantic-action> |
| 685 | </div> |
| 686 | </div> |
| 687 | |
| 688 | <div class="example-card"> |
| 689 | <div class="example-label">Call-to-Action</div> |
| 690 | <div class="inline-demo"> |
| 691 | <semantic-action intent="primary" sentiment="constructive">🚀 Get Started Free</semantic-action> |
| 692 | <semantic-action intent="tertiary">Learn More →</semantic-action> |
| 693 | </div> |
| 694 | </div> |
| 695 | </div> |
| 696 | </div> |
| 697 | |
| 698 | <!-- Properties Table --> |
| 699 | <div class="variation-group"> |
| 700 | <h3 class="variation-title">Properties & Attributes</h3> |
| 701 | <table class="props-table"> |
| 702 | <thead> |
| 703 | <tr> |
| 704 | <th>Attribute</th> |
| 705 | <th>Type</th> |
| 706 | <th>Values</th> |
| 707 | <th>Description</th> |
| 708 | </tr> |
| 709 | </thead> |
| 710 | <tbody> |
| 711 | <tr> |
| 712 | <td><span class="prop-name">intent</span></td> |
| 713 | <td><span class="prop-type">string</span></td> |
| 714 | <td>primary | secondary | tertiary</td> |
| 715 | <td>Importance level of the action</td> |
| 716 | </tr> |
| 717 | <tr> |
| 718 | <td><span class="prop-name">sentiment</span></td> |
| 719 | <td><span class="prop-type">string</span></td> |
| 720 | <td>constructive | destructive | neutral</td> |
| 721 | <td>Consequence of the action</td> |
| 722 | </tr> |
| 723 | <tr> |
| 724 | <td><span class="prop-name">disabled</span></td> |
| 725 | <td><span class="prop-type">boolean</span></td> |
| 726 | <td>true | false</td> |
| 727 | <td>Whether action is disabled</td> |
| 728 | </tr> |
| 729 | <tr> |
| 730 | <td><span class="prop-name">urgency</span></td> |
| 731 | <td><span class="prop-type">string</span></td> |
| 732 | <td>critical | high | medium | low</td> |
| 733 | <td>For attention budget scoring</td> |
| 734 | </tr> |
| 735 | <tr> |
| 736 | <td><span class="prop-name">attention-weight</span></td> |
| 737 | <td><span class="prop-type">number</span></td> |
| 738 | <td>0-100</td> |
| 739 | <td>Base attention priority</td> |
| 740 | </tr> |
| 741 | </tbody> |
| 742 | </table> |
| 743 | </div> |
| 744 | |
| 745 | <!-- Events --> |
| 746 | <div class="variation-group"> |
| 747 | <h3 class="variation-title">Events</h3> |
| 748 | <table class="props-table"> |
| 749 | <thead> |
| 750 | <tr> |
| 751 | <th>Event</th> |
| 752 | <th>Trigger</th> |
| 753 | <th>Detail</th> |
| 754 | </tr> |
| 755 | </thead> |
| 756 | <tbody> |
| 757 | <tr> |
| 758 | <td><span class="prop-name">intent: activate</span></td> |
| 759 | <td>Click, tap, Enter, Space, voice "activate"</td> |
| 760 | <td>{ type: 'activate' }</td> |
| 761 | </tr> |
| 762 | <tr> |
| 763 | <td><span class="prop-name">intent: inspect</span></td> |
| 764 | <td>Long-press (500ms), voice "inspect"</td> |
| 765 | <td>{ type: 'inspect' }</td> |
| 766 | </tr> |
| 767 | </tbody> |
| 768 | </table> |
| 769 | </div> |
| 770 | </section> |
| 771 | |
| 772 | <!-- CARDS --> |
| 773 | <section class="component-section"> |
| 774 | <div class="section-header"> |
| 775 | <h2 class="section-title">02. semantic-card</h2> |
| 776 | <p class="section-description">Inspectable content cards with preview on hover/long-press</p> |
| 777 | </div> |
| 778 | |
| 779 | <!-- Basic Card --> |
| 780 | <div class="variation-group"> |
| 781 | <h3 class="variation-title">Basic Structure</h3> |
| 782 | <p class="variation-description">Standard card with all slots</p> |
| 783 | <div class="variation-grid grid-2"> |
| 784 | <div class="example-card"> |
| 785 | <div class="example-label">Full Card Example</div> |
| 786 | <semantic-card> |
| 787 | <span slot="media-icon">🚀</span> |
| 788 | <card-title slot="title">Project Alpha</card-title> |
| 789 | <card-description slot="description"> |
| 790 | Next-generation platform architecture |
| 791 | </card-description> |
| 792 | <div slot="preview"> |
| 793 | <strong>Preview Mode</strong><br> |
| 794 | Status: In Progress<br> |
| 795 | Team: 5 members<br> |
| 796 | Due: Dec 15, 2024 |
| 797 | </div> |
| 798 | <div slot="actions"> |
| 799 | <semantic-action intent="tertiary">View</semantic-action> |
| 800 | <semantic-action intent="tertiary">Edit</semantic-action> |
| 801 | </div> |
| 802 | </semantic-card> |
| 803 | </div> |
| 804 | |
| 805 | <div class="example-card"> |
| 806 | <div class="example-label">Code</div> |
| 807 | <pre class="example-code" style="margin: 0; height: 100%;"><semantic-card> |
| 808 | <span slot="media-icon">🚀</span> |
| 809 | |
| 810 | <card-title slot="title"> |
| 811 | Project Alpha |
| 812 | </card-title> |
| 813 | |
| 814 | <card-description slot="description"> |
| 815 | Next-generation platform |
| 816 | </card-description> |
| 817 | |
| 818 | <div slot="preview"> |
| 819 | Preview content here |
| 820 | </div> |
| 821 | |
| 822 | <div slot="actions"> |
| 823 | <semantic-action intent="tertiary"> |
| 824 | View |
| 825 | </semantic-action> |
| 826 | </div> |
| 827 | </semantic-card></pre> |
| 828 | </div> |
| 829 | </div> |
| 830 | </div> |
| 831 | |
| 832 | <!-- Interaction States --> |
| 833 | <div class="variation-group"> |
| 834 | <h3 class="variation-title">Interactive Card State Demo</h3> |
| 835 | <p class="variation-description"> |
| 836 | <strong>TRY IT:</strong> Hover over cards to see elevation + preview, long-press (500ms) for inspect intent |
| 837 | </p> |
| 838 | <div class="variation-grid grid-3"> |
| 839 | <semantic-card id="card-demo-1"> |
| 840 | <span slot="media-icon">📄</span> |
| 841 | <card-title slot="title">Hover Over Me</card-title> |
| 842 | <card-description slot="description"> |
| 843 | Watch what happens when you hover |
| 844 | </card-description> |
| 845 | <div slot="preview"> |
| 846 | <strong>✨ Preview Visible!</strong><br> |
| 847 | This content appears on hover/long-press<br> |
| 848 | Notice: Card lifts + blue border + preview slides in |
| 849 | </div> |
| 850 | </semantic-card> |
| 851 | |
| 852 | <semantic-card id="card-demo-2"> |
| 853 | <span slot="media-icon">🔍</span> |
| 854 | <card-title slot="title">Long-Press Me</card-title> |
| 855 | <card-description slot="description"> |
| 856 | Hold for 500ms to inspect |
| 857 | </card-description> |
| 858 | <div slot="preview"> |
| 859 | <strong>🔍 Inspect Mode!</strong><br> |
| 860 | Hold mouse/finger for 500ms<br> |
| 861 | Triggers 'inspect' intent event |
| 862 | </div> |
| 863 | </semantic-card> |
| 864 | |
| 865 | <semantic-card id="card-demo-3"> |
| 866 | <span slot="media-icon">👆</span> |
| 867 | <card-title slot="title">Click Me</card-title> |
| 868 | <card-description slot="description"> |
| 869 | Click triggers 'activate' intent |
| 870 | </card-description> |
| 871 | <div slot="preview"> |
| 872 | <strong>Clicks: <span id="card-click-count">0</span></strong><br> |
| 873 | Each click fires an 'activate' intent<br> |
| 874 | Try it and watch the counter |
| 875 | </div> |
| 876 | </semantic-card> |
| 877 | </div> |
| 878 | <p style="font-size: 12px; color: #ababab; margin-top: 16px; padding: 16px; background: rgba(0,102,204,0.05); border-radius: 8px; border-left: 3px solid #0066cc;"> |
| 879 | <strong>Visual Feedback:</strong><br> |
| 880 | • <strong>Default:</strong> Flat, subtle shadow<br> |
| 881 | • <strong>Hover:</strong> Lifts up, blue border glows, preview content slides in from bottom<br> |
| 882 | • <strong>Active/Click:</strong> Slight scale down on mousedown<br> |
| 883 | • <strong>Disabled:</strong> Greyed out, no interaction (see examples below) |
| 884 | </p> |
| 885 | </div> |
| 886 | |
| 887 | <!-- Media Variations --> |
| 888 | <div class="variation-group"> |
| 889 | <h3 class="variation-title">Media Variations</h3> |
| 890 | <p class="variation-description">Different media types and styles</p> |
| 891 | <div class="variation-grid grid-3"> |
| 892 | <semantic-card> |
| 893 | <span slot="media-icon" style="font-size: 72px;">🎨</span> |
| 894 | <card-title slot="title">Icon Media</card-title> |
| 895 | <card-description slot="description"> |
| 896 | Using emoji or icon fonts |
| 897 | </card-description> |
| 898 | </semantic-card> |
| 899 | |
| 900 | <semantic-card media-url="https://via.placeholder.com/400x200/667eea/ffffff?text=Image" media-alt="Placeholder"> |
| 901 | <card-title slot="title">Image Media</card-title> |
| 902 | <card-description slot="description"> |
| 903 | Using media-url attribute |
| 904 | </card-description> |
| 905 | </semantic-card> |
| 906 | |
| 907 | <semantic-card> |
| 908 | <div slot="media-icon" style="width: 100%; height: 200px; background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); display: flex; align-items: center; justify-content: center; font-size: 64px;"> |
| 909 | ⚡ |
| 910 | </div> |
| 911 | <card-title slot="title">Custom Media</card-title> |
| 912 | <card-description slot="description"> |
| 913 | Custom gradient background |
| 914 | </card-description> |
| 915 | </semantic-card> |
| 916 | </div> |
| 917 | </div> |
| 918 | |
| 919 | <!-- Real-World Examples --> |
| 920 | <div class="variation-group"> |
| 921 | <h3 class="variation-title">Real-World Examples</h3> |
| 922 | <div class="variation-grid grid-3"> |
| 923 | <semantic-card> |
| 924 | <span slot="media-icon">📊</span> |
| 925 | <card-title slot="title">Q4 Report</card-title> |
| 926 | <card-description slot="description"> |
| 927 | Financial summary • 15 pages |
| 928 | </card-description> |
| 929 | <div slot="preview"> |
| 930 | <strong>Quick Stats:</strong><br> |
| 931 | Revenue: +23%<br> |
| 932 | Customers: +156<br> |
| 933 | Last modified: 2 hours ago |
| 934 | </div> |
| 935 | <div slot="actions"> |
| 936 | <semantic-action intent="tertiary">Open</semantic-action> |
| 937 | <semantic-action intent="tertiary">Share</semantic-action> |
| 938 | </div> |
| 939 | </semantic-card> |
| 940 | |
| 941 | <semantic-card> |
| 942 | <span slot="media-icon">👤</span> |
| 943 | <card-title slot="title">Sarah Johnson</card-title> |
| 944 | <card-description slot="description"> |
| 945 | Senior Developer • Online |
| 946 | </card-description> |
| 947 | <div slot="preview"> |
| 948 | <strong>Contact Info:</strong><br> |
| 949 | Email: sarah@example.com<br> |
| 950 | Slack: @sarahj<br> |
| 951 | Time zone: PST |
| 952 | </div> |
| 953 | <div slot="actions"> |
| 954 | <semantic-action intent="tertiary">Message</semantic-action> |
| 955 | <semantic-action intent="tertiary">Call</semantic-action> |
| 956 | </div> |
| 957 | </semantic-card> |
| 958 | |
| 959 | <semantic-card> |
| 960 | <span slot="media-icon">🎯</span> |
| 961 | <card-title slot="title">Sprint Review</card-title> |
| 962 | <card-description slot="description"> |
| 963 | Meeting • Tomorrow at 2pm |
| 964 | </card-description> |
| 965 | <div slot="preview"> |
| 966 | <strong>Agenda:</strong><br> |
| 967 | 1. Demo new features<br> |
| 968 | 2. Retrospective<br> |
| 969 | 3. Sprint planning |
| 970 | </div> |
| 971 | <div slot="actions"> |
| 972 | <semantic-action intent="tertiary">Join</semantic-action> |
| 973 | <semantic-action intent="tertiary">Details</semantic-action> |
| 974 | </div> |
| 975 | </semantic-card> |
| 976 | </div> |
| 977 | </div> |
| 978 | |
| 979 | <!-- Properties --> |
| 980 | <div class="variation-group"> |
| 981 | <h3 class="variation-title">Properties & Slots</h3> |
| 982 | <table class="props-table"> |
| 983 | <thead> |
| 984 | <tr> |
| 985 | <th>Slot/Attribute</th> |
| 986 | <th>Type</th> |
| 987 | <th>Description</th> |
| 988 | </tr> |
| 989 | </thead> |
| 990 | <tbody> |
| 991 | <tr> |
| 992 | <td><span class="prop-name">media-url</span></td> |
| 993 | <td><span class="prop-type">attribute</span></td> |
| 994 | <td>URL for image media</td> |
| 995 | </tr> |
| 996 | <tr> |
| 997 | <td><span class="prop-name">media-alt</span></td> |
| 998 | <td><span class="prop-type">attribute</span></td> |
| 999 | <td>Alt text for image</td> |
| 1000 | </tr> |
| 1001 | <tr> |
| 1002 | <td><span class="prop-name">media-icon</span></td> |
| 1003 | <td><span class="prop-type">slot</span></td> |
| 1004 | <td>Icon/emoji when no image</td> |
| 1005 | </tr> |
| 1006 | <tr> |
| 1007 | <td><span class="prop-name">title</span></td> |
| 1008 | <td><span class="prop-type">slot</span></td> |
| 1009 | <td>Card title</td> |
| 1010 | </tr> |
| 1011 | <tr> |
| 1012 | <td><span class="prop-name">description</span></td> |
| 1013 | <td><span class="prop-type">slot</span></td> |
| 1014 | <td>Card description/subtitle</td> |
| 1015 | </tr> |
| 1016 | <tr> |
| 1017 | <td><span class="prop-name">preview</span></td> |
| 1018 | <td><span class="prop-type">slot</span></td> |
| 1019 | <td>Content shown on hover/long-press</td> |
| 1020 | </tr> |
| 1021 | <tr> |
| 1022 | <td><span class="prop-name">actions</span></td> |
| 1023 | <td><span class="prop-type">slot</span></td> |
| 1024 | <td>Action buttons</td> |
| 1025 | </tr> |
| 1026 | </tbody> |
| 1027 | </table> |
| 1028 | </div> |
| 1029 | </section> |
| 1030 | |
| 1031 | <!-- FEEDBACK --> |
| 1032 | <section class="component-section"> |
| 1033 | <div class="section-header"> |
| 1034 | <h2 class="section-title">03. semantic-feedback</h2> |
| 1035 | <p class="section-description">Context-aware notifications that adapt to user attention, noise level, and modality</p> |
| 1036 | </div> |
| 1037 | |
| 1038 | <!-- Feedback Types --> |
| 1039 | <div class="variation-group"> |
| 1040 | <h3 class="variation-title">Feedback Types</h3> |
| 1041 | <p class="variation-description">Different types of feedback for different situations</p> |
| 1042 | <div class="variation-grid grid-4"> |
| 1043 | <div class="example-card"> |
| 1044 | <div class="example-label">Success Feedback</div> |
| 1045 | <semantic-feedback type="success" message="Changes saved successfully!" visible></semantic-feedback> |
| 1046 | <pre class="example-code" style="margin-top: 16px;"><semantic-feedback |
| 1047 | type="success" |
| 1048 | message="Changes saved!" |
| 1049 | visible> |
| 1050 | </semantic-feedback></pre> |
| 1051 | </div> |
| 1052 | |
| 1053 | <div class="example-card"> |
| 1054 | <div class="example-label">Error Feedback</div> |
| 1055 | <semantic-feedback type="error" message="Failed to connect to server" visible></semantic-feedback> |
| 1056 | <pre class="example-code" style="margin-top: 16px;"><semantic-feedback |
| 1057 | type="error" |
| 1058 | message="Failed to connect" |
| 1059 | visible> |
| 1060 | </semantic-feedback></pre> |
| 1061 | </div> |
| 1062 | |
| 1063 | <div class="example-card"> |
| 1064 | <div class="example-label">Warning Feedback</div> |
| 1065 | <semantic-feedback type="warning" message="Storage is 90% full" visible></semantic-feedback> |
| 1066 | <pre class="example-code" style="margin-top: 16px;"><semantic-feedback |
| 1067 | type="warning" |
| 1068 | message="Storage 90% full" |
| 1069 | visible> |
| 1070 | </semantic-feedback></pre> |
| 1071 | </div> |
| 1072 | |
| 1073 | <div class="example-card"> |
| 1074 | <div class="example-label">Info Feedback</div> |
| 1075 | <semantic-feedback type="info" message="New features available" visible></semantic-feedback> |
| 1076 | <pre class="example-code" style="margin-top: 16px;"><semantic-feedback |
| 1077 | type="info" |
| 1078 | message="New features" |
| 1079 | visible> |
| 1080 | </semantic-feedback></pre> |
| 1081 | </div> |
| 1082 | </div> |
| 1083 | </div> |
| 1084 | |
| 1085 | <!-- Urgency Levels --> |
| 1086 | <div class="variation-group"> |
| 1087 | <h3 class="variation-title">Urgency Levels (Attention Budget)</h3> |
| 1088 | <p class="variation-description">Controls priority in attention budget system</p> |
| 1089 | <div class="variation-grid grid-2"> |
| 1090 | <div class="example-card"> |
| 1091 | <div class="example-label">Critical Urgency</div> |
| 1092 | <semantic-feedback type="error" message="Critical system failure!" urgency="critical" visible></semantic-feedback> |
| 1093 | <p style="font-size: 12px; color: #ababab; margin-top: 12px;"> |
| 1094 | Always shown, may trigger sound/vibration even in focus mode |
| 1095 | </p> |
| 1096 | </div> |
| 1097 | |
| 1098 | <div class="example-card"> |
| 1099 | <div class="example-label">Low Urgency</div> |
| 1100 | <semantic-feedback type="info" message="Tip: You can use keyboard shortcuts" urgency="low" visible></semantic-feedback> |
| 1101 | <p style="font-size: 12px; color: #ababab; margin-top: 12px;"> |
| 1102 | Can be suppressed if user is busy or in focus mode |
| 1103 | </p> |
| 1104 | </div> |
| 1105 | </div> |
| 1106 | </div> |
| 1107 | |
| 1108 | <!-- Interactive Demo --> |
| 1109 | <div class="variation-group"> |
| 1110 | <h3 class="variation-title">Interactive Demo</h3> |
| 1111 | <p class="variation-description"><strong>TRY IT:</strong> Trigger different feedback types</p> |
| 1112 | <div class="variation-grid grid-2"> |
| 1113 | <div class="example-card"> |
| 1114 | <div class="example-label">Trigger Feedback</div> |
| 1115 | <div class="inline-demo" style="flex-direction: column; align-items: stretch; gap: 12px;"> |
| 1116 | <semantic-action intent="primary" sentiment="constructive" id="trigger-success"> |
| 1117 | ✓ Show Success |
| 1118 | </semantic-action> |
| 1119 | <semantic-action intent="primary" sentiment="destructive" id="trigger-error"> |
| 1120 | ✗ Show Error |
| 1121 | </semantic-action> |
| 1122 | <semantic-action intent="secondary" id="trigger-warning"> |
| 1123 | ⚠ Show Warning |
| 1124 | </semantic-action> |
| 1125 | <semantic-action intent="secondary" id="trigger-info"> |
| 1126 | ℹ Show Info |
| 1127 | </semantic-action> |
| 1128 | </div> |
| 1129 | </div> |
| 1130 | |
| 1131 | <div class="example-card"> |
| 1132 | <div class="example-label">Feedback Container</div> |
| 1133 | <div id="feedback-container" style="min-height: 200px; background: #000; border-radius: 8px; padding: 16px; position: relative;"> |
| 1134 | <p style="font-size: 12px; color: #ababab; text-align: center;"> |
| 1135 | Click buttons to see feedback appear here |
| 1136 | </p> |
| 1137 | </div> |
| 1138 | </div> |
| 1139 | </div> |
| 1140 | </div> |
| 1141 | |
| 1142 | <!-- Properties --> |
| 1143 | <div class="variation-group"> |
| 1144 | <h3 class="variation-title">Properties & Attributes</h3> |
| 1145 | <table class="props-table"> |
| 1146 | <thead> |
| 1147 | <tr> |
| 1148 | <th>Attribute</th> |
| 1149 | <th>Type</th> |
| 1150 | <th>Values</th> |
| 1151 | <th>Description</th> |
| 1152 | </tr> |
| 1153 | </thead> |
| 1154 | <tbody> |
| 1155 | <tr> |
| 1156 | <td><span class="prop-name">type</span></td> |
| 1157 | <td><span class="prop-type">string</span></td> |
| 1158 | <td>success | error | warning | info</td> |
| 1159 | <td>Type of feedback</td> |
| 1160 | </tr> |
| 1161 | <tr> |
| 1162 | <td><span class="prop-name">message</span></td> |
| 1163 | <td><span class="prop-type">string</span></td> |
| 1164 | <td>Any text</td> |
| 1165 | <td>Feedback message</td> |
| 1166 | </tr> |
| 1167 | <tr> |
| 1168 | <td><span class="prop-name">urgency</span></td> |
| 1169 | <td><span class="prop-type">string</span></td> |
| 1170 | <td>critical | high | medium | low</td> |
| 1171 | <td>Attention budget priority</td> |
| 1172 | </tr> |
| 1173 | <tr> |
| 1174 | <td><span class="prop-name">duration</span></td> |
| 1175 | <td><span class="prop-type">number</span></td> |
| 1176 | <td>milliseconds</td> |
| 1177 | <td>Auto-hide after duration (0 = manual)</td> |
| 1178 | </tr> |
| 1179 | <tr> |
| 1180 | <td><span class="prop-name">visible</span></td> |
| 1181 | <td><span class="prop-type">boolean</span></td> |
| 1182 | <td>true | false</td> |
| 1183 | <td>Show/hide feedback</td> |
| 1184 | </tr> |
| 1185 | </tbody> |
| 1186 | </table> |
| 1187 | </div> |
| 1188 | </section> |
| 1189 | |
| 1190 | <!-- ADJUSTERS --> |
| 1191 | <section class="component-section"> |
| 1192 | <div class="section-header"> |
| 1193 | <h2 class="section-title">04. semantic-adjuster</h2> |
| 1194 | <p class="section-description">Multi-modal value controls supporting mouse, touch, voice, keyboard, and gestures</p> |
| 1195 | </div> |
| 1196 | |
| 1197 | <!-- Basic Adjusters --> |
| 1198 | <div class="variation-group"> |
| 1199 | <h3 class="variation-title">Adjuster Types</h3> |
| 1200 | <p class="variation-description">Different styles for different use cases</p> |
| 1201 | <div class="variation-grid grid-3"> |
| 1202 | <div class="example-card"> |
| 1203 | <div class="example-label">Slider</div> |
| 1204 | <semantic-adjuster |
| 1205 | label="Volume" |
| 1206 | value="75" |
| 1207 | min="0" |
| 1208 | max="100" |
| 1209 | step="1" |
| 1210 | show-value> |
| 1211 | </semantic-adjuster> |
| 1212 | </div> |
| 1213 | |
| 1214 | <div class="example-card"> |
| 1215 | <div class="example-label">Stepper</div> |
| 1216 | <semantic-adjuster |
| 1217 | label="Quantity" |
| 1218 | value="5" |
| 1219 | min="1" |
| 1220 | max="10" |
| 1221 | step="1" |
| 1222 | type="stepper" |
| 1223 | show-value> |
| 1224 | </semantic-adjuster> |
| 1225 | </div> |
| 1226 | |
| 1227 | <div class="example-card"> |
| 1228 | <div class="example-label">Discrete Steps</div> |
| 1229 | <semantic-adjuster |
| 1230 | label="Font Size" |
| 1231 | value="16" |
| 1232 | min="12" |
| 1233 | max="24" |
| 1234 | step="2" |
| 1235 | show-value> |
| 1236 | </semantic-adjuster> |
| 1237 | </div> |
| 1238 | </div> |
| 1239 | </div> |
| 1240 | |
| 1241 | <!-- Interactive Demo --> |
| 1242 | <div class="variation-group"> |
| 1243 | <h3 class="variation-title">Interactive Control Demo</h3> |
| 1244 | <p class="variation-description"> |
| 1245 | <strong>TRY IT:</strong> Adjust values and watch real-time feedback |
| 1246 | </p> |
| 1247 | <div class="variation-grid grid-2"> |
| 1248 | <div class="example-card"> |
| 1249 | <div class="example-label">Multi-Modal Controls</div> |
| 1250 | <div style="display: flex; flex-direction: column; gap: 24px;"> |
| 1251 | <semantic-adjuster |
| 1252 | label="Brightness" |
| 1253 | value="50" |
| 1254 | min="0" |
| 1255 | max="100" |
| 1256 | step="5" |
| 1257 | show-value |
| 1258 | id="brightness-adjuster"> |
| 1259 | </semantic-adjuster> |
| 1260 | |
| 1261 | <semantic-adjuster |
| 1262 | label="Temperature" |
| 1263 | value="20" |
| 1264 | min="15" |
| 1265 | max="30" |
| 1266 | step="1" |
| 1267 | show-value |
| 1268 | id="temp-adjuster"> |
| 1269 | </semantic-adjuster> |
| 1270 | |
| 1271 | <semantic-adjuster |
| 1272 | label="Zoom Level" |
| 1273 | value="100" |
| 1274 | min="50" |
| 1275 | max="200" |
| 1276 | step="10" |
| 1277 | type="stepper" |
| 1278 | show-value |
| 1279 | id="zoom-adjuster"> |
| 1280 | </semantic-adjuster> |
| 1281 | </div> |
| 1282 | <p style="font-size: 12px; color: #ababab; margin-top: 16px;"> |
| 1283 | Try: Mouse drag, keyboard arrows, pinch gesture, voice "increase/decrease" |
| 1284 | </p> |
| 1285 | </div> |
| 1286 | |
| 1287 | <div class="example-card"> |
| 1288 | <div class="example-label">Live Visual Feedback</div> |
| 1289 | <div style="background: #000; border-radius: 8px; padding: 24px; min-height: 200px;"> |
| 1290 | <div style="font-size: 14px; margin-bottom: 16px; color: #ababab;"> |
| 1291 | <strong>Brightness:</strong> <span id="brightness-value" style="color: #409cff;">50%</span> |
| 1292 | </div> |
| 1293 | <div id="brightness-box" style="width: 100%; height: 80px; background: rgba(255,255,255,0.5); border-radius: 8px; transition: opacity 0.2s;"></div> |
| 1294 | |
| 1295 | <div style="font-size: 14px; margin: 16px 0 16px 0; color: #ababab;"> |
| 1296 | <strong>Temperature:</strong> <span id="temp-value" style="color: #ff9500;">20°C</span> |
| 1297 | </div> |
| 1298 | <div id="temp-indicator" style="width: 100%; height: 40px; background: linear-gradient(90deg, #0066cc 0%, #ff9500 50%, #ff3b30 100%); border-radius: 8px; position: relative;"> |
| 1299 | <div style="position: absolute; left: 33%; top: 50%; transform: translate(-50%, -50%); width: 4px; height: 100%; background: white; box-shadow: 0 0 8px rgba(0,0,0,0.5);"></div> |
| 1300 | </div> |
| 1301 | </div> |
| 1302 | </div> |
| 1303 | </div> |
| 1304 | </div> |
| 1305 | |
| 1306 | <!-- Properties --> |
| 1307 | <div class="variation-group"> |
| 1308 | <h3 class="variation-title">Properties & Attributes</h3> |
| 1309 | <table class="props-table"> |
| 1310 | <thead> |
| 1311 | <tr> |
| 1312 | <th>Attribute</th> |
| 1313 | <th>Type</th> |
| 1314 | <th>Description</th> |
| 1315 | </tr> |
| 1316 | </thead> |
| 1317 | <tbody> |
| 1318 | <tr> |
| 1319 | <td><span class="prop-name">label</span></td> |
| 1320 | <td><span class="prop-type">string</span></td> |
| 1321 | <td>Label for the control</td> |
| 1322 | </tr> |
| 1323 | <tr> |
| 1324 | <td><span class="prop-name">value</span></td> |
| 1325 | <td><span class="prop-type">number</span></td> |
| 1326 | <td>Current value</td> |
| 1327 | </tr> |
| 1328 | <tr> |
| 1329 | <td><span class="prop-name">min</span></td> |
| 1330 | <td><span class="prop-type">number</span></td> |
| 1331 | <td>Minimum value</td> |
| 1332 | </tr> |
| 1333 | <tr> |
| 1334 | <td><span class="prop-name">max</span></td> |
| 1335 | <td><span class="prop-type">number</span></td> |
| 1336 | <td>Maximum value</td> |
| 1337 | </tr> |
| 1338 | <tr> |
| 1339 | <td><span class="prop-name">step</span></td> |
| 1340 | <td><span class="prop-type">number</span></td> |
| 1341 | <td>Increment/decrement step</td> |
| 1342 | </tr> |
| 1343 | <tr> |
| 1344 | <td><span class="prop-name">type</span></td> |
| 1345 | <td><span class="prop-type">string</span></td> |
| 1346 | <td>slider | stepper</td> |
| 1347 | </tr> |
| 1348 | <tr> |
| 1349 | <td><span class="prop-name">show-value</span></td> |
| 1350 | <td><span class="prop-type">boolean</span></td> |
| 1351 | <td>Show current value</td> |
| 1352 | </tr> |
| 1353 | </tbody> |
| 1354 | </table> |
| 1355 | </div> |
| 1356 | </section> |
| 1357 | |
| 1358 | <!-- Component 05: semantic-input --> |
| 1359 | <section class="component-section" id="semantic-input"> |
| 1360 | <div class="component-header"> |
| 1361 | <h2 class="component-number">05.</h2> |
| 1362 | <div> |
| 1363 | <h2 class="component-name">semantic-input</h2> |
| 1364 | <p class="component-tagline">Form inputs with voice hints, validation, and multi-modal support</p> |
| 1365 | </div> |
| 1366 | </div> |
| 1367 | |
| 1368 | <!-- Basic Structure --> |
| 1369 | <div class="variation-group"> |
| 1370 | <h3 class="variation-title">Input Types</h3> |
| 1371 | <p class="variation-description">Different input types for different data</p> |
| 1372 | <div class="variation-grid grid-3"> |
| 1373 | <div class="example-card"> |
| 1374 | <div class="example-label">Text Input</div> |
| 1375 | <semantic-input |
| 1376 | label="Full Name" |
| 1377 | placeholder="Enter your name" |
| 1378 | type="text"> |
| 1379 | </semantic-input> |
| 1380 | </div> |
| 1381 | |
| 1382 | <div class="example-card"> |
| 1383 | <div class="example-label">Email Input</div> |
| 1384 | <semantic-input |
| 1385 | label="Email Address" |
| 1386 | placeholder="you@example.com" |
| 1387 | type="email"> |
| 1388 | </semantic-input> |
| 1389 | </div> |
| 1390 | |
| 1391 | <div class="example-card"> |
| 1392 | <div class="example-label">Password Input</div> |
| 1393 | <semantic-input |
| 1394 | label="Password" |
| 1395 | placeholder="••••••••" |
| 1396 | type="password"> |
| 1397 | </semantic-input> |
| 1398 | </div> |
| 1399 | </div> |
| 1400 | </div> |
| 1401 | |
| 1402 | <!-- Validation States --> |
| 1403 | <div class="variation-group"> |
| 1404 | <h3 class="variation-title">Validation States</h3> |
| 1405 | <p class="variation-description">Clear feedback for valid and invalid inputs</p> |
| 1406 | <div class="variation-grid grid-3"> |
| 1407 | <div class="example-card"> |
| 1408 | <div class="example-label">Valid Input</div> |
| 1409 | <semantic-input |
| 1410 | label="Email" |
| 1411 | value="user@example.com" |
| 1412 | type="email" |
| 1413 | valid> |
| 1414 | </semantic-input> |
| 1415 | </div> |
| 1416 | |
| 1417 | <div class="example-card"> |
| 1418 | <div class="example-label">Invalid Input</div> |
| 1419 | <semantic-input |
| 1420 | label="Email" |
| 1421 | value="not-an-email" |
| 1422 | type="email" |
| 1423 | error="Please enter a valid email"> |
| 1424 | </semantic-input> |
| 1425 | </div> |
| 1426 | |
| 1427 | <div class="example-card"> |
| 1428 | <div class="example-label">Disabled Input</div> |
| 1429 | <semantic-input |
| 1430 | label="Username" |
| 1431 | value="john_doe" |
| 1432 | disabled> |
| 1433 | </semantic-input> |
| 1434 | </div> |
| 1435 | </div> |
| 1436 | </div> |
| 1437 | |
| 1438 | <!-- Properties --> |
| 1439 | <div class="variation-group"> |
| 1440 | <h3 class="variation-title">Properties & Attributes</h3> |
| 1441 | <table style="width: 100%; color: #fff; border-collapse: collapse; font-size: 14px;"> |
| 1442 | <thead> |
| 1443 | <tr style="background: rgba(0,102,204,0.1); border-bottom: 2px solid #0066cc;"> |
| 1444 | <th style="padding: 12px; text-align: left;">Attribute</th> |
| 1445 | <th style="padding: 12px; text-align: left;">Type</th> |
| 1446 | <th style="padding: 12px; text-align: left;">Description</th> |
| 1447 | </tr> |
| 1448 | </thead> |
| 1449 | <tbody> |
| 1450 | <tr style="border-bottom: 1px solid #333;"> |
| 1451 | <td style="padding: 12px;"><span class="prop-name">label</span></td> |
| 1452 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 1453 | <td style="padding: 12px;">Label for the input</td> |
| 1454 | </tr> |
| 1455 | <tr style="border-bottom: 1px solid #333;"> |
| 1456 | <td style="padding: 12px;"><span class="prop-name">type</span></td> |
| 1457 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 1458 | <td style="padding: 12px;">text | email | password | number</td> |
| 1459 | </tr> |
| 1460 | <tr style="border-bottom: 1px solid #333;"> |
| 1461 | <td style="padding: 12px;"><span class="prop-name">placeholder</span></td> |
| 1462 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 1463 | <td style="padding: 12px;">Placeholder text</td> |
| 1464 | </tr> |
| 1465 | <tr style="border-bottom: 1px solid #333;"> |
| 1466 | <td style="padding: 12px;"><span class="prop-name">value</span></td> |
| 1467 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 1468 | <td style="padding: 12px;">Current value</td> |
| 1469 | </tr> |
| 1470 | <tr style="border-bottom: 1px solid #333;"> |
| 1471 | <td style="padding: 12px;"><span class="prop-name">error</span></td> |
| 1472 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 1473 | <td style="padding: 12px;">Error message</td> |
| 1474 | </tr> |
| 1475 | <tr style="border-bottom: 1px solid #333;"> |
| 1476 | <td style="padding: 12px;"><span class="prop-name">valid</span></td> |
| 1477 | <td style="padding: 12px;"><span class="prop-type">boolean</span></td> |
| 1478 | <td style="padding: 12px;">Show valid state</td> |
| 1479 | </tr> |
| 1480 | <tr style="border-bottom: 1px solid #333;"> |
| 1481 | <td style="padding: 12px;"><span class="prop-name">disabled</span></td> |
| 1482 | <td style="padding: 12px;"><span class="prop-type">boolean</span></td> |
| 1483 | <td style="padding: 12px;">Disable input</td> |
| 1484 | </tr> |
| 1485 | </tbody> |
| 1486 | </table> |
| 1487 | </div> |
| 1488 | </section> |
| 1489 | |
| 1490 | <!-- Component 06: semantic-modal --> |
| 1491 | <section class="component-section" id="semantic-modal"> |
| 1492 | <div class="component-header"> |
| 1493 | <h2 class="component-number">06.</h2> |
| 1494 | <div> |
| 1495 | <h2 class="component-name">semantic-modal</h2> |
| 1496 | <p class="component-tagline">Context-aware dialogs with keyboard, voice, and gesture support</p> |
| 1497 | </div> |
| 1498 | </div> |
| 1499 | |
| 1500 | <!-- Modal Types --> |
| 1501 | <div class="variation-group"> |
| 1502 | <h3 class="variation-title">Modal Variations</h3> |
| 1503 | <p class="variation-description"><strong>TRY IT:</strong> Click buttons to open modals</p> |
| 1504 | <div class="variation-grid grid-3"> |
| 1505 | <div class="example-card"> |
| 1506 | <div class="example-label">Basic Modal</div> |
| 1507 | <semantic-action intent="primary" onclick="document.getElementById('modal-basic').setAttribute('open', '')"> |
| 1508 | Open Modal |
| 1509 | </semantic-action> |
| 1510 | </div> |
| 1511 | |
| 1512 | <div class="example-card"> |
| 1513 | <div class="example-label">With Actions</div> |
| 1514 | <semantic-action intent="primary" onclick="document.getElementById('modal-actions').setAttribute('open', '')"> |
| 1515 | Open with Actions |
| 1516 | </semantic-action> |
| 1517 | </div> |
| 1518 | |
| 1519 | <div class="example-card"> |
| 1520 | <div class="example-label">Critical Modal</div> |
| 1521 | <semantic-action intent="primary" sentiment="destructive" onclick="document.getElementById('modal-critical').setAttribute('open', '')"> |
| 1522 | Open Critical |
| 1523 | </semantic-action> |
| 1524 | </div> |
| 1525 | </div> |
| 1526 | </div> |
| 1527 | |
| 1528 | <!-- Modal Examples (hidden by default) --> |
| 1529 | <semantic-modal id="modal-basic"> |
| 1530 | <h3 slot="title">Basic Modal</h3> |
| 1531 | <p>This is a simple modal dialog with just content and a close button.</p> |
| 1532 | </semantic-modal> |
| 1533 | |
| 1534 | <semantic-modal id="modal-actions"> |
| 1535 | <h3 slot="title">Confirm Action</h3> |
| 1536 | <p>Are you sure you want to continue? This action will save your changes.</p> |
| 1537 | <div slot="actions"> |
| 1538 | <semantic-action intent="secondary" onclick="document.getElementById('modal-actions').removeAttribute('open')"> |
| 1539 | Cancel |
| 1540 | </semantic-action> |
| 1541 | <semantic-action intent="primary" sentiment="constructive" onclick="document.getElementById('modal-actions').removeAttribute('open')"> |
| 1542 | Save Changes |
| 1543 | </semantic-action> |
| 1544 | </div> |
| 1545 | </semantic-modal> |
| 1546 | |
| 1547 | <semantic-modal id="modal-critical" urgency="critical"> |
| 1548 | <h3 slot="title">⚠️ Destructive Action</h3> |
| 1549 | <p>This action cannot be undone. All data will be permanently deleted.</p> |
| 1550 | <div slot="actions"> |
| 1551 | <semantic-action intent="secondary" onclick="document.getElementById('modal-critical').removeAttribute('open')"> |
| 1552 | Cancel |
| 1553 | </semantic-action> |
| 1554 | <semantic-action intent="primary" sentiment="destructive" onclick="document.getElementById('modal-critical').removeAttribute('open')"> |
| 1555 | Delete Forever |
| 1556 | </semantic-action> |
| 1557 | </div> |
| 1558 | </semantic-modal> |
| 1559 | |
| 1560 | <!-- Properties --> |
| 1561 | <div class="variation-group"> |
| 1562 | <h3 class="variation-title">Properties & Slots</h3> |
| 1563 | <table style="width: 100%; color: #fff; border-collapse: collapse; font-size: 14px;"> |
| 1564 | <thead> |
| 1565 | <tr style="background: rgba(0,102,204,0.1); border-bottom: 2px solid #0066cc;"> |
| 1566 | <th style="padding: 12px; text-align: left;">Slot/Attribute</th> |
| 1567 | <th style="padding: 12px; text-align: left;">Type</th> |
| 1568 | <th style="padding: 12px; text-align: left;">Description</th> |
| 1569 | </tr> |
| 1570 | </thead> |
| 1571 | <tbody> |
| 1572 | <tr style="border-bottom: 1px solid #333;"> |
| 1573 | <td style="padding: 12px;"><span class="prop-name">title</span></td> |
| 1574 | <td style="padding: 12px;"><span class="prop-type">slot</span></td> |
| 1575 | <td style="padding: 12px;">Modal title</td> |
| 1576 | </tr> |
| 1577 | <tr style="border-bottom: 1px solid #333;"> |
| 1578 | <td style="padding: 12px;"><span class="prop-name">actions</span></td> |
| 1579 | <td style="padding: 12px;"><span class="prop-type">slot</span></td> |
| 1580 | <td style="padding: 12px;">Action buttons</td> |
| 1581 | </tr> |
| 1582 | <tr style="border-bottom: 1px solid #333;"> |
| 1583 | <td style="padding: 12px;"><span class="prop-name">open</span></td> |
| 1584 | <td style="padding: 12px;"><span class="prop-type">attribute</span></td> |
| 1585 | <td style="padding: 12px;">Show/hide modal</td> |
| 1586 | </tr> |
| 1587 | <tr style="border-bottom: 1px solid #333;"> |
| 1588 | <td style="padding: 12px;"><span class="prop-name">urgency</span></td> |
| 1589 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 1590 | <td style="padding: 12px;">critical | high | medium | low</td> |
| 1591 | </tr> |
| 1592 | </tbody> |
| 1593 | </table> |
| 1594 | </div> |
| 1595 | </section> |
| 1596 | |
| 1597 | <!-- Component 07: semantic-navigator --> |
| 1598 | <section class="component-section" id="semantic-navigator"> |
| 1599 | <div class="component-header"> |
| 1600 | <h2 class="component-number">07.</h2> |
| 1601 | <div> |
| 1602 | <h2 class="component-name">semantic-navigator</h2> |
| 1603 | <p class="component-tagline">Navigation patterns with voice commands and keyboard shortcuts</p> |
| 1604 | </div> |
| 1605 | </div> |
| 1606 | |
| 1607 | <!-- Navigation Types --> |
| 1608 | <div class="variation-group"> |
| 1609 | <h3 class="variation-title">Navigation Patterns</h3> |
| 1610 | <p class="variation-description">Different layouts for different contexts</p> |
| 1611 | <div class="variation-grid grid-2"> |
| 1612 | <div class="example-card"> |
| 1613 | <div class="example-label">Horizontal Tabs</div> |
| 1614 | <semantic-navigator type="tabs"> |
| 1615 | <nav-item href="#home" active>Home</nav-item> |
| 1616 | <nav-item href="#products">Products</nav-item> |
| 1617 | <nav-item href="#about">About</nav-item> |
| 1618 | <nav-item href="#contact">Contact</nav-item> |
| 1619 | </semantic-navigator> |
| 1620 | </div> |
| 1621 | |
| 1622 | <div class="example-card"> |
| 1623 | <div class="example-label">Vertical Menu</div> |
| 1624 | <semantic-navigator type="menu"> |
| 1625 | <nav-item href="#dashboard" icon="📊">Dashboard</nav-item> |
| 1626 | <nav-item href="#projects" icon="🚀" active>Projects</nav-item> |
| 1627 | <nav-item href="#team" icon="👥">Team</nav-item> |
| 1628 | <nav-item href="#settings" icon="⚙️">Settings</nav-item> |
| 1629 | </semantic-navigator> |
| 1630 | </div> |
| 1631 | </div> |
| 1632 | </div> |
| 1633 | |
| 1634 | <!-- Properties --> |
| 1635 | <div class="variation-group"> |
| 1636 | <h3 class="variation-title">Properties & Child Elements</h3> |
| 1637 | <table style="width: 100%; color: #fff; border-collapse: collapse; font-size: 14px;"> |
| 1638 | <thead> |
| 1639 | <tr style="background: rgba(0,102,204,0.1); border-bottom: 2px solid #0066cc;"> |
| 1640 | <th style="padding: 12px; text-align: left;">Attribute</th> |
| 1641 | <th style="padding: 12px; text-align: left;">Type</th> |
| 1642 | <th style="padding: 12px; text-align: left;">Description</th> |
| 1643 | </tr> |
| 1644 | </thead> |
| 1645 | <tbody> |
| 1646 | <tr style="border-bottom: 1px solid #333;"> |
| 1647 | <td style="padding: 12px;"><span class="prop-name">type</span></td> |
| 1648 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 1649 | <td style="padding: 12px;">tabs | menu | breadcrumb</td> |
| 1650 | </tr> |
| 1651 | <tr style="border-bottom: 1px solid #333;"> |
| 1652 | <td style="padding: 12px;"><span class="prop-name">nav-item</span></td> |
| 1653 | <td style="padding: 12px;"><span class="prop-type">element</span></td> |
| 1654 | <td style="padding: 12px;">Navigation item with href, icon, active</td> |
| 1655 | </tr> |
| 1656 | </tbody> |
| 1657 | </table> |
| 1658 | </div> |
| 1659 | </section> |
| 1660 | |
| 1661 | <!-- Component 08: semantic-list --> |
| 1662 | <section class="component-section" id="semantic-list"> |
| 1663 | <div class="component-header"> |
| 1664 | <h2 class="component-number">08.</h2> |
| 1665 | <div> |
| 1666 | <h2 class="component-name">semantic-list</h2> |
| 1667 | <p class="component-tagline">Selectable lists with keyboard navigation and voice selection</p> |
| 1668 | </div> |
| 1669 | </div> |
| 1670 | |
| 1671 | <!-- List Types --> |
| 1672 | <div class="variation-group"> |
| 1673 | <h3 class="variation-title">List Variations</h3> |
| 1674 | <p class="variation-description"><strong>TRY IT:</strong> Click items, use arrow keys, or voice commands</p> |
| 1675 | <div class="variation-grid grid-2"> |
| 1676 | <div class="example-card"> |
| 1677 | <div class="example-label">Single Selection</div> |
| 1678 | <semantic-list selection="single"> |
| 1679 | <list-item value="1">First Item</list-item> |
| 1680 | <list-item value="2" selected>Second Item (Selected)</list-item> |
| 1681 | <list-item value="3">Third Item</list-item> |
| 1682 | <list-item value="4">Fourth Item</list-item> |
| 1683 | </semantic-list> |
| 1684 | </div> |
| 1685 | |
| 1686 | <div class="example-card"> |
| 1687 | <div class="example-label">Multiple Selection</div> |
| 1688 | <semantic-list selection="multiple"> |
| 1689 | <list-item value="a" selected>Option A (Selected)</list-item> |
| 1690 | <list-item value="b">Option B</list-item> |
| 1691 | <list-item value="c" selected>Option C (Selected)</list-item> |
| 1692 | <list-item value="d">Option D</list-item> |
| 1693 | </semantic-list> |
| 1694 | </div> |
| 1695 | </div> |
| 1696 | </div> |
| 1697 | |
| 1698 | <!-- Properties --> |
| 1699 | <div class="variation-group"> |
| 1700 | <h3 class="variation-title">Properties & Child Elements</h3> |
| 1701 | <table style="width: 100%; color: #fff; border-collapse: collapse; font-size: 14px;"> |
| 1702 | <thead> |
| 1703 | <tr style="background: rgba(0,102,204,0.1); border-bottom: 2px solid #0066cc;"> |
| 1704 | <th style="padding: 12px; text-align: left;">Attribute</th> |
| 1705 | <th style="padding: 12px; text-align: left;">Type</th> |
| 1706 | <th style="padding: 12px; text-align: left;">Description</th> |
| 1707 | </tr> |
| 1708 | </thead> |
| 1709 | <tbody> |
| 1710 | <tr style="border-bottom: 1px solid #333;"> |
| 1711 | <td style="padding: 12px;"><span class="prop-name">selection</span></td> |
| 1712 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 1713 | <td style="padding: 12px;">single | multiple | none</td> |
| 1714 | </tr> |
| 1715 | <tr style="border-bottom: 1px solid #333;"> |
| 1716 | <td style="padding: 12px;"><span class="prop-name">list-item</span></td> |
| 1717 | <td style="padding: 12px;"><span class="prop-type">element</span></td> |
| 1718 | <td style="padding: 12px;">List item with value, selected attributes</td> |
| 1719 | </tr> |
| 1720 | </tbody> |
| 1721 | </table> |
| 1722 | </div> |
| 1723 | </section> |
| 1724 | |
| 1725 | <!-- Component 09: semantic-menu --> |
| 1726 | <section class="component-section" id="semantic-menu"> |
| 1727 | <div class="component-header"> |
| 1728 | <h2 class="component-number">09.</h2> |
| 1729 | <div> |
| 1730 | <h2 class="component-name">semantic-menu</h2> |
| 1731 | <p class="component-tagline">Context menus with keyboard shortcuts and voice activation</p> |
| 1732 | </div> |
| 1733 | </div> |
| 1734 | |
| 1735 | <!-- Menu Example --> |
| 1736 | <div class="variation-group"> |
| 1737 | <h3 class="variation-title">Context Menu</h3> |
| 1738 | <p class="variation-description"><strong>TRY IT:</strong> Right-click the box below</p> |
| 1739 | <div class="variation-grid grid-1"> |
| 1740 | <div class="example-card"> |
| 1741 | <div id="menu-trigger" style="background: rgba(0,102,204,0.1); border: 2px dashed #0066cc; border-radius: 12px; padding: 48px; text-align: center; cursor: pointer;"> |
| 1742 | <strong style="font-size: 18px; color: #409cff;">Right-click here</strong><br> |
| 1743 | <span style="font-size: 14px; color: #ababab;">Context menu will appear</span> |
| 1744 | </div> |
| 1745 | </div> |
| 1746 | </div> |
| 1747 | </div> |
| 1748 | |
| 1749 | <!-- Menu Component (hidden) --> |
| 1750 | <semantic-menu id="context-menu"> |
| 1751 | <menu-item icon="📋" shortcut="Ctrl+C">Copy</menu-item> |
| 1752 | <menu-item icon="✂️" shortcut="Ctrl+X">Cut</menu-item> |
| 1753 | <menu-item icon="📄" shortcut="Ctrl+V">Paste</menu-item> |
| 1754 | <menu-divider></menu-divider> |
| 1755 | <menu-item icon="🗑️" shortcut="Del" intent="destructive">Delete</menu-item> |
| 1756 | </semantic-menu> |
| 1757 | |
| 1758 | <!-- Properties --> |
| 1759 | <div class="variation-group"> |
| 1760 | <h3 class="variation-title">Properties & Child Elements</h3> |
| 1761 | <table style="width: 100%; color: #fff; border-collapse: collapse; font-size: 14px;"> |
| 1762 | <thead> |
| 1763 | <tr style="background: rgba(0,102,204,0.1); border-bottom: 2px solid #0066cc;"> |
| 1764 | <th style="padding: 12px; text-align: left;">Element</th> |
| 1765 | <th style="padding: 12px; text-align: left;">Attributes</th> |
| 1766 | <th style="padding: 12px; text-align: left;">Description</th> |
| 1767 | </tr> |
| 1768 | </thead> |
| 1769 | <tbody> |
| 1770 | <tr style="border-bottom: 1px solid #333;"> |
| 1771 | <td style="padding: 12px;"><span class="prop-name">menu-item</span></td> |
| 1772 | <td style="padding: 12px;"><span class="prop-type">icon, shortcut, intent</span></td> |
| 1773 | <td style="padding: 12px;">Menu item with optional icon and keyboard shortcut</td> |
| 1774 | </tr> |
| 1775 | <tr style="border-bottom: 1px solid #333;"> |
| 1776 | <td style="padding: 12px;"><span class="prop-name">menu-divider</span></td> |
| 1777 | <td style="padding: 12px;"><span class="prop-type">-</span></td> |
| 1778 | <td style="padding: 12px;">Visual separator between menu groups</td> |
| 1779 | </tr> |
| 1780 | </tbody> |
| 1781 | </table> |
| 1782 | </div> |
| 1783 | </section> |
| 1784 | </div> |
| 1785 | |
| 1786 | <!-- Context Simulator --> |
| 1787 | <div class="context-simulator"> |
| 1788 | <h3>🎮 Context Simulator</h3> |
| 1789 | |
| 1790 | <div class="context-control"> |
| 1791 | <label>Modality</label> |
| 1792 | <select id="sim-modality"> |
| 1793 | <option value="screen">Screen Only</option> |
| 1794 | <option value="voice-screen">Voice + Screen</option> |
| 1795 | <option value="voice-only">Voice Only</option> |
| 1796 | <option value="touch">Touch</option> |
| 1797 | </select> |
| 1798 | </div> |
| 1799 | |
| 1800 | <div class="context-control"> |
| 1801 | <label>Noise Level: <span id="noise-value">0%</span></label> |
| 1802 | <input type="range" id="sim-noise" min="0" max="100" value="0"> |
| 1803 | </div> |
| 1804 | |
| 1805 | <div class="context-control"> |
| 1806 | <label>Viewers: <span id="viewer-value">1</span></label> |
| 1807 | <input type="range" id="sim-viewers" min="1" max="10" value="1"> |
| 1808 | </div> |
| 1809 | |
| 1810 | <div class="context-row"> |
| 1811 | <label style="margin: 0;">User Busy</label> |
| 1812 | <div class="toggle-small" id="toggle-busy"></div> |
| 1813 | </div> |
| 1814 | |
| 1815 | <div class="context-row"> |
| 1816 | <label style="margin: 0;">Focus Mode</label> |
| 1817 | <div class="toggle-small" id="toggle-focus"></div> |
| 1818 | </div> |
| 1819 | </div> |
| 1820 | |
| 1821 | <script> |
| 1822 | // Selectable state demo boxes |
| 1823 | document.querySelectorAll('.state-demo-box.clickable').forEach(box => { |
| 1824 | box.addEventListener('click', function() { |
| 1825 | const group = this.getAttribute('data-select-group'); |
| 1826 | |
| 1827 | // Deselect all in same group |
| 1828 | document.querySelectorAll(`[data-select-group="${group}"]`).forEach(b => { |
| 1829 | b.classList.remove('selected'); |
| 1830 | }); |
| 1831 | |
| 1832 | // Select this one |
| 1833 | this.classList.add('selected'); |
| 1834 | }); |
| 1835 | }); |
| 1836 | |
| 1837 | // Auto-cycling state demo |
| 1838 | let cycleState = 0; |
| 1839 | const states = [ |
| 1840 | { name: 'DEFAULT', class: 'state-default-bg', button: '' }, |
| 1841 | { name: 'HOVER', class: 'state-hover-bg', button: 'transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,102,204,0.3);' }, |
| 1842 | { name: 'ACTIVE', class: 'state-active-bg', button: 'transform: scale(0.95);' }, |
| 1843 | { name: 'SELECTED', class: 'state-selected-bg', button: 'box-shadow: 0 0 0 3px rgba(52,199,89,0.5);' } |
| 1844 | ]; |
| 1845 | |
| 1846 | setInterval(() => { |
| 1847 | const label = document.getElementById('cycle-label'); |
| 1848 | const button = document.getElementById('cycle-button'); |
| 1849 | |
| 1850 | cycleState = (cycleState + 1) % states.length; |
| 1851 | const state = states[cycleState]; |
| 1852 | |
| 1853 | // Update label |
| 1854 | label.className = 'current-state-label ' + state.class; |
| 1855 | label.textContent = state.name; |
| 1856 | |
| 1857 | // Update button style |
| 1858 | button.setAttribute('style', state.button); |
| 1859 | }, 2000); |
| 1860 | |
| 1861 | // Click counter demo |
| 1862 | let clickCount = 0; |
| 1863 | const clickBtn = document.getElementById('click-demo-btn'); |
| 1864 | if (clickBtn) { |
| 1865 | clickBtn.addEventListener('click', () => { |
| 1866 | clickCount++; |
| 1867 | document.getElementById('click-count').textContent = `Clicks: ${clickCount}`; |
| 1868 | document.getElementById('click-count').style.transform = 'scale(1.2)'; |
| 1869 | setTimeout(() => { |
| 1870 | document.getElementById('click-count').style.transform = 'scale(1)'; |
| 1871 | }, 100); |
| 1872 | }); |
| 1873 | } |
| 1874 | |
| 1875 | // Interactive demos |
| 1876 | const activateDemo = document.getElementById('activate-demo'); |
| 1877 | if (activateDemo) { |
| 1878 | activateDemo.addEventListener('intent', (e) => { |
| 1879 | if (e.detail.type === 'activate') { |
| 1880 | const log = document.getElementById('activate-log'); |
| 1881 | log.innerHTML = `<strong>✓ ACTIVATED</strong><br>Time: ${new Date().toLocaleTimeString()}<br>Method: ${e.detail.method || 'click'}`; |
| 1882 | } |
| 1883 | }); |
| 1884 | } |
| 1885 | |
| 1886 | const inspectDemo = document.getElementById('inspect-demo'); |
| 1887 | if (inspectDemo) { |
| 1888 | inspectDemo.addEventListener('intent', (e) => { |
| 1889 | if (e.detail.type === 'inspect') { |
| 1890 | const log = document.getElementById('inspect-log'); |
| 1891 | log.innerHTML = `<strong>🔍 INSPECTED</strong><br>Time: ${new Date().toLocaleTimeString()}<br>Duration: 500ms`; |
| 1892 | } |
| 1893 | }); |
| 1894 | } |
| 1895 | |
| 1896 | // Context simulator |
| 1897 | document.getElementById('sim-modality').addEventListener('change', (e) => { |
| 1898 | if (window.semanticContext) { |
| 1899 | window.semanticContext.setModality(e.target.value); |
| 1900 | } |
| 1901 | }); |
| 1902 | |
| 1903 | document.getElementById('sim-noise').addEventListener('input', (e) => { |
| 1904 | document.getElementById('noise-value').textContent = e.target.value + '%'; |
| 1905 | if (window.semanticContext) { |
| 1906 | window.semanticContext.context.environment.noiseLevel = parseInt(e.target.value); |
| 1907 | } |
| 1908 | }); |
| 1909 | |
| 1910 | document.getElementById('sim-viewers').addEventListener('input', (e) => { |
| 1911 | document.getElementById('viewer-value').textContent = e.target.value; |
| 1912 | if (window.semanticContext) { |
| 1913 | window.semanticContext.context.environment.viewerCount = parseInt(e.target.value); |
| 1914 | } |
| 1915 | }); |
| 1916 | |
| 1917 | document.getElementById('toggle-busy').addEventListener('click', function() { |
| 1918 | this.classList.toggle('active'); |
| 1919 | if (window.semanticContext) { |
| 1920 | window.semanticContext.context.user.isBusy = this.classList.contains('active'); |
| 1921 | } |
| 1922 | }); |
| 1923 | |
| 1924 | document.getElementById('toggle-focus').addEventListener('click', function() { |
| 1925 | this.classList.toggle('active'); |
| 1926 | if (window.semanticContext) { |
| 1927 | window.semanticContext.context.user.inFocusMode = this.classList.contains('active'); |
| 1928 | } |
| 1929 | }); |
| 1930 | |
| 1931 | // Log all intents |
| 1932 | document.addEventListener('intent', (e) => { |
| 1933 | console.log('Intent:', e.detail); |
| 1934 | }); |
| 1935 | |
| 1936 | // Add smooth transitions to click count |
| 1937 | const clickCountEl = document.getElementById('click-count'); |
| 1938 | if (clickCountEl) { |
| 1939 | clickCountEl.style.transition = 'transform 0.1s ease'; |
| 1940 | } |
| 1941 | |
| 1942 | // Card click counter demo |
| 1943 | let cardClickCount = 0; |
| 1944 | const cardDemo3 = document.getElementById('card-demo-3'); |
| 1945 | if (cardDemo3) { |
| 1946 | cardDemo3.addEventListener('intent', (e) => { |
| 1947 | if (e.detail.type === 'activate') { |
| 1948 | cardClickCount++; |
| 1949 | const counter = document.getElementById('card-click-count'); |
| 1950 | if (counter) { |
| 1951 | counter.textContent = cardClickCount; |
| 1952 | counter.style.color = '#34c759'; |
| 1953 | counter.style.fontWeight = '900'; |
| 1954 | } |
| 1955 | } |
| 1956 | }); |
| 1957 | } |
| 1958 | |
| 1959 | // Log card inspects |
| 1960 | const cardDemo2 = document.getElementById('card-demo-2'); |
| 1961 | if (cardDemo2) { |
| 1962 | cardDemo2.addEventListener('intent', (e) => { |
| 1963 | if (e.detail.type === 'inspect') { |
| 1964 | console.log('Card inspected!', e.detail); |
| 1965 | // Could show visual feedback here |
| 1966 | } |
| 1967 | }); |
| 1968 | } |
| 1969 | |
| 1970 | // Feedback demo buttons |
| 1971 | const feedbackContainer = document.getElementById('feedback-container'); |
| 1972 | |
| 1973 | const triggerSuccess = document.getElementById('trigger-success'); |
| 1974 | if (triggerSuccess) { |
| 1975 | triggerSuccess.addEventListener('click', () => { |
| 1976 | const feedback = document.createElement('semantic-feedback'); |
| 1977 | feedback.setAttribute('type', 'success'); |
| 1978 | feedback.setAttribute('message', 'Operation completed successfully!'); |
| 1979 | feedback.setAttribute('visible', ''); |
| 1980 | feedback.setAttribute('duration', '3000'); |
| 1981 | feedbackContainer.innerHTML = ''; |
| 1982 | feedbackContainer.appendChild(feedback); |
| 1983 | }); |
| 1984 | } |
| 1985 | |
| 1986 | const triggerError = document.getElementById('trigger-error'); |
| 1987 | if (triggerError) { |
| 1988 | triggerError.addEventListener('click', () => { |
| 1989 | const feedback = document.createElement('semantic-feedback'); |
| 1990 | feedback.setAttribute('type', 'error'); |
| 1991 | feedback.setAttribute('message', 'Something went wrong!'); |
| 1992 | feedback.setAttribute('visible', ''); |
| 1993 | feedback.setAttribute('duration', '5000'); |
| 1994 | feedbackContainer.innerHTML = ''; |
| 1995 | feedbackContainer.appendChild(feedback); |
| 1996 | }); |
| 1997 | } |
| 1998 | |
| 1999 | const triggerWarning = document.getElementById('trigger-warning'); |
| 2000 | if (triggerWarning) { |
| 2001 | triggerWarning.addEventListener('click', () => { |
| 2002 | const feedback = document.createElement('semantic-feedback'); |
| 2003 | feedback.setAttribute('type', 'warning'); |
| 2004 | feedback.setAttribute('message', 'Please review your changes'); |
| 2005 | feedback.setAttribute('visible', ''); |
| 2006 | feedback.setAttribute('duration', '4000'); |
| 2007 | feedbackContainer.innerHTML = ''; |
| 2008 | feedbackContainer.appendChild(feedback); |
| 2009 | }); |
| 2010 | } |
| 2011 | |
| 2012 | const triggerInfo = document.getElementById('trigger-info'); |
| 2013 | if (triggerInfo) { |
| 2014 | triggerInfo.addEventListener('click', () => { |
| 2015 | const feedback = document.createElement('semantic-feedback'); |
| 2016 | feedback.setAttribute('type', 'info'); |
| 2017 | feedback.setAttribute('message', 'Did you know? You can use keyboard shortcuts'); |
| 2018 | feedback.setAttribute('visible', ''); |
| 2019 | feedback.setAttribute('duration', '4000'); |
| 2020 | feedbackContainer.innerHTML = ''; |
| 2021 | feedbackContainer.appendChild(feedback); |
| 2022 | }); |
| 2023 | } |
| 2024 | |
| 2025 | // Adjuster demos - brightness |
| 2026 | const brightnessAdjuster = document.getElementById('brightness-adjuster'); |
| 2027 | if (brightnessAdjuster) { |
| 2028 | brightnessAdjuster.addEventListener('intent', (e) => { |
| 2029 | if (e.detail.type === 'adjust') { |
| 2030 | const value = e.detail.value; |
| 2031 | document.getElementById('brightness-value').textContent = value + '%'; |
| 2032 | const box = document.getElementById('brightness-box'); |
| 2033 | box.style.opacity = value / 100; |
| 2034 | } |
| 2035 | }); |
| 2036 | } |
| 2037 | |
| 2038 | // Temperature adjuster |
| 2039 | const tempAdjuster = document.getElementById('temp-adjuster'); |
| 2040 | if (tempAdjuster) { |
| 2041 | tempAdjuster.addEventListener('intent', (e) => { |
| 2042 | if (e.detail.type === 'adjust') { |
| 2043 | const value = e.detail.value; |
| 2044 | document.getElementById('temp-value').textContent = value + '°C'; |
| 2045 | // Move indicator |
| 2046 | const percent = ((value - 15) / (30 - 15)) * 100; |
| 2047 | const indicator = document.querySelector('#temp-indicator > div'); |
| 2048 | if (indicator) { |
| 2049 | indicator.style.left = percent + '%'; |
| 2050 | } |
| 2051 | } |
| 2052 | }); |
| 2053 | } |
| 2054 | |
| 2055 | // Zoom adjuster (could show visual zoom effect) |
| 2056 | const zoomAdjuster = document.getElementById('zoom-adjuster'); |
| 2057 | if (zoomAdjuster) { |
| 2058 | zoomAdjuster.addEventListener('intent', (e) => { |
| 2059 | if (e.detail.type === 'adjust') { |
| 2060 | console.log('Zoom level:', e.detail.value + '%'); |
| 2061 | } |
| 2062 | }); |
| 2063 | } |
| 2064 | </script> |
| 2065 | </body> |
| 2066 | </html> |