Compare commits

..

488 Commits

Author SHA1 Message Date
Lea Verou
82faf7da36 Don't break in SSR 2025-02-10 10:20:50 -05:00
Lea Verou
fd0fad361f <wa-isolate> as a wrapper for DSD 2025-02-10 10:17:23 -05:00
Lea Verou
ffda52a7cf Theme remixing: Dynamic code snippets (#729) 2025-02-07 23:03:34 -05:00
Lea Verou
9be7919c60 Implement brand stylesheets for missing hues 2025-02-07 17:59:18 -05:00
Lea Verou
c30f3c4b09 Improve theme remixing UI (#724)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-02-07 11:35:12 -05:00
Lea Verou
7e8f13b5cb Add accent color tint as separate variable (#725)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-02-06 18:30:43 -05:00
Lindsay M
97ab986425 Revise classic palette, closes #707 (#716)
* Change  everything 

* No changes to `gray`
2025-02-06 17:58:33 -05:00
Lea Verou
f1fa7f713e Add label attribute to option & menu-item (#704)
* Add `label` attribute and `defaultLabel` getter to option and menu-item, drop `getTextLabel()`

- Add `label` attribute to option and menu-item, closes #698
- [Option] Add `defaultLabel` cached property to both
- [Option] Remove `getTextLabel()` method from both (people can just set `el.label`)
- Refactor: Merge utils to get text content into one more powerful utility function
- Fixed typo in `slot.ts`

.

Add `label` attribute to menu, remove `getTextLabel`

* Update filename
2025-02-06 10:58:09 -05:00
lindsaym-fa
3394a95057 Remove visual test failure markers 2025-02-06 10:57:33 -05:00
Lea Verou
eed9ddb9b3 Fix #622 2025-02-06 10:57:33 -05:00
Lea Verou
daf5e7734d Support opting out of anchor headings with data-no-anchor 2025-02-06 10:56:56 -05:00
Lea Verou
63133d0e33 Card fixes 2025-02-06 10:25:02 -05:00
Lea Verou
b2d74145b8 Remove stray console.log() 2025-02-05 11:35:55 -05:00
Lea Verou
17eeccbc5d Better infrastructure for core colors, show core colors in docs, closes #668 2025-02-05 11:24:13 -05:00
Lea Verou
68f645e776 [Option] Drop base part, rel #207 2025-02-05 09:29:50 -05:00
Cory LaViska
b3e4c59197 add secure context notice (#683) 2025-02-04 16:27:35 +00:00
Lindsay M
6080a85035 Replace teal with cyan, fixes #659 (#671)
Co-authored-by: Lea Verou <lea@verou.me>
2025-02-03 19:01:23 -05:00
lindsaym-fa
f7e088c8df Rename violet to purple, fixes #656 2025-02-03 18:47:03 -05:00
Lea Verou
80e1c05b37 Add --wa-color-brand-* tokens, fixes #655 (#662) 2025-02-03 15:39:59 -05:00
Cory LaViska
99f0273783 fix placeholder token (#652) 2025-02-03 17:03:34 +00:00
Cory LaViska
8e13683a30 Select tag fix (#651)
* add tag-counter part to wa-select

* on second thought
2025-02-03 16:48:46 +00:00
Cory LaViska
fd73542d2c restore slot detection for non-SSR environments (#649) 2025-02-03 16:21:53 +00:00
Cory LaViska
bde0ed7403 add orientation example and use utils for spacing (#648) 2025-02-03 15:46:51 +00:00
Cory LaViska
8dc49f7119 fix event listeners (#647) 2025-02-03 10:07:21 -05:00
Cory LaViska
25cb96aa30 3.0.0-alpha.10 2025-01-31 11:23:56 -05:00
Cory LaViska
360273ac27 update version 2025-01-31 11:23:50 -05:00
Lea Verou
404d59d9d6 Improve FOUCE reduction utility, docs fixes, :state(wa-defined) (#643)
* Utility layout

* Split out, improve & document FOUCE utility
2025-01-31 11:19:30 -05:00
Lea Verou
ce1ce6caca Fix regression (#642) 2025-01-31 10:01:01 -05:00
Lea Verou
74ecc52a15 Inheritable size (#593)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-30 15:56:32 -08:00
Lindsay M
a64cc60ad5 Revise docs to clarify installation guidance (#638)
* Revise docs to clarify installation guidance

* Fix broken link

* Clarify `:where(:root)`, add CSS part example
2025-01-30 14:40:08 -05:00
Lindsay M
c5f91ec2f7 Add missing changelog entries (#639)
* Add logs for visual tests, `variant` inheritance, and missing bug fixes

* Update logs on docs changes
2025-01-30 11:51:57 -05:00
Lea Verou
4f9af1e871 Add JS snppet for setting wa-dark based on OS default 2025-01-30 08:32:01 -08:00
Lea Verou
aeb25f3a7d Infrastructure for inheritable props, make variant inherit (#582)
Fixes #454, fixes #592 

Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-29 16:22:50 -08:00
Cory LaViska
b89ee673e6 Fix <wa-textarea> form submit behavior (#637)
* fix textarea form submit behavior

* add test
2025-01-29 17:57:16 -05:00
Lindsay M
3c70c44b8a Use flex columns for form controls, fixes #629 (#636)
* Use flex columns for form controls

* Touch up spacing in color picker example

* Use consistent `display` for related form controls
2025-01-29 09:56:09 -05:00
Lindsay M
d8881c0b1e Add Visual Test Suite (#617)
* Initial progress on visual test suite

* Additional tests and descriptions

* Add native callout, add dividers between tables

* Indicate test failures, improve alignment tests

* Split tests into separate files

* Add table scrolling

* Remove irrelevant icon test cases

* Add test failures

* Shorten "Inline Code" > "Code" to prevent wrapping

* Add horizontal orientation to radio button tests
2025-01-28 18:45:19 -05:00
Lea Verou
88b6fe2fbe Docs on cherry-picking native styles (#619)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-01-28 16:58:53 -05:00
Lea Verou
6a0725cf00 Fix button appearance docs (#603) 2025-01-28 15:46:30 -05:00
Cory LaViska
3ff8745910 Add orientation to radio group (#635)
* add orientation to radio group; fixes #613

* fix timing issue that prevents value from being set sometimes

* gimme a break

* make radio button examples horizontal

---------

Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-28 14:23:39 -05:00
Lindsay M
0cb72adb28 Use 100% width for text field and select labels (#599) 2025-01-27 09:49:35 -05:00
Cory LaViska
3d35f5d4e0 Ensure change events bubble (#601) 2025-01-26 14:10:57 -05:00
Lindsay M
815cc4220b Add breaks between radios in examples (#598) 2025-01-24 17:19:26 -05:00
Lea Verou
a7caf19b34 Tintless variables + OKLCH coords as comments (#596)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-01-24 16:55:21 -05:00
Lindsay M
71c054d6e4 Use background-image for native select caret (#594) 2025-01-24 11:52:06 -05:00
Cory LaViska
e1bf5471bf Use native events when possible (#590)
* fix filename

* <wa-input> input + change (change not working)

* compose that horribly misleading change event

* use native blur/focus events

* update checkbox

* update color picker events

* update color picker events

* update radio group events

* update button events

* remove event options

* update select events

* update image comparer events

* update icon button events

* update slider events

* update rating events

* update radio events

* update switch event

* update textarea events

* update radio button events

* remove unused events

* cleanup

* fix react wrappers

* fix react events for real this time

* update changelog

* add note

* Update src/components/input/input.ts

Co-authored-by: Lea Verou <lea@verou.me>

* delete unused close event

* use same event type

* fix tests

* remove wa- from events in docs and examples

* fix comment

* Update docs/docs/resources/changelog.md

Co-authored-by: Lea Verou <lea@verou.me>

---------

Co-authored-by: Lea Verou <lea@verou.me>
2025-01-23 17:52:41 -05:00
Lea Verou
099edc5186 Implement wide page-level data 2025-01-22 13:25:29 -05:00
Lea Verou
e3560dcf98 Do not reflect default values
- Add `default` descriptor
- Do not reflect attributes when equal to their default value
- Patch getter return value to return default value when empty
- Use it in button `appearance`
2025-01-21 15:16:11 -05:00
Cory LaViska
f2bb2c84a0 fix nested tab groups (#576) 2025-01-21 12:54:38 -05:00
Cory LaViska
13b3342017 fix slot names (#577) 2025-01-21 12:52:41 -05:00
Cory LaViska
d1c1d689ce ensure fix works on backers website (#579) 2025-01-21 12:36:54 -05:00
Cory LaViska
44e5e37a2b 3.0.0-alpha.9 2025-01-17 10:40:54 -05:00
Cory LaViska
566aae927d fix typo 2025-01-17 10:39:18 -05:00
Lea Verou
7258c001a7 Demo for mixing and matching (#565) 2025-01-17 10:38:03 -05:00
Lea Verou
7a70940c6a Update changelog, remove .wa-callout from alpha 2025-01-16 18:27:47 -05:00
Lea Verou
45f4edc426 Fix #561 2025-01-16 16:50:28 -05:00
Lea Verou
da32015f27 Basic mixing and matching docs (#560) 2025-01-16 16:31:24 -05:00
Lea Verou
03d8238edb Add missing :state(blank) docs 2025-01-16 16:17:50 -05:00
Lindsay M
34f8744493 Fix missing mild palette doc and links (#557) 2025-01-16 16:09:52 -05:00
Lindsay M
fa3fe5f753 Theme files housekeeping, closes #519 (#552)
* Reorg Glossy theme

* Reorg Playful theme

* Remove redundant dark mode tokens
2025-01-16 16:09:28 -05:00
Lindsay M
fc6c7de1fd Fix contrast issues with Bright teal (#556) 2025-01-16 16:09:03 -05:00
Lea Verou
0037712549 Matter Ripple MVP (#558)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-16 16:05:50 -05:00
Lea Verou
5301945bfa Filled inputs 2025-01-16 14:48:56 -05:00
Lea Verou
1298651dd8 Floating labels on select 2025-01-16 14:48:56 -05:00
Lea Verou
5f9695fde1 Floating labels on textarea 2025-01-16 14:48:56 -05:00
Lea Verou
2eb2597efe Floating labels for input 2025-01-16 14:48:56 -05:00
lindsaym-fa
431e82261b Initial floating label attempt 2025-01-16 14:48:56 -05:00
Lea Verou
df51149d0a Show contrast ratios in contrast pair tables 2025-01-16 13:18:26 -05:00
Lindsay M
fba0b11343 Add Matter theme (#547)
* Add Matter theme

* Add Matter to alpha build

* Add changelog

* Fix incorrect palette name

* Make loud fills darker in light mode
2025-01-16 12:08:51 -05:00
Lea Verou
3618e93490 Reintroduce --border-width and --border-radius, fixes #531 2025-01-16 10:36:03 -05:00
Lea Verou
cfa95307d1 Quick proof of concept contrast tests 2025-01-16 10:22:01 -05:00
Lea Verou
15344c2a2a Appease Turbo for the color scheme picker too, fixes #520 2025-01-16 10:15:52 -05:00
lindsaym-fa
3974aa5130 Decrease line height on swatches 2025-01-16 10:15:16 -05:00
lindsaym-fa
a6702ad6d2 Revise Color tokens doc and link to palettes 2025-01-16 10:15:16 -05:00
lindsaym-fa
ecf21adddc Fix punctuation 2025-01-16 10:15:16 -05:00
Lea Verou
52c24fc3b7 Add color palette to theme pages 2025-01-16 10:15:16 -05:00
Lea Verou
d464714d7b Rudimentary palette icons 2025-01-16 10:15:16 -05:00
Lea Verou
7d089bbe2f Palette Docs 2025-01-16 10:15:16 -05:00
Lea Verou
71914afc91 defaultPalette -> palette 2025-01-16 10:15:16 -05:00
Lindsay M
9d139e3fa0 Minor style update for checkboxes in wa-tree-item (#542)
* Use theme value line height for tree item checkbox

* Apply theme checkbox styles to selected tree items
2025-01-16 09:30:35 -05:00
Lindsay M
db3039e9fe Fix green-40 in classic color palette (#548) 2025-01-16 09:26:06 -05:00
Lindsay M
9494b9bb67 Improve default tooltip styles (#543)
* Use inverted colors for tooltips

* Remove redundant tooltip overrides from themes
2025-01-16 04:35:08 -05:00
Lea Verou
7e1f4f0351 Separate meaningful theme parts out (#526)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-15 17:32:36 -05:00
Lindsay M
5ebe4f4d3e Finalize playful theme, closes #490 (#527)
* Finalize Playful theme

* Add changelog, add to alpha

* Add playful theme to alpha build

* Touchup and tweaks

* Tweak hover mix color in `wa-dark`

* Avoid transforming buttons in button groups

* Final touchup

---------

Co-authored-by: Lea Verou <lea@verou.me>
2025-01-15 17:13:48 -05:00
Lea Verou
dfb9d53a25 Checkbox improvements
- Added `part="control", fixes #529
- Removed wrapper div which is no longer needed
- Removed `form-control--has-hint` class which is no longer used anywhere
2025-01-15 15:03:58 -05:00
Lindsay M
c2c1a2ff5b Add missing Glossy and Premium themes to alpha build (#528) 2025-01-15 10:45:43 -05:00
Lindsay M
ac86c037a1 Finalize Glossy theme, closes #491 (#525)
* Initial glassy theme progress

* Add fallback to slider thumb box shadow

* Remove redundant `wa-dark` styles and refactor shadows

* Rename to 'Glossy' since it fits the vibe better
2025-01-14 18:44:31 -05:00
Lea Verou
6b07c9a040 Native callout (#513)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-14 14:56:03 -05:00
Lea Verou
24a76f6a7c Color palette housekeeping (#523) 2025-01-14 14:54:34 -05:00
Lea Verou
89c0667e9c Improve maintainability of color docs 2025-01-14 14:44:30 -05:00
Lea Verou
434084ea4e Playful: refer to rudimentary palette 2025-01-14 14:32:39 -05:00
Lea Verou
1738c6345b Fix #514 for reals this time 2025-01-14 13:02:37 -05:00
Lea Verou
0ac7916a1b Attempt to fix #514 2025-01-14 13:02:37 -05:00
Lea Verou
e7979991e3 Update docs to lean into the "tokens" terminology in lieu of "properties"
Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-01-14 12:31:24 -05:00
Lea Verou
07f70098f8 Theming -> Design Tokens 2025-01-14 12:31:24 -05:00
Lindsay M
17146698db Finalize Premium theme, closes #489 (#510)
* Finalize Premium theme

* Improve theme compatibility of dark mode shadows

* Improve theme compatibility of code examples

* Add comments

* Revert dark mode shadow color changes (to be addressed separately)

* Revert dark mode shadow color change

* Clean up redundant `wa-dark` properties
2025-01-14 11:56:30 -05:00
Lea Verou
bf852b1296 Fix #515 2025-01-14 11:29:36 -05:00
Lea Verou
e367c0ef29 Open sidebar group on overview pages, fixes #507 2025-01-14 10:20:04 -05:00
Lea Verou
01210ef364 Implement .wa-invert, closes #497 (#508) 2025-01-14 10:04:27 -05:00
Lea Verou
40648e15fb Refactor: library.system.ts to export supported icons (#505) 2025-01-13 16:37:54 -05:00
Cory LaViska
ab67ecfad3 add native icon to search (#498) 2025-01-13 14:48:51 -05:00
Lea Verou
a07f6280a3 Themes category in docs (#477)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-13 13:14:12 -05:00
Lea Verou
6822b25772 Rewrite color scheme logic (#481)
- Minimize needless swaps
- Centralize logic
- Use an actual `<wa-select>` rather than hacking it with `<wa-dropdown>`
- Move shared includes to shared template
- Rewrite critical theme JS
- Refactor of theme picker code
- Utilize view transitions better and use them for color scheme too
- Do not store default value in localStorage
- Removed unused `*-wide` templates
- Fixed #482
2025-01-10 15:32:28 -05:00
Konnor Rogers
200188b0c3 properly report build failures (#485)
* properly report build failures

* prettier
2025-01-10 13:29:14 -05:00
Lea Verou
bc6fe95f13 npm run build:alpha:serve per @KonnorRogers suggestion 2025-01-10 13:13:01 -05:00
Lea Verou
3a33fa208a Add command for testing the build without having to push to Vercel 2025-01-10 13:13:01 -05:00
Lea Verou
3ec4e6de07 Fix build 2025-01-10 13:13:01 -05:00
Lea Verou
eb07dc1410 Use passthrough copy (#474) 2025-01-09 17:24:18 -05:00
Lindsay M
5bfeb8044e Theme showcase improvements (#480)
* Presentation improvements

* Change `-webkit-text-size-adjust` to supported value (`none` isn't a supported keyword on iOS)

* Try using `text-size-adjust`

* Throwing caution to the wind

* Give up on `text-size-adjust` and add 1-column view
2025-01-09 13:31:31 -05:00
lindsaym-fa
aa915c3e28 Doc revisions 2025-01-09 11:57:35 -05:00
Lea Verou
c79457a607 Attempt at better style isolation between themes
Still doesn't quite fix #475 but might be a nudge in the right direction.
2025-01-09 11:57:35 -05:00
Lea Verou
419f0610e4 Template-tweaks
- Move breadcrumbs to separate template
- Rename `beforeContent` to `header`
- Move breadcrumbs inside header
2025-01-09 02:26:01 -05:00
Cory LaViska
7ab5ca8640 3.0.0-alpha.8 2025-01-08 18:30:48 -05:00
Cory LaViska
c39faff936 update version (#473) 2025-01-08 18:17:31 -05:00
Lindsay M
6d31db57f6 Revise and add showcase to Themes doc (#456)
* Initial progress

* Make responsive

* quick fix to show theme name/description

* Small styling tweaks

* Documentation updates

* Revisions and improvements

* Avoid using static URLs 'cause that's ridiculous

---------

Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
2025-01-08 17:33:09 -05:00
Lea Verou
21ed4f82b0 Improve UX of Layout section 2025-01-08 17:13:38 -05:00
Lea Verou
844e374a72 Fix #470 2025-01-08 16:23:34 -05:00
Lea Verou
e5f4c14608 Fix native select caret positioning, fixes #411 2025-01-08 15:58:33 -05:00
Lea Verou
1ad963f5ad wa-card styling fixes 2025-01-08 15:36:12 -05:00
Lea Verou
4476117932 Add default layout as a failsafe 2025-01-08 15:20:26 -05:00
Lindsay M
e52a7a5ce5 Pre-release theme touchup (#465)
* Fix themed card styles

* Improve lowered surface colors across themes
2025-01-08 15:04:27 -05:00
Lindsay M
fa66f4262d Fix mobile theme selector; fixes #440 (#446)
* Fix styling

* Fix mobile theme selector label
2025-01-08 15:01:20 -05:00
Lea Verou
a87f3627bb Fix #451 without changing logic/specificity 2025-01-08 15:00:45 -05:00
Cory LaViska
06e432589f change migration => tailspin (#463) 2025-01-08 13:59:27 -05:00
Cory LaViska
b4c4074ae1 fix mobile color picker bug (#462) 2025-01-08 13:49:57 -05:00
Lea Verou
19042fcca4 Decouple dark mode & theme, fixes #445 closes #385 (#457)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-01-08 12:50:29 -05:00
Lea Verou
8541369ae1 Fix #437 regression (#458) 2025-01-08 12:33:19 -05:00
Kelsey Jackson
31cfdf5704 Fixed radio button styling regression (#443)
* fixed styling regression

* Import missing appearance utilities

* Fix up radio button theme styles

* tweaked based on feedback

---------

Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-08 12:07:28 -05:00
Lindsay M
3511a60b93 Fix missing select styles, improve consistency (#450)
* Refactor for consistency, fix missing theme styles

* Remove unused custom properties from docs

* Add missing custom property to docs

* Add UI test case
2025-01-08 12:04:22 -05:00
Lindsay M
e55e091192 Fix caret color on slider tooltips (#448) 2025-01-08 12:03:16 -05:00
Lindsay M
09df23dff8 Use theme properties for color picker border (#449) 2025-01-08 10:02:18 -05:00
Lea Verou
f4a88c3b3a Harmonize updated() definitions
- Use proper type
- Use same argument name
- Ensure `super.updated()` is called
2025-01-07 17:39:56 -05:00
Cory LaViska
559efcd1d2 Fix switch's submitted value; fixes #409 (#442)
* fix switch's submitted value; fixes #409

* update tests
2025-01-07 17:01:27 -05:00
Lindsay M
e046015ed5 Theme cleanup (#414)
* formatting, docs tweaks

* FA theme cleanup

* Revert removal of `--wa-form-control-height-*`

* Classic theme cleanup

* Use consistent selectors for dark mode

* Clean slate for additional themes

* Retire depth stylesheets

* Move header styles for themer out of themes

* Missed instance of dark mode selector

* Migration theme cleanup

* Brutalist theme cleanup

* Changelog for new themes

* Playful theme cleanup

* Formatting

* Default theme update

* Add tests for form theming

* Fix test typo

* Change misnamed `multiplier` properties to `scale`

* Active theme cleanup

* Mellow theme cleanup

* Cleanup unused FA styles

* Glassy theme progress

* Add checked styles to glassy

* Fix typo

* Final FA theme cleanup

* Rename FA theme to 'Awesome', allow in alpha

* Final brutalist theme cleanup

* A few more brutalist tweaks

* One last brutalist tweak

* Final mellow theme cleanup

* Final Tailwind theme cleanup

* Final active theme cleanup

* Some classic theme cleanup

* Remove unused `--wa-form-control-height-*`

* Rename `--wa-form-control-resting-color` to `border-color`

* Touch up callout `appearance` styles

* Add more themes to alpha

* Add changelog for removal of `--wa-form-control-height-*`

* Clean up colors

* Final classic theme cleanup

* Add new themes to alpha build

* Re-add teal (used by Awesome theme)

* sync mobile/desktop theme pickers and don't dup IDs

* Remove `color/standard.css` (duplicates `/themes/default/color.css`)

* add view transition

* Add premium theme for later cleanup

* Accommodate new tag `appearance` styles

* Revise `--wa-form-control-height-*` changelog entry

Co-authored-by: Lea Verou <lea@verou.me>

* Improve `--wa-border-width-scale` description

Co-authored-by: Lea Verou <lea@verou.me>

* Better border docs

* Premium tweaks

---------

Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
Co-authored-by: Lea Verou <lea@verou.me>
2025-01-07 15:41:57 -05:00
Lea Verou
44dbdd14cc Separate WebAwesomeFormAssociatedElement (and friends) into a separate file 2025-01-07 14:23:20 -05:00
lindsaym-fa
5e3fed605e Add changelog 2025-01-07 11:56:19 -05:00
Lea Verou
4b4f2247c5 [Tag] Add appearance, closes #435 2025-01-07 11:56:19 -05:00
Lea Verou
eca15dc7fc Revamp <wa-card> HTML & CSS, fix #431 (#433)
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
2025-01-07 10:12:32 -05:00
Lea Verou
eca444bbaa [Callout] Add appearance & size, closes #422 (#432)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-07 09:38:28 -05:00
Lea Verou
f39308dbc5 Allow customization of outlined styles, fixes #412 (#426) 2025-01-06 17:35:57 -05:00
Lea Verou
fc84e1a50d Replace M form control height with size-dependent height (#425) 2025-01-06 17:10:11 -05:00
Lea Verou
ef7d47e2b9 [Docs] Move commonalities across blocks to a single base layout (#424) 2025-01-06 17:01:29 -05:00
Lea Verou
a9af3172ad Rename Range to Slider (#428) 2025-01-06 16:44:43 -05:00
konnorrogers
cde8bea97a test commit 2025-01-06 13:24:54 -05:00
Kelsey Jackson
33b4045dad tweaked the tag component (#407)
* tweaked the tag component

* updated based on feedback

* updated to remove span

* changed display to initial

* prettier

---------

Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
2025-01-06 13:23:47 -05:00
Cory LaViska
bc4ad39f2e Fix tests (#410)
* skip broken test

* add middleware to follow new stylesheet imports

* fix avatar tests

* update badge tests

* fix button tests

* skip carousel test

* fix checkbox tests

* fix details test

* update radio button tests

* fix input tests

* fix progress bar tests

* update

* fix range tests

* fix select tests

* restore wrapper div to pass a11y tests

* fix switch tests

* fix tag tests

* fix textarea tests

* fix tooltip tests

* skips

* fix tree item tests

* [DRAFT]: test fixes (#421)

* working on some stuff..

* add a small delay for menu-item

* prettier

* add a small delay for menu-item

* prettier

* add a small delay for menu-item

* add a small delay for menu-item

* add a small delay for menu-item

* prettier

* Empty commit

* add a small delay for menu-item

* always build with alpha

* always build with alpha

* move to alpha builds

---------

Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
2025-01-06 13:13:34 -05:00
Konnor Rogers
b868b1e8fc fix alpha builds (#423)
* fix alpha builds

* Update docs/_includes/sidebar-group.njk

Co-authored-by: Lea Verou <lea@verou.me>

* Update docs/_includes/sidebar-group.njk

Co-authored-by: Lea Verou <lea@verou.me>

---------

Co-authored-by: Lea Verou <lea@verou.me>
2025-01-06 12:53:47 -05:00
Lea Verou
e916d771b0 Ensure --box-shadow & --border-width defaults are always set on the root stylable element, fixes #419 2025-01-06 12:41:28 -05:00
lindsaym-fa
bd6fe74c7d Fix missing input value styles 2025-01-04 16:42:45 -05:00
Lea Verou
ac7437894a Automate all overviews, fix bugs with filtering 2025-01-03 20:17:19 -05:00
Lea Verou
55ebe6e20b Add e-commerce tag, for overview 2025-01-03 20:14:51 -05:00
Lea Verou
e6388e7671 Let sort filter provide missing values so we can specify large values to place elements at the end 2025-01-03 19:20:49 -05:00
Lea Verou
9a21ae6f52 Make sure unlisted page cards never show up 2025-01-03 19:02:31 -05:00
Lea Verou
cd3386ce78 Exclude unlisted pages properly 2025-01-03 18:51:16 -05:00
Lea Verou
26b9bbb515 Automate Theming listing 2025-01-03 18:44:11 -05:00
Lea Verou
bda0ec0313 Overviews don't need to be MD files
And having them as MD files can insert pointless `<p>` tags if we're not careful, which can cause weird bugs.
2025-01-03 18:27:07 -05:00
Lea Verou
2490fbeaca attr filter for nicer optional attributes 2025-01-03 18:12:41 -05:00
Lea Verou
297149021e Add {% markdown %} paired shortcode 2025-01-03 17:45:26 -05:00
Lea Verou
c700c3ec09 Components index doesn't actually need to be a MD file
And having it as a MD file can insert pointless `<p>` tags if we're not careful, which can cause weird bugs.
2025-01-03 16:13:02 -05:00
Lea Verou
b383d8bf2d Move e-commerce patterns under E-commerce
As discussed on Slack with @kelseythejackson
2025-01-03 16:08:24 -05:00
Lea Verou
1dcf895be1 Don’t render children on the top level as well 2025-01-03 16:00:36 -05:00
Lea Verou
19fd55ca97 fix: noAlpha, not isAlpha 2025-01-03 15:58:42 -05:00
Lea Verou
fa094d924d Automate sidebar listings 2025-01-03 15:52:58 -05:00
Lea Verou
2a957e6316 Add layout and isAlpha to pattern pages automatically 2025-01-03 15:52:27 -05:00
Lea Verou
90b6a9a8ac Add status as computed data on component pages 2025-01-03 15:02:36 -05:00
Lea Verou
99fdd90601 [Select] Remove leftover code
The select uses the appearance utils, so this is done automatically.
2025-01-03 14:23:09 -05:00
Lea Verou
ecaa461638 [Select] Remove leftover code, rel #413
This was meant to be deleted, since there’s already `min-height: var(--wa-form-control-height);` above it which already responds to size.
2025-01-03 14:14:39 -05:00
lindsaym-fa
d3a65ee35d Fix typo 2025-01-03 09:37:39 -05:00
lindsaym-fa
8ab1489cc4 Simplify shadow scales 2025-01-02 15:59:04 -05:00
lindsaym-fa
093c42ce66 Revise changelog for border radius and width tokens 2025-01-02 15:50:09 -05:00
lindsaym-fa
ed3e7014e3 Simplify border radius scale 2025-01-02 15:37:09 -05:00
Cory LaViska
7db62766dc update changelog 2025-01-02 10:23:43 -05:00
Cory LaViska
2de515bce7 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2025-01-02 10:23:07 -05:00
Cory LaViska
80949c2988 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2025-01-02 10:23:05 -05:00
Konnor Rogers
c7a35afefb fix wa-split utility (#395) 2025-01-02 10:12:44 -05:00
Cory LaViska
89dd462720 backport SL-2318 2025-01-02 10:02:10 -05:00
Cory LaViska
ce40d5e997 Merge pull request #396 from shoelace-style/konnorrogers/fix-switch-checked-property
Fix switch dirty checking to behave like checkbox
2025-01-02 09:33:03 -05:00
Cory LaViska
752cbb2f16 Merge branch 'next' into konnorrogers/fix-switch-checked-property 2025-01-02 09:32:54 -05:00
Cory LaViska
2048df8a40 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2025-01-02 09:31:29 -05:00
Cory LaViska
beace5a611 backport SL-2329 2025-01-02 09:31:26 -05:00
Konnor Rogers
1a8908acf7 prettier 2024-12-23 16:39:32 -05:00
Konnor Rogers
812badd721 fix switch 2024-12-23 16:39:16 -05:00
Lea Verou
8142da95d8 Update sidebar.njk 2024-12-23 02:20:39 -05:00
Lea Verou
546c9c67b4 Hide cheatsheet from components sidebar 2024-12-23 02:18:59 -05:00
Lea Verou
d5fe23ab39 Add missing icons 2024-12-23 02:17:39 -05:00
Lea Verou
3b10933151 Automate listing in components index page 2024-12-23 02:15:48 -05:00
Lea Verou
51a416718d sidebar should be using components tag 2024-12-23 02:15:25 -05:00
Lea Verou
08f327c224 [docs.css] Remove duplicate code, use CSS nesting for .index.grid 2024-12-23 01:58:10 -05:00
Konnor Rogers
b196ccc0bc Merge pull request #394 from shoelace-style/next
next -> alpha
2024-12-22 06:14:28 -05:00
Konnor Rogers
c62eed16aa fix missing components and format number (#393) 2024-12-22 06:12:44 -05:00
Lea Verou
e982c10987 Move grouping logic to separate subtemplate and use it on layout too 2024-12-20 18:29:28 -05:00
Lea Verou
23af07bcd5 Temp fix for spacing issue 2024-12-20 17:49:44 -05:00
Lea Verou
6aca515024 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-20 17:44:12 -05:00
Lea Verou
7d3f8b175c Separate native styles page for elements that correspond to a separate WA component 2024-12-20 17:44:10 -05:00
Cory LaViska
e2acfd106f fix padding in codepen examples 2024-12-20 15:39:30 -05:00
Cory LaViska
cfd282df4b update version 2024-12-20 14:05:02 -05:00
Cory LaViska
d0567c7ae9 3.0.0-alpha.7 2024-12-20 14:04:13 -05:00
Lea Verou
f076dd1afa Usage -> Installation 2024-12-20 14:02:35 -05:00
Lea Verou
83fb761d41 Rename applied.css to docs and add some docs on usage 2024-12-20 14:01:14 -05:00
Cory LaViska
fd337dd1ee not true anymore 2024-12-20 13:40:39 -05:00
Lea Verou
22883021e9 Fix typo 2024-12-20 13:37:10 -05:00
Lea Verou
02b72f991b Mark rounding utils as WIP and change title to Rounding 2024-12-20 13:32:40 -05:00
Lea Verou
84734a56b6 Add class names to utility class pages 2024-12-20 13:20:06 -05:00
Cory LaViska
c159964490 update changelog 2024-12-20 13:17:22 -05:00
Cory LaViska
5c8e044f4d 3.0.0-alpha.6 2024-12-20 13:16:45 -05:00
Lea Verou
a238880dbe Allow utilities to have statuses too 2024-12-20 13:14:37 -05:00
Lea Verou
307c989e3b Add examples for native buttons in button group 2024-12-20 13:06:17 -05:00
Cory LaViska
c33d17b4a2 fix search styles 2024-12-20 12:59:58 -05:00
lindsaym-fa
9d3e2bd214 Fix giant homepage icons (#380) 2024-12-20 12:46:30 -05:00
Lea Verou
6e99787425 Add properties for border-radius overrides and use them to fix #348 in a better way, also closes #379 and improves #374 2024-12-20 12:26:47 -05:00
Lea Verou
43a1179513 Automate layout page listing 2024-12-20 12:00:43 -05:00
Lea Verou
8887056651 If you say pill, we should assume you really mean it :P Fixes #378 2024-12-20 11:44:29 -05:00
Lea Verou
ec3251d0c6 Utilities index pages 2024-12-20 11:37:15 -05:00
Lea Verou
f5ac87c8a3 Cards for native styles 2024-12-20 11:22:21 -05:00
Lea Verou
a3d8f712ce Remove visually-hidden component, add its icon to the util 2024-12-20 11:22:21 -05:00
Cory LaViska
0fdf4e0f4d Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-20 11:19:05 -05:00
Lea Verou
013cf46be8 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-20 11:10:59 -05:00
Lea Verou
cbd74eded2 Native <progress> styles 2024-12-20 11:10:57 -05:00
lindsaym-fa
960c6d8da3 Add descriptions for utilities 2024-12-20 11:07:51 -05:00
Cory LaViska
ef81c77c60 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-20 11:05:43 -05:00
Cory LaViska
01918ca784 fix button alignment in button groups 2024-12-20 11:05:32 -05:00
Lea Verou
b0bb014167 Statuses 2024-12-20 10:58:45 -05:00
Lea Verou
9f12c1d9ab Temp workaround for #376 2024-12-20 10:55:53 -05:00
lindsaym-fa
4456a8df5c Add descriptions for native styles 2024-12-20 10:36:22 -05:00
Cory LaViska
8e7816f308 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-20 10:33:12 -05:00
Cory LaViska
3861041bc1 fixes #350 2024-12-20 10:33:10 -05:00
Lea Verou
e29ae5d18e No, button groups shouldn't wrap 2024-12-20 10:15:29 -05:00
Cory LaViska
6ef2e92923 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-20 10:07:30 -05:00
Cory LaViska
562fec9ac7 fix component section in alpha 2024-12-20 10:07:27 -05:00
Cory LaViska
b38568f5c5 fix dropdown examples 2024-12-20 10:07:19 -05:00
Lea Verou
c0012f5b94 Fix dropdown in button-group rounding, closes #348 2024-12-20 10:03:03 -05:00
lindsaym-fa
41ee75bbfe Fix capitalization 2024-12-20 09:45:23 -05:00
Lea Verou
54f7916ddb Simplify progress bar CSS & DOM (still doesn't fix the transition in Safari but working on it) 2024-12-20 08:41:14 -05:00
Konnor Rogers
e170b488ea fix label position docs (#371) 2024-12-19 22:08:53 -05:00
Lea Verou
cd172ede8c Docs for visually hidden util, remove visually hidden component per #232 2024-12-19 21:15:33 -05:00
Konnor Rogers
d1b38af039 fix textarea jank (#370)
* fix textarea jank

* prettier
2024-12-19 20:52:05 -05:00
Lea Verou
506fb2588b Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-19 19:49:13 -05:00
Lea Verou
123a8c331f Restrict what default slot things <wa-page> adds spacing to, related to #331 2024-12-19 19:49:11 -05:00
Lea Verou
1a1847eeb5 Update search dialog styles to new simpler structure, closes #331 2024-12-19 19:48:38 -05:00
Konnor Rogers
835326a2db fix delayed button loading (#369)
* fix delayed button loading

* fix delayed button loading
2024-12-19 19:13:08 -05:00
lindsaym-fa
1905ca9b77 Capitalize "Style Utilities" 2024-12-19 18:54:12 -05:00
lindsaym-fa
fc3688df97 Fix closable tab example (#363) 2024-12-19 17:55:57 -05:00
Lea Verou
107f074f99 Page utils & native styles 2024-12-19 17:34:32 -05:00
lindsaym-fa
5d3e58bde0 Fix #361 2024-12-19 16:58:06 -05:00
lindsaym-fa
f5b8f2257d Fix specificity of gap and align-items in layout utilities 2024-12-19 16:51:55 -05:00
Lea Verou
52c0fdf6de Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-19 16:37:57 -05:00
Lea Verou
c2c42f56ba Docs for size utils 2024-12-19 16:37:55 -05:00
lindsaym-fa
328d6989d9 Set default color for dark theme 2024-12-19 16:34:36 -05:00
lindsaym-fa
49465c9a1d Fix form control label margin 2024-12-19 16:26:06 -05:00
lindsaym-fa
394a028973 Consolidate native form styles 2024-12-19 15:58:31 -05:00
lindsaym-fa
431d23d420 Fix range disabled and focus styles 2024-12-19 15:46:30 -05:00
Lea Verou
c230a42053 Fix filename 2024-12-19 15:30:48 -05:00
Lea Verou
378f100729 Update changelog.md 2024-12-19 15:30:38 -05:00
Cory LaViska
87314f8864 Merge pull request #364 from shoelace-style/konnorrogers/fix-safari-placeholder
fix safari placeholder
2024-12-19 15:01:47 -05:00
konnorrogers
70a8fc6425 fix safari placeholder 2024-12-19 14:28:35 -05:00
Konnor Rogers
486b0649e0 fix code demo with empty slot (#360)
* fix code demo with empty slot

* prettier
2024-12-19 14:12:55 -05:00
Lea Verou
63a2367cc5 Docs for color and appearance variants 2024-12-19 14:04:15 -05:00
Lea Verou
995d0f2af4 First stab at variant utils docs 2024-12-19 13:50:12 -05:00
Lindsay M
874bb5cbf6 Fix missing input and textarea styles in Firefox and Safari (#339)
* initial fix

* fix disabled styles in all browsers

* simpler fix
2024-12-19 13:32:30 -05:00
Lea Verou
15495bd9bd Automate theming sidebar block 2024-12-19 13:05:59 -05:00
Cory LaViska
f4678e12c6 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-19 12:43:31 -05:00
Cory LaViska
2bf7ebbb71 fixes #343; fixes #341 2024-12-19 12:43:29 -05:00
Lea Verou
68e53a4ef1 Automatic util listing on sidebar 2024-12-19 12:40:04 -05:00
Lea Verou
0f0b9d50cd Move all utilities under /utilities/
Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2024-12-19 12:40:04 -05:00
Lea Verou
5d13583da7 Update sort filter to take multiple keys into account in order of priority, default to order, then title
And use `order` on Page
2024-12-19 12:40:04 -05:00
Lea Verou
f99f32d054 Refactor: sort filter 2024-12-19 12:40:04 -05:00
Lea Verou
39acaeba70 Refactor: move sort filter to filters.js 2024-12-19 12:40:04 -05:00
Cory LaViska
e87c725e07 fixes #344 2024-12-19 12:38:49 -05:00
Cory LaViska
31a3421709 fixes #332 2024-12-19 12:15:34 -05:00
Cory LaViska
5d1fb7c477 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-19 11:19:51 -05:00
Lea Verou
13e606c1cb Native color-picker styles 2024-12-19 10:16:23 -05:00
lindsaym-fa
42dd64f397 Fix layout and add description to Native Styles 2024-12-19 10:13:16 -05:00
Kelsey Jackson
53e87e4dcd Remove :required content styles for native elements
* fixed label ::after

* removed label styles
2024-12-19 10:00:39 -05:00
Lea Verou
dabaef3fab The big rename nobody wants to do :P 2024-12-19 04:03:44 -05:00
Lea Verou
d5939efc30 Refactor table styles
- Use hueless color tokens so it can be used with variants (and add example)
- Fix hover effect on zebra rows
- Reduce padding a bit
- Shorten utility class
- CSS nesting
2024-12-19 03:53:54 -05:00
Lea Verou
d345878de6 Remove *--disabled classes, use regular selectors 2024-12-19 03:24:18 -05:00
lindsaym-fa
609578ff30 Fix typo 2024-12-19 03:08:37 -05:00
lindsaym-fa
648137a964 Add native select styles and share with <wa-select> 2024-12-19 03:06:31 -05:00
Lea Verou
cd487bf8be Use :dir() in CSS rather than custom RTL classes 2024-12-19 02:17:55 -05:00
Lea Verou
239ddcf75d Simplify RTL handling with logical properties 2024-12-19 02:13:17 -05:00
Lea Verou
ad2e945e44 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-19 02:01:39 -05:00
Lea Verou
11f7adefc2 Remove no longer needed hasFocus in all but color-picker 2024-12-19 02:01:30 -05:00
lindsaym-fa
909986b520 Tweak checkbox styles 2024-12-19 01:44:52 -05:00
lindsaym-fa
8de5fc9580 *Actually* add radio styles 2024-12-19 01:44:28 -05:00
lindsaym-fa
197aedcc70 Add radio styles and share with <wa-radio> 2024-12-19 01:43:56 -05:00
Lea Verou
491533e09c Merge textarea & input styles
Also simplify textarea component DOM
2024-12-19 01:38:39 -05:00
Lea Verou
474d8d7c7b Remove wa-off 2024-12-19 01:38:07 -05:00
Lea Verou
8d83076ef2 Fix transition 2024-12-19 00:59:00 -05:00
Lea Verou
e69632ff60 [Input] Several improvements
- Simplify styles and DOM
- Add `.wa-text-field` utility class
- Eliminate `--border-color` (except when set by appearance utils), `--border-style`, `--border-radius`
2024-12-19 00:39:23 -05:00
Lea Verou
996fa6df57 Import appearance helpers in elements with newly acquired appearance attribute 2024-12-19 00:39:23 -05:00
Konnor Rogers
239782a7d8 add proper dependencies to wa-page (#337)
* add proper dependencies to wa-page

* add proper dependencies to wa-page
2024-12-18 23:40:14 -05:00
Konnor Rogers
7d3a629a1e fix host context selectors for unsupported browsers (#335)
* fix host context selectors

* fix textarea value being lost

* fix textarea

* fix example

* fix textarea value being lost
2024-12-18 23:27:50 -05:00
lindsaym-fa
067ae799fd Add native textarea styles and share with <wa-textarea> 2024-12-18 22:33:24 -05:00
Lea Verou
ea165cb477 Now that all sizeable form controls use the size util, simplify form-control.css 2024-12-18 21:42:55 -05:00
Lea Verou
d33b5c4870 [Switch] Simplify DOM & CSS 2024-12-18 21:33:52 -05:00
Lea Verou
96db264724 [Switch] Use size utils 2024-12-18 21:09:22 -05:00
Lea Verou
dda4575aa4 [color-picker] Use size util 2024-12-18 21:06:52 -05:00
Lea Verou
2322762cc6 [Input] Remove unnecessary classes, simplify DOM 2024-12-18 20:56:30 -05:00
Lea Verou
4a14eb3282 Calculate form control height in size util 2024-12-18 20:48:25 -05:00
Lea Verou
931faf911c Use size helper in input 2024-12-18 20:34:55 -05:00
Lea Verou
f4db1e37e0 No need for fallback any more 2024-12-18 20:34:45 -05:00
Lea Verou
833b7b1207 Update tag.css 2024-12-18 20:33:47 -05:00
Lea Verou
622ee91323 Fix tag glitch 2024-12-18 20:12:28 -05:00
Lea Verou
d206414825 Make size utils root-level so there's always a default value 2024-12-18 20:09:31 -05:00
Lea Verou
73d26ece05 Clean up CSS structure 2024-12-18 19:40:52 -05:00
Lea Verou
3b90a1cc31 Native slider! 2024-12-18 19:36:26 -05:00
Lea Verou
289ce105dc Fix build 2024-12-18 18:59:39 -05:00
Lea Verou
deb2752d35 Refactor range styles to prepare for native ranges 2024-12-18 18:58:21 -05:00
lindsaym-fa
df4393e033 Fix native label spacing 2024-12-18 18:09:58 -05:00
Konnor Rogers
cf34747701 fix layout demo and custom states support (#318)
* fix demo

* fix linting errors

* remove jinja, run prettier

* prettier
2024-12-18 17:08:38 -05:00
lindsaym-fa
ad467f0691 Add native details styles and share with <wa-details> 2024-12-18 17:02:25 -05:00
Kelsey Jackson
142403fe78 changed disply on label 2024-12-18 15:20:07 -06:00
Cory LaViska
60f2b9657b remove base from docs 2024-12-18 15:09:46 -05:00
Lea Verou
a41787d23a Remove opt-out class, add docs on opting out, closes #300 2024-12-18 14:18:30 -05:00
Lea Verou
252adbd830 filledappearance=filled rel #330 2024-12-18 14:18:30 -05:00
lindsaym-fa
c8db30fa0f Add native checkbox styles and share with <wa-checkbox> 2024-12-18 14:09:09 -05:00
Lea Verou
fa415005eb Rename tintedfilled 2024-12-18 13:11:40 -05:00
Cory LaViska
ba8046bff5 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-18 13:08:57 -05:00
Cory LaViska
948254dd29 remove SSR in dev mode 2024-12-18 13:08:55 -05:00
Lea Verou
82b799c1a4 Prettier 2024-12-18 13:05:08 -05:00
Lea Verou
358444bc1d Remove poorly working Prettier Jinja plugin 2024-12-18 13:02:27 -05:00
Lea Verou
dbab4ae645 Rename filledaccent (rel #330) 2024-12-18 12:58:06 -05:00
Lea Verou
f5ed55513b textplain (for appearance and utils) rel #330 2024-12-18 12:51:13 -05:00
Lea Verou
d6fb269381 Add reference to button essentials in button component and vice versa 2024-12-18 12:49:16 -05:00
Lea Verou
3734f9cea5 Essential Dialog docs
Essentials page for dialog
2024-12-18 11:15:52 -05:00
Lea Verou
5a058a8808 Revamp dialog styles, port to Essentials
Refactor dialog CSS

Add native dialog stub
2024-12-18 11:15:52 -05:00
Lea Verou
e2d99e3c86 Refactor: animateWithClass() 2024-12-18 11:15:52 -05:00
Lea Verou
e74edd8f68 Element description, just like components 2024-12-18 11:15:52 -05:00
Cory LaViska
d961203d17 fix styles 2024-12-18 11:06:13 -05:00
Lea Verou
be752371a6 Revert back to has any sibling 2024-12-17 18:41:46 -05:00
Lea Verou
af3b83318b Cross linking between Essentials and Components 2024-12-17 18:06:54 -05:00
Lea Verou
b0cd38e2c5 Tweak spacing to have more reasonable spacing for callout
cc @lindsaym-fa
2024-12-17 18:06:54 -05:00
Cory LaViska
0d8d718b7a Merge pull request #317 from shoelace-style/component-search
Add search filter to component index page
2024-12-17 16:49:01 -05:00
Lea Verou
54687046ab Use .wa-off-deep for deep opt-out
Rel #300
2024-12-17 16:40:45 -05:00
Lea Verou
22529870f4 Failed attempt to get Prettier to work with .njk files 2024-12-17 16:22:42 -05:00
Lea Verou
8aafea456d Flesh out Essentials pages a little (still heavily WIP) 2024-12-17 16:22:11 -05:00
Lea Verou
cfb70f2135 Remove invalid </input> 2024-12-17 15:54:22 -05:00
Lea Verou
1d02644996 [Essentials] Write index page 2024-12-17 15:53:33 -05:00
Lea Verou
312809a766 First stab at breaking down essentials into multiple pages
Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2024-12-17 15:17:25 -05:00
Lea Verou
5e221f6c3a Remove empty page 2024-12-17 14:50:17 -05:00
Lea Verou
232734563f Formatting 2024-12-17 14:47:24 -05:00
Cory LaViska
5cbc64ad4f fix link to size.css 2024-12-17 14:46:13 -05:00
Cory LaViska
35858e0549 ugh, modal 2024-12-17 14:46:08 -05:00
Cory LaViska
752b8d462e add empty state 2024-12-17 14:41:11 -05:00
Lea Verou
1da80bee80 Fix custom parents in breadcrumbs 2024-12-17 14:38:02 -05:00
Cory LaViska
315dd40734 add search filter 2024-12-17 14:27:33 -05:00
Lea Verou
5a82b7ad99 Remove BEM-style namespaces on class names (#316) 2024-12-17 13:46:39 -05:00
Cory LaViska
1a29875940 Merge pull request #315 from shoelace-style/konnorrogers/fix-component-reloading
fix component reloading
2024-12-17 13:27:23 -05:00
konnorrogers
be0631bd3e fix component reloading 2024-12-17 13:22:10 -05:00
Lea Verou
e882102aff Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-17 13:00:57 -05:00
Lea Verou
97c0470f13 First stab at breadcrumbs (no custom parents yet) 2024-12-17 13:00:55 -05:00
Cory LaViska
47badda35c Merge pull request #314 from shoelace-style/custom-states
Custom states
2024-12-17 12:20:10 -05:00
Cory LaViska
b2353ca9bd remove try/catch 2024-12-17 12:18:40 -05:00
Cory LaViska
65310be0b0 Merge branch 'next' into custom-states 2024-12-17 12:14:29 -05:00
Cory LaViska
ac9960c1f0 Merge pull request #296 from shoelace-style/konnorrogers/fix-turbo-2
Fix turbo caching on script tag
2024-12-17 12:13:57 -05:00
Cory LaViska
b9393068a7 Merge branch 'next' into custom-states 2024-12-17 12:13:32 -05:00
Cory LaViska
9c216f60ff Merge pull request #312 from shoelace-style/konnorrogers/remove-unnecessary-plugin
remove unnecessary plugin
2024-12-17 12:13:10 -05:00
Cory LaViska
ce65a49dbe Merge branch 'next' into konnorrogers/remove-unnecessary-plugin 2024-12-17 12:13:02 -05:00
Cory LaViska
e973b599aa add links; fixes #313 2024-12-17 12:10:11 -05:00
Cory LaViska
9979028d7e fix smooth scroll bug 2024-12-17 12:09:45 -05:00
Cory LaViska
d09ea4a73a add section for custom states 2024-12-17 12:09:36 -05:00
Lea Verou
1bf83499b0 Refactor: Move 11ty filters to separate file 2024-12-17 12:08:55 -05:00
lindsaym-fa
9c4e4a2280 Use appearance for alpha badge 😁 2024-12-17 11:57:32 -05:00
Cory LaViska
f8e61f72c4 fix typo 2024-12-17 11:53:30 -05:00
lindsaym-fa
d08b95378a Fix custom button styles 2024-12-17 11:50:50 -05:00
lindsaym-fa
c1153708f6 Fix link button appearance 2024-12-17 11:47:59 -05:00
Cory LaViska
d676c1b569 update changelog 2024-12-17 11:46:05 -05:00
Cory LaViska
77f50a4890 fix part name 2024-12-17 11:46:00 -05:00
Cory LaViska
24e2b47ff1 fix part name 2024-12-17 11:45:56 -05:00
Cory LaViska
651c38afbf use states instead of parts 2024-12-17 11:45:45 -05:00
Cory LaViska
2dec73b2c5 hoist internals and custom state methods to WebAwesomeElement 2024-12-17 11:43:51 -05:00
Cory LaViska
ad36ba5569 rename part 2024-12-17 11:34:18 -05:00
Cory LaViska
1855d1b809 update tests to use :state() 2024-12-17 11:30:19 -05:00
Cory LaViska
543fa3c85c update tests to check states 2024-12-17 11:30:07 -05:00
Cory LaViska
fe05300bdc use :state() 2024-12-17 11:29:59 -05:00
Cory LaViska
0eebf44292 move custom states 2024-12-17 11:29:47 -05:00
Cory LaViska
7c40243da3 add custom state types to wa form control 2024-12-17 11:26:33 -05:00
Cory LaViska
4a046684c8 add comments and fix hasCustomState 2024-12-17 11:22:49 -05:00
Lea Verou
49eeca1617 Update callout.css 2024-12-17 11:20:54 -05:00
Cory LaViska
88e2af266f update docs and tests 2024-12-17 11:18:43 -05:00
Cory LaViska
0bcc788752 remove data- attribute fallback for states 2024-12-17 11:13:20 -05:00
Cory LaViska
5d687f1aa0 add custom states to checkbox/radio 2024-12-17 11:12:40 -05:00
Cory LaViska
8fbd0b54e4 update changelog 2024-12-17 11:10:10 -05:00
Cory LaViska
37a1680a85 move states 2024-12-17 11:10:04 -05:00
Cory LaViska
2b0acca219 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-17 10:57:42 -05:00
Cory LaViska
5293f0fa63 downgrade esbuild 2024-12-17 10:57:23 -05:00
Lea Verou
7d52f00d8d Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-17 10:46:55 -05:00
Lea Verou
f8e367a5e7 Move size utils to style/utilities/ 2024-12-17 10:46:40 -05:00
Cory LaViska
b9541ba2e0 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-17 10:44:54 -05:00
Cory LaViska
25ee6ef1ad fix ts errors 2024-12-17 10:44:40 -05:00
Cory LaViska
45cb5598fc add update script and update non-breaking deps 2024-12-17 10:44:28 -05:00
Cory LaViska
a6bf9ea58c add terms 2024-12-17 10:44:11 -05:00
Lea Verou
1e1877c954 --content-color ➡️ --text-color
Harmonize with other properties for the same thing
2024-12-17 10:41:51 -05:00
Lea Verou
47c9f43954 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-17 10:39:52 -05:00
Lea Verou
2136fed4cb --label-color ➡️ --text-color
As we move towards using these helpers more widely, `--label-color` doesn't quite make sense
2024-12-17 10:39:47 -05:00
Cory LaViska
4b6baa93a6 remove AI note 2024-12-17 10:13:54 -05:00
Lea Verou
ef4cbd915d Tidy up 2024-12-17 04:31:46 -05:00
Lea Verou
d9b8fc6806 Prettier 2024-12-17 04:29:37 -05:00
Lea Verou
6bb6bcc538 Simplify tag
- Drop `base`, rel #207
- Use size helper
- Drop classes duplicating attributes
2024-12-17 04:27:32 -05:00
Lea Verou
e60a5032da Remove classes no longer needed 2024-12-17 04:07:45 -05:00
Lea Verou
a6b71e119c Use variant helper in tag & callout 2024-12-17 04:06:47 -05:00
Lea Verou
8e01281c12 Leftover 2024-12-17 04:01:24 -05:00
Lea Verou
a31de87882 [Avatar] Simplify HTML & CSS, drop base (rel #207) 2024-12-17 03:58:58 -05:00
Lea Verou
dbfaa4299f [Avatar] Drop BEM 2024-12-17 03:40:28 -05:00
Lea Verou
78432c41d8 Better appearance combinations 2024-12-17 03:22:31 -05:00
Lea Verou
0d003c0309 Fix build 2024-12-17 03:06:18 -05:00
Lea Verou
0a796d618f Badge appearances! 2024-12-17 03:04:44 -05:00
Lea Verou
84909930fb Simplify badge HTML & styles 2024-12-17 03:04:36 -05:00
Lea Verou
cbab3b09e5 Move appearance utils to separate file 2024-12-17 03:03:55 -05:00
Lea Verou
8a321951d3 Fix wording 2024-12-17 03:03:28 -05:00
Lea Verou
4852f5614f Use variant helper to simplify badge styles 2024-12-17 02:22:28 -05:00
Lea Verou
87621ef109 Rename variant color tokens to be wa- prefixed, since we specify them on :root too 2024-12-17 02:22:08 -05:00
Lea Verou
6a9c7dd2bc Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-17 02:03:06 -05:00
Lea Verou
1fb8088fc8 Essentials page for button 2024-12-17 02:03:01 -05:00
Lea Verou
27c58637eb Revamp button styles
- More style sharing between native buttons & button component
- Fix radio button styling
- Better ability to style button from the outside (without `::part(base)`)
- Orthogonal variant + appearance
2024-12-17 02:02:30 -05:00
Lea Verou
426a242d26 Define button-group util and use it in button-group and radio-group 2024-12-17 01:57:48 -05:00
Lea Verou
7a7a7abe78 Add size & variant utils to Applied CSS 2024-12-17 01:55:17 -05:00
Lea Verou
aade89b66e Remove unused class 2024-12-17 01:54:32 -05:00
Lea Verou
771a1559ef Fix typo 2024-12-16 22:08:38 -05:00
lindsaym-fa
74ae758819 Add native input styles and share with <wa-input> 2024-12-16 19:32:35 -05:00
Lea Verou
5e2081451d Add --space-smaller to size utility 2024-12-16 15:41:33 -05:00
Lea Verou
1ffdc19305 Add variants.css (not yet linked from anywhere) 2024-12-16 15:41:33 -05:00
Lea Verou
6996d17531 Replace font-size variable with 1em
Revert "Replace font-size variable with `1em`"

This reverts commit 1ac70f31abe2bab310bbfbdbb3aa5d4498c5648d.

Replace font-size vars with 1em when calculating form control height
2024-12-16 15:41:33 -05:00
Cory LaViska
1e3b93d579 Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-16 14:38:25 -05:00
Cory LaViska
70fab26e6b empty styles for these components 2024-12-16 14:38:22 -05:00
konnorrogers
725fb1f013 remove unnecessary plugin 2024-12-16 14:05:29 -05:00
Lea Verou
6d4c8e5942 Simplify Classic theme using the new CSS files 2024-12-16 13:21:27 -05:00
Lea Verou
b6e0ca5d45 --*-multiplier to --*-scale
As discussed with @lindsaym-fa

Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2024-12-16 12:50:37 -05:00
Lea Verou
35571c1d4e Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-16 12:46:59 -05:00
Lea Verou
82a5aff8db Split default theme tokens into separate CSS files
As discussed with @lindsaym-fa last week. Hopefully this will eventually help reduce duplication across themes.

Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2024-12-16 12:46:57 -05:00
Cory LaViska
e74a30f62a prettier 2024-12-16 12:45:25 -05:00
Lindsay M
11d3a73f05 Add native button styles and share with <wa-button> (#310) 2024-12-16 12:18:45 -05:00
Lea Verou
9fefb6d65a [Native details] Refactor to use nesting and opt-out
Rel #300
2024-12-16 11:51:40 -05:00
Lea Verou
4b18c74b83 [Details] Add RTL example 2024-12-16 11:50:41 -05:00
Lea Verou
f739c6c143 Fix details tests 2024-12-16 11:17:58 -05:00
Lea Verou
9739aceb9f Fix select tests 2024-12-16 11:16:42 -05:00
Lea Verou
afde497a1a [Docs] Collapse "Components" by default, except when viewing a page in /components/ 2024-12-16 11:14:18 -05:00
Lea Verou
666f1e5d52 Fix #309 for reals this time 2024-12-16 11:13:07 -05:00
Lea Verou
1013e83032 [Details] Fix interactive elements in summary, closes #309 2024-12-16 11:10:13 -05:00
Lea Verou
b15d938c7e Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-16 10:49:09 -05:00
Lea Verou
c066c5f30b [Details] Revamp CSS, simplify part names
First component to use the `display: contents` trick discussed in #207
2024-12-16 10:48:56 -05:00
Cory LaViska
abbfd9b43d remove eslint from gh actions 2024-12-16 10:39:25 -05:00
Cory LaViska
ee0167a059 fix jsdoc 2024-12-16 10:29:46 -05:00
Lea Verou
f86c07bdab Automate component navigation 2024-12-16 09:42:24 -05:00
Lea Verou
699595496e [Page] CSS utilities: .wa-mobile-only and .wa-desktop-only 2024-12-16 07:55:28 -05:00
Lea Verou
fa42764a4b Automatically hide [data-toggle-nav] on desktop view 2024-12-16 07:53:35 -05:00
Lea Verou
15bbafd631 Fix typo 2024-12-16 07:44:01 -05:00
Lea Verou
9423178df5 Tweaks to <details> styles 2024-12-16 07:18:02 -05:00
Lea Verou
9260d35b4c Split Applied CSS out to make it easier to manage and share w/ components
As discussed with @lindsaym-fa
Still unsure about some of these (especially about whether blockquote & details should be separate) but I figured better go ahead and split and we can fine tune later

Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2024-12-16 06:55:01 -05:00
Lea Verou
10156a8218 Add log filter for easier debugging of templates 2024-12-16 06:27:25 -05:00
Lea Verou
d0574677c1 Fix a couple types that were throwing off the CEM 2024-12-14 20:29:29 -05:00
Lea Verou
7b0274a657 Refactor: Normalize order of alternatives 2024-12-14 19:51:04 -05:00
Lea Verou
325eaeb225 [select] Mark getTag as attribute: false 2024-12-14 19:10:30 -05:00
Lea Verou
f840d623d5 We no longer need to highlight CSS in template strings 2024-12-14 18:53:56 -05:00
Lea Verou
f9590195a5 Refactor: Revamp select styles
- Removed BEM-style naming (the shadow DOM gives you scoping already!)
- Use new size helper
- Organize styles to keep an element’s styles together, using nesting for modifiers
- Removed unused classes
2024-12-14 17:35:50 -05:00
Lea Verou
53eb0d8f30 Refactor: [textarea] Use size util 2024-12-14 17:12:22 -05:00
Lea Verou
b0c4c7263b Allow Prettier default for trailing commas, run Prettier on repo
per convo with @claviska
2024-12-14 17:10:26 -05:00
Lea Verou
b5d1a71f46 Simplify hint slots 2024-12-14 17:04:42 -05:00
Lea Verou
dd7b673328 Run Prettier on repo
Turns out `prettier-plugin-organize-imports` sorts imports differently than the old one so this will prevent spreading the change across multiple commits whenever we touch a file (and potentially introducing conflicts)
2024-12-14 17:01:35 -05:00
Lea Verou
9f0276f55e Introduce size shadow utils and use them with checkbox (more to come) 2024-12-14 16:34:53 -05:00
Lea Verou
15d250b103 Refactor: [select.css] more CSS nesting 2024-12-14 15:46:59 -05:00
Lea Verou
0c40579be4 Split visually hidden into a separate file that components can import 2024-12-14 15:30:51 -05:00
Lea Verou
f0f080a428 Refactor: [select, input] Use CSS Nesting 2024-12-13 19:20:54 -05:00
Lea Verou
54b511b709 Collapse weird pill rules duplicating values 2024-12-13 18:57:45 -05:00
Lea Verou
c50da3429b Refactor: Collapse 3 rules doing the same thing 2024-12-13 17:32:34 -05:00
Lea Verou
ad3cd289dd Merge branch 'next' of https://github.com/shoelace-style/webawesome into next 2024-12-13 17:17:48 -05:00
Lea Verou
b1fffc7df9 Refactor: checkbox
- Reduce class names by using `:has()`, native pseudo-classes, or `[part~=foo]` selectors
- Remove `hasFocus` property since it’s no longer needed
- Move the icon hiding logic to CSS
2024-12-13 17:17:45 -05:00
Lea Verou
587db10022 Refactor: reduce duplication in form-controls.css 2024-12-13 17:14:15 -05:00
Lea Verou
47294ad0ed Leftover help-text ➡️ hint 2024-12-13 17:09:23 -05:00
lindsaym-fa
28ebab868b remove busted links to old layout.css location 2024-12-13 15:03:25 -05:00
lindsaym-fa
07d15fd863 fix references to utility files 2024-12-13 14:43:43 -05:00
Lea Verou
2c9eb385fd Add note about Chrome bugfix
Also revert unintentional change, oops
2024-12-13 14:35:16 -05:00
Lea Verou
6d9f513f68 help-text ➡️ hint 2024-12-13 14:17:58 -05:00
Lea Verou
4b56a03144 Convert component shadow styles to CSS files too 2024-12-13 13:56:42 -05:00
Lea Verou
9c17d27af4 Big CSS Reorg Part 1 (#304) 2024-12-13 13:45:33 -05:00
Lea Verou
cc37a5c44b Delete unused tabbable.ts file 2024-12-13 10:56:13 -05:00
Lea Verou
9e6ee89585 Support any CSS length in mobile-breakpoint (#303)
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
2024-12-13 10:48:41 -05:00
Lea Verou
ea25de8040 Split CSS utility regions into separate files 2024-12-13 04:25:58 -05:00
Lea Verou
7bee00d706 Update package-lock.json 2024-12-13 04:25:28 -05:00
Lea Verou
6b9f064aeb Ooops, turns out prettier-plugin-organize-imports was not added 2024-12-13 04:16:32 -05:00
Lea Verou
e9377cf746 Apply display: flex to gap utils, closes #265 2024-12-13 03:50:22 -05:00
Lea Verou
35d2b7f12a Add tab-size: 4, closes #256 2024-12-13 03:45:48 -05:00
Lea Verou
922d7d9894 Remove <wa-visually-hidden>, closes #232 2024-12-13 03:42:09 -05:00
Lea Verou
24f5f3c4ca Enable light dismiss by default for <wa-drawer>
The docs seemed to be hinting that this is the case, and indeed it seems more reasonable.
2024-12-13 03:32:45 -05:00
Lea Verou
8358127992 Leftover work from removing ESLint 2024-12-13 03:14:41 -05:00
Konnor Rogers
f27c982962 keep previews 2024-12-10 22:47:26 -05:00
konnorrogers
19340adcfb fix turbo 2024-12-10 19:07:45 -05:00
konnorrogers
f22e598ad6 prettier 2024-12-10 18:52:12 -05:00
konnorrogers
68f693cbc0 fix turbo caching stuff 2024-12-10 18:49:56 -05:00
666 changed files with 23788 additions and 20524 deletions

View File

@@ -29,9 +29,9 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run prettier && npm run lint
run: npm run prettier
- name: Build
run: npm run build
run: npm run build:alpha
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run CSR tests

View File

@@ -27,10 +27,10 @@ jobs:
run: npm ci
# Just lint here too. Save some GH Action minutes and not need to use "depends_on" or anything.
- name: Lint
run: npm run prettier && npm run lint
run: npm run prettier
- name: Build
run: npm run build
run: npm run build:alpha
- name: Install Playwright
run: npx playwright install --with-deps

View File

@@ -13,3 +13,4 @@ package-lock.json
tsconfig.json
cdn
_site
docs/assets/scripts/prism.js

View File

@@ -3,7 +3,6 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bierner.lit-html",
"bashmish.es6-string-css",
"streetsidesoftware.code-spell-checker"
]
}

View File

@@ -59,6 +59,8 @@ To generate a production build, run the following command.
npm run build
```
You can also run `npm run build:serve` to start an [`http-server`](https://www.npmjs.com/package/http-server) instance on `http://localhost:4000` after the build completes, so you can preview the production build.
### Creating New Components
To scaffold a new component, run the following command, replacing `wa-tag-name` with the desired tag name.

View File

@@ -39,6 +39,7 @@
"crutchcorn",
"csspart",
"cssproperty",
"cssstate",
"datetime",
"describedby",
"Docsify",
@@ -46,6 +47,7 @@
"dropdowns",
"easings",
"ecommerce",
"endfor",
"endraw",
"endregion",
"enterkeyhint",
@@ -103,6 +105,7 @@
"metaframeworks",
"middlewares",
"minlength",
"minmax",
"monospace",
"mousedown",
"mousemove",
@@ -155,16 +158,19 @@
"smartquotes",
"spacebar",
"stylesheet",
"svgs",
"Tabbable",
"tabindex",
"tabler",
"tablist",
"tabpanel",
"tbody",
"templating",
"tera",
"testid",
"textareas",
"textfield",
"thead",
"Themer",
"tinycolor",
"transitionend",

View File

@@ -2,8 +2,8 @@ import { customElementJetBrainsPlugin } from 'custom-element-jet-brains-integrat
import { customElementVsCodePlugin } from 'custom-element-vs-code-integration';
// import { customElementVuejsPlugin } from 'custom-element-vuejs-integration';
import { parse } from 'comment-parser';
import { pascalCase } from 'pascal-case';
import fs from 'fs';
import { pascalCase } from 'pascal-case';
const packageData = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
const { name, description, version, author, homepage, license } = packageData;
@@ -28,7 +28,7 @@ export default {
name: 'wa-package-data',
packageLinkPhase({ customElementsManifest }) {
customElementsManifest.package = { name, description, version, author, homepage, license };
}
},
},
// Parse custom jsDoc tags
@@ -83,13 +83,13 @@ export default {
classDoc[t.tag].push({
name: t.name,
description: t.description,
type: t.type || undefined
type: t.type || undefined,
});
}
});
}
}
}
},
},
{
@@ -109,7 +109,7 @@ export default {
}
}
}
}
},
},
{
@@ -127,7 +127,7 @@ export default {
//
const terms = [
{ from: /^src\//, to: '' }, // Strip the src/ prefix
{ from: /\.(t|j)sx?$/, to: '.js' } // Convert .ts to .js
{ from: /\.(t|j)sx?$/, to: '.js' }, // Convert .ts to .js
];
mod.path = replace(mod.path, terms);
@@ -146,7 +146,7 @@ export default {
}
}
});
}
},
},
// Generate custom VS Code data
@@ -156,9 +156,9 @@ export default {
referencesTemplate: (_, tag) => [
{
name: 'Documentation',
url: `https://webawesome.com/docs/components/${tag.replace('wa-', '')}`
}
]
url: `https://webawesome.com/docs/components/${tag.replace('wa-', '')}`,
},
],
}),
customElementJetBrainsPlugin({
@@ -168,10 +168,10 @@ export default {
referencesTemplate: (_, tag) => {
return {
name: 'Documentation',
url: `https://webawesome.com/docs/components/${tag.replace('wa-', '')}`
url: `https://webawesome.com/docs/components/${tag.replace('wa-', '')}`,
};
}
})
},
}),
//
// TODO - figure out why this broke when events were updated
@@ -181,5 +181,5 @@ export default {
// fileName: 'index.d.ts',
// componentTypePath: (_, tag) => `../../components/${tag.replace('wa-', '')}/${tag.replace('wa-', '')}.js`
// })
]
],
};

View File

@@ -1,24 +1,33 @@
import { parse } from 'path';
import { markdown } from './_utils/markdown.js';
import { anchorHeadingsPlugin } from './_utils/anchor-headings.js';
import { codeExamplesPlugin } from './_utils/code-examples.js';
import { copyCodePlugin } from './_utils/copy-code.js';
import { removeDataAlphaElements } from './_utils/remove-data-alpha-elements.js';
import { currentLink } from './_utils/current-link.js';
import { highlightCodePlugin } from './_utils/highlight-code.js';
import { markdown } from './_utils/markdown.js';
import { removeDataAlphaElements } from './_utils/remove-data-alpha-elements.js';
// import { formatCodePlugin } from './_utils/format-code.js';
import litPlugin from '@lit-labs/eleventy-plugin-lit';
import { readFile } from 'fs/promises';
import componentList from './_data/componentList.js';
import * as filters from './_utils/filters.js';
import { outlinePlugin } from './_utils/outline.js';
import { replaceTextPlugin } from './_utils/replace-text.js';
import { searchPlugin } from './_utils/search.js';
import { readFile } from 'fs/promises';
import { outlinePlugin } from './_utils/outline.js';
import componentList from './_data/componentList.js';
import litPlugin from '@lit-labs/eleventy-plugin-lit';
import process from 'process';
const packageData = JSON.parse(await readFile('./package.json', 'utf-8'));
const isAlpha = process.argv.includes('--alpha');
// const isDeveloping = process.argv.includes('--develop');
const isDev = process.argv.includes('--develop');
const globalData = {
package: packageData,
isAlpha,
layout: 'page.njk',
};
const passThroughExtensions = ['js', 'css', 'png', 'svg', 'jpg', 'mp4'];
const passThrough = [...passThroughExtensions.map(ext => 'docs/**/*.' + ext)];
export default function (eleventyConfig) {
// NOTE - alpha setting removes certain pages
@@ -32,26 +41,26 @@ export default function (eleventyConfig) {
}
// Add template data
eleventyConfig.addGlobalData('package', packageData);
eleventyConfig.addGlobalData('isAlpha', isAlpha);
for (let name in globalData) {
eleventyConfig.addGlobalData(name, globalData[name]);
}
// Template filters - {{ content | filter }}
eleventyConfig.addFilter('inlineMarkdown', content => markdown.renderInline(content || ''));
eleventyConfig.addFilter('markdown', content => markdown.render(content || ''));
eleventyConfig.addFilter('stripExtension', string => parse(string).name);
eleventyConfig.addFilter('stripPrefix', content => content.replace(/^wa-/, ''));
eleventyConfig.addFilter('trimPipes', content => {
// Trims whitespace and pipes from the start and end of a string. Useful for CEM types, which can be pipe-delimited.
// With Prettier 3, this means a leading pipe will exist be present when the line wraps.
return typeof content === 'string' ? content.replace(/^(\s|\|)/g, '').replace(/(\s|\|)$/g, '') : content;
});
eleventyConfig.addFilter('keys', obj => Object.keys(obj));
for (let name in filters) {
eleventyConfig.addFilter(name, filters[name]);
}
// Shortcodes - {% shortCode arg1, arg2 %}
eleventyConfig.addShortcode('cdnUrl', location => {
return `https://early.webawesome.com/webawesome@${packageData.version}/dist/` + location.replace(/^\//, '');
});
// Paired shortcodes - {% shortCode %}content{% endShortCode %}
eleventyConfig.addPairedShortcode('markdown', content => markdown.render(content || ''));
// Helpers
// Remove elements that have [data-alpha="remove"]
@@ -71,8 +80,8 @@ export default function (eleventyConfig) {
selector: 'h2, h3',
ifEmpty: doc => {
doc.querySelector('#outline')?.remove();
}
})
},
}),
);
// Add current link classes
@@ -93,64 +102,77 @@ export default function (eleventyConfig) {
// Replace [issue:1234] with a link to the issue on GitHub
{
replace: /\[pr:([0-9]+)\]/gs,
replaceWith: '<a href="https://github.com/shoelace-style/webawesome/pull/$1">#$1</a>'
replaceWith: '<a href="https://github.com/shoelace-style/webawesome/pull/$1">#$1</a>',
},
// Replace [pr:1234] with a link to the pull request on GitHub
{
replace: /\[issue:([0-9]+)\]/gs,
replaceWith: '<a href="https://github.com/shoelace-style/webawesome/issues/$1">#$1</a>'
replaceWith: '<a href="https://github.com/shoelace-style/webawesome/issues/$1">#$1</a>',
},
// Replace [discuss:1234] with a link to the discussion on GitHub
{
replace: /\[discuss:([0-9]+)\]/gs,
replaceWith: '<a href="https://github.com/shoelace-style/webawesome/discussions/$1">#$1</a>'
}
])
replaceWith: '<a href="https://github.com/shoelace-style/webawesome/discussions/$1">#$1</a>',
},
]),
);
const omittedModules = [];
// SSR plugin
if (!isDev) {
//
// Problematic components in SSR land:
// - animation (breaks on navigation + ssr with Turbo)
// - mutation-observer (why SSR this?)
// - resize-observer (why SSR this?)
// - tooltip (why SSR this?)
//
const omittedModules = [];
const componentModules = componentList
.filter(component => !omittedModules.includes(component.tagName.split(/wa-/)[1]))
.map(component => {
const name = component.tagName.split(/wa-/)[1];
return `./dist/components/${name}/${name}.js`;
});
// problematic components:
// animation (breaks on navigation + ssr with Turbo)
// mutation-observer (why SSR this?)
// resize-observer (why SSR this?)
// tooltip (why SSR this?)
const componentModules = componentList
// .filter(component => !omittedModules.includes(component.tagName.split(/wa-/)[1]))
.map(component => {
const name = component.tagName.split(/wa-/)[1];
return `./dist/components/${name}/${name}.js`;
eleventyConfig.addPlugin(litPlugin, {
mode: 'worker',
componentModules,
});
eleventyConfig.addPlugin(litPlugin, {
mode: 'worker',
componentModules
});
}
// Build the search index
eleventyConfig.addPlugin(
searchPlugin({
filename: '',
selectorsToIgnore: ['code.example'],
getContent: doc => doc.querySelector('#content')?.textContent ?? ''
})
getContent: doc => doc.querySelector('#content')?.textContent ?? '',
}),
);
// Production-only plugins
//
// TODO - disabled because it takes about a minute to run now
//
// if (!isDeveloping) {
// if (!isDev) {
// // Run Prettier on each file (prod only because it can be slow)
// eleventyConfig.addPlugin(formatCodePlugin());
// }
eleventyConfig.addPassthroughCopy({
'docs/assets': 'assets',
});
for (let glob of passThrough) {
eleventyConfig.addPassthroughCopy(glob);
}
return {
markdownTemplateEngine: 'njk',
dir: {
input: 'docs',
includes: '_includes',
layouts: '_layouts'
layouts: '_layouts',
},
templateFormats: ['njk', 'md']
templateFormats: ['njk', 'md'],
};
}

View File

@@ -1,9 +1,9 @@
/**
* @module components Fetches components from custom-elements.json and exposes them in a saner format.
*/
import { readFileSync } from 'fs';
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';
import { readFileSync } from 'fs';
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -36,7 +36,7 @@ const components = manifest.modules.flatMap(module => {
slug: declaration.tagName.replace(/^wa-/, ''),
methods,
attributes,
properties
properties,
};
});
});

View File

@@ -6,7 +6,7 @@ const by = {
event: {},
method: {},
cssPart: {},
cssProperty: {}
cssProperty: {},
};
function getAll(component, type) {

1
docs/_data/hues.json Normal file
View File

@@ -0,0 +1 @@
["red", "yellow", "green", "cyan", "blue", "indigo", "purple", "gray"]

1
docs/_data/palettes.js Normal file
View File

@@ -0,0 +1 @@
export { default as default } from '../../src/styles/color/palettes-analyzed.js';

File diff suppressed because one or more lines are too long

View File

@@ -1,110 +1,45 @@
<!DOCTYPE html>
<html lang="en" data-fa-kit-code="b10bfbde90" data-cdn-url="{% cdnUrl %}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{ description }}">
{% include 'head.njk' %}
<meta name="theme-color" content="#f36944">
{% if noindex %}<meta name="robots" content="noindex">{% endif %}
<title>{{ title }}</title>
<link rel="icon" href="/assets/images/webawesome-logo.svg" />
<link rel="apple-touch-icon" href="/assets/images/app-icon.png">
{# Scripts #}
{# Hydration stuff #}
<script src="/assets/scripts/hydration-errors.js"></script>
<link rel="stylesheet" href="/assets/styles/hydration-errors.css">
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<script type="module" src="https://cdn.jsdelivr.net/npm/@hotwired/turbo@8.0.10/+esm"></script>
<script type="module" src="/assets/scripts/code-examples.js"></script>
<script type="module" src="/assets/scripts/color-scheme.js"></script>
<script type="module" src="/assets/scripts/copy-code.js"></script>
<script type="module" src="/assets/scripts/preset-theme.js"></script>
<script type="module" src="/assets/scripts/scroll.js"></script>
<script type="module" src="/assets/scripts/turbo.js"></script>
<script type="module" src="/assets/scripts/search.js"></script>
<script type="module" src="/assets/scripts/outline.js"></script>
<script defer data-domain="backers.webawesome.com" src="https://plausible.io/js/script.js"></script>
{# Web Awesome #}
<script type="module" src="/dist/webawesome.ssr-loader.js"></script>
<link rel="stylesheet" id="theme-stylesheet" href="/dist/themes/default.css" />
<link rel="stylesheet" href="/dist/themes/applied.css" />
<link id="color-stylesheet" rel="stylesheet" href="/dist/themes/layout.css" />
<link id="color-stylesheet" rel="stylesheet" href="/dist/themes/utilities.css" />
<link rel="stylesheet" href="/dist/themes/forms.css" />
{# Docs styles #}
<link rel="stylesheet" href="/assets/styles/docs.css" />
{# Set the theme to prevent flashing #}
<script>
function getColorScheme() {
return localStorage.getItem('colorScheme') || 'auto';
}
function getPresetTheme () {
return localStorage.getItem('presetTheme') || 'default';
}
function isDark() {
const colorScheme = getColorScheme()
if (colorScheme === 'auto') {
return window.matchMedia('(prefers-color-scheme: dark)').matches;
}
return colorScheme === 'dark';
}
const oldStylesheet = document.querySelector("#theme-stylesheet")
const newStylesheet = document.createElement("link")
let preset = getPresetTheme()
newStylesheet.href = `/dist/themes/${preset}.css`
newStylesheet.rel = "preload"
newStylesheet.as = "style"
document.head.append(newStylesheet)
function updateStylesheet () {
newStylesheet.rel = "stylesheet"
newStylesheet.id = "theme-stylesheet"
requestAnimationFrame(() => oldStylesheet.remove())
}
newStylesheet.addEventListener("load", updateStylesheet)
document.documentElement.classList.toggle(
`wa-theme-${preset}-dark`,
isDark()
);
</script>
{% block head %}{% endblock %}
</head>
<body class="layout-{{ layout | stripExtension }}">
<body class="layout-{{ layout | stripExtension }}{{ ' page-wide' if wide }}">
<!-- use view="desktop" as default to reduce layout jank on desktop site. -->
<wa-page view="desktop" disable-navigation-toggle="">
<header slot="header">
<header slot="header" class="wa-split">
{# Logo #}
<div id="docs-branding">
{# Nav toggle #}
<wa-button appearance="text" size="small" data-toggle-nav>
<wa-button appearance="plain" size="small" data-toggle-nav>
<wa-icon name="bars" label="Toggle navigation"></wa-icon>
</wa-button>
<a href="/" aria-label="Web Awesome">
<span class="only-desktop">{% include "logo.njk" %}</span>
<span class="only-mobile">{% include "logo-simple.njk" %}</span>
<span class="wa-desktop-only">{% include "logo.njk" %}</span>
<span class="wa-mobile-only">{% include "logo-simple.njk" %}</span>
</a>
<small id="version-number" class="only-desktop">{{ package.version }}</small>
<wa-badge variant="warning" class="only-desktop">Alpha</wa-badge>
<wa-badge variant="warning" appearance="filled" class="only-desktop">Alpha</wa-badge>
</div>
<div id="docs-toolbar">
<div id="docs-toolbar" class="wa-cluster wa-gap-xs">
{# Desktop selectors #}
<div class="only-desktop">
<div class="only-desktop wa-cluster wa-gap-xs">
{% include "preset-theme-selector.njk" %}
{% include "color-scheme-selector.njk" %}
</div>
@@ -121,8 +56,8 @@
{# Sidebar #}
{% if hasSidebar %}
{# Mobile selectors #}
<div class="only-mobile" slot="navigation-header">
<div style="display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));">
<div class="wa-mobile-only" slot="navigation-header">
<div class="wa-cluster wa-gap-xs">
{% include "preset-theme-selector.njk" %}
{% include "color-scheme-selector.njk" %}
</div>
@@ -150,11 +85,12 @@
</details>
</nav>
{% block beforeContent %}{% endblock %}
{% block header %}
{% include 'breadcrumbs.njk' %}
<h1 class="title">{{ title }}</h1>
{% endblock %}
{% block content %}
<h1 class="title">{{ title }}</h1>
{{ content | safe }}
{% endblock %}

View File

@@ -0,0 +1,10 @@
{% set breadcrumbs = page.url | breadcrumbs %}
{% if breadcrumbs.length > 0 %}
<wa-breadcrumb id="docs-breadcrumbs">
{% for crumb in breadcrumbs %}
<wa-breadcrumb-item href="{{ crumb.url }}">{{ crumb.title }}</wa-breadcrumb-item>
{% endfor %}
<wa-breadcrumb-item>{# Current page #}</wa-breadcrumb-item>
</wa-breadcrumb>
{% else %}
{% endif %}

View File

@@ -1,15 +1,19 @@
{# Color scheme selector #}
<wa-dropdown id="color-scheme-selector">
<wa-button slot="trigger" appearance="tinted" size="small" pill caret title="Press \ to toggle">
<wa-select class="color-scheme-selector" appearance="filled" size="small" value="auto" pill title="Press \ to toggle">
<wa-icon class="only-light" slot="prefix" name="sun" variant="regular"></wa-icon>
<wa-icon class="only-dark" slot="prefix" name="moon" variant="regular"></wa-icon>
<wa-option value="light">
<wa-icon slot="prefix" name="sun" variant="regular"></wa-icon>
Light
</wa-option>
<wa-option value="dark">
<wa-icon slot="prefix" name="moon" variant="regular"></wa-icon>
Dark
</wa-option>
<wa-divider></wa-divider>
<wa-option value="auto">
<wa-icon class="only-light" slot="prefix" name="sun" variant="regular"></wa-icon>
<wa-icon class="only-dark" slot="prefix" name="moon" variant="regular"></wa-icon>
<span class="only-light">Light</span>
<span class="only-dark">Dark</span>
</wa-button>
<wa-menu>
<wa-menu-item type="checkbox" value="light">Light</wa-menu-item>
<wa-menu-item type="checkbox" value="dark">Dark</wa-menu-item>
<wa-divider></wa-divider>
<wa-menu-item type="checkbox" value="auto">System</wa-menu-item>
</wa-menu>
</wa-dropdown>
System
</wa-option>
</wa-select>

View File

@@ -0,0 +1,40 @@
<table class="colors wa-palette-{{ paletteId }}">
<thead>
<tr>
<th></th>
{% for tint_bg in tints -%}
{% for tint_fg in tints | reverse -%}
{% if (tint_fg - tint_bg) | abs == difference %}
<th>{{ tint_fg }} on {{ tint_bg }}</th>
{% endif %}
{%- endfor -%}
{%- endfor %}
</tr>
</thead>
{% for hue in hues -%}
<tr>
<th>{{ hue | capitalize }}</th>
{% for tint_bg in tints -%}
{% set color_bg = palettes[paletteId][hue][tint_bg] %}
{% for tint_fg in tints | reverse -%}
{% set color_fg = palettes[paletteId][hue][tint_fg] %}
{% if (tint_fg - tint_bg) | abs == difference %}
<td>
<div class="color swatch" style="background-color: var(--wa-color-{{ hue }}-{{ tint_bg }}); color: var(--wa-color-{{ hue }}-{{ tint_fg }})">
{% set contrast_wcag = '' %}
{% if color_fg and color_bg %}
{% set contrast_wcag = color_bg.contrast(color_fg, 'WCAG21') %}
{% endif %}
{% if contrast_wcag %}
{{ contrast_wcag | number({maximumSignificantDigits: 2}) }}
{% else %}
{{ tint_fg }} on {{ tint_bg }}
{% endif %}
</div>
</td>
{% endif %}
{%- endfor -%}
{%- endfor -%}
</tr>
{%- endfor %}
</table>

View File

@@ -0,0 +1,12 @@
{# Cards for pages listed by category #}
<section id="grid" class="index-grid">
{% for category, pages in allPages | groupByTags(categories) -%}
<h2 class="index-category">{{ category | getCategoryTitle(categories) }}</h2>
{%- for page in pages -%}
{%- if not page.data.parent or listChildren -%}
{% include "page-card.njk" %}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
</section>

49
docs/_includes/head.njk Normal file
View File

@@ -0,0 +1,49 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{ description }}">
{% if noindex %}<meta name="robots" content="noindex">{% endif %}
<title>{{ title }}</title>
{# Dark mode #}
<script>
let colorScheme = localStorage.colorScheme;
let isDark = localStorage.colorScheme === "dark";
if (!colorScheme || colorScheme === "auto") {
isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
}
document.documentElement.classList.toggle('wa-dark', isDark);
</script>
<link rel="icon" href="/assets/images/webawesome-logo.svg" />
<link rel="apple-touch-icon" href="/assets/images/app-icon.png">
{# Scripts #}
{# Hydration stuff #}
<script src="/assets/scripts/hydration-errors.js"></script>
<link rel="stylesheet" href="/assets/styles/hydration-errors.css">
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<script type="module" src="https://cdn.jsdelivr.net/npm/@hotwired/turbo@8.0.10/+esm"></script>
{# Web Awesome #}
<script type="module" src="/dist/webawesome.ssr-loader.js"></script>
<script type="module" src="/assets/scripts/theme-picker.js"></script>
{# Preset Theme #}
{% if forceTheme %}
<link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/{{ forceTheme }}.css" render="blocking" fetchpriority="high" />
{% else %}
<noscript><link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/default.css" render="blocking" fetchpriority="high" /></noscript>
<script>
{
let preset = localStorage.presetTheme ?? 'default';
let script = document.currentScript;
script.insertAdjacentHTML('beforebegin', `<link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/${ preset }.css" render="blocking" fetchpriority="high" />`);
}
</script>
<script type="module" src="/assets/scripts/preset-theme-picker.js"></script>
{% endif %}
<link rel="stylesheet" href="/dist/styles/webawesome.css" />
<link id="color-stylesheet" rel="stylesheet" href="/dist/styles/utilities.css" />
<link rel="stylesheet" href="/dist/styles/forms.css" />

View File

@@ -0,0 +1,18 @@
<wa-tab-group class="import-stylesheet-code">
<wa-tab panel="html">In HTML</wa-tab>
<wa-tab panel="css">In CSS</wa-tab>
<wa-tab-panel name="html">
Add the following code to the `<head>` of your page:
```html
<link rel="stylesheet" href="{% cdnUrl stylesheet %}" />
```
</wa-tab-panel>
<wa-tab-panel name="css">
Add the following code at the top of your CSS file:
```css
@import url('{% cdnUrl stylesheet %}');
```
</wa-tab-panel>
</wa-tab-group>

View File

@@ -0,0 +1,13 @@
{%- if not page.data.unlisted -%}
<a href="{{ page.url }}"{{ page.data.keywords | attr('data-keywords') }}>
<wa-card with-header>
<div slot="header">
{% include "svgs/" + (page.data.icon or "thumbnail-placeholder") + ".njk" %}
</div>
<span class="page-name">{{ page.data.title }}</span>
{% if pageSubtitle -%}
<div class="wa-caption-s">{{ pageSubtitle }}</div>
{%- endif %}
</wa-card>
</a>
{% endif %}

View File

@@ -1,5 +1,5 @@
<div id="page_slots_demo">
<link rel="stylesheet" href="/assets/examples/page-demo/demo.css">
<link rel="stylesheet" href="./demo.css">
{% set slots = components.page.slots %}
<fieldset id="page_slots_fieldset">
@@ -16,7 +16,11 @@
</div>
</fieldset>
<wa-viewport-demo viewport="1000">
<iframe srcdoc="" id="page_slots_iframe" data-turbo="false" data-turbo-temporary></iframe>
<iframe srcdoc="" id="page_slots_iframe"></iframe>
</wa-viewport-demo>
</div>
<script type=module src="/assets/examples/page-demo/demo.js"></script>
<script type="module">
const cacheBust = new Date().toString()
import(`./demo.js?${cacheBust}`)
</script>

View File

@@ -1,18 +1,9 @@
{# Preset theme selector #}
<wa-dropdown id="preset-theme-selector">
<wa-button slot="trigger" appearance="tinted" size="small" pill caret>
<wa-icon slot="prefix" name="paintbrush" variant="regular"></wa-icon>
<span id="preset-theme-selector__text">Default</span>
</wa-button>
<wa-menu>
<wa-menu-item type="checkbox" value="default">Default</wa-menu-item>
<wa-menu-item type="checkbox" value="classic">Classic</wa-menu-item>
<wa-menu-item data-alpha="remove" type="checkbox" value="fa">Font Awesome</wa-menu-item>
<wa-menu-item data-alpha="remove" type="checkbox" value="active">Active</wa-menu-item>
<wa-menu-item data-alpha="remove" type="checkbox" value="brutalist">Brutalism</wa-menu-item>
<wa-menu-item data-alpha="remove" type="checkbox" value="glassy">Glassy</wa-menu-item>
<wa-menu-item data-alpha="remove" type="checkbox" value="migration">Migration</wa-menu-item>
<wa-menu-item data-alpha="remove" type="checkbox" value="playful">Playful</wa-menu-item>
<wa-menu-item data-alpha="remove" type="checkbox" value="premium">Premium</wa-menu-item>
</wa-menu>
</wa-dropdown>
<wa-select appearance="filled" size="small" value="default" pill class="preset-theme-selector">
<wa-icon slot="prefix" name="paintbrush" variant="regular"></wa-icon>
{% for theme in collections.theme | sort %}
<wa-option value="{{ theme.page.fileSlug }}"{{ ' data-alpha="remove"' if theme.noAlpha }}>
{{ theme.data.title }}
</wa-option>
{% endfor %}
</wa-select>

View File

@@ -6,7 +6,7 @@
<wa-input
id="site-search-input"
type="search"
filled
appearance="filled"
size="large"
clearable
placeholder="Search"

View File

@@ -0,0 +1,22 @@
{# Some collections (like "patterns") will not have any items in the alpha build for example. So this checks to make sure the collection exists. #}
{% if collections[tag] -%}
{% set groupUrl %}/docs/{{ tag }}/{% endset %}
<wa-details {{ ((tag in (tags or [])) or (groupUrl in page.url)) | attr('open') }}>
<h2 slot="summary">
{% if groupUrl | getCollectionItemFromUrl %}
<a href="{{ groupUrl }}" title="Overview">{{ title or (tag | capitalize) }}
<wa-icon name="grid-2"></wa-icon>
</a>
{% else %}
{{ title or (tag | capitalize) }}
{% endif %}
</h2>
<ul>
{% for page in collections[tag] | sort %}
{% if not page.data.parent -%}
{% include 'sidebar-link.njk' %}
{%- endif %}
{% endfor %}
</ul>
</wa-details>
{%- endif %}

View File

@@ -0,0 +1,16 @@
{% if not (isAlpha and page.data.noAlpha) and page.fileSlug != tag and not page.data.unlisted -%}
<li>
<a href="{{ page.url }}">{{ page.data.title }}</a>
{% if page.data.status == 'experimental' %}<wa-icon name="flask"></wa-icon>{% endif %}
{% if page.data.isPro %}<wa-badge class="pro">PRO</wa-badge>{% endif %}
{% set children = page.data.children %}
{% if children.length > 0 %}
<ul>
{% for page in children %}
{% include 'sidebar-link.njk' %}
{% endfor %}
</ul>
{% endif %}
</li>
{%- endif %}

View File

@@ -3,7 +3,6 @@
<ul>
<li><a href="/docs/installation">Installation</a></li>
<li><a href="/docs/usage">Usage</a></li>
<li><a href="/docs/themes">Themes</a></li>
<li><a href="/docs/customizing">Customizing</a></li>
<li><a href="/docs/form-controls">Form Controls</a></li>
<li><a href="/docs/localization">Localization</a></li>
@@ -17,300 +16,18 @@
<li><a href="/docs/resources/accessibility">Accessibility</a></li>
<li><a href="/docs/resources/contributing">Contributing</a></li>
<li><a href="/docs/resources/changelog">Changelog</a></li>
<li><a href="/docs/resources/visual-tests">Visual Tests</a></li>
</ul>
{# Components #}
<h2>
<a href="/docs/components/" title="Overview">Components
<wa-icon name="grid-2"></wa-icon>
</a>
</h2>
<ul>
<li>
<a href="/docs/components/animated-image">Animated Image</a>
</li>
<li>
<a href="/docs/components/animation">Animation</a>
</li>
<li>
<a href="/docs/components/avatar">Avatar</a>
</li>
<li>
<a href="/docs/components/badge">Badge</a>
</li>
<li>
<a href="/docs/components/breadcrumb">Breadcrumb</a>
<ul>
<li>
<a href="/docs/components/breadcrumb-item">Breadcrumb Item</a>
</li>
</ul>
</li>
<li>
<a href="/docs/components/button">Button</a>
</li>
<li>
<a href="/docs/components/button-group">Button Group</a>
</li>
<li>
<a href="/docs/components/callout">Callout</a>
</li>
<li>
<a href="/docs/components/card">Card</a>
</li>
<li>
<a href="/docs/components/carousel">Carousel</a>
<ul>
<li>
<a href="/docs/components/carousel-item">Carousel Item</a>
</li>
</ul>
</li>
<li>
<a href="/docs/components/checkbox">Checkbox</a>
</li>
{% if not isAlpha %}
<li>
<a href="/docs/components/code-demo">Code Demo</a>
</li>
{% endif %}
<li>
<a href="/docs/components/color-picker">Color Picker</a>
</li>
<li>
<a href="/docs/components/copy-button">Copy Button</a>
</li>
<li>
<a href="/docs/components/details">Details</a>
</li>
<li>
<a href="/docs/components/dialog">Dialog</a>
</li>
<li>
<a href="/docs/components/divider">Divider</a>
</li>
<li>
<a href="/docs/components/drawer">Drawer</a>
</li>
<li>
<a href="/docs/components/dropdown">Dropdown</a>
</li>
<li>
<a href="/docs/components/format-bytes">Format Bytes</a>
</li>
<li>
<a href="/docs/components/format-date">Format Date</a>
</li>
<li>
<a href="/docs/components/format-number">Format Number</a>
</li>
<li>
<a href="/docs/components/icon">Icon</a>
</li>
<li>
<a href="/docs/components/icon-button">Icon Button</a>
</li>
<li>
<a href="/docs/components/image-comparer">Image Comparer</a>
</li>
<li>
<a href="/docs/components/include">Include</a>
</li>
<li>
<a href="/docs/components/input">Input</a>
</li>
<li>
<a href="/docs/components/menu">Menu</a>
<ul>
<li>
<a href="/docs/components/menu-item">Menu Item</a>
</li>
<li>
<a href="/docs/components/menu-label">Menu Label</a>
</li>
</ul>
</li>
<li>
<a href="/docs/components/mutation-observer">Mutation Observer</a>
</li>
<li>
<a href="/docs/components/page">Page</a>
<wa-icon name="flask"></wa-icon>
<wa-badge class="pro">PRO</wa-badge>
</li>
<li>
<a href="/docs/components/popup">Popup</a>
</li>
<li>
<a href="/docs/components/progress-bar">Progress Bar</a>
</li>
<li>
<a href="/docs/components/progress-ring">Progress Ring</a>
</li>
<li>
<a href="/docs/components/qr-code">QR Code</a>
</li>
<li>
<a href="/docs/components/radio-group">Radio Group</a>
<ul>
<li>
<a href="/docs/components/radio">Radio</a>
</li>
<li>
<a href="/docs/components/radio-button">Radio Button</a>
</li>
</ul>
</li>
<li>
<a href="/docs/components/range">Range</a>
</li>
<li>
<a href="/docs/components/rating">Rating</a>
</li>
<li>
<a href="/docs/components/relative-time">Relative Time</a>
</li>
<li>
<a href="/docs/components/resize-observer">Resize Observer</a>
</li>
<li>
<a href="/docs/components/select">Select</a>
<ul>
<li>
<a href="/docs/components/option">Option</a>
</li>
</ul>
</li>
<li>
<a href="/docs/components/skeleton">Skeleton</a>
</li>
<li>
<a href="/docs/components/spinner">Spinner</a>
</li>
<li>
<a href="/docs/components/split-panel">Split Panel</a>
</li>
<li>
<a href="/docs/components/switch">Switch</a>
</li>
<li>
<a href="/docs/components/tab-group">Tab Group</a>
<ul>
<li>
<a href="/docs/components/tab">Tab</a>
</li>
<li>
<a href="/docs/components/tab-panel">Tab Panel</a>
</li>
</ul>
</li>
<li>
<a href="/docs/components/tag">Tag</a>
</li>
<li>
<a href="/docs/components/textarea">Textarea</a>
</li>
<li>
<a href="/docs/components/tooltip">Tooltip</a>
</li>
<li>
<a href="/docs/components/tree">Tree</a>
<ul>
<li>
<a href="/docs/components/tree-item">Tree Item</a>
</li>
</ul>
</li>
{% if not isAlpha %}
<li>
<a href="/docs/components/viewport-demo">Viewport Demo</a>
</li>
{% endif %}
<li>
<a href="/docs/components/visually-hidden">Visually Hidden</a>
</li>
</ul>
{# Layout #}
{% if not isAlpha %}
<h2>
<a href="/docs/layout" title="Overview">Layout
<wa-icon name="grid-2"></wa-icon>
</a>
</h2>
<ul>
<li><a href="/docs/components/page">Page</a></li>
<li><a href="/docs/layout/cluster">Cluster</a></li>
<li><a href="/docs/layout/flank">Flank</a></li>
<li><a href="/docs/layout/frame">Frame</a></li>
<li><a href="/docs/layout/grid">Grid</a></li>
<li><a href="/docs/layout/split">Split</a></li>
<li><a href="/docs/layout/stack">Stack</a></li>
</ul>
{% endif %}
{# Patterns #}
{% if not isAlpha %}
<h2>Patterns</h2>
<ul>
<li><a href="/docs/patterns/app">Web App</a></li>
<li><a href="/docs/patterns/ecommerce">E-commerce</a>
<ul>
<li><a href="/docs/patterns/ecommerce-product-review">Product Reviews</a></li>
<li><a href="/docs/patterns/ecommerce-product-list">Product Lists</a></li>
<li><a href="/docs/patterns/ecommerce-category-preview">Category Previews</a></li>
<li><a href="/docs/patterns/ecommerce-shopping-cart">Shopping Carts</a></li>
<li><a href="/docs/patterns/ecommerce-category-filter">Category Filters</a></li>
<li><a href="/docs/patterns/ecommerce-product-detail">Product Detail</a></li>
<li><a href="/docs/patterns/ecommerce-order-summary">Order Summaries</a></li>
<li><a href="/docs/patterns/ecommerce-order-history">Order History</a></li>
</ul>
</li>
<li><a href="/docs/patterns/blog">Blog</a></li>
<li><a href="/docs/patterns/news">News</a></li>
</ul>
{% endif %}
{# Theming #}
<h2>
<a href="/docs/theming" title="Overview">Theming
<wa-icon name="grid-2"></wa-icon>
</a>
</h2>
<ul>
<li>
<a href="/docs/theming/color">Color</a>
</li>
<li>
<a href="/docs/theming/typography">Typography</a>
</li>
<li>
<a href="/docs/theming/space">Space</a>
</li>
<li>
<a href="/docs/theming/borders">Borders</a>
</li>
<li>
<a href="/docs/theming/focus">Focus</a>
</li>
<li>
<a href="/docs/theming/shadows">Shadows</a>
</li>
<li>
<a href="/docs/theming/transitions">Transitions</a>
</li>
<li>
<a href="/docs/theming/component-groups">Component Groups</a>
</li>
</ul>
{# Style Utilities #}
{% if not isAlpha %}
<h2>Style Utilities</h2>
<ul>
<li><a href="/docs/style-utilities/align-items">Align Items</a></li>
<li><a href="/docs/style-utilities/border-radius">Border Radius</a></li>
<li><a href="/docs/style-utilities/gap">Gap</a></li>
<li><a href="/docs/style-utilities/text">Text</a></li>
</ul>
{% endif %}
{% for tag, title in {
'themes': 'Themes',
'components': 'Components',
'native': 'Native Styles',
'utilities': 'Style Utilities',
'layout': 'Layout',
'patterns': 'Patterns',
'palettes': 'Color Palettes',
'tokens': 'Design Tokens'
} %}
{% include 'sidebar-group.njk' %}
{% endfor %}

25
docs/_includes/status.njk Normal file
View File

@@ -0,0 +1,25 @@
{% if since -%}
<wa-badge variant="neutral">Since {{ since }}</wa-badge>
{% endif -%}
{%- if status %}
{%- if status == "wip" %}
<wa-badge variant="danger">
<wa-icon name="pickaxe"></wa-icon>
Work In Progress
</wa-badge>
{%- elif status == "experimental" %}
<wa-badge variant="warning">
<wa-icon name="flask"></wa-icon>
Experimental
</wa-badge>
{%- elif status == "stable" %}
<wa-badge variant="brand">Stable</wa-badge>
{%- else %}
<wa-badge>{{ status}}</wa-badge>
{%- endif -%}
{%- endif %}
{%- if isPro %}
<wa-badge class="pro">PRO</wa-badge>
{%- endif -%}

View File

@@ -0,0 +1,24 @@
{% set paletteId = palette.fileSlug or page.fileSlug %}
{% set tints = [80, 60, 40, 20] %}
{% set width = 20 %}
{% set height = 13 %}
{% set gap_x = 3 %}
{% set gap_y = 3 %}
<svg viewBox="0 0 {{ (width + gap_x) * hues|length }} {{ (height + gap_y) * tints|length }}" fill="none" xmlns="http://www.w3.org/2000/svg" class="wa-palette-{{ paletteId }} palette-icon">
<style>
@import url('/dist/styles/color/{{ paletteId }}.css') layer(palette.{{ paletteId }});
.palette-icon {
height: 8ch;
}
</style>
{% for hue in hues -%}
{% set hueIndex = loop.index0 %}
{% for tint in tints -%}
<rect x="{{ hueIndex * (width + gap_x) }}" y="{{ loop.index0 * (height + gap_y) }}"
width="{{ width }}" height="{{ height }}"
fill="var(--wa-color-{{ hue }}-{{ tint }})" rx="4" />
{%- endfor %}
{% endfor %}
</svg>

View File

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 337 B

View File

@@ -0,0 +1,24 @@
{% set themeId = theme.fileSlug %}
<wa-isolate>
<template>
<link rel="stylesheet" href="/dist/styles/utilities.css">
<link rel="stylesheet" href="/dist/styles/themes/{{ page.fileSlug or 'default' }}.css">
<link rel="stylesheet" href="/dist/styles/themes/{{ themeId }}/color.css">
<link rel="stylesheet" href="/assets/styles/theme-icons.css">
<div class="theme-color-icon wa-theme-{{ themeId }}">
<div class="wa-brand wa-accent">A</div>
<div class="wa-brand wa-outlined">A</div>
<div class="wa-brand wa-filled">A</div>
<div class="wa-brand wa-plain">A</div>
{# <div class="wa-danger wa-outlined wa-filled"><wa-icon slot="icon" name="circle-exclamation" variant="regular"></wa-icon></div> #}
<div class="wa-neutral wa-accent">A</div>
<div class="wa-neutral wa-outlined">A</div>
<div class="wa-neutral wa-filled">A</div>
<div class="wa-neutral wa-plain">A</div>
{# <div class="wa-warning wa-outlined wa-filled"><wa-icon slot="icon" name="triangle-exclamation" variant="regular"></wa-icon></div> #}
</div>
</template>
</wa-isolate>

View File

@@ -0,0 +1,16 @@
{% set themeId = theme.fileSlug %}
<wa-isolate>
<template>
<link rel="stylesheet" href="/dist/styles/native/content.css">
<link rel="stylesheet" href="/dist/styles/native/blockquote.css">
<link rel="stylesheet" href="/dist/styles/themes/{{ page.fileSlug or 'default' }}.css">
<link rel="stylesheet" href="/dist/styles/themes/{{ themeId }}/typography.css">
<link rel="stylesheet" href="/assets/styles/theme-icons.css">
<div class="theme-typography-icon wa-theme-{{ themeId }}" data-no-outline data-no-anchor role="presentation">
<h3>Title</h3>
<p>Body text</p>
</div>
</template>
</wa-isolate>

View File

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 596 B

View File

@@ -2,7 +2,7 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.8665 59.1993L33.7329 33H64C63.8352 38.2705 62.3694 43.4244 59.7264 48C57.0833 52.5756 53.3507 56.4213 48.8665 59.1993Z" fill="var(--wa-color-green-70)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M32 64C26.714 64 21.5155 62.6919 16.8665 60.1993L32 34L47.1336 60.1993C42.4845 62.6919 37.286 64 32 64Z" fill="var(--wa-color-blue-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.27365 48C1.63063 43.4244 0.164839 38.2706 0 33L30.2671 33L15.1336 59.1993C10.6493 56.4213 6.91666 52.5756 4.27365 48Z" fill="var(--wa-color-indigo-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.27365 16C6.91667 11.4244 10.6493 7.57868 15.1336 4.80072L30.2671 31L0 31C0.16484 25.7295 1.63063 20.5756 4.27365 16Z" fill="var(--wa-color-violet-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.27365 16C6.91667 11.4244 10.6493 7.57868 15.1336 4.80072L30.2671 31L0 31C0.16484 25.7295 1.63063 20.5756 4.27365 16Z" fill="var(--wa-color-purple-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M32 30L16.8665 3.80072C21.5155 1.30813 26.714 0 32 0C37.286 0 42.4845 1.30813 47.1336 3.80072L32 30Z" fill="var(--wa-color-red-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.7329 31L48.8665 4.80072C53.3507 7.57868 57.0833 11.4244 59.7264 16C62.3694 20.5756 63.8352 25.7294 64 31L33.7329 31Z" fill="var(--wa-color-yellow-80)"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 502 B

View File

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 790 B

View File

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 697 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,144 @@
<div class="showcase-examples-wrapper" aria-hidden="true" data-no-outline>
<div class="showcase-examples">
<wa-card with-header with-footer>
<div slot="header" class="wa-split">
<h3 class="wa-heading-m">Your Cart</h3>
<wa-icon-button name="xmark" tabindex="-1"></wa-icon-button>
</div>
<div class="wa-stack wa-gap-xl">
<div class="wa-flank">
<wa-avatar shape="rounded" style="--size: 3em; --background-color: var(--wa-color-green-60); --text-color: var(--wa-color-green-95);">
<wa-icon slot="icon" name="sword-laser" family="duotone" style="font-size: 1.5em;"></wa-icon>
</wa-avatar>
<div class="wa-stack wa-gap-2xs">
<div class="wa-split wa-gap-2xs">
<strong>Initiate Saber</strong>
<strong>$179.99</strong>
</div>
<div class="wa-split wa-gap-2xs wa-caption-m">
<span>Green</span>
<a href="#" tabindex="-1">Remove</a>
</div>
</div>
</div>
<wa-divider></wa-divider>
<div class="wa-flank">
<wa-avatar shape="rounded" style="--size: 3em; --background-color: var(--wa-color-cyan-60); --text-color: var(--wa-color-cyan-95);">
<wa-icon slot="icon" name="robot-astromech" family="duotone" style="font-size: 1.5em;"></wa-icon>
</wa-avatar>
<div class="wa-stack wa-gap-2xs">
<div class="wa-split wa-gap-2xs">
<strong>Repair Droid</strong>
<strong>$3,049.99</strong>
</div>
<div class="wa-split wa-gap-2xs wa-caption-m">
<span>R-series</span>
<a href="#" tabindex="-1">Remove</a>
</div>
</div>
</div>
</div>
<div slot="footer" class="wa-stack">
<div class="wa-split">
<strong>Subtotal</strong>
<strong>$3,229.98</strong>
</div>
<span class="wa-caption-m">Shipping and taxes calculated at checkout.</span>
<wa-button tabindex="-1" variant="brand">
<wa-icon slot="prefix" name="shopping-bag"></wa-icon>
Checkout
</wa-button>
</div>
</wa-card>
<wa-card>
<wa-avatar shape="rounded" style="--size: 1.9lh; float: left; margin-right: var(--wa-space-m);">
<wa-icon slot="icon" name="hat-wizard" family="duotone" style="font-size: 1.75em;"></wa-icon>
</wa-avatar>
<p class="wa-body-l" style="margin: 0;">&ldquo;All we have to decide is what to do with the time that is given to us. There are other forces at work in this world, Frodo, besides the will of evil.&rdquo;</p>
</wa-card>
<wa-card>
<div class="wa-stack">
<h3 class="wa-heading-m">Sign In</h3>
<wa-input tabindex="-1" label="Email" placeholder="ddjarin@mandalore.gov">
<wa-icon slot="prefix" name="envelope" variant="regular"></wa-icon>
</wa-input>
<wa-input tabindex="-1" label="Password" type="password">
<wa-icon slot="prefix" name="lock" variant="regular"></wa-icon>
</wa-input>
<wa-button tabindex="-1" variant="brand">Sign In</wa-button>
<a href="#" tabindex="-1" class="wa-body-s">I forgot my password</a>
</div>
</wa-card>
<wa-card with-footer>
<div class="wa-stack">
<div class="wa-split">
<h3 class="wa-heading-m">To-Do</h3>
<wa-icon-button tabindex="-1" name="plus" label="Add task"></wa-icon-button>
</div>
<wa-checkbox tabindex="-1" checked>Umbrella for Adelard</wa-checkbox>
<wa-checkbox tabindex="-1" checked>Waste-paper basket for Dora</wa-checkbox>
<wa-checkbox tabindex="-1" checked>Pen and ink for Milo</wa-checkbox>
<wa-checkbox tabindex="-1">Mirror for Angelica</wa-checkbox>
<wa-checkbox tabindex="-1">Silver spoons for Lobelia</wa-checkbox>
</div>
<div slot="footer">
<a href="" tabindex="-1">View all completed</a>
</div>
</wa-card>
<wa-card>
<div class="wa-stack">
<div class="wa-frame wa-border-radius-m" style="align-self: center; max-inline-size: 25ch;">
<img src="https://images.unsplash.com/photo-1667514627762-521b1c815a89?q=20" alt="Album art">
</div>
<div class="wa-flank:end wa-align-items-start">
<div class="wa-stack wa-gap-3xs">
<div class="wa-cluster wa-gap-xs" style="height: 2.25em;">
<strong>The Stone Troll</strong>
<small><wa-badge variant="neutral" appearance="filled">E</wa-badge></small>
</div>
<span class="wa-caption-m">Samwise G</span>
</div>
<wa-icon-button tabindex="-1" name="ellipsis" label="Options"></wa-icon-button>
</div>
<div class="wa-stack wa-gap-2xs">
<wa-progress-bar value="34" style="height: 0.5em"></wa-progress-bar>
<div class="wa-split">
<span class="wa-caption-xs">1:01</span>
<span class="wa-caption-xs">-1:58</span>
</div>
</div>
<div class="wa-grid wa-align-items-center" style="--min-column-size: 1em; justify-items: center;">
<wa-icon-button tabindex="-1" name="backward" label="Skip backward"></wa-icon-button>
<wa-icon-button tabindex="-1" name="pause" style="font-size: var(--wa-font-size-2xl);" label="Pause"></wa-icon-button>
<wa-icon-button tabindex="-1" name="forward" label="Skip forward"></wa-icon-button>
</div>
</div>
</wa-card>
<wa-card>
<div class="wa-stack">
<h3 class="wa-heading-m">Chalmun's Spaceport Cantina</h3>
<div class="wa-cluster wa-gap-xs">
<wa-rating value="4.6" read-only></wa-rating>
<strong>4.6</strong>
<span>(419 reviews)</span>
</div>
<div class="wa-cluster wa-gap-xs">
<div class="wa-cluster wa-gap-3xs">
<wa-icon name="dollar" style="color: var(--wa-color-green-60);"></wa-icon>
<wa-icon name="dollar" style="color: var(--wa-color-green-60);"></wa-icon>
<wa-icon name="dollar" style="color: var(--wa-color-green-60);"></wa-icon>
</div>
<span class="wa-caption-m">&bull;</span>
<wa-tag size="small">Cocktail Bar</wa-tag>
<wa-tag size="small">Gastropub</wa-tag>
<wa-tag size="small">Local Fare</wa-tag>
<wa-tag size="small">Gluten Free</wa-tag>
</div>
<div class="wa-flank wa-gap-xs">
<wa-icon name="location-dot"></wa-icon>
<a href="#" class="wa-caption-m" tabindex="-1">Mos Eisley, Tatooine</a>
</div>
</div>
</wa-card>
</div>
</div>

View File

@@ -0,0 +1,77 @@
```html {.example}
<style>
div.alignment {
background: linear-gradient(to bottom, lightblue, lightblue 1px, transparent 1px, transparent), linear-gradient(to top, lightblue, lightblue 1px, transparent 1px, transparent);
position: relative;
display: flex;
gap: 1rem;
align-items: center;
}
div.alignment::after {
content: '';
position: absolute;
top: calc(50% - 0.5px);
width: 100%;
height: 1px;
background-color: red;
}
</style>
<div class="wa-stack wa-gap-xl">
<div class="alignment">
<wa-switch size="small">Switch</wa-switch>
<wa-checkbox size="small">Checkbox</wa-checkbox>
<wa-radio value="1" size="small">Radio</wa-radio>
</div>
<div class="alignment">
<wa-switch>Switch</wa-switch>
<wa-checkbox>Checkbox</wa-checkbox>
<wa-radio value="1">Radio</wa-radio>
</div>
<div class="alignment">
<wa-switch size="large">Switch</wa-switch>
<wa-checkbox size="large">Checkbox</wa-checkbox>
<wa-radio value="1" size="large">Radio</wa-radio>
</div>
<div class="alignment">
<wa-textarea placeholder="textarea" size="small" rows="1"></wa-textarea>
<wa-input placeholder="input" size="small"></wa-input>
<wa-select size="small" value="1" multiple>
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-color-picker size="small"></wa-color-picker>
<wa-button size="small">Button</wa-button>
</div>
<div class="alignment">
<wa-textarea placeholder="textarea" size="medium" rows="1"></wa-textarea>
<wa-input placeholder="input" size="medium"></wa-input>
<wa-select size="medium" value="1" multiple>
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-color-picker size="medium"></wa-color-picker>
<wa-button size="medium">Button</wa-button>
</div>
<div class="alignment">
<wa-textarea placeholder="textarea" size="large" rows="1"></wa-textarea>
<wa-input placeholder="input" size="large"></wa-input>
<wa-select size="large" value="1" multiple>
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-color-picker size="large"></wa-color-picker>
<wa-button size="large">Button</wa-button>
</div>
<div class="alignment">
<wa-badge>Badge</wa-badge>
<code>Code</code>
<kbd>Keyboard</kbd>
<ins>Inserted</ins>
<del>Deleted</del>
<mark>Highlighted</mark>
</div>
<div class="alignment">
<wa-avatar></wa-avatar>
<wa-rating></wa-rating>
<wa-icon-button name="gear" label="Settings"></wa-icon-button>
<wa-spinner></wa-spinner>
</div>
</div>
```

View File

@@ -0,0 +1,799 @@
<h3>Badge</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>accent</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="accent outlined">Brand</wa-badge>
<wa-badge variant="neutral" appearance="accent outlined">Neutral</wa-badge>
<wa-badge variant="success" appearance="accent outlined">Success</wa-badge>
<wa-badge variant="warning" appearance="accent outlined">Warning</wa-badge>
<wa-badge variant="danger" appearance="accent outlined">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-accent wa-outlined">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-accent wa-outlined">Neutral</wa-badge>
<wa-badge variant="success" class="wa-accent wa-outlined">Success</wa-badge>
<wa-badge variant="warning" class="wa-accent wa-outlined">Warning</wa-badge>
<wa-badge variant="danger" class="wa-accent wa-outlined">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>accent</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="accent">Brand</wa-badge>
<wa-badge variant="neutral" appearance="accent">Neutral</wa-badge>
<wa-badge variant="success" appearance="accent">Success</wa-badge>
<wa-badge variant="warning" appearance="accent">Warning</wa-badge>
<wa-badge variant="danger" appearance="accent">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-accent">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-accent">Neutral</wa-badge>
<wa-badge variant="success" class="wa-accent">Success</wa-badge>
<wa-badge variant="warning" class="wa-accent">Warning</wa-badge>
<wa-badge variant="danger" class="wa-accent">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>filled</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="filled outlined">Brand</wa-badge>
<wa-badge variant="neutral" appearance="filled outlined">Neutral</wa-badge>
<wa-badge variant="success" appearance="filled outlined">Success</wa-badge>
<wa-badge variant="warning" appearance="filled outlined">Warning</wa-badge>
<wa-badge variant="danger" appearance="filled outlined">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-filled wa-outlined">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-filled wa-outlined">Neutral</wa-badge>
<wa-badge variant="success" class="wa-filled wa-outlined">Success</wa-badge>
<wa-badge variant="warning" class="wa-filled wa-outlined">Warning</wa-badge>
<wa-badge variant="danger" class="wa-filled wa-outlined">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="filled">Brand</wa-badge>
<wa-badge variant="neutral" appearance="filled">Neutral</wa-badge>
<wa-badge variant="success" appearance="filled">Success</wa-badge>
<wa-badge variant="warning" appearance="filled">Warning</wa-badge>
<wa-badge variant="danger" appearance="filled">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-filled">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-filled">Neutral</wa-badge>
<wa-badge variant="success" class="wa-filled">Success</wa-badge>
<wa-badge variant="warning" class="wa-filled">Warning</wa-badge>
<wa-badge variant="danger" class="wa-filled">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="outlined">Brand</wa-badge>
<wa-badge variant="neutral" appearance="outlined">Neutral</wa-badge>
<wa-badge variant="success" appearance="outlined">Success</wa-badge>
<wa-badge variant="warning" appearance="outlined">Warning</wa-badge>
<wa-badge variant="danger" appearance="outlined">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-outlined">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-outlined">Neutral</wa-badge>
<wa-badge variant="success" class="wa-outlined">Success</wa-badge>
<wa-badge variant="warning" class="wa-outlined">Warning</wa-badge>
<wa-badge variant="danger" class="wa-outlined">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>plain</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="plain">Brand</wa-badge>
<wa-badge variant="neutral" appearance="plain">Neutral</wa-badge>
<wa-badge variant="success" appearance="plain">Success</wa-badge>
<wa-badge variant="warning" appearance="plain">Warning</wa-badge>
<wa-badge variant="danger" appearance="plain">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-plain">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-plain">Neutral</wa-badge>
<wa-badge variant="success" class="wa-plain">Success</wa-badge>
<wa-badge variant="warning" class="wa-plain">Warning</wa-badge>
<wa-badge variant="danger" class="wa-plain">Danger</wa-badge>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>accent</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="accent outlined">Brand</wa-button>
<wa-button variant="neutral" appearance="accent outlined">Neutral</wa-button>
<wa-button variant="success" appearance="accent outlined">Success</wa-button>
<wa-button variant="warning" appearance="accent outlined">Warning</wa-button>
<wa-button variant="danger" appearance="accent outlined">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-accent wa-outlined">Brand</wa-button>
<wa-button variant="neutral" class="wa-accent wa-outlined">Neutral</wa-button>
<wa-button variant="success" class="wa-accent wa-outlined">Success</wa-button>
<wa-button variant="warning" class="wa-accent wa-outlined">Warning</wa-button>
<wa-button variant="danger" class="wa-accent wa-outlined">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>accent</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="accent">Brand</wa-button>
<wa-button variant="neutral" appearance="accent">Neutral</wa-button>
<wa-button variant="success" appearance="accent">Success</wa-button>
<wa-button variant="warning" appearance="accent">Warning</wa-button>
<wa-button variant="danger" appearance="accent">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-accent">Brand</wa-button>
<wa-button variant="neutral" class="wa-accent">Neutral</wa-button>
<wa-button variant="success" class="wa-accent">Success</wa-button>
<wa-button variant="warning" class="wa-accent">Warning</wa-button>
<wa-button variant="danger" class="wa-accent">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>filled</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="filled outlined">Brand</wa-button>
<wa-button variant="neutral" appearance="filled outlined">Neutral</wa-button>
<wa-button variant="success" appearance="filled outlined">Success</wa-button>
<wa-button variant="warning" appearance="filled outlined">Warning</wa-button>
<wa-button variant="danger" appearance="filled outlined">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-filled wa-outlined">Brand</wa-button>
<wa-button variant="neutral" class="wa-filled wa-outlined">Neutral</wa-button>
<wa-button variant="success" class="wa-filled wa-outlined">Success</wa-button>
<wa-button variant="warning" class="wa-filled wa-outlined">Warning</wa-button>
<wa-button variant="danger" class="wa-filled wa-outlined">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="filled">Brand</wa-button>
<wa-button variant="neutral" appearance="filled">Neutral</wa-button>
<wa-button variant="success" appearance="filled">Success</wa-button>
<wa-button variant="warning" appearance="filled">Warning</wa-button>
<wa-button variant="danger" appearance="filled">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-filled">Brand</wa-button>
<wa-button variant="neutral" class="wa-filled">Neutral</wa-button>
<wa-button variant="success" class="wa-filled">Success</wa-button>
<wa-button variant="warning" class="wa-filled">Warning</wa-button>
<wa-button variant="danger" class="wa-filled">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="outlined">Brand</wa-button>
<wa-button variant="neutral" appearance="outlined">Neutral</wa-button>
<wa-button variant="success" appearance="outlined">Success</wa-button>
<wa-button variant="warning" appearance="outlined">Warning</wa-button>
<wa-button variant="danger" appearance="outlined">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-outlined">Brand</wa-button>
<wa-button variant="neutral" class="wa-outlined">Neutral</wa-button>
<wa-button variant="success" class="wa-outlined">Success</wa-button>
<wa-button variant="warning" class="wa-outlined">Warning</wa-button>
<wa-button variant="danger" class="wa-outlined">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>plain</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="plain">Brand</wa-button>
<wa-button variant="neutral" appearance="plain">Neutral</wa-button>
<wa-button variant="success" appearance="plain">Success</wa-button>
<wa-button variant="warning" appearance="plain">Warning</wa-button>
<wa-button variant="danger" appearance="plain">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-plain">Brand</wa-button>
<wa-button variant="neutral" class="wa-plain">Neutral</wa-button>
<wa-button variant="success" class="wa-plain">Success</wa-button>
<wa-button variant="warning" class="wa-plain">Warning</wa-button>
<wa-button variant="danger" class="wa-plain">Danger</wa-button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Callout</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>accent</code> + <code>outlined</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="accent outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="accent outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="accent outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="accent outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="accent outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>accent</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="accent">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="accent">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="accent">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="accent">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="accent">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-accent">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-accent">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-accent">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-accent">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-accent">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>filled</code> + <code>outlined</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="filled outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="filled outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="filled outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="filled outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="filled outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="filled">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="filled">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="filled">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="filled">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-filled">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-filled">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-filled">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-filled">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>plain</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="plain">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="plain">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="plain">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="plain">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="plain">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-plain">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-plain">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-plain">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-plain">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-plain">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Tag</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>accent</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="accent outlined">Brand</wa-tag>
<wa-tag variant="neutral" appearance="accent outlined">Neutral</wa-tag>
<wa-tag variant="success" appearance="accent outlined">Success</wa-tag>
<wa-tag variant="warning" appearance="accent outlined">Warning</wa-tag>
<wa-tag variant="danger" appearance="accent outlined">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-accent wa-outlined">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-accent wa-outlined">Neutral</wa-tag>
<wa-tag variant="success" class="wa-accent wa-outlined">Success</wa-tag>
<wa-tag variant="warning" class="wa-accent wa-outlined">Warning</wa-tag>
<wa-tag variant="danger" class="wa-accent wa-outlined">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>accent</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="accent">Brand</wa-tag>
<wa-tag variant="neutral" appearance="accent">Neutral</wa-tag>
<wa-tag variant="success" appearance="accent">Success</wa-tag>
<wa-tag variant="warning" appearance="accent">Warning</wa-tag>
<wa-tag variant="danger" appearance="accent">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-accent">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-accent">Neutral</wa-tag>
<wa-tag variant="success" class="wa-accent">Success</wa-tag>
<wa-tag variant="warning" class="wa-accent">Warning</wa-tag>
<wa-tag variant="danger" class="wa-accent">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>filled</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="filled outlined">Brand</wa-tag>
<wa-tag variant="neutral" appearance="filled outlined">Neutral</wa-tag>
<wa-tag variant="success" appearance="filled outlined">Success</wa-tag>
<wa-tag variant="warning" appearance="filled outlined">Warning</wa-tag>
<wa-tag variant="danger" appearance="filled outlined">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-filled wa-outlined">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-filled wa-outlined">Neutral</wa-tag>
<wa-tag variant="success" class="wa-filled wa-outlined">Success</wa-tag>
<wa-tag variant="warning" class="wa-filled wa-outlined">Warning</wa-tag>
<wa-tag variant="danger" class="wa-filled wa-outlined">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="filled">Brand</wa-tag>
<wa-tag variant="neutral" appearance="filled">Neutral</wa-tag>
<wa-tag variant="success" appearance="filled">Success</wa-tag>
<wa-tag variant="warning" appearance="filled">Warning</wa-tag>
<wa-tag variant="danger" appearance="filled">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-filled">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-filled">Neutral</wa-tag>
<wa-tag variant="success" class="wa-filled">Success</wa-tag>
<wa-tag variant="warning" class="wa-filled">Warning</wa-tag>
<wa-tag variant="danger" class="wa-filled">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="outlined">Brand</wa-tag>
<wa-tag variant="neutral" appearance="outlined">Neutral</wa-tag>
<wa-tag variant="success" appearance="outlined">Success</wa-tag>
<wa-tag variant="warning" appearance="outlined">Warning</wa-tag>
<wa-tag variant="danger" appearance="outlined">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-outlined">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-outlined">Neutral</wa-tag>
<wa-tag variant="success" class="wa-outlined">Success</wa-tag>
<wa-tag variant="warning" class="wa-outlined">Warning</wa-tag>
<wa-tag variant="danger" class="wa-outlined">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>plain</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="plain">Brand</wa-tag>
<wa-tag variant="neutral" appearance="plain">Neutral</wa-tag>
<wa-tag variant="success" appearance="plain">Success</wa-tag>
<wa-tag variant="warning" appearance="plain">Warning</wa-tag>
<wa-tag variant="danger" appearance="plain">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-plain">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-plain">Neutral</wa-tag>
<wa-tag variant="success" class="wa-plain">Success</wa-tag>
<wa-tag variant="warning" class="wa-plain">Warning</wa-tag>
<wa-tag variant="danger" class="wa-plain">Danger</wa-tag>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Form Controls</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-stack">
<wa-input appearance="outlined" placeholder="Input"></wa-input>
<wa-select appearance="outlined" placeholder="Select">
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-textarea appearance="outlined" placeholder="Textarea"></wa-textarea>
</div>
</td>
<td>
<div class="wa-stack">
<wa-input class="wa-outlined" placeholder="Input"></wa-input>
<wa-select class="wa-outlined" placeholder="Select">
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-textarea class="wa-outlined" placeholder="Textarea"></wa-textarea>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-stack">
<wa-input appearance="filled" placeholder="Input"></wa-input>
<wa-select appearance="filled" placeholder="Select">
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-textarea appearance="filled" placeholder="Textarea"></wa-textarea>
</div>
</td>
<td>
<div class="wa-stack">
<wa-input class="wa-filled" placeholder="Input"></wa-input>
<wa-select class="wa-filled" placeholder="Select">
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-textarea class="wa-filled" placeholder="Textarea"></wa-textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,698 @@
<h3>Badge</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>variant=""</code></th>
<th><code>.wa-[variant]</code></th>
</thead>
<tbody>
<tr>
<th><code>brand</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="brand" appearance="accent">Accent</wa-badge>
<wa-badge variant="brand" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="brand" appearance="filled">Filled</wa-badge>
<wa-badge variant="brand" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="brand" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-brand" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-brand" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-brand" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-brand" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-brand" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-brand" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>neutral</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="neutral" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="neutral" appearance="accent">Accent</wa-badge>
<wa-badge variant="neutral" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="neutral" appearance="filled">Filled</wa-badge>
<wa-badge variant="neutral" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="neutral" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-neutral" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-neutral" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-neutral" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-neutral" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-neutral" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-neutral" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>success</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="success" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="success" appearance="accent">Accent</wa-badge>
<wa-badge variant="success" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="success" appearance="filled">Filled</wa-badge>
<wa-badge variant="success" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="success" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-success" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-success" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-success" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-success" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-success" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-success" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>warning</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="warning" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="warning" appearance="accent">Accent</wa-badge>
<wa-badge variant="warning" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="warning" appearance="filled">Filled</wa-badge>
<wa-badge variant="warning" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="warning" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-warning" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-warning" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-warning" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-warning" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-warning" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-warning" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>danger</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="danger" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="danger" appearance="accent">Accent</wa-badge>
<wa-badge variant="danger" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="danger" appearance="filled">Filled</wa-badge>
<wa-badge variant="danger" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="danger" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-danger" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-danger" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-danger" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-danger" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-danger" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-danger" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>variant=""</code></th>
<th><code>.wa-[variant]</code></th>
</thead>
<tbody>
<tr>
<th><code>brand</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="accent outlined">A+O</wa-button>
<wa-button variant="brand" appearance="accent">Accent</wa-button>
<wa-button variant="brand" appearance="filled outlined">F+O</wa-button>
<wa-button variant="brand" appearance="filled">Filled</wa-button>
<wa-button variant="brand" appearance="outlined">Outlined</wa-button>
<wa-button variant="brand" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-brand" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-brand" appearance="accent">Accent</wa-button>
<wa-button class="wa-brand" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-brand" appearance="filled">Filled</wa-button>
<wa-button class="wa-brand" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-brand" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>neutral</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="neutral" appearance="accent outlined">A+O</wa-button>
<wa-button variant="neutral" appearance="accent">Accent</wa-button>
<wa-button variant="neutral" appearance="filled outlined">F+O</wa-button>
<wa-button variant="neutral" appearance="filled">Filled</wa-button>
<wa-button variant="neutral" appearance="outlined">Outlined</wa-button>
<wa-button variant="neutral" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-neutral" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-neutral" appearance="accent">Accent</wa-button>
<wa-button class="wa-neutral" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-neutral" appearance="filled">Filled</wa-button>
<wa-button class="wa-neutral" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-neutral" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>success</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="success" appearance="accent outlined">A+O</wa-button>
<wa-button variant="success" appearance="accent">Accent</wa-button>
<wa-button variant="success" appearance="filled outlined">F+O</wa-button>
<wa-button variant="success" appearance="filled">Filled</wa-button>
<wa-button variant="success" appearance="outlined">Outlined</wa-button>
<wa-button variant="success" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-success" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-success" appearance="accent">Accent</wa-button>
<wa-button class="wa-success" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-success" appearance="filled">Filled</wa-button>
<wa-button class="wa-success" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-success" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>warning</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="warning" appearance="accent outlined">A+O</wa-button>
<wa-button variant="warning" appearance="accent">Accent</wa-button>
<wa-button variant="warning" appearance="filled outlined">F+O</wa-button>
<wa-button variant="warning" appearance="filled">Filled</wa-button>
<wa-button variant="warning" appearance="outlined">Outlined</wa-button>
<wa-button variant="warning" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-warning" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-warning" appearance="accent">Accent</wa-button>
<wa-button class="wa-warning" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-warning" appearance="filled">Filled</wa-button>
<wa-button class="wa-warning" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-warning" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>danger</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="danger" appearance="accent outlined">A+O</wa-button>
<wa-button variant="danger" appearance="accent">Accent</wa-button>
<wa-button variant="danger" appearance="filled outlined">F+O</wa-button>
<wa-button variant="danger" appearance="filled">Filled</wa-button>
<wa-button variant="danger" appearance="outlined">Outlined</wa-button>
<wa-button variant="danger" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-danger" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-danger" appearance="accent">Accent</wa-button>
<wa-button class="wa-danger" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-danger" appearance="filled">Filled</wa-button>
<wa-button class="wa-danger" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-danger" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Callout</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>variant=""</code></th>
<th><code>.wa-[variant]</code></th>
</thead>
<tbody>
<tr>
<th><code>brand</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="accent outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="brand" appearance="accent">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="brand" appearance="filled outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="brand" appearance="filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="brand" appearance="outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="brand" appearance="plain">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-brand" appearance="accent outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-brand" appearance="accent">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-brand" appearance="filled outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-brand" appearance="filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-brand" appearance="outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-brand" appearance="plain">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>neutral</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="neutral" appearance="accent outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="neutral" appearance="accent">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="neutral" appearance="filled outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="neutral" appearance="filled">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="neutral" appearance="outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="neutral" appearance="plain">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-neutral" appearance="accent outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-neutral" appearance="accent">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-neutral" appearance="filled outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-neutral" appearance="filled">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-neutral" appearance="outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-neutral" appearance="plain">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>success</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="success" appearance="accent outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="success" appearance="accent">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="success" appearance="filled outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="success" appearance="filled">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="success" appearance="outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="success" appearance="plain">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-success" appearance="accent outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-success" appearance="accent">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-success" appearance="filled outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-success" appearance="filled">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-success" appearance="outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-success" appearance="plain">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>warning</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="warning" appearance="accent outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="warning" appearance="accent">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="warning" appearance="filled outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="warning" appearance="filled">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="warning" appearance="outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="warning" appearance="plain">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-warning" appearance="accent outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-warning" appearance="accent">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-warning" appearance="filled outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-warning" appearance="filled">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-warning" appearance="outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-warning" appearance="plain">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>danger</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="danger" appearance="accent outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="danger" appearance="accent">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="danger" appearance="filled outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="danger" appearance="filled">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="danger" appearance="outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="danger" appearance="plain">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-danger" appearance="accent outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-danger" appearance="accent">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-danger" appearance="filled outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-danger" appearance="filled">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-danger" appearance="outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-danger" appearance="plain">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Tag</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>variant=""</code></th>
<th><code>.wa-[variant]</code></th>
</thead>
<tbody>
<tr>
<th><code>brand</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="brand" appearance="accent">Accent</wa-tag>
<wa-tag variant="brand" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="brand" appearance="filled">Filled</wa-tag>
<wa-tag variant="brand" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="brand" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-brand" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-brand" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-brand" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-brand" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-brand" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-brand" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>neutral</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="neutral" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="neutral" appearance="accent">Accent</wa-tag>
<wa-tag variant="neutral" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="neutral" appearance="filled">Filled</wa-tag>
<wa-tag variant="neutral" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="neutral" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-neutral" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-neutral" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-neutral" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-neutral" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-neutral" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-neutral" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>success</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="success" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="success" appearance="accent">Accent</wa-tag>
<wa-tag variant="success" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="success" appearance="filled">Filled</wa-tag>
<wa-tag variant="success" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="success" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-success" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-success" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-success" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-success" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-success" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-success" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>warning</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="warning" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="warning" appearance="accent">Accent</wa-tag>
<wa-tag variant="warning" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="warning" appearance="filled">Filled</wa-tag>
<wa-tag variant="warning" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="warning" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-warning" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-warning" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-warning" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-warning" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-warning" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-warning" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>danger</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="danger" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="danger" appearance="accent">Accent</wa-tag>
<wa-tag variant="danger" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="danger" appearance="filled">Filled</wa-tag>
<wa-tag variant="danger" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="danger" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-danger" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-danger" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-danger" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-danger" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-danger" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-danger" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,32 @@
<h3>Form Controls</h3>
```html {.example}
<form class="wa-stack">
<wa-input label="Input" placeholder="Placeholder"></wa-input>
<wa-select label="Select" value="option-1">
<wa-option value="option-1">Option 1</wa-option>
<wa-option value="option-2">Option 2</wa-option>
<wa-option value="option-3">Option 3</wa-option>
</wa-select>
<wa-textarea label="Textarea" placeholder="Placeholder"></wa-textarea>
<wa-radio-group label="Radio group" name="a" value="1">
<wa-radio value="1">Option 1</wa-radio>
<wa-radio value="2">Option 2</wa-radio>
<wa-radio value="3">Option 3</wa-radio>
</wa-radio-group>
<wa-checkbox>Checkbox</wa-checkbox>
<wa-switch>Switch</wa-switch>
<wa-slider label="Range"></wa-slider>
<wa-button>Button</wa-button>
</form>
```
<h3>Progress</h3>
```html {.example}
<div class="wa-stack">
<wa-progress-bar value="50" max="100"></wa-progress-bar>
<wa-progress-ring value="50" max="100"></wa-progress-ring>
<wa-spinner></wa-spinner>
</div>
```

View File

@@ -0,0 +1,745 @@
<h3>Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-button&gt;</code></th>
<th><code>&lt;button&gt;</code></th>
<th><code>.wa-button</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-button>Button</wa-button>
</td>
<td>
<button>Button</button>
</td>
<td>
<div class="wa-button">Button</div>
</td>
</tr>
<tr>
<th><code>.wa-brand</code></th>
<td>
<wa-button class="wa-brand">Brand</wa-button>
</td>
<td>
<button class="wa-brand">Brand</button>
</td>
<td>
<div class="wa-button wa-brand">Brand</div>
</td>
</tr>
<tr>
<th><code>.wa-neutral</code></th>
<td>
<wa-button class="wa-neutral">Neutral</wa-button>
</td>
<td>
<button class="wa-neutral">Neutral</button>
</td>
<td>
<div class="wa-button wa-neutral">Neutral</div>
</td>
</tr>
<tr>
<th><code>.wa-success</code></th>
<td>
<wa-button class="wa-success">Success</wa-button>
</td>
<td>
<button class="wa-success">Success</button>
</td>
<td>
<div class="wa-button wa-success">Success</div>
</td>
</tr>
<tr>
<th><code>.wa-warning</code></th>
<td>
<wa-button class="wa-warning">Warning</wa-button>
</td>
<td>
<button class="wa-warning">Warning</button>
</td>
<td>
<div class="wa-button wa-warning">Warning</div>
</td>
</tr>
<tr>
<th><code>.wa-danger</code></th>
<td>
<wa-button class="wa-danger">Danger</wa-button>
</td>
<td>
<button class="wa-danger">Danger</button>
</td>
<td>
<div class="wa-button wa-danger">Danger</div>
</td>
</tr>
<tr>
<th><code>.wa-accent</code></th>
<td>
<wa-button class="wa-accent">Accent</wa-button>
</td>
<td>
<button class="wa-accent">Accent</button>
</td>
<td>
<div class="wa-button wa-accent">Accent</div>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-button class="wa-filled">Filled</wa-button>
</td>
<td>
<button class="wa-filled">Filled</button>
</td>
<td>
<div class="wa-button wa-filled">Filled</div>
</td>
</tr>
<tr>
<th><code>.wa-outlined</code></th>
<td>
<wa-button class="wa-outlined">Outlined</wa-button>
</td>
<td>
<button class="wa-outlined">Outlined</button>
</td>
<td>
<div class="wa-button wa-outlined">Outlined</div>
</td>
</tr>
<tr>
<th><code>.wa-plain</code></th>
<td>
<wa-button class="wa-plain">Plain</wa-button>
</td>
<td>
<button class="wa-plain">Plain</button>
</td>
<td>
<div class="wa-button wa-plain">Plain</div>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-button class="wa-size-s">Small</wa-button>
</td>
<td>
<button class="wa-size-s">Small</button>
</td>
<td>
<div class="wa-button wa-size-s">Small</div>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-button class="wa-size-m">Medium</wa-button>
</td>
<td>
<button class="wa-size-m">Medium</button>
</td>
<td>
<div class="wa-button wa-size-m">Medium</div>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-button class="wa-size-l">Large</wa-button>
</td>
<td>
<button class="wa-size-l">Large</button>
</td>
<td>
<div class="wa-button wa-size-l">Large</div>
</td>
</tr>
<tr>
<th><code>.wa-pill</code></th>
<td>
<wa-button class="wa-pill">Pill</wa-button>
</td>
<td>
<button class="wa-pill">Pill</button>
</td>
<td>
<div class="wa-button wa-pill">Pill</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Callout</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-callout&gt;</code></th>
<th><code>.wa-callout</code></th>
</thead>
<tbody>
<tr>
<th class="test-failure"><em>default</em></th>
<td>
<wa-callout>Callout</wa-callout>
</td>
<td>
<div class="wa-callout">Callout</div>
</td>
</tr>
<tr>
<th><code>.wa-brand</code></th>
<td>
<wa-callout class="wa-brand">Brand</wa-callout>
</td>
<td>
<div class="wa-callout wa-brand">Brand</div>
</td>
</tr>
<tr>
<th><code>.wa-neutral</code></th>
<td>
<wa-callout class="wa-neutral">Neutral</wa-callout>
</td>
<td>
<div class="wa-callout wa-neutral">Neutral</div>
</td>
</tr>
<tr>
<th><code>.wa-success</code></th>
<td>
<wa-callout class="wa-success">Success</wa-callout>
</td>
<td>
<div class="wa-callout wa-success">Success</div>
</td>
</tr>
<tr>
<th><code>.wa-warning</code></th>
<td>
<wa-callout class="wa-warning">Warning</wa-callout>
</td>
<td>
<div class="wa-callout wa-warning">Warning</div>
</td>
</tr>
<tr>
<th><code>.wa-danger</code></th>
<td>
<wa-callout class="wa-danger">Danger</wa-callout>
</td>
<td>
<div class="wa-callout wa-danger">Danger</div>
</td>
</tr>
<tr>
<th><code>.wa-accent</code></th>
<td>
<wa-callout class="wa-accent">Accent</wa-callout>
</td>
<td>
<div class="wa-callout wa-accent">Accent</div>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-callout class="wa-filled">Filled</wa-callout>
</td>
<td>
<div class="wa-callout wa-filled">Filled</div>
</td>
</tr>
<tr>
<th><code>.wa-outlined</code></th>
<td>
<wa-callout class="wa-outlined">Outlined</wa-callout>
</td>
<td>
<div class="wa-callout wa-outlined">Outlined</div>
</td>
</tr>
<tr>
<th><code>.wa-plain</code></th>
<td>
<wa-callout class="wa-plain">Plain</wa-callout>
</td>
<td>
<div class="wa-callout wa-plain">Plain</div>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-callout class="wa-size-s">Small</wa-callout>
</td>
<td>
<div class="wa-callout wa-size-s">Small</div>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-callout class="wa-size-m">Medium</wa-callout>
</td>
<td>
<div class="wa-callout wa-size-m">Medium</div>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-callout class="wa-size-l">Large</wa-callout>
</td>
<td>
<div class="wa-callout wa-size-l">Large</div>
</td>
</tr>
<tr>
<th><code>.wa-pill</code></th>
<td>
<wa-callout class="wa-pill">Pill</wa-callout>
</td>
<td>
<div class="wa-callout wa-pill">Pill</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Checkbox</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-checkbox&gt;</code></th>
<th><code>&lt;input type="checkbox"&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-checkbox>Checkbox</wa-checkbox>
</td>
<td>
<label><input type="checkbox"></input> Checkbox</label>
</td>
</tr>
<tr>
<th><code>checked</code></th>
<td>
<wa-checkbox checked>Checkbox</wa-checkbox>
</td>
<td>
<label><input type="checkbox" checked></input> Checkbox</label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Color Picker</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-color-picker&gt;</code></th>
<th><code>&lt;input type="color"&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-color-picker label="Color Picker" value="#ffa07a"></wa-color-picker>
</td>
<td>
<label>Color Picker <input type="color" value="#ffa07a"></input></label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Details</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-details&gt;</code></th>
<th><code>&lt;details&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-details summary="Summary">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</wa-details>
</td>
<td>
<details>
<summary>Summary</summary>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</details>
</td>
</tr>
<tr>
<th><code>dir="rtl"</code></th>
<td>
<wa-details summary="تبديلني" lang="ar" dir="rtl">
استخدام طريقة لوريم إيبسوم لأنها تعطي توزيعاَ طبيعياَ -إلى حد ما- للأحرف عوضاً عن
</wa-details>
</td>
<td>
<details lang="ar" dir="rtl">
<summary>تبديلني</summary>
<p>استخدام طريقة لوريم إيبسوم لأنها تعطي توزيعاَ طبيعياَ -إلى حد ما- للأحرف عوضاً عن</p>
</details>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3 class="test-failure">Input</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-input&gt;</code></th>
<th><code>&lt;input&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-input label="Input" placeholder="Placeholder"></wa-input>
</td>
<td>
<label>Input <input type="text" placeholder="Placeholder"></input></label>
</td>
</tr>
<tr>
<th><code>type="password"</code></th>
<td>
<wa-input label="Input (password)" type="password"></wa-input>
</td>
<td>
<label>Input (password) <input type="password"></input></label>
</td>
</tr>
<tr>
<th><code>type="date"</code></th>
<td>
<wa-input label="Input (date)" type="date"></wa-input>
</td>
<td>
<label>Input (date) <input type="date"></input></label>
</td>
</tr>
<tr>
<th><code>type="time"</code></th>
<td>
<wa-input label="Input (time)" type="time"></wa-input>
</td>
<td>
<label>Input (time) <input type="time"></input></label>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-input label="Input (filled)" placeholder="Placeholder" class="wa-filled"></wa-input>
</td>
<td>
<label>Input (filled) <input type="text" placeholder="Placeholder" class="wa-filled"></input></label>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-input label="Input (small)" placeholder="Placeholder" class="wa-size-s"></wa-input>
</td>
<td>
<label class="wa-size-s">Input (small) <input type="text" placeholder="Placeholder"></input></label>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-input label="Input (medium)" placeholder="Placeholder" class="wa-size-m"></wa-input>
</td>
<td>
<label class="wa-size-m">Input (medium) <input type="text" placeholder="Placeholder"></input></label>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-input label="Input (large)" placeholder="Placeholder" class="wa-size-l"></wa-input>
</td>
<td>
<label class="wa-size-l">Input (large) <input type="text" placeholder="Placeholder"></input></label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Progress Bar</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-progress-bar&gt;</code></th>
<th><code>&lt;progress&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-progress-bar value="50" max="100"></wa-progress-bar>
</td>
<td>
<progress value="50" max="100"></progress>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Radio</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-radio&gt;</code></th>
<th><code>&lt;input type="radio"&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-radio>Radio</wa-radio>
</td>
<td>
<label><input type="radio"></input> Radio</label>
</td>
</tr>
<tr>
<th><code>checked</code></th>
<td>
<wa-radio-group value="1">
<wa-radio value="1">Radio</wa-radio>
</wa-radio-group>
</td>
<td>
<label><input type="radio" checked></input> Radio</label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Select</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-select&gt;</code></th>
<th><code>&lt;select&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-select label="Select" value="1">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label>Select
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-select label="Select (filled)" value="1" class="wa-filled">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label class="wa-filled">Select (filled)
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-select label="Select (small)" value="1" class="wa-size-s">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label class="wa-size-s">Select (small)
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-select label="Select (medium)" value="1" class="wa-size-m">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label class="wa-size-m">Select (medium)
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-select label="Select (large)" value="1" class="wa-size-l">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label class="wa-size-l">Select (large)
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3 class="test-failure">Slider</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-slider&gt;</code></th>
<th><code>&lt;input type="range"&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-slider label="Slider"></wa-slider>
</td>
<td>
<label>Slider <input type="range"></input></label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3 class="test-failure">Textarea</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-textarea&gt;</code></th>
<th><code>&lt;textarea&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-textarea label="Textarea" placeholder="Placeholder" rows="2"></wa-textarea>
</td>
<td>
<label>Textarea <textarea placeholder="Placeholder" rows="2"></textarea></label>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-textarea label="Textarea (filled)" placeholder="Placeholder" class="wa-filled" rows="2"></wa-textarea>
</td>
<td>
<label>Textarea (filled) <textarea placeholder="Placeholder" class="wa-filled" rows="2"></textarea></label>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-textarea label="Textarea (small)" placeholder="Placeholder" class="wa-size-s" rows="2"></wa-textarea>
</td>
<td>
<label class="wa-size-s">Textarea (small) <textarea placeholder="Placeholder" rows="2"></textarea></label>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-textarea label="Textarea (medium)" placeholder="Placeholder" class="wa-size-m" rows="2"></wa-textarea>
</td>
<td>
<label class="wa-size-m">Textarea (medium) <textarea placeholder="Placeholder" rows="2"></textarea></label>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-textarea label="Textarea (large)" placeholder="Placeholder" class="wa-size-l" rows="2"></wa-textarea>
</td>
<td>
<label class="wa-size-l">Textarea (large) <textarea placeholder="Placeholder" rows="2"></textarea></label>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,856 @@
<h3>Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-button size="small">Button</wa-button>
</td>
<td>
<wa-button class="wa-size-s">Button</wa-button>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-button size="medium">Button</wa-button>
</td>
<td>
<wa-button class="wa-size-m">Button</wa-button>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-button size="large">Button</wa-button>
</td>
<td>
<wa-button class="wa-size-l">Button</wa-button>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Button Group</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-button-group orientation="horizontal" size="small">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
<td>
<wa-button-group orientation="horizontal" class="wa-size-s">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-button-group orientation="horizontal" size="medium">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
<td>
<wa-button-group orientation="horizontal" class="wa-size-m">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-button-group orientation="horizontal" size="large">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
<td>
<wa-button-group orientation="horizontal" class="wa-size-l">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Callout</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-callout size="small">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
<td>
<wa-callout class="wa-size-s">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-callout size="medium">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
<td>
<wa-callout class="wa-size-m">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-callout size="large">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
<td>
<wa-callout class="wa-size-l">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Card</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-card size="small">
Card
</wa-card>
</td>
<td>
<wa-card class="wa-size-s">
Card
</wa-card>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-card size="medium">
Card
</wa-card>
</td>
<td>
<wa-card class="wa-size-m">
Card
</wa-card>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-card size="large">
Card
</wa-card>
</td>
<td>
<wa-card class="wa-size-l">
Card
</wa-card>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Checkbox</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-checkbox hint="Hint" size="small">Checkbox</wa-checkbox>
</td>
<td>
<wa-checkbox hint="Hint" class="wa-size-s">Checkbox</wa-checkbox>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-checkbox hint="Hint" size="medium">Checkbox</wa-checkbox>
</td>
<td>
<wa-checkbox hint="Hint" class="wa-size-m">Checkbox</wa-checkbox>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-checkbox hint="Hint" size="large">Checkbox</wa-checkbox>
</td>
<td>
<wa-checkbox hint="Hint" class="wa-size-l">Checkbox</wa-checkbox>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Color Picker</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-color-picker size="small" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
<td>
<wa-color-picker class="wa-size-s" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-color-picker size="medium" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
<td>
<wa-color-picker class="wa-size-m" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-color-picker size="large" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
<td>
<wa-color-picker class="wa-size-l" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Dropdown</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-dropdown size="small">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
<td>
<wa-dropdown class="wa-size-s">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-dropdown size="medium">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
<td>
<wa-dropdown class="wa-size-m">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-dropdown size="large">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
<td>
<wa-dropdown class="wa-size-l">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Menu</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-menu size="small">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
<td>
<wa-menu class="wa-size-s">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-menu size="medium">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
<td>
<wa-menu class="wa-size-m">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-menu size="large">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
<td>
<wa-menu class="wa-size-l">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Input</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-input size="small" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
<td>
<wa-input class="wa-size-s" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-input size="medium" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
<td>
<wa-input class="wa-size-m" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-input size="large" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
<td>
<wa-input class="wa-size-l" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Radio</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-radio size="small">Radio</wa-radio>
</td>
<td>
<wa-radio class="wa-size-s">Radio</wa-radio>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-radio size="medium">Radio</wa-radio>
</td>
<td>
<wa-radio class="wa-size-m">Radio</wa-radio>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-radio size="large">Radio</wa-radio>
</td>
<td>
<wa-radio class="wa-size-l">Radio</wa-radio>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Radio Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button size="small" value="1">Radio</wa-radio-button>
<wa-radio-button size="small" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button class="wa-size-s" value="1">Radio</wa-radio-button>
<wa-radio-button class="wa-size-s" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button size="medium" value="1">Radio</wa-radio-button>
<wa-radio-button size="medium" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button class="wa-size-m" value="1">Radio</wa-radio-button>
<wa-radio-button class="wa-size-m" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button size="large" value="1">Radio</wa-radio-button>
<wa-radio-button size="large" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button class="wa-size-l" value="1">Radio</wa-radio-button>
<wa-radio-button class="wa-size-l" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Radio Group</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" size="small">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" size="small">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" class="wa-size-s">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" class="wa-size-s">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" size="medium">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" size="medium">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" class="wa-size-m">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" class="wa-size-m">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" size="large">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" size="large">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" class="wa-size-l">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" class="wa-size-l">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Rating</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-rating size="small"></wa-rating>
</td>
<td>
<wa-rating class="wa-size-s"></wa-rating>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-rating size="medium"></wa-rating>
</td>
<td>
<wa-rating class="wa-size-m"></wa-rating>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-rating size="large"></wa-rating>
</td>
<td>
<wa-rating class="wa-size-l"></wa-rating>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Select</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-select size="small" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<wa-select class="wa-size-s" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-select size="medium" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<wa-select class="wa-size-m" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-select size="large" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<wa-select class="wa-size-l" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Switch</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-switch hint="Hint" size="small">Switch</wa-switch>
</td>
<td>
<wa-switch hint="Hint" class="wa-size-s">Switch</wa-switch>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-switch hint="Hint" size="medium">Switch</wa-switch>
</td>
<td>
<wa-switch hint="Hint" class="wa-size-m">Switch</wa-switch>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-switch hint="Hint" size="large">Switch</wa-switch>
</td>
<td>
<wa-switch hint="Hint" class="wa-size-l">Switch</wa-switch>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Textarea</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-textarea size="small" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
<td>
<wa-textarea class="wa-size-s" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-textarea size="medium" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
<td>
<wa-textarea class="wa-size-m" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-textarea size="large" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
<td>
<wa-textarea class="wa-size-l" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -1,63 +1,11 @@
<!DOCTYPE html>
<html lang="en" data-fa-kit-code="b10bfbde90" data-cdn-url="{% cdnUrl %}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{ description }}">
{% if noindex %}<meta name="robots" content="noindex">{% endif %}
<title>{{ title }}</title>
<link rel="icon" href="/assets/images/webawesome-logo.svg" />
<link rel="apple-touch-icon" href="/assets/images/app-icon.png">
{# Scripts #}
{# Hydration stuff #}
<script src="/assets/scripts/hydration-errors.js"></script>
<link rel="stylesheet" href="/assets/styles/hydration-errors.css">
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<script type="module" src="https://cdn.jsdelivr.net/npm/@hotwired/turbo@8.0.10/+esm"></script>
{# Web Awesome #}
<script type="module" src="/dist/webawesome.ssr-loader.js"></script>
<link rel="stylesheet" id="theme-stylesheet" />
<link rel="stylesheet" href="/dist/themes/applied.css" />
<link id="color-stylesheet" rel="stylesheet" href="/dist/themes/layout.css" />
<link id="color-stylesheet" rel="stylesheet" href="/dist/themes/utilities.css" />
<link rel="stylesheet" href="/dist/themes/forms.css" />
{# Set the theme to prevent flashing #}
<script>
function getColorScheme() {
return localStorage.getItem('colorScheme') || 'auto';
}
function getPresetTheme () {
return localStorage.getItem('presetTheme') || 'default';
}
function isDark() {
const colorScheme = getColorScheme()
if (colorScheme === 'auto') {
return window.matchMedia('(prefers-color-scheme: dark)').matches;
}
return colorScheme === 'dark';
}
const stylesheet = document.getElementById("theme-stylesheet")
let preset = getPresetTheme()
stylesheet.href = `/dist/themes/${preset}.css`
document.documentElement.classList.toggle(
`wa-theme-${preset}-dark`,
isDark()
);
</script>
{% include 'head.njk' %}
</head>
<body class="layout-{{ layout | stripExtension }}">
{% block beforeContent %}{% endblock %}
{% block header %}{% endblock %}
{% block content %}
{{ content | safe }}

38
docs/_layouts/block.njk Normal file
View File

@@ -0,0 +1,38 @@
{% set hasSidebar = true %}
{% set hasOutline = true %}
{% extends '../_includes/base.njk' %}
{# Component header #}
{% block header %}
{% include 'breadcrumbs.njk' %}
<h1 class="title">{{ title }}</h1>
<div class="block-info">
{% set snippets = (elements or element or snippets or snippet) | dict %}
{% for snippet, link in snippets %}
{% if snippet %}
<code class="class">
{%- if link -%}
<a href="{{ link }}">{{ snippet }}</a>
{%- else -%}
{{ snippet }}
{%- endif-%}
</code>
{%- endif %}
{% endfor %}
{% include '../_includes/status.njk' %}
</div>
{% if description %}
<p class="summary">
{{ description | inlineMarkdown | safe }}
</p>
{% endif %}
{% block notes %}{% endblock %}
{% endblock %}
{# Content #}
{% block content %}
{{ content | safe }}
{% endblock %}

View File

@@ -1,35 +1,15 @@
{% set hasSidebar = true %}
{% set hasOutline = true %}
{% extends '../_layouts/block.njk' %}
{% set component = components[page.fileSlug] %}
{% set description = component.summary %}
{% extends '../_includes/base.njk' %}
{# Component header #}
{% block beforeContent %}
<h1 class="title">{{ title }}</h1>
<div class="component-info">
<code class="component-tag">&lt;{{ component.tagName }}&gt;</code>
<wa-badge variant="neutral">Since {{ component.since }}</wa-badge>
<wa-badge
{% if component.status == 'stable' %}variant="brand"{% endif %}
{% if component.status == 'experimental' %}variant="warning"{% endif %}
>
{{ component.status }}
</wa-badge>
{# TODO - add a pro flag for pro components #}
{% if component.tagName == 'wa-page' %}
<wa-badge class="pro">PRO</wa-badge>
{% endif %}
</div>
<p class="component-summary">
{{ component.summary | inlineMarkdown | safe }}
</p>
{% endblock %}
{# Content #}
{% block content %}
{{ content | safe }}
{% block notes %}
{% if native %}
<wa-callout variant="success">
<wa-icon slot="icon" name="lightbulb" variant="regular"></wa-icon>
Just want the styles?
Check out the <a href="/docs/native/{{ native }}/">{{ ('/docs/native/' + native + '/') | getTitleFromUrl }} native styles</a>!
</wa-callout>
{% endif %}
{% endblock %}
{# Component API #}
@@ -37,6 +17,7 @@
{# Slots #}
{% if component.slots.length %}
<h2>Slots</h2>
<p>Learn more about <a href="/docs/usage/#slots">using slots</a>.</p>
<div class="table-scroll">
<table class="component-table">
@@ -67,6 +48,7 @@
{# Properties #}
{% if component.properties.length %}
<h2>Attributes & Properties</h2>
<p>Learn more about <a href="/docs/usage/#attributes-and-properties">attributes and properties</a>.</p>
<div class="table-scroll">
<table class="component-table">
@@ -113,6 +95,8 @@
{# Methods #}
{% if component.methods.length %}
<h2>Methods</h2>
<p>Learn more about <a href="/docs/usage/#methods">methods</a>.</p>
<div class="table-scroll">
<table class="component-table">
<thead>
@@ -143,34 +127,10 @@
</div>
{% endif %}
{# States #}
{% if component.states.length %}
<h2>States</h2>
<div class="table-scroll">
<table class="component-table">
<thead>
<tr>
<th class="table-name">Name</th>
<th class="table-description">Description</th>
<th class="table-selector">CSS selector</th>
</tr>
</thead>
<tbody>
{% for state in component.states %}
<tr>
<td class="table-name"><code>{{ state.name }}</code></td>
<td class="table-description">{{ state.description | inlineMarkdown | safe }}</td>
<td class="table-selector"><code>[data-state-{{ state.name }}]</code></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{# Events #}
{% if component.events.length %}
<h2>Events</h2>
<p>Learn more about <a href="/docs/usage/#events">events</a>.</p>
<div class="table-scroll">
<table class="component-table">
@@ -197,6 +157,7 @@
{# Custom Properties #}
{% if component.cssProperties.length %}
<h2>CSS custom properties</h2>
<p>Learn more about <a href="/docs/customizing/#custom-properties">CSS custom properties</a>.</p>
<div class="table-scroll">
<table class="component-table">
@@ -225,9 +186,37 @@
</div>
{% endif %}
{# Custom States #}
{% if component.cssStates.length %}
<h2>Custom States</h2>
<p>Learn more about <a href="/docs/customizing/#custom-states">custom states</a>.</p>
<div class="table-scroll">
<table class="component-table">
<thead>
<tr>
<th class="table-name">Name</th>
<th class="table-description">Description</th>
<th class="table-selector">CSS selector</th>
</tr>
</thead>
<tbody>
{% for state in component.cssStates %}
<tr>
<td class="table-name"><code>{{ state.name }}</code></td>
<td class="table-description">{{ state.description | inlineMarkdown | safe }}</td>
<td class="table-selector"><code>:state({{ state.name }})</code></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{# CSS Parts #}
{% if component.cssParts.length %}
<h2>CSS parts</h2>
<p>Learn more about <a href="/docs/customizing/#css-parts">CSS parts</a>.</p>
<div class="table-scroll">
<table class="component-table">
@@ -253,7 +242,7 @@
{% if component.dependencies.length %}
<h2>Dependencies</h2>
<p>
This component automatically imports the following elements. Subdependencies, if any exist, will also be included in this list.
This component automatically imports the following elements. Sub-dependencies, if any exist, will also be included in this list.
</p>
<ul class="dependency-list">
@@ -266,7 +255,7 @@
{# Importing #}
<h2>Importing</h2>
<p>
The <a href="/docs/#autoloading">autoloader</a> is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets.
The <a href="/docs/installation/#quick-start-autoloading-via-cdn">autoloader</a> is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets.
</p>
<wa-tab-group label="How would you like to import this component?">

32
docs/_layouts/element.njk Normal file
View File

@@ -0,0 +1,32 @@
{% extends '../_layouts/block.njk' %}
{# Component header #}
{% block notes %}
{% if component %}
<wa-callout variant="success">
<wa-icon slot="icon" name="lightbulb" variant="regular"></wa-icon>
Want to do more?
Check out the {% for name in (component | toList) -%}
{{ ' and ' if loop.last and not loop.first }}<a href="/docs/components/{{ name }}"><code>&lt;wa-{{ name }}&gt;</code></a>{{ ', ' if not loop.last }}
{%- endfor %} component{{ 's' if (component | isList) }}</a>!
</wa-callout>
{% endif %}
{% endblock %}
{% block afterContent %}
{% if file %}
{% markdown %}
## Opting In to Native {{ title }} Styles
If you want to use the Native {{ title }} styles **without including the entirety of Web Awesome Native Styles**,
you can include the following CSS files from the Web Awesome CDN.
{% set stylesheet = file %}
{% include 'import-stylesheet-code.md.njk' %}
To use all of Web Awesome Native styles, follow the [instructions on the Native Styles overview page](../).
{% endmarkdown %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,25 @@
---
layout: page-outline
tags: ["overview"]
---
{% set forTag = forTag or (page.url | split('/') | last) %}
{% if description %}
<div class="index-summary">{{ description | markdown | safe }}</div>
{% endif %}
<div id="block-filter">
<wa-input type="search" placeholder="Search {{ title }}" clearable autofocus>
<wa-icon slot="prefix" name="search"></wa-icon>
</wa-input>
</div>
{% set allPages = collections[forTag] %}
{% include "grouped-pages.njk" %}
<link href="/assets/styles/filter.css" rel="stylesheet">
<script type="module" src="/assets/scripts/filter.js"></script>
{% if content | trim %}
<wa-divider style="--spacing: var(--wa-space-3xl)"></wa-divider> {# Temp fix for spacing issue #}
{{ content | safe }}
{% endif %}

View File

@@ -1,4 +0,0 @@
{% set hasSidebar = true %}
{% set hasOutline = true %}
{% extends "../_includes/base-wide.njk" %}

126
docs/_layouts/palette.njk Normal file
View File

@@ -0,0 +1,126 @@
{% set hasSidebar = true %}
{% set hasOutline = true %}
{# {% set forceTheme = page.fileSlug %} #}
{% extends '../_layouts/block.njk' %}
{% set paletteId = page.fileSlug %}
{% block afterContent %}
<style>@import url('/dist/styles/color/{{ paletteId }}.css') layer(palette.{{ paletteId }});</style>
{% set tints = ["95", "90", "80", "70", "60", "50", "40", "30", "20", "10", "05"] %}
<table class="colors wa-palette-{{ paletteId }}">
<thead>
<tr>
<th></th>
<th class="core-column">Core tint</th>
{% for tint in tints -%}
<th>{{ tint }}</th>
{%- endfor %}
</tr>
</thead>
{% for hue in hues -%}
<tr>
<th>{{ hue | capitalize }}</th>
<td class="core-column">
<div class="color swatch" style="background-color: var(--wa-color-{{ hue }}); color: var(--wa-color-{{ hue }}-{{ '05' if palettes[paletteId][hue].maxChromaTint > 60 else '95' }});">
{{ palettes[paletteId][hue].maxChromaTint }}
<wa-copy-button value="--wa-color-{{ hue }}" copy-label="--wa-color-{{ hue }}"></wa-copy-button>
</div>
</td>
{% for tint in tints -%}
<td>
<div class="color swatch" style="background-color: var(--wa-color-{{ hue }}-{{ tint }})">
<wa-copy-button value="--wa-color-{{ hue }}-{{ tint }}" copy-label="--wa-color-{{ hue }}-{{ tint }}"></wa-copy-button>
</div>
</td>
{%- endfor -%}
</tr>
{%- endfor %}
</table>
<h2>Used By</h2>
<section class="index-grid">
{% for page in collections.theme %}
{%- if page.data.palette == paletteId -%}
{% include "page-card.njk" %}
{%- endif -%}
{% endfor %}
</section>
{% markdown %}
## Color Contrast
Web Awesome color scales are designed to guarantee certain contrast ratios,
both per [WCAG 2.1 success criteria](https://www.w3.org/TR/WCAG21/#contrast-minimum)
as well as the emergent APCA specification _(planned)_,
so you can ensure that text is both legible to all users, and legally conformant.
### Level 1
A difference of `40` ensures a minimum **3:1** contrast ratio, suitable for large text and icons (AA).
{% endmarkdown %}
{% set difference = 40 %}
{% include "contrast-table.njk" %}
{% markdown %}
This also goes for a difference of `45`:
{% endmarkdown %}
{% set difference = 45 %}
{% include "contrast-table.njk" %}
{% markdown %}
### Level 2
A difference of `50` ensures a minimum **4.5:1** contrast ratio, suitable for normal text (AA) and large text (AAA)
{% endmarkdown %}
{% set difference = 50 %}
{% include "contrast-table.njk" %}
{% markdown %}
This also goes for a difference of `55`:
{% endmarkdown %}
{% set difference = 55 %}
{% include "contrast-table.njk" %}
{% markdown %}
### Level 3
A difference of `60` ensures a minimum **7:1** contrast ratio, suitable for all text (AAA)
{% endmarkdown %}
{% set difference = 60 %}
{% include "contrast-table.njk" %}
{% markdown %}
This also goes for a difference of `65`:
{% endmarkdown %}
{% set difference = 65 %}
{% include "contrast-table.njk" %}
{% markdown %}
## How to use this palette
If you are using a Web Awesome theme that uses this palette, it will already be included.
To use a different palette than a theme default, or to use it in a custom theme, you can import this palette directly from the Web Awesome CDN.
{% set stylesheet = 'styles/color/' + page.fileSlug + '.css' %}
{% include 'import-stylesheet-code.md.njk' %}
{% endmarkdown %}
{% endblock %}

View File

@@ -1,4 +0,0 @@
{% set hasSidebar = true %}
{% set hasOutline = true %}
{% extends "../_includes/base.njk" %}

207
docs/_layouts/theme.njk Normal file
View File

@@ -0,0 +1,207 @@
{% set hasSidebar = true %}
{% set hasOutline = true %}
{# {% set forceTheme = page.fileSlug %} #}
{% extends '../_includes/base.njk' %}
{% block head %}
<script>
globalThis.wa_data ??= {};
wa_data.baseTheme = "{{ page.fileSlug }}";
wa_data.themes = {
{% for theme in collections.theme -%}
"{{ theme.fileSlug }}": {
"title": "{{ theme.data.title }}",
"palette": "{{ theme.data.palette }}",
"brand": "{{ theme.data.brand }}"
},
{% endfor %}
};
wa_data.palettes = {
{% for palette in collections.palette -%}
"{{ palette.fileSlug }}": {
"title": "{{ palette.data.title }}",
},
{% endfor %}
};
</script>
<link href="{{ page.url }}../remix.css" rel="stylesheet">
<script src="{{ page.url }}../remix.js" type="module"></script>
{% endblock %}
{% block header %}
<iframe src='{{ page.url }}demo.html' id="demo"></iframe>
<wa-details id="mix_and_match" class="wa-gap-m" >
<h4 slot="summary" data-no-anchor data-no-outline id="remix">
<wa-icon name="arrows-rotate"></wa-icon>
Remix this theme
<wa-icon id="what-is-remixing" href="#remixing" name="circle-question" slot="suffix" variant="regular"></wa-icon>
<wa-tooltip for="what-is-remixing">Customize this theme by changing its colors and/or remixing it with design elements from other themes!</wa-tooltip>
</h4>
<wa-select name="colors" label="Colors from…" value="" clearable>
<wa-icon name="palette" slot="prefix" variant="regular"></wa-icon>
{% for theme in collections.theme | sort %}
{% set currentTheme = theme.fileSlug == page.fileSlug %}
<wa-option label="{{ theme.data.title }}" value="{{ theme.fileSlug if not currentTheme }}" {{ (theme.fileSlug if currentTheme) | attr('data-id') }}>
<wa-card with-header>
<div slot="header">
{% include "svgs/theme-color.njk" %}
</div>
<span class="page-name">
{{ theme.data.title }}
{% if theme.data.isPro %}<wa-badge class="pro">PRO</wa-badge>{% endif %}
{% if currentTheme %}<wa-badge variant="neutral" appearance="outlined">This theme</wa-badge>{% endif %}
</span>
</wa-card>
</wa-option>
{% endfor %}
</wa-select>
<wa-select name="palette" label="Palette" clearable>
<wa-icon name="swatchbook" slot="prefix" variant="regular"></wa-icon>
{% set defaultPalette = palette %}
{% for palette in collections.palette | sort %}
{% set currentPalette = palette.fileSlug == defaultPalette %}
<wa-option label="{{ palette.data.title }}" value="{{ palette.fileSlug if not currentPalette }}" {{ (palette.fileSlug if currentPalette) | attr('data-id') }}>
<wa-card with-header>
<div slot="header">
{% include "svgs/" + (palette.data.icon or "thumbnail-placeholder") + ".njk" %}
</div>
<span class="page-name">
{{ palette.data.title }}
{% if palette.data.isPro %}<wa-badge class="pro">PRO</wa-badge>{% endif %}
{% if currentPalette %}<wa-badge variant="neutral" appearance="outlined">Theme default</wa-badge>{% endif %}
</span>
</wa-card>
</wa-option>
{% endfor %}
{% set palette = defaultPalette %}
</wa-select>
<wa-select name="brand" label="Brand color" value="" clearable>
<div class="selected-swatch" slot="prefix"></div>
{% for hue in hues %}
{% set currentBrand = hue == brand %}
<wa-option label="{{ hue | capitalize }}" value="{{ hue if not currentBrand }}" {{ (hue if currentBrand) | attr('data-id') }} style="--color: var(--wa-color-{{ hue }})">
{{ hue | capitalize }}
{% if currentBrand %}<wa-badge variant="neutral" appearance="outlined">Theme default</wa-badge>{% endif %}
</wa-option>
{% endfor %}
</wa-select>
<wa-select name="typography" label="Typography from…" clearable>
<wa-icon name="font-case" slot="prefix"></wa-icon>
{% for theme in collections.theme | sort %}
{% set currentTheme = theme.fileSlug == page.fileSlug %}
<wa-option label="{{ theme.data.title }}" value="{{ theme.fileSlug if not currentTheme }}" {{ (theme.fileSlug if currentTheme) | attr('data-id') }}>
<wa-card with-header>
<div slot="header">
{% include "svgs/theme-typography.njk" %}
</div>
<span class="page-name">
{{ theme.data.title }}
{% if theme.data.isPro %}<wa-badge class="pro">PRO</wa-badge>{% endif %}
{% if currentTheme %}<wa-badge variant="neutral" appearance="outlined">This theme</wa-badge>{% endif %}
</span>
</wa-card>
</wa-option>
{% endfor %}
</wa-select>
</wa-details>
<h2>Color</h2>
{% set paletteURL = '/docs/palettes/' + palette + '/' %}
<div class="index-grid">
{% set themePage = page %}
{% set page = paletteURL | getCollectionItemFromUrl %}
{% set pageSubtitle = "Default color palette" %}
{% include 'page-card.njk' %}
{% set page = themePage %}
<wa-card style="--header-background: var(--wa-color-{{ brand }})" class="wa-palette-{{ palette }}">
<div slot="header"></div>
<div class="page-name">{{ brand | capitalize }}</div>
<div class="wa-caption-s">Default brand color</div>
</wa-card>
</div>
{% endblock %}
{% block afterContent %}
<h2 id="usage">How to use this theme</h2>
{% markdown %}
You can import this theme from the Web Awesome CDN.
{% set stylesheet = 'styles/themes/' + page.fileSlug + '.css' %}
{% include 'import-stylesheet-code.md.njk' %}
## Dark mode
To activate the dark color scheme of the theme on any element and its contents, apply the class `wa-dark` to it.
This means you can use different color schemes throughout the page.
Here, we use the default theme with a dark sidebar:
```html
<html>
<head>
<link rel="stylesheet" href="path/to/web-awesome/dist/styles/themes/default.css" />
</head>
<body>
<nav class="wa-dark">
<!-- dark-themed sidebar -->
</nav>
<!-- light-themed content -->
</body>
</html>
```
You can apply the class to the `<html>` element on your page to activate the dark color scheme for the entire page.
```html
<html class="wa-dark">
<head>
<link rel="stylesheet" href="path/to/web-awesome/dist/styles/themes/{{ page.fileSlug }}.css" />
<!-- other links, scripts, and metadata -->
</head>
<body>
<!-- page content -->
</body>
</html>
```
### Detecting Color Scheme Preference
Web Awesome's themes have both light and dark styles built in.
However, Web Awesome doesn't try to auto-detect the user's light/dark mode preference.
This should be done at the application level.
As a best practice, to provide a dark theme in your app, you should:
- Check for [`prefers-color-scheme`](https://stackoverflow.com/a/57795495/567486) and use its value by default
- Allow the user to override the setting in your app
- Remember the user's preference and restore it on subsequent logins
Web Awesome avoids using the `prefers-color-scheme` media query because not all apps support dark mode, and it would break things for the ones that don't.
Assuming the user's preference is in a variable called `colorScheme` (values: `auto`, `light`, `dark`),
you can use the following JS snippet to apply the `wa-dark` class to the `<html>` element accordingly:
```js
const systemDark = window.matchMedia('(prefers-color-scheme: dark)');
const applyDark = function (event = systemDark) {
const isDark = colorScheme === 'auto' ? event.matches : colorScheme === 'dark';
document.documentElement.classList.toggle('wa-dark', isDark);
};
systemDark.addEventListener('change', applyDark);
applyDark();
```
{% endmarkdown %}
{% endblock %}

19
docs/_layouts/utility.njk Normal file
View File

@@ -0,0 +1,19 @@
{% extends '../_layouts/block.njk' %}
{% block afterContent %}
{% if file %}
{% markdown %}
## Opting In
If you want to use this utility **only** without [all others](../), you can include the following CSS file from the Web Awesome CDN.
{% set stylesheet = file %}
{% include 'import-stylesheet-code.md.njk' %}
Want them all?
Follow the [instructions on the Utilities overview page](../) to get all Web Awesome utilities.
{% endmarkdown %}
{% endif %}
{% endblock %}

View File

@@ -1,11 +1,11 @@
import { parse } from 'node-html-parser';
import { v4 as uuid } from 'uuid';
import slugify from 'slugify';
import { v4 as uuid } from 'uuid';
function createId(text) {
let slug = slugify(String(text), {
remove: /[^\w|\s]/g,
lower: true
lower: true,
});
// ids must start with a letter
@@ -24,7 +24,7 @@ export function anchorHeadingsPlugin(options = {}) {
container: 'body',
headingSelector: 'h2, h3, h4, h5, h6',
anchorLabel: 'Jump to heading',
...options
...options,
};
return function (eleventyConfig) {
@@ -37,7 +37,8 @@ export function anchorHeadingsPlugin(options = {}) {
}
// Look for headings
container.querySelectorAll(options.headingSelector).forEach(heading => {
let selector = `:is(${options.headingSelector}):not([data-no-anchor], [data-no-anchor] *)`;
container.querySelectorAll(selector).forEach(heading => {
const hasAnchor = heading.querySelector('a');
const existingId = heading.getAttribute('id');
const clone = parse(heading.outerHTML);

View File

@@ -53,7 +53,7 @@ const templates = {
attributes = {
open,
include: `link[rel=stylesheet][href^='/dist/']`,
...attributes
...attributes,
};
const attributesString = Object.entries(attributes)
@@ -93,7 +93,7 @@ const templates = {
${pre.outerHTML}
</wa-code-demo>
`;
}
},
};
/**
@@ -107,13 +107,13 @@ export function codeExamplesPlugin(eleventyConfig, options = {}) {
outputPathIndex === 1 && // is first
code.textContent.length < 500
); // is short
}
},
};
options = { ...defaultOptions, ...options };
const stats = {
inputPaths: {},
outputPaths: {}
outputPaths: {},
};
eleventyConfig.addTransform('code-examples', function (content) {
@@ -144,7 +144,7 @@ export function codeExamplesPlugin(eleventyConfig, options = {}) {
edit: true,
buttons: true,
new: true, // comment this line to default back to the old demos
attributes: {}
attributes: {},
};
for (const prop of ['new', 'open', 'buttons', 'edit']) {
@@ -174,7 +174,7 @@ export function codeExamplesPlugin(eleventyConfig, options = {}) {
localOptions.open = localOptions.defaultOpen(code, {
pre,
inputPathIndex: stats.inputPaths[inputPath],
outputPathIndex: stats.outputPaths[outputPath]
outputPathIndex: stats.outputPaths[outputPath],
});
}
}

View File

@@ -6,7 +6,7 @@ import { parse } from 'node-html-parser';
export function copyCodePlugin(options = {}) {
options = {
container: 'body',
...options
...options,
};
return function (eleventyConfig) {

View File

@@ -28,7 +28,7 @@ export function currentLink(options = {}) {
options = {
container: 'body',
className: 'current',
...options
...options,
};
return function (eleventyConfig) {

284
docs/_utils/filters.js Normal file
View File

@@ -0,0 +1,284 @@
import { parse } from 'path';
export function stripExtension(string) {
return parse(string).name;
}
export function stripPrefix(content) {
return content.replace(/^wa-/, '');
}
// Trims whitespace and pipes from the start and end of a string. Useful for CEM types, which can be pipe-delimited.
// With Prettier 3, this means a leading pipe will exist be present when the line wraps.
export function trimPipes(content) {
return typeof content === 'string' ? content.replace(/^(\s|\|)/g, '').replace(/(\s|\|)$/g, '') : content;
}
export function keys(obj) {
return Object.keys(obj);
}
export function log(firstArg, ...rest) {
console.log(firstArg, ...rest);
return firstArg;
}
function getCollection(name) {
// From https://github.com/11ty/eleventy/blob/d3d24ccddb804e6e14773501d8c4e07e2c4b9c2b/src/Filters/GetLocaleCollectionItem.js#L39-L43
return this.collections?.[name] || this.ctx?.collections?.[name] || this.context?.environments?.collections?.[name];
}
export function getCollectionItemFromUrl(url, collection) {
collection ??= getCollection.call(this, 'all') || [];
return collection.find(item => item.url === url);
}
export function getTitleFromUrl(url, collection) {
const item = getCollectionItemFromUrl.call(this, url, collection);
return item?.data.title || '';
}
export function split(text, separator) {
return (text + '').split(separator).filter(Boolean);
}
export function breadcrumbs(url, { withCurrent = false } = {}) {
const parts = split(url, '/');
const ret = [];
while (parts.length) {
let partialUrl = '/' + parts.join('/') + '/';
let item = getCollectionItemFromUrl.call(this, partialUrl);
if (item && (partialUrl !== url || withCurrent)) {
let title = item.data.title;
if (title) {
ret.unshift({ url: partialUrl, title });
}
}
parts.pop();
if (item?.data.parent) {
let parentURL = item.data.parent;
if (!item.data.parent.startsWith('/')) {
// Parent is in the same directory
parts.push(item.data.parent);
parentURL = '/' + parts.join('/') + '/';
}
let parentBreadcrumbs = breadcrumbs.call(this, parentURL, { withCurrent: true });
return [...parentBreadcrumbs, ...ret];
}
}
return ret;
}
export function isObject(value) {
return typeof value === 'object' && value !== null && !Array.isArray(value);
}
export function isList(value) {
return Array.isArray(value) || value instanceof Set;
}
/** Get an Array or Set */
export function toList(value) {
return isList(value) ? value : [value];
}
/**
* Convert any value to something that can be iterated over with a for key, value loop.
* Arrays and sets will be converted to a Map of value -> undefined
*/
export function dict(value) {
if (value instanceof Map || isObject(value)) {
return value;
}
let list = toList(value);
return new Map([...list].map(item => [item, undefined]));
}
export function deepValue(obj, key) {
key = Array.isArray(key) ? key : key.split('.');
return key.reduce((subObj, property) => subObj?.[property], obj);
}
export function number(value, options) {
if (typeof value !== 'number' && isNaN(value)) {
return value;
}
let lang = options?.lang ?? 'en';
if (options?.lang) {
delete options.lang;
}
if (!options || Object.keys(options).length === 0) {
options = { maximumSignificantDigits: 3 };
}
return Number(value).toLocaleString(lang, options);
}
export function isNumeric(value) {
return typeof value === 'number' || (typeof value === 'string' && !isNaN(value));
}
export function isString(value) {
return typeof value === 'string';
}
export function isEmpty(value) {
return value === null || value === undefined || value === '';
}
function compare(a, b) {
let isEmptyA = isEmpty(a);
let isEmptyB = isEmpty(b);
if (isEmptyA) {
if (isEmptyB) {
return 0;
} else {
return 1;
}
} else if (isEmptyB) {
return -1;
}
// Both strings, and at least one non-numeric
if (isNumeric(a) || isNumeric(b)) {
return a - b;
}
return (a + '').localeCompare(b);
}
/** Sort an array of objects by one or more of their properties */
export function sort(arr, by = { 'data.order': 1, 'data.title': '' }) {
let keys = Array.isArray(by) ? by : Object.keys(by);
return arr.sort((a, b) => {
let aValues = keys.map(key => deepValue(a, key) ?? by[key]);
let bValues = keys.map(key => deepValue(b, key) ?? by[key]);
for (let i = 0; i < aValues.length; i++) {
let aVal = aValues[i];
let bVal = bValues[i];
let result = compare(aVal, bVal);
// They are not equal in terms of comparison OR we're at the last key
if (result !== 0 || i === aValues.length - 1) {
return result;
}
}
});
}
/**
* Group an 11ty collection (or any array of objects with a `data.tags` property) by certain tags.
* @param {object[]} collection
* @param { Object<string, string> | (string | Object<string, string>)[]} [tags] The tags to group by. If not provided/empty, defaults to grouping by all tags.
* @returns { Object.<string, object[]> } An object with keys for each tag, and an array of items for each tag.
*/
export function groupByTags(collection, tags) {
if (!collection) {
console.error(`Empty collection passed to groupByTags() to group by ${JSON.stringify(tags)}`);
}
if (!tags) {
// Default to grouping by union of all tags
tags = Array.from(new Set(collection.flatMap(item => item.data.tags)));
} else if (Array.isArray(tags)) {
// May contain objects of one-off tag -> label mappings
tags = tags.map(tag => (typeof tag === 'object' ? Object.keys(tag)[0] : tag));
} else if (typeof tags === 'object') {
// tags is an object of tags to labels, so we just want the keys
tags = Object.keys(tags);
}
let ret = Object.fromEntries(tags.map(tag => [tag, []]));
ret.other = [];
for (let item of collection) {
let categorized = false;
for (let tag of tags) {
if (item.data.tags.includes(tag)) {
ret[tag].push(item);
categorized = true;
}
}
if (!categorized) {
ret.other.push(item);
}
}
// Remove empty categories
for (let category in ret) {
if (ret[category].length === 0) {
delete ret[category];
}
}
return ret;
}
export function getCategoryTitle(category, categories) {
let title;
if (Array.isArray(categories)) {
// Find relevant entry
// [{id: "Title"}, id2, ...]
title = categories.find(entry => typeof entry === 'object' && entry?.[category])?.[category];
} else if (typeof categories === 'object') {
// {id: "Title", id2: "Title 2", ...}
title = categories[category];
}
if (title) {
return title;
}
// Capitalized
return category.charAt(0).toUpperCase() + category.slice(1);
}
const IDENTITY = x => x;
/**
* Helper to print out one or more HTML attributes, especially conditional ones.
* Usage in 11ty:
* - Single attribute: `<foo{{ value | attr(name) }}>`
* - Multiple attributes: `<foo{{ { name1: value1, name2: value2 } | attr }}>`
*
* @overload
* @param {any} value - The attribute value If falsey, the attribute is not printed. If `true` the attribute is printed without a value.
* @param {string} name - The name of the attribute
*
* @overload
* @param {Object<string, any>} obj - Map of attribute names to values
*
* @returns {string} The attribute string. No `| safe` is needed.
*/
export function attr(value, name) {
const safe = this?.env.filters.safe ?? IDENTITY;
if (arguments.length === 1 && value && typeof value === 'object') {
// Called with a single object argument of names to values
let ret = Object.entries(obj)
.map(([name, value]) => attr(value, name))
.join('');
return safe(ret);
}
if (!value) {
// false, "", null, undefined
return '';
}
let ret = ' ' + name + (value === true ? '' : `="${value}"`);
return safe(ret);
}

View File

@@ -11,7 +11,7 @@ import defaultOptions from '../../prettier.config.js';
export async function formatCode(string, options) {
return await format(string, {
...defaultOptions,
...options
...options,
});
}
@@ -21,7 +21,7 @@ export async function formatCode(string, options) {
export function formatCodePlugin(options = {}) {
options = {
parser: 'html',
...options
...options,
};
return function (eleventyConfig) {

View File

@@ -1,8 +1,8 @@
/* eslint sort-imports-es6-autofix/sort-imports-es6: 0 */
import { parse } from 'node-html-parser';
import Prism from 'prismjs';
import 'prismjs/plugins/custom-class/prism-custom-class.js';
import PrismLoader from 'prismjs/components/index.js';
import 'prismjs/plugins/custom-class/prism-custom-class.js';
PrismLoader('diff');
PrismLoader.silent = true;
@@ -40,7 +40,7 @@ export function highlightCode(code, language = 'plain') {
export function highlightCodePlugin(options = {}) {
options = {
container: 'body',
...options
...options,
};
return function (eleventyConfig) {

View File

@@ -14,7 +14,7 @@ export const markdown = MarkdownIt({
breaks: false,
langPrefix: 'language-',
linkify: false,
typographer: false
typographer: false,
});
markdown.use(markdownItIns);
@@ -34,7 +34,7 @@ markdown.use(markdownItMark);
`;
}
return '</div></div>\n';
}
},
});
});
@@ -44,7 +44,7 @@ markdown.use(markdownItContainer, 'aside', {
return `<aside>`;
}
return '</aside>\n';
}
},
});
markdown.use(markdownItContainer, 'details', {
@@ -55,9 +55,9 @@ markdown.use(markdownItContainer, 'details', {
return `<details>\n<summary><span>${markdown.utils.escapeHtml(m[1])}</span></summary>\n`;
}
return '</details>\n';
}
},
});
markdown.use(markdownItAttrs, {
allowedAttributes: []
allowedAttributes: [],
});

View File

@@ -15,7 +15,7 @@ export function outlinePlugin(options = {}) {
target: '.outline',
selector: 'h2,h3',
ifEmpty: () => null,
...options
...options,
};
return function (eleventyConfig) {

View File

@@ -6,7 +6,7 @@ import { parse } from 'node-html-parser';
export function removeDataAlphaElements(options = {}) {
options = {
isAlpha: false,
...options
...options,
};
return function (eleventyConfig) {

View File

@@ -1,8 +1,8 @@
/* eslint-disable no-invalid-this */
import { dirname, join } from 'path';
import { mkdir, writeFile } from 'fs/promises';
import { parse } from 'node-html-parser';
import lunr from 'lunr';
import { parse } from 'node-html-parser';
import { dirname, join } from 'path';
function collapseWhitespace(string) {
return string.replace(/\s+/g, ' ');
@@ -19,7 +19,7 @@ export function searchPlugin(options = {}) {
getDescription: doc => doc.querySelector('meta[name="description"]')?.getAttribute('content') ?? '',
getHeadings: doc => [...doc.querySelectorAll('h1, h2, h3, h4, h5, h6')].map(heading => heading.textContent ?? ''),
getContent: doc => doc.querySelector('body')?.textContent ?? '',
...options
...options,
};
return function (eleventyConfig) {
@@ -32,8 +32,8 @@ export function searchPlugin(options = {}) {
noscript: false,
style: false,
pre: false,
code: false
}
code: false,
},
});
// Remove content that shouldn't be searchable to reduce the index size
@@ -46,7 +46,7 @@ export function searchPlugin(options = {}) {
description: collapseWhitespace(options.getDescription(doc)),
headings: options.getHeadings(doc).map(collapseWhitespace),
content: collapseWhitespace(options.getContent(doc)),
url: this.page.url === '/' ? '/' : this.page.url.replace(/\/$/, '')
url: this.page.url === '/' ? '/' : this.page.url.replace(/\/$/, ''),
});
return content;

View File

Before

Width:  |  Height:  |  Size: 698 KiB

After

Width:  |  Height:  |  Size: 698 KiB

View File

Before

Width:  |  Height:  |  Size: 241 KiB

After

Width:  |  Height:  |  Size: 241 KiB

View File

Before

Width:  |  Height:  |  Size: 786 KiB

After

Width:  |  Height:  |  Size: 786 KiB

View File

Before

Width:  |  Height:  |  Size: 716 KiB

After

Width:  |  Height:  |  Size: 716 KiB

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 438 KiB

After

Width:  |  Height:  |  Size: 438 KiB

View File

@@ -18,12 +18,11 @@ document.addEventListener('click', event => {
const cdnUrl = document.documentElement.dataset.cdnUrl;
const html =
`<script type="module" src="${cdnUrl}webawesome.loader.js"></script>\n` +
`<link rel="stylesheet" href="${cdnUrl}themes/default.css">\n` +
`<link rel="stylesheet" href="${cdnUrl}themes/applied.css">\n` +
`<link rel="stylesheet" href="${cdnUrl}themes/layout.css">\n` +
`<link rel="stylesheet" href="${cdnUrl}themes/utilities.css">\n\n` +
`<link rel="stylesheet" href="${cdnUrl}styles/themes/default.css">\n` +
`<link rel="stylesheet" href="${cdnUrl}styles/webawesome.css">\n` +
`<link rel="stylesheet" href="${cdnUrl}styles/utilities.css">\n\n` +
`${code.textContent}`;
const css = 'html > body {\n font: 16px sans-serif;\n padding: 2rem;\n}';
const css = 'html > body {\n padding: 2rem !important;\n}';
const js = '';
const form = document.createElement('form');
@@ -44,7 +43,7 @@ document.addEventListener('click', event => {
js_pre_processor: 'none',
html,
css,
js
js,
};
const input = document.createElement('input');

View File

@@ -1,59 +0,0 @@
//
// Color scheme selector
//
(() => {
function setColorScheme(newColorScheme) {
colorScheme = newColorScheme;
localStorage.setItem('colorScheme', colorScheme);
const presetTheme = window.getPresetTheme();
// Update the UI
updateSelection();
// Toggle the dark mode class
document.documentElement.classList.toggle(`wa-theme-${presetTheme}-dark`, window.isDark());
}
function updateSelection() {
const menu = document.querySelector('#color-scheme-selector wa-menu');
if (!menu) return;
[...menu.querySelectorAll('wa-menu-item')].forEach(async item => {
await customElements.whenDefined(item.localName);
await item.updateComplete;
item.checked = item.getAttribute('value') === colorScheme;
});
}
let colorScheme = window.getColorScheme();
// Selection is not preserved when changing page, so update when opening dropdown
document.addEventListener('wa-show', event => {
const colorSchemeSelector = event.target.closest('#color-scheme-selector');
if (!colorSchemeSelector) return;
updateSelection();
});
// Listen for selections
document.addEventListener('wa-select', event => {
const menu = event.target.closest('#color-scheme-selector wa-menu');
if (!menu) return;
setColorScheme(event.detail.item.value);
});
// Update the color scheme when the preference changes
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => setColorScheme(colorScheme));
// Toggle with backslash
document.addEventListener('keydown', event => {
if (
event.key === '\\' &&
!event.composedPath().some(el => ['input', 'textarea'].includes(el?.tagName?.toLowerCase()))
) {
event.preventDefault();
setColorScheme(window.isDark() ? 'light' : 'dark');
}
});
// Set the initial color scheme and sync the UI
setColorScheme(colorScheme);
})();

View File

@@ -0,0 +1,25 @@
function updateResults(input) {
const filter = input.value.toLowerCase().trim();
let filtered = Boolean(filter);
for (let grid of document.querySelectorAll('.index-grid')) {
grid.classList.toggle('filtered', filtered);
for (let item of grid.querySelectorAll('a:has(> wa-card)')) {
let isMatch = true;
if (filter) {
const content = item.textContent.toLowerCase() + ' ' + (item.getAttribute('data-keywords') + ' ');
isMatch = content.includes(filter);
}
item.hidden = !isMatch;
}
}
}
document.documentElement.addEventListener('input', e => {
if (e.target?.matches('#block-filter wa-input')) {
updateResults(e.target);
}
});

View File

@@ -79,8 +79,8 @@
diffViewer.appendChild(
createDiff({
serverHTML,
clientHTML
})
clientHTML,
}),
);
});
}
@@ -88,7 +88,7 @@
function createDiff({ serverHTML, clientHTML }) {
const diff = diffLines(serverHTML, clientHTML, {
ignoreWhitespace: false,
newLineIsToken: true
newLineIsToken: true,
});
const fragment = document.createDocumentFragment();
for (var i = 0; i < diff.length; i++) {

View File

@@ -0,0 +1,52 @@
import { domChange, nextFrame, ThemeAspect } from './theme-picker.js';
const presetTheme = new ThemeAspect({
defaultValue: 'default',
key: 'presetTheme',
picker: 'wa-select.preset-theme-selector',
applyChange(options = {}) {
const oldStylesheets = [...document.querySelectorAll('#theme-stylesheet')];
const oldStylesheet = oldStylesheets.pop();
if (oldStylesheets.length > 0) {
// Remove all but the last one
for (let stylesheet of oldStylesheets) {
stylesheet.remove();
}
}
const href = `/dist/styles/themes/${this.value}.css`;
if (!oldStylesheet || oldStylesheet.getAttribute('href') !== href) {
const newStylesheet = document.createElement('link');
Object.assign(newStylesheet, { href, id: 'theme-stylesheet', rel: 'preload', as: 'style' });
oldStylesheet.after(newStylesheet);
newStylesheet.addEventListener(
'load',
e => {
domChange(
async instant => {
// Swap stylesheets
newStylesheet.rel = 'stylesheet';
if (instant) {
// If no VT, delay by 1 frame to make it smoother
await nextFrame();
}
oldStylesheet.remove();
},
{ behavior: 'smooth', ...options },
);
},
{ once: true },
);
}
},
});
window.addEventListener('turbo:render', e => {
presetTheme.applyChange({ behavior: 'instant' });
});

View File

@@ -1,86 +0,0 @@
//
// Preset theme selector
//
(() => {
function setPresetTheme(newPresetTheme) {
presetTheme = newPresetTheme;
localStorage.setItem('presetTheme', presetTheme);
const stylesheet = document.getElementById('theme-stylesheet');
const newStylesheet = Object.assign(document.createElement('link'), {
href: `/dist/themes/${presetTheme}.css`,
rel: 'preload',
as: 'style'
});
newStylesheet.addEventListener(
'load',
() => {
newStylesheet.rel = 'stylesheet';
newStylesheet.id = stylesheet.id;
requestAnimationFrame(() => {
stylesheet.remove();
});
},
{ once: true }
);
document.head.append(newStylesheet);
// Update the UI
updateSelection();
// Toggle the dark mode class
document.documentElement.classList.toggle(`wa-theme-${presetTheme}-dark`, window.isDark());
}
function updateSelection(container = document) {
const menu = container.querySelector('#preset-theme-selector wa-menu');
if (!menu) return;
[...menu.querySelectorAll('wa-menu-item')].forEach(async item => {
const isChecked = item.getAttribute('value') === presetTheme;
if (isChecked) {
container.querySelector('#preset-theme-selector__text').textContent = item.innerText;
}
await customElements.whenDefined(item.localName);
await item.updateComplete;
item.checked = isChecked;
});
}
let presetTheme = window.getPresetTheme();
// Selection is not preserved when changing page, so update when opening dropdown
document.addEventListener('wa-show', event => {
const presetThemeSelector = event.target.closest('#preset-theme-selector');
if (!presetThemeSelector) return;
updateSelection();
});
// Listen for selections
document.addEventListener('wa-select', event => {
const menu = event.target.closest('#preset-theme-selector wa-menu');
if (!menu) return;
setPresetTheme(event.detail.item.value);
});
// Update the color scheme when the preference changes
window.matchMedia('(prefers-preset-theme: dark)').addEventListener('change', () => setPresetTheme(presetTheme));
updateSelection();
/**
* Without this, there's a flash of the incorrect preset theme.
*/
function updateSelectionBeforeTurboLoad(e) {
const newElement = e.detail.newBody || e.detail.newFrame || e.detail.newStream;
if (!newElement) {
return;
}
updateSelection(newElement);
}
['turbo:before-render', 'turbo:before-stream-render', 'turbo:before-frame-render'].forEach(eventName => {
document.addEventListener(eventName, updateSelectionBeforeTurboLoad);
});
})();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,37 @@
/**
* Get import code for remixed themes.
*/
export const urls = {
colors: id => `styles/themes/${id}/color.css`,
palette: id => `styles/color/${id}.css`,
brand: id => `styles/brand/${id}.css`,
typography: id => `styles/themes/${id}/typography.css`,
};
function getImport(url, options = {}) {
let { language = 'html', cdnUrl = '/dist/', attributes } = options;
url = cdnUrl + url;
if (language === 'css') {
return `@import url('${url}');`;
} else {
attributes = attributes ? ` ${attributes}` : '';
return `<link rel="stylesheet" href="${url}"${attributes} />`;
}
}
export function getCode(base, params, options) {
let ret = [];
if (base) {
ret.push(`styles/themes/${base}.css`);
}
ret.push(
...Object.entries(params)
.filter(([aspect, id]) => Boolean(id))
.map(([aspect, id]) => urls[aspect](id)),
);
return ret.map(url => getImport(url, options)).join('\n');
}

View File

@@ -1,13 +1,14 @@
// Smooth links
document.addEventListener('click', event => {
const link = event.target.closest('a');
const id = (link?.hash ?? '').substr(1);
if (!link || link.getAttribute('data-smooth-link') === 'off') {
return;
}
if (id) {
const id = (link.hash ?? '').substr(1);
// Only handle smooth scroll if there's a hash and the link points to the current page
if (id && link.pathname === window.location.pathname) {
const target = document.getElementById(id);
const headerHeight = document.querySelector('wa-page > header').clientHeight;
@@ -15,7 +16,7 @@ document.addEventListener('click', event => {
event.preventDefault();
window.scroll({
top: target.offsetTop - headerHeight,
behavior: 'smooth'
behavior: 'smooth',
});
history.pushState(undefined, undefined, `#${id}`);
}

View File

@@ -9,7 +9,8 @@ const icons = {
component: 'puzzle-piece',
document: 'file',
home: 'house',
theme: 'palette'
native: 'code',
theme: 'palette',
};
let searchTimeout;
@@ -18,7 +19,7 @@ function getElements() {
return {
dialog: document.getElementById('site-search'),
input: document.getElementById('site-search-input'),
results: document.getElementById('site-search-listbox')
results: document.getElementById('site-search-listbox'),
};
}
@@ -166,6 +167,7 @@ async function updateResults(query = '') {
li.setAttribute('data-selected', index === 0 ? 'true' : 'false');
if (page.url === '/') icon = icons.home;
if (page.url.startsWith('/docs/native')) icon = icons.native;
if (page.url.startsWith('/docs/components')) icon = icons.component;
if (page.url.startsWith('/docs/theme') || page.url.startsWith('/docs/restyle')) icon = icons.theme;

View File

@@ -0,0 +1,37 @@
/**
* Sync iframe height with its content page (for same-origin iframes)
* NOT CURRENTLY USED ANYWHERE
*/
for (let iframe of document.querySelectorAll('iframe')) {
if (iframe.contentDocument) {
// Already loaded
syncIframeHeight(iframe);
}
iframe.onload = () => {
console.log('iframe loaded');
if (iframe.contentDocument) {
// Same origin
iframe.contentWindow.iframe = iframe;
syncIframeHeight(iframe);
const resizeObserver = new ResizeObserver(entries => {
for (let entry of entries) {
if (entry.target === iframe.contentDocument.body) {
syncIframeHeight(iframe);
}
}
});
resizeObserver.observe(iframe.contentDocument.body);
window.addEventListener('turbo:render', syncIframeHeight(iframe));
}
};
}
function syncIframeHeight(iframe) {
iframe.style.height = '0px';
requestAnimationFrame(() => {
iframe.style.height = iframe.contentDocument.body.scrollHeight + 'px';
});
}

View File

@@ -0,0 +1,119 @@
// Helper for view transitions
export function domChange(fn, { behavior = 'smooth' } = {}) {
const canUseViewTransitions =
document.startViewTransition && !window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (canUseViewTransitions && behavior === 'smooth') {
document.startViewTransition(fn);
} else {
fn(true);
}
}
export function nextFrame() {
return new Promise(resolve => requestAnimationFrame(resolve));
}
export class ThemeAspect {
constructor(options) {
Object.assign(this, options);
this.set();
// Update when local storage changes.
// That way changes in one window will propagate to others (including iframes).
window.addEventListener('storage', event => {
if (event.key === this.key) {
this.set();
}
});
// Listen for selections
document.addEventListener('change', event => {
const picker = event.target.closest(this.picker);
if (picker) {
this.set(picker.value);
}
});
['turbo:before-render', 'turbo:before-stream-render', 'turbo:before-frame-render'].forEach(eventName => {
document.addEventListener(eventName, e => {
const newElement = e.detail.newBody || e.detail.newFrame || e.detail.newStream;
if (newElement) {
this.syncUI(newElement);
}
});
});
}
get() {
return localStorage.getItem(this.key) ?? this.defaultValue;
}
computed = {};
get computedValue() {
if (this.value in this.computed) {
return this.computed[this.value];
}
return this.value;
}
set(value = this.get()) {
if (value === this.value) {
return;
}
this.value = value;
if (this.value === this.defaultValue) {
localStorage.removeItem(this.key);
} else {
localStorage.setItem(this.key, this.value);
}
this.applyChange();
this.syncUI();
}
syncUI(container = document) {
for (let picker of container.querySelectorAll(this.picker)) {
picker.setAttribute('value', this.value);
picker.value = this.value;
}
}
}
const colorScheme = new ThemeAspect({
defaultValue: 'auto',
key: 'colorScheme',
picker: 'wa-select.color-scheme-selector',
computed: {
get auto() {
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
},
},
applyChange() {
// Toggle the dark mode class
domChange(() => {
let dark = this.computedValue === 'dark';
document.documentElement.classList.toggle(`wa-dark`, dark);
});
},
});
// Update the color scheme when the preference changes
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => colorScheme.set());
// Toggle color scheme with backslash
document.addEventListener('keydown', event => {
if (
event.key === '\\' &&
!event.composedPath().some(el => ['input', 'textarea'].includes(el?.tagName?.toLowerCase()))
) {
event.preventDefault();
colorScheme.set(theming.colorScheme.resolvedValue === 'dark' ? 'light' : 'dark');
}
});

View File

@@ -9,7 +9,7 @@ function saveScrollPosition() {
if (element.id) {
positions[element.id] = {
top: element.scrollTop,
left: element.scrollLeft
left: element.scrollLeft,
};
} else {
console.warn(`Can't save scroll position for elements without an id.`, el);

View File

@@ -1,6 +1,6 @@
.code-example {
border: var(--wa-border-style) var(--wa-panel-border-width) var(--wa-color-neutral-border-quiet);
border-radius: var(--wa-border-radius-m);
border-radius: var(--wa-border-radius-l);
color: var(--wa-color-text-normal);
margin-block-end: var(--wa-flow-spacing);
}
@@ -41,8 +41,8 @@
border-bottom: none;
pre {
border-bottom-right-radius: var(--wa-border-radius-m);
border-bottom-left-radius: var(--wa-border-radius-m);
border-bottom-right-radius: var(--wa-border-radius-l);
border-bottom-left-radius: var(--wa-border-radius-l);
}
}
@@ -62,11 +62,11 @@
&:first-of-type {
border-left: none;
border-bottom-left-radius: var(--wa-border-radius-m);
border-bottom-left-radius: var(--wa-border-radius-l);
}
&:last-of-type {
border-bottom-right-radius: var(--wa-border-radius-m);
border-bottom-right-radius: var(--wa-border-radius-l);
}
&:focus-visible {

View File

@@ -1,6 +1,12 @@
pre {
background-color: var(--wa-color-gray-20);
color: white;
/* Ensures a discernible background color in dark mode
* Useful for themes that use gray-20 as --wa-color-surface-default */
.wa-dark & {
background-color: var(--wa-color-surface-lowered);
}
}
.code-comment,
.code-prolog,

View File

@@ -6,7 +6,7 @@ wa-copy-button.copy-button {
right: 0.25rem;
font-family: var(--wa-font-family-body);
color: var(--wa-color-gray-80);
border-radius: var(--wa-border-radius-s);
border-radius: var(--wa-border-radius-m);
padding: 0.25rem;
&:hover {

View File

@@ -10,8 +10,8 @@
--wa-brand-grey: #30323b;
}
html.wa-theme-default-dark .only-light,
html:not(.wa-theme-default-dark) .only-dark {
.wa-dark .only-light,
.only-dark:not(.wa-dark, .wa-dark *) {
display: none;
}
@@ -22,22 +22,18 @@ wa-page {
/* Header */
wa-page::part(header) {
background-color: var(--wa-color-surface-default);
border-bottom: var(--wa-border-style) var(--wa-panel-border-width) var(--wa-color-neutral-border-quiet);
border-bottom: var(--wa-border-style) var(--wa-panel-border-width) var(--wa-color-surface-border);
}
wa-page::part(drawer__body) {
wa-page::part(body) {
padding-top: 0px;
}
wa-page::part(drawer__header-actions) {
wa-page::part(header-actions) {
align-self: center;
}
wa-page > header {
flex: 1 1 auto;
display: flex;
align-items: center;
justify-content: space-between;
padding-inline: var(--wa-space-xl);
a[href='/'] {
@@ -46,7 +42,7 @@ wa-page > header {
}
wa-button[data-toggle-nav] {
--label-color: currentColor;
--text-color: currentColor;
font-size: 1rem;
margin-inline-start: -0.875rem;
margin-inline-end: 0;
@@ -76,14 +72,12 @@ wa-page > header {
margin-block-start: var(--wa-space-2xs);
}
#version-number + wa-badge {
--background-color: var(--wa-color-warning-fill-quiet);
--content-color: var(--wa-color-warning-on-quiet);
font-size: var(--wa-font-size-2xs);
text-transform: uppercase;
}
wa-button#search-trigger {
--background-color: var(--wa-form-control-background-color);
--border-color: var(--wa-form-control-resting-color);
--border-color: var(--wa-form-control-border-color);
}
#search-trigger kbd {
font-size: var(--wa-font-size-2xs);
@@ -97,9 +91,18 @@ wa-page > header {
font-size: var(--wa-font-size-m);
margin: 0;
}
h2:not(:first-child) {
h2:not(:first-child),
wa-details:not(:first-child) {
margin-block-start: var(--wa-space-xs);
}
wa-details {
border: none;
background: none;
padding: 0;
}
ul {
border-inline-start: var(--wa-border-width-s) solid var(--wa-color-surface-border);
font-size: var(--wa-font-size-s);
@@ -107,21 +110,30 @@ wa-page > header {
margin: 0;
padding-inline-start: var(--wa-space-m);
}
ul ul {
margin-block-start: var(--wa-space-m);
}
ul:empty {
display: none;
}
li {
list-style: none;
+ li {
margin-block-start: var(--wa-space-m);
}
}
li + li {
margin-block-start: var(--wa-space-m);
}
li a {
color: var(--wa-color-text-normal);
text-decoration: none;
}
li a:hover {
text-decoration: underline;
&:hover {
text-decoration: underline;
}
}
li wa-badge::part(base) {
@@ -199,6 +211,20 @@ wa-page::part(menu) {
scrollbar-width: thin;
}
wa-page[view='mobile'] :is([slot='navigation-header'], [slot='navigation']) {
padding: 0;
& wa-details::part(icon) {
padding-inline: var(--wa-space-xs); /* aligns details icons with drawer close icon */
}
}
[slot='navigation-header'] wa-menu {
font-family: var(--wa-font-family-body);
font-size: var(--wa-font-size-m);
font-weight: var(--wa-font-weight-normal);
}
/* Main content */
wa-page > main {
max-width: 80ch;
@@ -214,7 +240,7 @@ h1.title wa-badge {
}
}
.component-info {
.block-info {
margin-block-end: var(--wa-flow-spacing);
}
@@ -245,7 +271,7 @@ h1.title wa-badge {
display: flex;
gap: 1rem;
border: var(--wa-border-style) var(--wa-border-width-s);
border-radius: var(--wa-border-radius-m);
border-radius: var(--wa-border-radius-l);
padding: 1rem;
margin-block-end: var(--wa-flow-spacing);
@@ -305,8 +331,48 @@ wa-page > main:has(> .index-grid) {
.index-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(20ch, 100%), 1fr));
grid-template-columns: repeat(auto-fit, minmax(min(22ch, 100%), 1fr));
gap: var(--wa-space-2xl);
margin-block-end: var(--wa-space-3xl);
a {
border-radius: var(--wa-border-radius-l);
text-decoration: none;
}
wa-card {
box-shadow: none;
--spacing: var(--wa-space-m);
inline-size: 100%;
&:hover {
--border-color: var(--wa-color-brand-border-loud);
border-color: var(--border-color);
box-shadow: 0 0 0 var(--wa-border-width-s) var(--border-color);
.page-name {
color: var(--wa-color-brand-on-quiet);
}
}
[slot='header'] {
display: flex;
}
&::part(header) {
background-color: var(--header-background, var(--wa-color-neutral-fill-quiet));
border-bottom: none;
display: flex;
align-items: center;
justify-content: center;
min-block-size: calc(6rem + var(--spacing));
}
}
.page-name {
font-size: var(--wa-font-size-s);
font-weight: var(--wa-font-weight-action);
}
}
.index-category {
@@ -315,123 +381,98 @@ wa-page > main:has(> .index-grid) {
margin-block-start: var(--wa-space-2xl);
}
.index-grid a {
border-radius: var(--wa-border-radius-m);
}
.index-grid wa-card {
--box-shadow: none;
--spacing: var(--wa-space-m);
inline-size: 100%;
}
.index-grid wa-card:hover {
--border-color: var(--wa-color-brand-border-loud);
--box-shadow: 0 0 0 var(--wa-border-width-s) var(--border-color);
& .page-name {
color: var(--wa-color-brand-on-quiet);
}
}
.index-grid wa-card [slot='header'] {
display: flex;
}
.index-grid wa-card::part(header) {
background-color: var(--wa-color-neutral-fill-quiet);
border-bottom: none;
display: flex;
align-items: center;
justify-content: center;
min-block-size: calc(6rem + var(--spacing));
}
.index-grid .page-name {
font-size: var(--wa-font-size-s);
font-weight: var(--wa-font-weight-action);
}
/* Index Pages */
wa-page > main:has(> .index-grid) {
max-width: 120ch;
margin-inline: auto;
}
.index-summary {
max-inline-size: 80ch;
}
.index-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(20ch, 100%), 1fr));
gap: var(--wa-space-2xl);
}
.index-category {
grid-column: 1 / -1;
margin-block-end: 0;
margin-block-start: var(--wa-space-2xl);
}
.index-grid a {
border-radius: var(--wa-border-radius-m);
}
.index-grid wa-card {
--box-shadow: none;
--spacing: var(--wa-space-m);
inline-size: 100%;
}
.index-grid wa-card:hover {
--border-color: var(--wa-color-brand-border-loud);
--box-shadow: 0 0 0 var(--wa-border-width-s) var(--border-color);
& .page-name {
color: var(--wa-color-brand-on-quiet);
}
}
.index-grid wa-card [slot='header'] {
display: flex;
}
.index-grid wa-card::part(header) {
background-color: var(--wa-color-neutral-fill-quiet);
border-bottom: none;
display: flex;
align-items: center;
justify-content: center;
min-block-size: calc(6rem + var(--spacing));
}
.index-grid .page-name {
font-size: var(--wa-font-size-s);
font-weight: var(--wa-font-weight-action);
}
/* Swatches */
.swatch {
position: relative;
display: flex;
align-items: center;
justify-content: center;
background-color: transparent;
border-color: var(--wa-color-neutral-border-normal);
border-style: var(--wa-border-style);
border-width: var(--wa-border-width-s);
border-radius: var(--wa-border-radius-s);
border-radius: var(--wa-border-radius-m);
box-sizing: border-box;
line-height: 2.5;
height: 2.5em;
padding-inline: var(--wa-space-xs);
min-height: 2.5em;
padding: var(--wa-space-xs);
font-weight: var(--wa-font-weight-semibold);
line-height: var(--wa-line-height-condensed);
&.color {
border-color: transparent;
}
wa-copy-button {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
--background-color-hover: transparent;
font-family: var(--wa-font-family-code);
&::part(button) {
display: block;
height: 100%;
width: 100%;
}
&::part(button):hover {
cursor: copy;
}
&::part(copy-icon),
&::part(success-icon),
&::part(error-icon) {
opacity: 0 !important;
}
}
}
table.colors {
thead {
th {
text-align: center;
padding-block: 0;
}
}
tbody {
tr {
border: none;
&:hover {
background: transparent;
}
}
th {
width: 0;
vertical-align: middle;
text-align: right;
}
td {
padding-inline: var(--wa-space-3xs);
padding-block: var(--wa-space-s);
}
}
.core-column {
padding-inline-end: var(--wa-space-xl);
}
}
/* Layout Examples */
.layout-example-boundary {
border: var(--wa-border-width-s) dashed var(--wa-color-neutral-border-normal);
border-radius: var(--wa-border-radius-m);
border-radius: var(--wa-border-radius-l);
padding: var(--wa-space-s);
}
.layout-example-block {
background-color: var(--wa-color-indigo-60);
border-radius: var(--wa-border-radius-s);
border-radius: var(--wa-border-radius-m);
min-block-size: 4rem;
min-inline-size: 4rem;
}
@@ -467,14 +508,9 @@ wa-page > main:has(> .index-grid) {
/** desktop */
@media screen and not (max-width: 768px) {
wa-page [data-toggle-nav],
wa-page .only-mobile {
display: none;
}
/* Navigation sidebar */
wa-page::part(navigation) {
border-right: var(--wa-border-style) var(--wa-panel-border-width) var(--wa-color-neutral-border-quiet);
border-right: var(--wa-border-style) var(--wa-panel-border-width) var(--wa-color-surface-border);
}
wa-page > #sidebar {
@@ -489,3 +525,22 @@ wa-page > main:has(> .index-grid) {
padding: var(--wa-space-3xl);
}
}
.page-wide {
wa-page > main {
max-width: 140ch;
.max-line-length {
max-width: 80ch;
}
}
}
.layout-theme {
iframe {
width: 100%;
min-height: 16lh;
height: 65vh;
max-height: 21lh;
}
}

View File

@@ -0,0 +1,37 @@
wa-card#drawer-card::part(header) {
--spacing: 0;
justify-content: flex-end;
overflow: hidden;
}
#block-filter {
margin-block-end: var(--wa-space-xl);
}
.index-grid.filtered {
h2 {
/* Hide headings while filtering */
display: none;
}
&:not(:has(> a:not([hidden]))) {
/* Were filtering and there are no results */
&::before {
content: var(--empty-message);
grid-column: 1 / -1;
color: var(--wa-color-on-quiet);
font-style: italic;
font-weight: var(--wa-font-weight-action);
}
/* Show empty state when there's a search filter and no results */
&[data-empty] {
--empty-message: attr(data-empty);
}
&:not([data-empty]) {
--empty-message: 'No results';
}
}
}

View File

@@ -18,7 +18,7 @@
.diff-grid > * {
height: 100%;
}
.diff-dialog::part(dialog) {
.diff-dialog {
max-width: 90vw;
width: 90vw;
}

View File

@@ -31,6 +31,9 @@
}
@media screen and (max-width: 1199px) {
wa-page [slot='aside'] {
display: none;
}
#outline {
padding-block: 0.25rem;
margin-block-end: -1rem;
@@ -42,5 +45,6 @@
#outline-expandable {
display: block;
margin-block-end: var(--wa-space-xl);
}
}

View File

@@ -1,13 +1,14 @@
#site-search {
--width: 38rem;
width: 38rem;
position: absolute;
top: 0;
border-radius: var(--wa-border-radius-l);
padding: 0;
margin: 0 auto;
overflow: hidden;
&::part(dialog) {
position: absolute;
top: 0;
border-radius: var(--wa-border-radius-m);
padding: 0;
margin: 10rem auto;
overflow: hidden;
&::part(base) {
margin-block: 10rem;
}
&::part(body) {
@@ -18,21 +19,22 @@
justify-content: center;
gap: 0.5rem;
}
@media screen and (max-width: 900px) {
max-width: calc(100% - 2rem);
&::part(base) {
margin-block: 1rem;
}
}
}
#site-search-container {
display: flex;
flex-direction: column;
max-height: calc(100vh - 20rem);
}
@media screen and (max-width: 900px) {
#site-search::part(dialog) {
max-width: calc(100% - 2rem);
margin-block: 1rem;
}
#site-search-container {
@media screen and (max-width: 900px) {
max-height: calc(100dvh - 2rem);
}
}
@@ -229,8 +231,8 @@ header {
gap: 2rem;
color: var(--wa-color-text-quiet);
border-top: var(--wa-panel-border-style) var(--wa-panel-border-width) var(--wa-color-neutral-border-quiet);
border-bottom-left-radius: var(--wa-border-radius-m);
border-bottom-right-radius: var(--wa-border-radius-m);
border-bottom-left-radius: var(--wa-border-radius-l);
border-bottom-right-radius: var(--wa-border-radius-l);
padding: 1rem;
kbd {

View File

@@ -1,5 +1,14 @@
/* #region Custom Styles */
@container preview (min-width: 0) {
/* Theme Builder Headers
* These styles control the appearance of the header of the theme builder,
* allowing each theme to have a unique hero section.
*/
/* #region Default */
html.wa-theme-default .preview-container {
container-name: default-theme;
}
@container default-theme (min-width: 0) {
.hero-background {
height: 47rem;
background-color: var(--wa-color-brand-fill-loud);
@@ -22,8 +31,8 @@
}
.hero wa-button[variant='brand'] {
--background: var(--wa-color-neutral-fill-quiet);
--label-color: var(--wa-color-neutral-on-normal);
--background-color: var(--wa-color-neutral-fill-quiet);
--text-color: var(--wa-color-neutral-on-normal);
}
.project-header {
@@ -41,10 +50,733 @@
}
/* responsive */
@container preview (min-width: 1040px) {
@container default-theme (min-width: 1040px) {
.hero-background::after {
background-position: right bottom;
background-size: 90%;
}
}
/* #endregion */
/* #region Tailspin */
html.wa-theme-tailspin .preview-container {
container-name: tailspin-theme;
}
@container tailspin-theme (min-width: 0) {
.project-header {
background: var(--wa-color-surface-default);
}
.hero {
--hero-background-color: var(--wa-color-surface-default);
--hero-lines-color: color-mix(in oklab, var(--wa-color-neutral-fill-normal), transparent 30%);
background: linear-gradient(to top, var(--wa-color-surface-lowered), transparent 40%),
radial-gradient(circle at 10% 70%, color-mix(in oklab, var(--wa-color-red-50) 16%, transparent), transparent 30%),
radial-gradient(
circle at 40% 50%,
color-mix(in oklab, var(--wa-color-indigo-40) 16%, transparent),
transparent 40%
),
radial-gradient(circle at 80% 25%, color-mix(in oklab, var(--wa-color-red-50) 8%, transparent), transparent 20%),
radial-gradient(
circle at 80% 80%,
color-mix(in oklab, var(--wa-color-indigo-40) 16%, transparent),
transparent 40%
),
radial-gradient(circle at 90% 30%, color-mix(in oklab, var(--wa-color-red-60) 8%, transparent), transparent 10%),
linear-gradient(176deg, var(--hero-background-color), transparent 6rem),
linear-gradient(90deg, var(--hero-background-color), transparent),
repeating-linear-gradient(
var(--hero-lines-color),
var(--hero-lines-color) 1px,
transparent 1px,
transparent 10rem,
var(--hero-lines-color) 10rem
),
repeating-linear-gradient(
90deg,
var(--hero-lines-color),
var(--hero-lines-color) 1px,
transparent 1px,
transparent 10rem,
var(--hero-lines-color) 10rem
),
var(--hero-background-color);
& .title {
padding-block: calc(var(--wa-space-3xl) * 2) calc(var(--wa-space-3xl) * 10);
& .hero-title {
font-size: calc((var(--wa-font-size-4xl) * 1.125) * 1.125);
margin-block: 0 var(--wa-space-3xl);
}
}
}
.badge-stock {
position: absolute;
top: var(--wa-space-l);
left: var(--wa-space-l);
}
.message-composer wa-card {
&::part(footer) {
border: none;
}
& wa-icon-button {
color: var(--wa-color-base-50);
}
}
.products {
margin-top: calc(var(--wa-space-3xl) * -8);
}
pre.codeblock {
background-color: var(--wa-color-neutral-fill-normal);
}
}
/* #endregion */
/* #region Brutalist */
html.wa-theme-brutalist .preview-container {
container-name: brutalist-theme;
}
@container brutalist-theme (min-width: 0) {
.overlap {
background: var(--wa-color-surface-lowered) url('/assets/images/themer/brutalist/hero.png') 50% 3% no-repeat;
}
.strata.hero {
height: 42rem;
padding-top: 8rem;
padding-right: 50%;
--wa-font-weight-heading: var(--wa-font-weight-normal);
}
.hero wa-button {
--background: var(--wa-color-neutral-fill-loud);
margin-block-start: var(--wa-space-xl);
font-size: var(--wa-font-size-l);
}
/* imitating the large button styles */
.hero wa-button::part(label) {
padding: 0 var(--wa-space-l);
}
.strata.products {
margin-top: -20rem;
padding-top: 10rem;
}
.product-card .badge-stock {
position: absolute;
top: 0;
left: 0;
}
.product-card::part(footer) {
--wa-shadow-offset-x-s: 0;
--wa-shadow-offset-y-s: 0;
border-width: 0;
text-align: right;
}
.product-card wa-button::part(prefix) {
padding-inline-start: var(--wa-space-xs);
}
.product-card wa-button::part(suffix) {
padding-inline-end: var(--wa-space-xs);
}
.product-card wa-button:not(:last-child) {
margin-inline-end: var(--wa-space-xs);
}
/* imitating the rounded avatar */
.blog wa-avatar {
background-color: transparent;
}
.blog wa-avatar::part(image) {
border: var(--wa-border-width-s) solid var(--wa-color-brand-fill-loud);
border-radius: var(--wa-border-radius-circle);
}
.blog .landscape-frame {
box-shadow: var(--wa-shadow-s);
border: var(--wa-panel-border-width) var(--wa-panel-border-style) var(--wa-color-surface-border);
margin-block-end: var(--wa-shadow-offset-y-s);
}
.post-meta .categories {
display: flex;
flex-direction: column;
}
.message-composer wa-card::part(header) {
background-color: var(--wa-color-neutral-fill-loud);
}
.message-composer .grouped-buttons {
--wa-color-neutral-border-quiet: color-mix(in oklab, var(--wa-color-gray-30), white 40%);
}
.message-composer [slot='header'] wa-icon-button::part(base) {
color: var(--wa-color-neutral-on-loud);
}
.message-composer .grouped-buttons wa-icon-button::part(base):hover {
background-color: var(--wa-color-neutral-fill-normal);
color: var(--wa-color-text-normal);
}
.message-composer wa-tooltip::part(body) {
background-color: var(--wa-color-brand-fill-loud);
color: var(--wa-color-brand-on-loud);
}
.message-composer wa-tooltip::part(base__arrow) {
--arrow-color: var(--wa-color-brand-fill-loud);
}
.message-composer wa-card::part(footer) {
border-width: 0;
--padding: 0 var(--wa-space-s) var(--wa-space-s) var(--wa-space-s);
}
.support-table th {
background-color: var(--wa-color-neutral-fill-loud);
color: var(--wa-color-neutral-on-loud);
}
.support-table th wa-checkbox {
--background: transparent;
--border-color: var(--wa-color-neutral-on-loud);
--border-color-checked: var(--wa-color-neutral-on-loud);
}
.checkout-form {
font-size: var(--wa-font-size-s);
}
.checkout-form .square-frame {
box-shadow: var(--wa-shadow-s);
border: var(--wa-panel-border-width) var(--wa-panel-border-style) var(--wa-color-surface-border);
}
.wa-theme-brutalist.wa-dark {
& p a::before {
background: var(--wa-color-yellow-40);
}
& wa-rating {
--symbol-color: color-mix(in oklab, var(--wa-color-base-80), transparent 50%);
--symbol-color-active: var(--wa-color-gray-80);
}
& wa-alert {
&[variant='brand'] {
--icon-color: var(--wa-color-brand-on-quiet);
}
&[variant='success'] {
--icon-color: var(--wa-color-success-on-quiet);
}
&[variant='warning'] {
--icon-color: var(--wa-color-warning-on-quiet);
}
&[variant='danger'] {
--icon-color: var(--wa-color-danger-on-quiet);
}
&[variant='neutral'] {
--icon-color: var(--wa-color-neutral-on-quiet);
}
}
}
.preview-container pre {
border-inline-start: var(--wa-panel-border-width) var(--wa-panel-border-style) var(--wa-color-neutral-border-quiet);
}
p a,
a.highlite-link {
position: relative;
--wa-link-decoration-default: none;
--wa-link-decoration-hover: none;
&:before {
position: absolute;
z-index: -1;
content: '';
background: var(--wa-color-yellow-80);
width: 100%;
bottom: 0;
height: 50%;
opacity: 0.7;
transition: all var(--wa-transition-fast) ease-in-out;
}
&:hover:before {
height: 100%;
}
}
}
@container brutalist-theme (min-width: 1040px) and (max-width: 1140px) {
.product-card wa-button {
font-size: 80%;
}
}
/* #endregion */
/* #region Playful */
html.wa-theme-playful .preview-container {
container-name: playful-theme;
}
@container playful-theme (min-width: 0) {
.project-header {
color: var(--wa-color-success-on-normal);
}
.hero-background {
position: absolute;
z-index: -1;
top: -60rem;
left: 50%;
width: 250rem;
height: 250rem;
transform: translate(-50%, -50%);
flex-shrink: 0;
border-radius: 50%;
background: linear-gradient(180deg, var(--wa-color-green-90) 69.42%, var(--wa-color-green-80) 100%);
}
.hero-background::after {
background: url(/assets/images/themer/playful/hero.png) 0 50% no-repeat;
content: '';
position: absolute;
width: 520px;
height: 600px;
transform: translateX(-50%);
left: 50%;
bottom: 33rem;
}
.strata.hero {
padding-top: 19rem;
text-align: center;
}
.hero .hero-title {
color: var(--wa-color-success-on-normal);
font-size: var(--wa-font-size-4xl);
}
.hero .hero-cta {
font-size: var(--wa-font-size-l);
}
.product-card .badge-stock {
position: absolute;
top: var(--wa-space-xl);
right: var(--wa-space-xl);
}
.product-card {
--wa-panel-border-radius: var(--wa-border-radius-l);
}
.product-card::part(footer) {
border-width: 0;
}
.product-card wa-button {
margin-inline-end: var(--wa-space-xs);
}
.blog wa-avatar {
--size: 2rem;
}
.blog .landscape-frame {
border-radius: var(--wa-border-radius-l);
box-shadow: var(--wa-shadow-s);
}
.message-composer wa-card {
--background: var(--wa-color-surface-raised);
}
.message-composer wa-card::part(header) {
--wa-color-neutral-border-quiet: var(--wa-color-gray-70);
border-width: 0;
background-color: var(--wa-color-neutral-fill-quiet);
}
&:not(.wa-theme-premium.wa-dark) .message-composer wa-card {
--wa-color-neutral-fill-quiet: var(--wa-color-gray-90);
}
.message-composer wa-icon-button {
color: var(--wa-text-color-normal);
font-size: var(--wa-font-size-l);
}
.message-composer wa-card::part(footer) {
padding-top: 0;
}
.product-detail .price {
font-weight: var(--wa-font-weight-bold);
}
.support-table wa-card {
background: var(--wa-color-surface-raised);
}
.support-table th {
font-size: var(--wa-font-size-s);
font-weight: var(--wa-font-weight-bold);
background-color: var(--wa-color-surface-lowered);
}
.support-table tr {
border-top-color: var(--wa-color-surface-lowered);
}
.support-table .excerpt {
color: var(--wa-color-text-quiet);
}
.order-item img {
border-radius: var(--wa-border-radius-m);
}
.checkout-form {
font-size: var(--wa-font-size-s);
}
.checkout-form h2 {
font-size: var(--wa-font-size-3xl);
}
.checkout-form wa-input::part(form-control-label),
.checkout-form wa-select::part(form-control-label) {
font-size: var(--wa-font-size-s);
padding-block-end: var(--wa-space-xs);
}
.wa-theme-playful.wa-dark {
& .hero-background {
background: linear-gradient(180deg, var(--wa-color-green-60) 69.42%, var(--wa-color-green-30) 100%);
}
& .message-composer wa-card {
border-color: var(--wa-color-gray-30);
}
& .message-composer wa-card::part(header) {
background: var(--wa-color-gray-40);
}
& .message-composer wa-card::part(footer) {
border-top: 0;
}
& .message-composer .tools .grouped-buttons:not(:last-of-type) {
--wa-color-neutral-border-quiet: var(--wa-color-gray-40);
}
& .support-table th {
background: var(--wa-color-surface-lowered);
}
}
}
/* responsive */
@container playful-theme (min-width: 1040px) and (max-width: 1140px) {
.product-card wa-button {
font-size: 80%;
margin-inline-end: 0;
}
}
/* #endregion */
/* #region Active */
html.wa-theme-active .preview-container {
container-name: active-theme;
}
@container active-theme (min-width: 0) {
.hero-background::after {
backdrop-filter: brightness(0.8);
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.hero-background {
background: linear-gradient(
var(--wa-color-green-80) 20%,
var(--wa-color-primary-80) 80.5%,
var(--wa-color-base-10) 80.5%,
var(--wa-color-primary-80) 100%
);
background: url(/assets/images/themer/active/hero.png) 50% 0px / cover no-repeat;
height: 40rem;
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: -1;
}
.strata.hero {
height: 24rem;
}
.hero .title {
text-align: right;
margin-inline-start: 55%;
}
.hero .hero-title {
font-style: italic;
font-weight: var(--wa-font-weight-black);
font-size: var(--wa-font-size-2xl);
}
.hero wa-button[variant='brand'] {
--background: var(--wa-color-neutral-fill-quiet);
--text-color: var(--wa-color-neutral-on-normal);
}
wa-rating {
--symbol-color-active: var(--wa-color-brand-on-quiet);
}
}
/* responsive */
@container preview (min-width: 1100px) {
.hero-background {
height: 47rem;
}
.strata.hero {
height: 30rem;
}
.hero .title {
margin-block-start: 10%;
}
}
/* #endregion */
/* #region Premium */
html.wa-theme-premium .preview-container {
container-name: premium-theme;
}
@container premium-theme (min-width: 0) {
.project-header {
background-color: var(--wa-color-warning-fill-normal);
}
.strata.hero {
height: 60rem;
background: var(--wa-color-warning-fill-normal) url('/assets/images/themer/premium/hero.png') -4rem 12rem no-repeat;
background-size: cover;
padding-top: var(--wa-space-2xl);
padding-left: var(--wa-space-s);
text-align: right;
}
.hero .hero-title {
color: var(--wa-color-warning-on-normal);
font-style: italic;
}
.blog wa-avatar {
border-radius: var(--wa-border-radius-circle);
overflow: hidden;
}
.strata.products {
margin-top: -25rem;
padding-top: 10rem;
background: linear-gradient(0deg, var(--wa-color-surface-lowered) 80%, rgba(255, 255, 255, 0) 100%);
}
.product-card .badge-stock {
position: absolute;
top: var(--wa-space-xl);
right: var(--wa-space-xl);
}
.product-card wa-rating {
--symbol-size: var(--wa-font-size-m);
}
.product-card .title {
font-size: var(--wa-font-size-2xl);
}
.product-card .description {
color: var(--wa-color-text-quiet);
}
.product-card::part(footer) {
border-width: 0;
}
.product-card wa-button:not(:last-child) {
margin-inline-end: var(--wa-space-xs);
}
.blog .authors a {
--wa-color-text-link: var(--wa-color-text-quiet);
--wa-link-decoration-default: none;
}
.message-composer wa-card {
background: var(--wa-color-surface-raised);
}
.message-composer wa-card::part(header) {
border-width: 0;
background-color: var(--wa-color-neutral-fill-quiet);
}
&:not(.wa-theme-premium.wa-dark) .message-composer wa-card {
--wa-color-neutral-fill-quiet: var(--wa-color-base-95);
}
.message-composer wa-card::part(footer) {
border-width: 0;
--padding: var(--wa-space-s) var(--wa-space-xl);
}
.message-composer .grouped-buttons wa-icon-button::part(base) {
block-size: var(--wa-form-control-height-s);
inline-size: var(--wa-form-control-height-s);
justify-content: center;
}
.message-composer .grouped-buttons wa-icon-button::part(base):hover {
background-color: var(--wa-color-neutral-fill-normal);
color: var(--wa-color-text-normal);
}
.support-table th {
text-transform: uppercase;
font-weight: var(--wa-font-weight-normal);
color: var(--wa-color-text-quiet);
background-color: var(--wa-color-surface-lowered);
}
.support-table th:first-child {
border-radius: var(--wa-border-radius-l) 0 0 0;
}
.support-table th:last-child {
border-radius: 0 var(--wa-border-radius-l) 0 0;
}
.support-table tr {
--wa-color-surface-border: var(--wa-color-surface-lowered);
}
.checkout-form wa-input::part(form-control-label),
.checkout-form wa-select::part(form-control-label) {
font-size: var(--wa-font-size-s);
margin-block-end: var(--wa-space-xs);
}
.order-item .finish {
color: var(--wa-color-text-quiet);
font-size: var(--wa-font-size-s);
font-style: italic;
}
.wa-theme-premium.wa-dark {
& .message-composer .tools .grouped-buttons:not(:last-of-type) {
--wa-color-neutral-border-quiet: var(--wa-color-base-40);
}
& .preview-container pre,
& .preview-container code {
background-color: var(--wa-color-base-20);
}
/* syntax highlighting */
& .token {
&.selector {
color: var(--wa-color-green-80);
}
&.tag {
color: var(--wa-color-primary-80);
}
&.punctuation {
color: var(--wa-color-base-95);
}
&.attr-name {
color: var(--wa-color-green-80);
}
&.attr-value {
color: var(--wa-color-yellow-80);
}
}
}
.preview-container pre,
.preview-container code {
background-color: var(--wa-color-base-90);
font-size: var(--font-size-m);
}
/* syntax highlighting */
.token {
&.selector {
color: var(--wa-color-green-30);
}
&.tag {
color: var(--wa-color-primary-30);
}
&.punctuation {
color: var(--wa-color-base-10);
}
&.attr-name {
color: var(--wa-color-green-30);
}
&.attr-value {
color: var(--wa-color-yellow-30);
}
}
}
/* responsive */
@container preview (min-width: 1040px) {
.strata.hero {
background: var(--wa-color-warning-fill-normal) url('/assets/images/themer/premium/hero.png') -4rem 35% no-repeat;
padding-top: 15rem;
padding-left: 50%;
}
.strata.products {
margin-top: -25rem;
padding-top: 10rem;
background: linear-gradient(0deg, var(--wa-color-surface-lowered) 60%, rgba(255, 255, 255, 0) 100%);
}
}
/* #endregion */

View File

@@ -0,0 +1,34 @@
.theme-color-icon {
display: grid;
gap: var(--wa-space-xs);
grid-template-columns: repeat(4, auto);
div {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
border-radius: var(--wa-border-radius-m);
background-color: var(--background-color);
border: var(--wa-border-width-s) var(--wa-border-style) var(--border-color);
padding: var(--wa-space-2xs) var(--wa-space-xs);
color: var(--text-color);
font-weight: var(--wa-font-weight-semibold);
&.plain {
font-weight: var(--wa-font-weight-bold);
}
}
}
.theme-typography-icon {
display: flex;
flex-direction: column;
gap: var(--wa-space-xs);
h3,
p {
margin-block: 0;
padding: 0;
}
}

View File

@@ -1,7 +1,8 @@
---
title: Animated Image
description: A component for displaying animated GIFs and WEBPs that play and pause on interaction.
layout: component
tags: [imagery, niche]
icon: animated-image
---
```html {.example}

View File

@@ -1,7 +1,8 @@
---
title: Animation
description: Animate elements declaratively with nearly 100 baked-in presets, or roll your own with custom keyframes.
layout: component
tags: [helpers, primitives]
icon: animation
---
To animate an element, wrap it in `<wa-animation>` and set an animation `name`. The animation will not start until you add the `play` attribute. Refer to the [properties table](#properties) for a list of all animation options.
@@ -76,9 +77,9 @@ This example demonstrates all of the baked-in animations and easings. Animations
easingName.appendChild(option);
});
animationName.addEventListener('wa-change', () => (animation.name = animationName.value));
easingName.addEventListener('wa-change', () => (animation.easing = easingName.value));
playbackRate.addEventListener('wa-input', () => (animation.playbackRate = playbackRate.value));
animationName.addEventListener('change', () => (animation.name = animationName.value));
easingName.addEventListener('change', () => (animation.easing = easingName.value));
playbackRate.addEventListener('input', () => (animation.playbackRate = playbackRate.value));
</script>
<style>
@@ -196,4 +197,3 @@ Animations won't play until you apply the `play` attribute. You can omit it init
animation.play = true;
});
</script>
```

Some files were not shown because too many files have changed in this diff Show More