Compare commits

..

33 Commits

Author SHA1 Message Date
konnorrogers
2b69fa74a5 Bump package.json version 2025-12-16 13:21:23 -05:00
konnorrogers
d1b6628d59 update package lock 2025-12-16 11:48:56 -05:00
konnorrogers
4dca4185e7 Bump changelog 2025-12-16 11:48:29 -05:00
Konnor Rogers
1e6d468959 add changelog entry (#1877) 2025-12-16 11:46:01 -05:00
Cory LaViska
00b8150f3e ensure min/max/step are numbers; fixes #1823 (#1832)
Co-authored-by: konnorrogers <konnor5456@gmail.com>
2025-12-16 11:06:27 -05:00
Konnor Rogers
3d395653fc Bug fix: el.form = 'foo' no longer sets the el.form property (#1815)
* Bug fix: el.form = 'foo' no longer sets the el.form property

* add changelog entry

* add changelog entry

* prettier

* fix form

* skip style attr for button

* prettier
2025-12-16 10:59:40 -05:00
Konnor Rogers
b3844ef77f fixing deploy scripts, and updating root version (#1857)
* fixing deploy scripts

* update root version script

* prettier
2025-12-16 10:29:26 -05:00
Lindsay M
a50648c6e8 Update changelog with leftover items (#1874)
* add leftover logs

* remove video component log
2025-12-15 17:49:56 -05:00
Cory LaViska
b6b82fb0ac Revert "updated sidebar (#1873)" (#1875)
This reverts commit fa073e8d21.
2025-12-15 15:59:38 -05:00
Kelsey Jackson
fa073e8d21 updated sidebar (#1873)
* updated sidebar

* added video item

* fixed formatting

* update

---------

Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
2025-12-15 15:01:32 -05:00
Cory LaViska
e0f6ff11ec Combobox (supporting contributions in free) (#1838)
* hold the mustard! let's make it yellower

* words

* update sidebar

* update changelog

* fix icon cropping

* add combobox support

* preserve user-selected order

* add quick pro flag

* move import to the top

* fix custom tag example
2025-12-11 13:04:42 -05:00
Cory LaViska
895fb304e0 Revert .css => .styles.ts (#1865)
* revert .css => .styles.ts; fixes #1812

* fix native styles and vh util

* remove layers in component CSS

* add layer
2025-12-11 11:32:51 -05:00
Brian Talbot
079c09b9a3 Space Junk Analytics: Remove Plausible Code + Details (#1801)
* removing plausible-based code

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-10 09:38:46 -05:00
Brian Talbot
fa6ccc1ee2 adding cookie consent dialog to base layout (#1840) 2025-12-09 12:10:24 -05:00
David Enke
579e86fc49 fix(wa-button): add missing css transition property (#1850)
fixes #1844
2025-12-08 13:49:22 -05:00
Cory LaViska
2baebca230 remove old and unsupported example (#1842) 2025-12-08 13:37:00 -05:00
Patrick McDougle
c0ced13f06 Add Intersection Observer component to the Utilities Category (#1837) 2025-12-02 11:29:04 -05:00
Cory LaViska
8ae90ef2b2 add missing icon dep (#1828) 2025-11-25 16:35:31 -05:00
Konnor Rogers
5fb6faf527 update webawesome simulation to be closer to the app. (#1789)
* update webawesome simulation to be closer to the app.

* prettier
2025-11-25 12:09:56 -05:00
Cory LaViska
fa558eeda0 update npm-check-updates and set a cooldown (#1820) 2025-11-24 15:58:08 -05:00
Brian Talbot
ed3cb6d782 marking planned pro components in sidebar (#1819) 2025-11-24 12:31:15 -05:00
Lindsay M
09c8f02f79 Use tokens for <wa-dropdown-item> transitions (#1693)
* use tokens for `<wa-dropdown-item>` transitions

* add changelog
2025-11-19 17:50:47 -05:00
Lindsay M
d6fe9f7819 Define and import cascade layers (#1793)
* define cascade layers

* invoke cascade layers in kitchen sink styles

* invoke cascade layers in utilities and native styles

* invoke cascade layers in palettes + consolidate shared palette rules

* invoke cascade layers in themes

* add changelog

* prettier demands whitespace
2025-11-19 17:43:55 -05:00
Cory LaViska
200b02f023 fix scroller styles; closes #1724 (#1785) 2025-11-19 07:34:22 -05:00
Cory LaViska
1429095eed Fix SVG fill in <wa-icon> (#1784)
* fix svg fill; closes #1733

* remove fill
2025-11-19 07:33:56 -05:00
Cory LaViska
9706964511 Fix spinner when <wa-tree-item> is lazy loaded (#1786)
* fix spinner when lazy; closes #1678

* remove redundant entry
2025-11-18 15:31:51 -05:00
Cory LaViska
bb0a961784 remove offending property; fixes #1614 (#1792) 2025-11-18 15:29:57 -05:00
Jesse Jurman
e2f2a8a0d3 Fix: Allow wa-hide to be cancelled in WaDropdown (#1774)
* Fix: Allow wa-hide to be cancelled in WaDropdown

* add tests around open attribute / property

* update changelog
2025-11-18 14:07:53 -05:00
Christian Oliff
86293cc3e1 Remove width property from select component (#1736)
Deleted the duplicate 'width: 100%' style from the select component (already defined on line 56). Also fixed a typo in a comment in the docs CSS. You should setup Stylelint to prevent these issues :-)
2025-11-18 10:03:29 -05:00
Fred
8fb521d9ef Adding a reflect property option to the name property (#1716) 2025-11-17 22:15:18 +00:00
Kelsey Jackson
2491ca45ac Fix appearance="filled-outlined" in <wa-card> (#1694)
* upated filled-outlined attribute for cards

* updated selector

* updated changelog

* updated heading

* updated css

* remove final `~=` selector (thanks @Copilot)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-17 15:12:23 -05:00
Cory LaViska
411d385d65 improve icon perf; closes #1729 (#1783) 2025-11-17 14:49:45 -05:00
Dimitri
634828d89a fix(wa-icon): add waitUntilFirstUpdate: true option to the setIcon() watch decorator (#1738) 2025-11-17 14:49:32 -05:00
198 changed files with 6420 additions and 5759 deletions

View File

@@ -105,6 +105,7 @@
"keydown",
"keyframes",
"keymaker",
"Kickstarter",
"Konnor",
"Kool",
"labelledby",
@@ -117,6 +118,7 @@
"lowercasing",
"Lucide",
"maxlength",
"mdash",
"Menlo",
"menuitemcheckbox",
"menuitemradio",
@@ -130,6 +132,7 @@
"mouseout",
"mouseup",
"multiselectable",
"nbsp",
"nextjs",
"nocheck",
"noindex",
@@ -179,6 +182,7 @@
"shadowrootmode",
"Shortcode",
"Shortcodes",
"signup",
"sitedir",
"slotchange",
"smartquotes",

214
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@webawesome/monorepo",
"version": "3.0.0-alpha.13",
"version": "3.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@webawesome/monorepo",
"version": "3.0.0-alpha.13",
"version": "3.0.0",
"license": "MIT",
"workspaces": [
"packages/*"
@@ -593,6 +593,10 @@
"resolved": "packages/webawesome",
"link": true
},
"node_modules/@awesome.me/webawesome-pro": {
"resolved": "packages/webawesome-pro",
"link": true
},
"node_modules/@babel/code-frame": {
"version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz",
@@ -2519,10 +2523,6 @@
"resolved": "https://registry.npmjs.org/@shoelace-style/localize/-/localize-3.2.1.tgz",
"integrity": "sha512-r4C9C/5kSfMBIr0D9imvpRdCNXtUNgyYThc4YlS6K5Hchv1UyxNQ9mxwj+BTRH2i1Neits260sR3OjKMnplsFA=="
},
"node_modules/@shoelace-style/webawesome-pro": {
"resolved": "packages/webawesome-pro",
"link": true
},
"node_modules/@sindresorhus/is": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
@@ -12139,6 +12139,16 @@
"fsevents": "~2.3.2"
}
},
"node_modules/rollup-plugin-typescript-paths": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-typescript-paths/-/rollup-plugin-typescript-paths-1.5.0.tgz",
"integrity": "sha512-zly2aiGNjYJNq5YUi6eyGrQnCYUQ8b5czOtHZIGriwG9U3Ba2F9hlSklafXCdsNulK/IlNmE0Kzj0h+fVV32pA==",
"dev": true,
"license": "MIT",
"peerDependencies": {
"typescript": ">=3.4"
}
},
"node_modules/run-async": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz",
@@ -14029,15 +14039,16 @@
"devDependencies": {
"@wc-toolkit/jsx-types": "^1.3.0",
"eleventy-plugin-git-commit-date": "^0.1.3",
"esbuild": "^0.25.11"
"esbuild": "^0.25.11",
"npm-check-updates": "^19.1.2"
},
"engines": {
"node": ">=14.17.0"
}
},
"packages/webawesome-pro": {
"name": "@shoelace-style/webawesome-pro",
"version": "3.0.0-beta.6",
"name": "@awesome.me/webawesome-pro",
"version": "3.0.0",
"dependencies": {
"@ctrl/tinycolor": "4.1.0",
"@floating-ui/dom": "^1.6.13",
@@ -14051,8 +14062,11 @@
},
"devDependencies": {
"@wc-toolkit/jsx-types": "^1.3.0",
"@web/dev-server-rollup": "^0.6.4",
"eleventy-plugin-git-commit-date": "^0.1.3",
"esbuild": "^0.25.11"
"esbuild": "^0.25.11",
"npm-check-updates": "^19.1.2",
"rollup-plugin-typescript-paths": "^1.5.0"
},
"engines": {
"node": ">=14.17.0"
@@ -14466,6 +14480,84 @@
"node": ">=18"
}
},
"packages/webawesome-pro/node_modules/@web/dev-server-core": {
"version": "0.7.5",
"resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.7.5.tgz",
"integrity": "sha512-Da65zsiN6iZPMRuj4Oa6YPwvsmZmo5gtPWhW2lx3GTUf5CAEapjVpZVlUXnKPL7M7zRuk72jSsIl8lo+XpTCtw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/koa": "^2.11.6",
"@types/ws": "^7.4.0",
"@web/parse5-utils": "^2.1.0",
"chokidar": "^4.0.1",
"clone": "^2.1.2",
"es-module-lexer": "^1.0.0",
"get-stream": "^6.0.0",
"is-stream": "^2.0.0",
"isbinaryfile": "^5.0.0",
"koa": "^2.13.0",
"koa-etag": "^4.0.0",
"koa-send": "^5.0.1",
"koa-static": "^5.0.0",
"lru-cache": "^8.0.4",
"mime-types": "^2.1.27",
"parse5": "^6.0.1",
"picomatch": "^2.2.2",
"ws": "^7.5.10"
},
"engines": {
"node": ">=18.0.0"
}
},
"packages/webawesome-pro/node_modules/@web/dev-server-rollup": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/@web/dev-server-rollup/-/dev-server-rollup-0.6.4.tgz",
"integrity": "sha512-sJZfTGCCrdku5xYnQQG51odGI092hKY9YFM0X3Z0tRY3iXKXcYRaLZrErw5KfCxr6g0JRuhe4BBhqXTA5Q2I3Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rollup/plugin-node-resolve": "^15.0.1",
"@web/dev-server-core": "^0.7.2",
"nanocolors": "^0.2.1",
"parse5": "^6.0.1",
"rollup": "^4.4.0",
"whatwg-url": "^14.0.0"
},
"engines": {
"node": ">=18.0.0"
}
},
"packages/webawesome-pro/node_modules/@web/parse5-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@web/parse5-utils/-/parse5-utils-2.1.0.tgz",
"integrity": "sha512-GzfK5disEJ6wEjoPwx8AVNwUe9gYIiwc+x//QYxYDAFKUp4Xb1OJAGLc2l2gVrSQmtPGLKrTRcW90Hv4pEq1qA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/parse5": "^6.0.1",
"parse5": "^6.0.1"
},
"engines": {
"node": ">=18.0.0"
}
},
"packages/webawesome-pro/node_modules/chokidar": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
"integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
"dev": true,
"license": "MIT",
"dependencies": {
"readdirp": "^4.0.1"
},
"engines": {
"node": ">= 14.16.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"packages/webawesome-pro/node_modules/esbuild": {
"version": "0.25.11",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.11.tgz",
@@ -14508,6 +14600,16 @@
"@esbuild/win32-x64": "0.25.11"
}
},
"packages/webawesome-pro/node_modules/lru-cache": {
"version": "8.0.5",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz",
"integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=16.14"
}
},
"packages/webawesome-pro/node_modules/nanoid": {
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.5.tgz",
@@ -14525,6 +14627,84 @@
"node": "^18 || >=20"
}
},
"packages/webawesome-pro/node_modules/npm-check-updates": {
"version": "19.1.2",
"resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-19.1.2.tgz",
"integrity": "sha512-FNeFCVgPOj0fz89hOpGtxP2rnnRHR7hD2E8qNU8SMWfkyDZXA/xpgjsL3UMLSo3F/K13QvJDnbxPngulNDDo/g==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"ncu": "build/cli.js",
"npm-check-updates": "build/cli.js"
},
"engines": {
"node": ">=20.0.0",
"npm": ">=8.12.1"
}
},
"packages/webawesome-pro/node_modules/readdirp": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
"integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 14.18.0"
},
"funding": {
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
},
"packages/webawesome-pro/node_modules/tr46": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz",
"integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==",
"dev": true,
"license": "MIT",
"dependencies": {
"punycode": "^2.3.1"
},
"engines": {
"node": ">=18"
}
},
"packages/webawesome-pro/node_modules/whatwg-url": {
"version": "14.2.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz",
"integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==",
"dev": true,
"license": "MIT",
"dependencies": {
"tr46": "^5.1.0",
"webidl-conversions": "^7.0.0"
},
"engines": {
"node": ">=18"
}
},
"packages/webawesome-pro/node_modules/ws": {
"version": "7.5.10",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
"integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8.3.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
},
"packages/webawesome/node_modules/@esbuild/aix-ppc64": {
"version": "0.25.11",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.11.tgz",
@@ -14966,6 +15146,20 @@
"engines": {
"node": "^18 || >=20"
}
},
"packages/webawesome/node_modules/npm-check-updates": {
"version": "19.1.2",
"resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-19.1.2.tgz",
"integrity": "sha512-FNeFCVgPOj0fz89hOpGtxP2rnnRHR7hD2E8qNU8SMWfkyDZXA/xpgjsL3UMLSo3F/K13QvJDnbxPngulNDDo/g==",
"dev": true,
"bin": {
"ncu": "build/cli.js",
"npm-check-updates": "build/cli.js"
},
"engines": {
"node": ">=20.0.0",
"npm": ">=8.12.1"
}
}
}
}

View File

@@ -2,7 +2,7 @@
"name": "@webawesome/monorepo",
"private": true,
"description": "A forward-thinking library of web components.",
"version": "3.0.0-alpha.13",
"version": "3.0.0",
"homepage": "https://webawesome.com/",
"author": "Web Awesome",
"license": "MIT",
@@ -85,4 +85,4 @@
"prettier --write"
]
}
}
}

View File

@@ -14,8 +14,8 @@
<p>Celebrate our official launch with a 20% discount on a Web Awesome Pro plan&hellip;<span class="appearance-underlined variant-drawn" style="--underline-color: var(--wa-color-brand);">for life</span>! But hurry, this lifetime discount is only available for a limited time.</p>
<div class="wa-split">
<wa-button type="button" appearance="plain" data-dialog="close" class="plausible-event-name=launch_dialog:close_button_click">Maybe Later</wa-button>
<wa-button variant="neutral" appearance="accent" href="/purchase" class="brand-font plausible-event-name=launch_dialog:pro_purchase_button_click">
<wa-button type="button" appearance="plain" data-dialog="close">Maybe Later</wa-button>
<wa-button variant="neutral" appearance="accent" href="/purchase" class="brand-font">
<wa-icon slot="start" variant="regular" name="rocket-launch"></wa-icon>
Get Pro + Save 20%
</wa-button>
@@ -43,13 +43,6 @@
return;
}
// Helper function to safely track Plausible events
const trackEvent = (eventName) => {
if (typeof plausible !== 'undefined') {
plausible(eventName);
}
};
// Initialize dialog functionality
let initCalled = false;
const initDialog = () => {
@@ -59,19 +52,8 @@
}
initCalled = true;
// Track when dialog is shown
dialog.addEventListener('wa-show', () => {
trackEvent('launch_dialog:view');
}, { once: true });
// Track when dialog is dismissed
// Save dismissal state when dialog is hidden
dialog.addEventListener('wa-hide', (event) => {
// Track overlay click or Escape key dismissal
// Button clicks are tracked via CSS classes, so we only track non-button dismissals
if (event.detail?.source === dialog) {
trackEvent('launch_dialog:overlay_click');
}
// Save dismissal state to localStorage
try {
localStorage.setItem(SITE_DIALOG_DISMISSED_KEY, 'true');

View File

@@ -17,7 +17,6 @@
<script type="module" src="/assets/scripts/color-scheme.js"></script>
<script type="module" src="/assets/scripts/theme.js"></script>
{% if hasSidebar %}<script type="module" src="/assets/scripts/sidebar.js"></script>{% endif %}
<script defer data-domain="webawesome.com" src="https://plausible.io/js/script.js"></script>
{% block head %}
<link rel="stylesheet" href="/assets/styles/docs.css" />
@@ -142,6 +141,9 @@
{% include "_dialog-wa-launch.njk" ignore missing %}
{% endif %}
{#- Cookie Consent Dialog -#}
{% include "cookie-consent.njk" ignore missing %}
{# Footer #}
{% block pageFooter %}{% endblock %}
</wa-page>

View File

@@ -78,10 +78,18 @@
</li>
</ul>
</li>
<li><span class="is-planned wa-split">Charts <a href="https://github.com/shoelace-style/webawesome/issues/1073" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a></span></li>
<li><span class="is-planned wa-split">Charts <span><a href="https://github.com/shoelace-style/webawesome/issues/1073" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a>{{ proBadge({ description: "This will require access to Web Awesome Pro" }) }}</span></span></li>
<li><a href="/docs/components/checkbox/">Checkbox</a></li>
<li><a href="/docs/components/color-picker/">Color Picker</a></li>
<li><span class="is-planned wa-split">Combobox <a href="https://github.com/shoelace-style/webawesome/issues/1074" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a></span></li>
<li>
<span class="wa-split">
<span>
<a href="/docs/components/combobox">Combobox</a>
<wa-icon name="flask" aria-hidden="true" class="icon-shrink"></wa-icon>
</span>
{{ proBadge() }}
</span>
</li>
<li><a href="/docs/components/comparison/">Comparison</a></li>
<li>
<a class="wa-cluster wa-gap-xs" href="/docs/components/copy-button/">
@@ -89,8 +97,8 @@
<wa-icon name="flask" aria-hidden="true" class="icon-shrink"></wa-icon>
</a>
</li>
<li><span class="is-planned wa-split">Data Grid <a href="https://github.com/shoelace-style/webawesome/issues/1072" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a></span></li>
<li><span class="is-planned wa-split">Datepicker <a href="https://github.com/shoelace-style/webawesome/issues/1075" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a></span></li>
<li><span class="is-planned wa-split">Data Grid <span><a href="https://github.com/shoelace-style/webawesome/issues/1072" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a>{{ proBadge({ description: "This will require access to Web Awesome Pro" }) }}</span></span></li>
<li><span class="is-planned wa-split">Date Picker <span><a href="https://github.com/shoelace-style/webawesome/issues/1075" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a>{{ proBadge({ description: "This will require access to Web Awesome Pro" }) }}</span></span></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>
@@ -101,7 +109,7 @@
<li><a href="/docs/components/dropdown-item">Dropdown Item</a></li>
</ul>
</li>
<li><span class="is-planned wa-split">File Input <a href="https://github.com/shoelace-style/webawesome/issues/1240" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a></span></li>
<li><span class="is-planned wa-split">File Input <span><a href="https://github.com/shoelace-style/webawesome/issues/1240" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a>{{ proBadge({ description: "This will require access to Web Awesome Pro" }) }}</span></span></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>
@@ -146,7 +154,7 @@
</li>
<li><a href="/docs/components/tag/">Tag</a></li>
<li><a href="/docs/components/textarea/">Textarea</a></li>
<li><span class="is-planned wa-split">Toast <a href="https://github.com/shoelace-style/webawesome/issues/105" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a></span></li>
<li><span class="is-planned wa-split">Toast <span><a href="https://github.com/shoelace-style/webawesome/issues/105" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a>{{ proBadge( { description: "This will require access to Web Awesome Pro" }) }}</span></span></li>
<li><a href="/docs/components/tooltip/">Tooltip</a></li>
<li>
<a href="/docs/components/tree/">Tree</a>
@@ -154,7 +162,7 @@
<li><a href="/docs/components/tree-item/">Tree Item</a></li>
</ul>
</li>
<li><span class="is-planned wa-split">Video <a href="https://github.com/shoelace-style/webawesome/issues/985" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a></span></li>
<li><span class="is-planned wa-split">Video <span><a href="https://github.com/shoelace-style/webawesome/issues/985" target="_blank">{{ plannedBadge("A Web Awesome Kickstarter stretch goal!") }}</a>{{ proBadge( { description: "This will require access to Web Awesome Pro" }) }}</span></span></li>
<li><a href="/docs/components/zoomable-frame">Zoomable Frame</a></li>
{# PLOP_NEW_COMPONENT_PLACEHOLDER #}
</ul>

View File

@@ -8,10 +8,13 @@
<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 %}
{% if component.status == 'experimental' %}variant="warning" appearance="filled"{% endif %}
>
{{ component.status }}
</wa-badge>
{% if isProComponent %}
<wa-badge class="pro">Pro</wa-badge>
{% endif %}
</div>
<p class="component-summary">
{{ component.summary | inlineMarkdown | safe }}
@@ -20,6 +23,37 @@
{# Component API #}
{% block afterContent %}
{# Importing #}
<h2>Importing</h2>
<p>
Autoloading components via <a href="/docs/#using-a-project">projects</a> is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets.
</p>
{% set componentName = component.tagName | stripPrefix %}
{% set componentPath = ["components/", componentName, "/", componentName, ".js"] | join("") %}
<wa-tab-group label="How would you like to import this component?">
<wa-tab panel="cdn">CDN</wa-tab>
<wa-tab panel="npm">npm</wa-tab>
<wa-tab panel="react">React</wa-tab>
<wa-tab-panel name="cdn">
<p>
Let your project code do the work! <a href="/signup">Sign up for free</a> to use a project with your very own CDN &mdash; it's the fastest and easiest way to use Web Awesome.
</p>
</wa-tab-panel>
<wa-tab-panel name="npm">
<p>
To manually import this component from NPM, use the following code.
</p>
<pre><code class="language-js">import '@awesome.me/webawesome/dist/{{ componentPath }}';</code></pre>
</wa-tab-panel>
<wa-tab-panel name="react">
<p>
To manually import this component from React, use the following code.
</p>
<pre><code class="language-js">import {{ component.name }} from '@awesome.me/webawesome/dist/react/{{ componentName }}';</code></pre>
</wa-tab-panel>
</wa-tab-group>
{# Slots #}
{% if component.slots.length %}
<h2>Slots</h2>
@@ -270,38 +304,6 @@
</ul>
{% endif %}
{# Importing #}
<h2>Importing</h2>
<p>
Autoloading components via <a href="/docs/#using-a-project">projects</a> is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets.
</p>
{% set componentName = component.tagName | stripPrefix %}
{% set componentPath = ["components/", componentName, "/", componentName, ".js"] | join("") %}
<wa-tab-group label="How would you like to import this component?">
<wa-tab panel="cdn">CDN</wa-tab>
<wa-tab panel="npm">npm</wa-tab>
<wa-tab panel="react">React</wa-tab>
<wa-tab-panel name="cdn">
<p>
Let your project code do the work! <a href="/signup">Sign up for free</a> to use a project with your very own CDN &mdash; it's the fastest and easiest way to use Web Awesome.
</p>
</wa-tab-panel>
<wa-tab-panel name="npm">
<p>
To manually import this component from NPM, use the following code.
</p>
<pre><code class="language-js">import '@awesome.me/webawesome/dist/{{ componentPath }}';</code></pre>
</wa-tab-panel>
<wa-tab-panel name="react">
<p>
To manually import this component from React, use the following code.
</p>
<pre><code class="language-js">import {{ component.name }} from '@awesome.me/webawesome/dist/react/{{ componentName }}';</code></pre>
</wa-tab-panel>
</wa-tab-group>
<wa-divider></wa-divider>
<div class="component-help">

View File

@@ -1,10 +1,20 @@
import * as path from 'node:path';
import nunjucks from 'nunjucks';
const baseDir = process.env.BASE_DIR || 'docs';
const views = [path.join(baseDir), path.join(baseDir, '_layouts'), path.join(baseDir, '_includes')];
const nunjucksEnv = new nunjucks.Environment(new nunjucks.FileSystemLoader(views), {
autoescape: true,
noCache: process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test',
});
/**
* This function simulates what a server would do running "on top" of eleventy.
*/
export function SimulateWebAwesomeApp(str) {
return nunjucks.renderString(str, {
return nunjucksEnv.renderString(str, {
// Stub the server EJS shortcodes.
currentUser: {
hasPro: false,

View File

@@ -38,7 +38,7 @@ wa-page > [slot='banner'] {
}
&.banner-wa-launch {
/* custom brand colors carrried over from theme-site for the banner */
/* custom brand colors carried over from theme-site for the banner */
--wa-color-brand-95: #fef0ec;
--wa-color-brand-90: #fce0d8;
--wa-color-brand-80: #f8bcac;

View File

@@ -5,7 +5,6 @@
border-radius: var(--wa-border-radius-l);
padding: 0;
margin: 0 auto;
overflow: hidden;
&::part(dialog) {
margin-block-start: 10vh;

View File

@@ -40,60 +40,6 @@ Set the `orientation` attribute to `vertical` to make a vertical button group.
</wa-button-group>
```
### Theme Buttons
Theme buttons are supported through the button group's `variant` attribute.
```html {.example}
<wa-button-group label="Alignment" variant="brand">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
<wa-button-group label="Alignment" variant="success">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
<wa-button-group label="Alignment">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
<wa-button-group label="Alignment" variant="warning">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
<wa-button-group label="Alignment" variant="danger">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
```
You can still use the buttons own `variant` attribute to override the inherited variant.
```html {.example}
<wa-button-group label="Alignment" variant="brand">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button variant="neutral">Right</wa-button>
</wa-button-group>
```
### Pill Buttons
Pill buttons are supported through the button's `pill` attribute.

View File

@@ -2,6 +2,7 @@
title: Intersection Observer
description: Tracks immediate child elements and fires events as they move in and out of view.
layout: component
category: Utilities
---
This component leverages the [IntersectionObserver API](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) to track when its direct children enter or leave a designated root element. The `wa-intersect` event fires whenever elements cross the visibility threshold.

View File

@@ -285,9 +285,10 @@ Remember that custom tags are rendered in a shadow root. To style them, you can
const name = option.querySelector('wa-icon[slot="start"]').name;
// You can return a string, a Lit Template, or an HTMLElement here
// Important: include data-value so the tag can be removed properly!
return `
<wa-tag with-remove>
<wa-icon name="${name}" style="padding-inline-end: .5rem;"></wa-icon>
<wa-tag with-remove data-value="${option.value}">
<wa-icon name="${name}"></wa-icon>
${option.label}
</wa-tag>
`;
@@ -299,6 +300,10 @@ Remember that custom tags are rendered in a shadow root. To style them, you can
Be sure you trust the content you are outputting! Passing unsanitized user input to `getTag()` can result in XSS vulnerabilities.
:::
:::info
When using custom tags with `with-remove`, you must include the `data-value` attribute set to the option's value. This allows the select to identify which option to deselect when the tag's remove button is clicked.
:::
### Lazy loading options
Lazy loading options works similarly to native `<select>` elements. The select component handles various scenarios intelligently:

View File

@@ -11,18 +11,35 @@ Web Awesome follows [Semantic Versioning](https://semver.org/). Breaking changes
Components with the <wa-badge variant="warning">Experimental</wa-badge> badge should not be used in production. They are made available as release candidates for development and testing purposes. As such, changes to experimental components will not be subject to semantic versioning.
## Next
## 3.1.0
- Added `<wa-combobox>` as an experimental pro component [issue:1074]
- Added version 2.0.0 of the [official Web Awesome Figma Design Kit](/docs/resources/figma)
- Added npm support for Web Awesome Pro
- Added `layers.css` to define cascade layer order and updated palettes, themes, native styles, and utilities to import the new rule for more fail-safe modularity [pr:1793]
- [PRO]: Fixed a few sizing bugs in `<wa-page>` and `slot="footer"` no longer will always "overflow" the container.
- Fixed a bug in `<wa-slider>` that caused some touch devices to end up with the incorrect value [issue:1703]
- Fixed a bug in `<wa-card>` that prevented some slots from being detected correctly [discuss:1450]
- Fixed a z-index bug in `<wa-scroller>` styles [issue:1724]
- Fixed a bug in `<wa-icon>` that caused some icon libraries to render with the incorrect SVG fill [issue:1733]
- Fixed a bug in `<wa-tree-item>` that caused the spinner to not show when lazy loading [issue:1678]
- Fixed a bug in `<wa-dropdown>` that caused the browser to hang when cancelling the `wa-hide` event [issue:1483]
- Fixed a bug in `<wa-dropdown-item>` that prevented the icon dependency from being imported [issue:1825]
- Fixed a bug in `<wa-select>` that prevented clicks on the tag's remove button from removing options in multiple mode
- Fixed a bug in `<wa-select>` that caused tags to appear in alphabetical order instead of selection order when using `multiple`
- Improved performance of `<wa-icon>` so initial rendering occurs faster, especially with multiple icons on the page [issue:1729]
- Improved `<wa-slider>` to not throw an error when string values are passed to the `min`, `max`, and `step` properties [issue:1823]
- Fixed a bug in Web Awesome form controls that caused `<wa-input form="foo">` to set the form property to equal `"foo"` instead of returning an `HTMLFormElement` breaking platform expectations. [pr:1815]
- Fixed a bug in `<wa-button>` causing it to not copy over attributes for form submissions. [pr:1815]
- Improved performance of all components by fixing how CSS is imported and reused [issue:1812]
- Modified the default `transition` styles of `<wa-dropdown-item>` to use design tokens [pr:1693]
## 3.0.0
- 🚨 BREAKING: Changed `appearance="filled outlined"` to `appearance="filled-outlined"` in the following elements [issue:1127]
- `<wa-badge>`
- `<wa-button>`
- `<wa-callout>`
- `<wa-card>`
- `<wa-details>`
- `<wa-input>`
- `<wa-select>`
@@ -499,4 +516,4 @@ Many of these changes and improvements were the direct result of feedback from u
</details>
Did we miss something? [Let us know!](https://github.com/shoelace-style/webawesome/discussions)
Did we miss something? [Let us know!](https://github.com/shoelace-style/webawesome/discussions)

View File

@@ -4,7 +4,7 @@
"access": "public"
},
"description": "A forward-thinking library of web components.",
"version": "3.0.0",
"version": "3.1.0",
"homepage": "https://webawesome.com/",
"author": "Web Awesome",
"license": "MIT",
@@ -64,10 +64,10 @@
"spellcheck": "cspell \"**/*.{js,ts,json,html,css,md}\" --no-progress --config=\"../../cspell.json\"",
"verify": "npm run prettier && npm run build && npm run test",
"prepublishOnly": "npm run verify",
"check-updates": "npx npm-check-updates --interactive --format group",
"check-updates": "npm-check-updates --cooldown 7 --interactive --format group",
"print-version": "echo $npm_package_version",
"tag-version": "git tag -a \"v$(npm run print-version | tail -n1)\" -m \"tag v$(npm run print-version | tail -n1)\"",
"postversion": "npm run tag-version"
"postversion": "node ./scripts/update-root-version.js"
},
"engines": {
"node": ">=14.17.0"
@@ -91,6 +91,7 @@
"devDependencies": {
"@wc-toolkit/jsx-types": "^1.3.0",
"eleventy-plugin-git-commit-date": "^0.1.3",
"esbuild": "^0.25.11"
"esbuild": "^0.25.11",
"npm-check-updates": "^19.1.2"
}
}

View File

@@ -230,9 +230,6 @@ export async function build(options = {}) {
js: `/*! Copyright ${currentYear} Fonticons, Inc. - https://webawesome.com/license */`,
},
plugins: [replace({ __WEBAWESOME_VERSION__: await getVersion() })],
loader: {
'.css': 'text',
},
};
const unbundledConfig = {

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env node
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as url from 'url';
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
const monorepoRoot = path.resolve(__dirname, '..', '..', '..');
const rootPackageJSONFile = path.join(monorepoRoot, 'package.json');
const webawesomePackageJSONFile = path.join(path.resolve(__dirname, '..'), 'package.json');
const rootPackageJSON = JSON.parse(fs.readFileSync(rootPackageJSONFile, { encoding: "utf8" }));
const webawesomePackageJSON = JSON.parse(fs.readFileSync(webawesomePackageJSONFile, { encoding: "utf8" }));
const currentVersion = webawesomePackageJSON.version;
rootPackageJSON.version = currentVersion;
fs.writeFileSync(rootPackageJSONFile, JSON.stringify(rootPackageJSON, null, 2));
const versionsFile = path.join(monorepoRoot, 'VERSIONS.txt');
const versions = fs.readFileSync(versionsFile, { encoding: "utf8" }).split(/\r?\n/);
// TODO: Make this smart and understand semver and "insert" in the correct spot instead of appending.
if (!versions.includes(currentVersion)) {
fs.appendFileSync(versionsFile, webawesomePackageJSON.version);
}

View File

@@ -1,65 +0,0 @@
:host {
--control-box-size: 3rem;
--icon-size: calc(var(--control-box-size) * 0.625);
display: inline-flex;
position: relative;
cursor: pointer;
}
img {
display: block;
width: 100%;
height: 100%;
}
img[aria-hidden='true'] {
display: none;
}
.control-box {
display: flex;
position: absolute;
align-items: center;
justify-content: center;
top: calc(50% - var(--control-box-size) / 2);
right: calc(50% - var(--control-box-size) / 2);
width: var(--control-box-size);
height: var(--control-box-size);
font-size: calc(var(--icon-size) * 0.75);
background: none;
border: solid var(--wa-border-width-s) currentColor;
background-color: rgb(0 0 0 / 50%);
border-radius: var(--wa-border-radius-circle);
color: white;
pointer-events: none;
transition: opacity var(--wa-transition-normal) var(--wa-transition-easing);
}
@media (hover: hover) {
:host([play]:hover) .control-box {
opacity: 1;
}
}
:where(:host([play]:not(:hover))) .control-box {
opacity: 0;
}
:host([play]) slot[name='play-icon'],
:host(:not([play])) slot[name='pause-icon'] {
display: none;
}
/* Show control box on keyboard focus */
.animated-image {
&:focus {
outline: none;
}
&:focus-visible .control-box {
opacity: 1;
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
}

View File

@@ -0,0 +1,69 @@
import { css } from 'lit';
export default css`
:host {
--control-box-size: 3rem;
--icon-size: calc(var(--control-box-size) * 0.625);
display: inline-flex;
position: relative;
cursor: pointer;
}
img {
display: block;
width: 100%;
height: 100%;
}
img[aria-hidden='true'] {
display: none;
}
.control-box {
display: flex;
position: absolute;
align-items: center;
justify-content: center;
top: calc(50% - var(--control-box-size) / 2);
right: calc(50% - var(--control-box-size) / 2);
width: var(--control-box-size);
height: var(--control-box-size);
font-size: calc(var(--icon-size) * 0.75);
background: none;
border: solid var(--wa-border-width-s) currentColor;
background-color: rgb(0 0 0 / 50%);
border-radius: var(--wa-border-radius-circle);
color: white;
pointer-events: none;
transition: opacity var(--wa-transition-normal) var(--wa-transition-easing);
}
@media (hover: hover) {
:host([play]:hover) .control-box {
opacity: 1;
}
}
:where(:host([play]:not(:hover))) .control-box {
opacity: 0;
}
:host([play]) slot[name='play-icon'],
:host(:not([play])) slot[name='pause-icon'] {
display: none;
}
/* Show control box on keyboard focus */
.animated-image {
&:focus {
outline: none;
}
&:focus-visible .control-box {
opacity: 1;
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
}
`;

View File

@@ -6,7 +6,7 @@ import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../icon/icon.js';
import styles from './animated-image.css';
import styles from './animated-image.styles.js';
/**
* @summary A component for displaying animated GIFs and WEBPs that play and pause on interaction.

View File

@@ -1,3 +0,0 @@
:host {
display: contents;
}

View File

@@ -0,0 +1,7 @@
import { css } from 'lit';
export default css`
:host {
display: contents;
}
`;

View File

@@ -5,7 +5,7 @@ import { WaFinishEvent } from '../../events/finish.js';
import { WaStartEvent } from '../../events/start.js';
import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './animation.css';
import styles from './animation.styles.js';
import { animations } from './animations.js';
/**

View File

@@ -1,53 +0,0 @@
:host {
--size: 3rem;
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
width: var(--size);
height: var(--size);
color: var(--wa-color-neutral-on-normal);
font: inherit;
font-size: calc(var(--size) * 0.4);
vertical-align: middle;
background-color: var(--wa-color-neutral-fill-normal);
border-radius: var(--wa-border-radius-circle);
user-select: none;
-webkit-user-select: none;
}
:host([shape='square']) {
border-radius: 0;
}
:host([shape='rounded']) {
border-radius: var(--wa-border-radius-m);
}
.icon {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.initials {
line-height: 1;
text-transform: uppercase;
}
.image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
overflow: hidden;
border-radius: inherit;
}

View File

@@ -0,0 +1,57 @@
import { css } from 'lit';
export default css`
:host {
--size: 3rem;
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
width: var(--size);
height: var(--size);
color: var(--wa-color-neutral-on-normal);
font: inherit;
font-size: calc(var(--size) * 0.4);
vertical-align: middle;
background-color: var(--wa-color-neutral-fill-normal);
border-radius: var(--wa-border-radius-circle);
user-select: none;
-webkit-user-select: none;
}
:host([shape='square']) {
border-radius: 0;
}
:host([shape='rounded']) {
border-radius: var(--wa-border-radius-m);
}
.icon {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.initials {
line-height: 1;
text-transform: uppercase;
}
.image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
overflow: hidden;
border-radius: inherit;
}
`;

View File

@@ -4,7 +4,7 @@ import { WaErrorEvent } from '../../events/error.js';
import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import '../icon/icon.js';
import styles from './avatar.css';
import styles from './avatar.styles.js';
/**
* @summary Avatars are used to represent a person or object.

View File

@@ -1,104 +0,0 @@
:host {
--pulse-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.375em 0.625em;
color: var(--wa-color-on-loud, var(--wa-color-brand-on-loud));
font-size: max(var(--wa-font-size-2xs), 0.75em);
font-weight: var(--wa-font-weight-semibold);
line-height: 1;
white-space: nowrap;
background-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
border-color: transparent;
border-radius: var(--wa-border-radius-s);
border-style: var(--wa-border-style);
border-width: var(--wa-border-width-s);
user-select: none;
-webkit-user-select: none;
cursor: inherit;
}
/* Appearance modifiers */
:host([appearance='outlined']) {
--pulse-color: var(--wa-color-border-loud, var(--wa-color-brand-border-loud));
color: var(--wa-color-on-quiet, var(--wa-color-brand-on-quiet));
background-color: transparent;
border-color: var(--wa-color-border-loud, var(--wa-color-brand-border-loud));
}
:host([appearance='filled']) {
--pulse-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal));
color: var(--wa-color-on-normal, var(--wa-color-brand-on-normal));
background-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal));
border-color: transparent;
}
:host([appearance='filled-outlined']) {
--pulse-color: var(--wa-color-border-normal, var(--wa-color-brand-border-normal));
color: var(--wa-color-on-normal, var(--wa-color-brand-on-normal));
background-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal));
border-color: var(--wa-color-border-normal, var(--wa-color-brand-border-normal));
}
:host([appearance='accent']) {
--pulse-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
color: var(--wa-color-on-loud, var(--wa-color-brand-on-loud));
background-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
border-color: transparent;
}
/* Pill modifier */
:host([pill]) {
border-radius: var(--wa-border-radius-pill);
}
/* Pulse attention */
:host([attention='pulse']) {
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 var(--pulse-color);
}
70% {
box-shadow: 0 0 0 0.5rem transparent;
}
100% {
box-shadow: 0 0 0 0 transparent;
}
}
/* Bounce attention */
:host([attention='bounce']) {
animation: bounce 1s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
}
@keyframes bounce {
0%,
20%,
50%,
80%,
100% {
transform: translateY(0);
}
40% {
transform: translateY(-5px);
}
60% {
transform: translateY(-2px);
}
}
::slotted(wa-icon) {
margin-inline-end: var(--wa-space-2xs, 0.25em);
opacity: 90%;
line-height: 1;
height: 0.85em;
}

View File

@@ -0,0 +1,108 @@
import { css } from 'lit';
export default css`
:host {
--pulse-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.375em 0.625em;
color: var(--wa-color-on-loud, var(--wa-color-brand-on-loud));
font-size: max(var(--wa-font-size-2xs), 0.75em);
font-weight: var(--wa-font-weight-semibold);
line-height: 1;
white-space: nowrap;
background-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
border-color: transparent;
border-radius: var(--wa-border-radius-s);
border-style: var(--wa-border-style);
border-width: var(--wa-border-width-s);
user-select: none;
-webkit-user-select: none;
cursor: inherit;
}
/* Appearance modifiers */
:host([appearance='outlined']) {
--pulse-color: var(--wa-color-border-loud, var(--wa-color-brand-border-loud));
color: var(--wa-color-on-quiet, var(--wa-color-brand-on-quiet));
background-color: transparent;
border-color: var(--wa-color-border-loud, var(--wa-color-brand-border-loud));
}
:host([appearance='filled']) {
--pulse-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal));
color: var(--wa-color-on-normal, var(--wa-color-brand-on-normal));
background-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal));
border-color: transparent;
}
:host([appearance='filled-outlined']) {
--pulse-color: var(--wa-color-border-normal, var(--wa-color-brand-border-normal));
color: var(--wa-color-on-normal, var(--wa-color-brand-on-normal));
background-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal));
border-color: var(--wa-color-border-normal, var(--wa-color-brand-border-normal));
}
:host([appearance='accent']) {
--pulse-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
color: var(--wa-color-on-loud, var(--wa-color-brand-on-loud));
background-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
border-color: transparent;
}
/* Pill modifier */
:host([pill]) {
border-radius: var(--wa-border-radius-pill);
}
/* Pulse attention */
:host([attention='pulse']) {
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 var(--pulse-color);
}
70% {
box-shadow: 0 0 0 0.5rem transparent;
}
100% {
box-shadow: 0 0 0 0 transparent;
}
}
/* Bounce attention */
:host([attention='bounce']) {
animation: bounce 1s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
}
@keyframes bounce {
0%,
20%,
50%,
80%,
100% {
transform: translateY(0);
}
40% {
transform: translateY(-5px);
}
60% {
transform: translateY(-2px);
}
}
::slotted(wa-icon) {
margin-inline-end: var(--wa-space-2xs, 0.25em);
opacity: 90%;
line-height: 1;
height: 0.85em;
}
`;

View File

@@ -1,8 +1,8 @@
import { html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import variantStyles from '../../styles/utilities/variants.css';
import styles from './badge.css';
import variantStyles from '../../styles/component/variants.styles.js';
import styles from './badge.styles.js';
/**
* @summary Badges are used to draw attention and display statuses or counts.

View File

@@ -1,81 +0,0 @@
:host {
color: var(--wa-color-text-link);
display: inline-flex;
align-items: center;
font: inherit;
font-weight: var(--wa-font-weight-action);
line-height: var(--wa-line-height-normal);
white-space: nowrap;
}
:host(:last-of-type) {
color: var(--wa-color-text-quiet);
}
.label {
display: inline-block;
font: inherit;
text-decoration: none;
color: currentColor;
background: none;
border: none;
border-radius: var(--wa-border-radius-m);
padding: 0;
margin: 0;
cursor: pointer;
transition: color var(--wa-transition-normal) var(--wa-transition-easing);
}
@media (hover: hover) {
:host(:not(:last-of-type)) .label:hover {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover));
}
}
:host(:not(:last-of-type)) .label:active {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-active));
}
.label:focus {
outline: none;
}
.label:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
.start,
.end {
display: none;
flex: 0 0 auto;
display: flex;
align-items: center;
}
.start,
.end {
display: inline-flex;
color: var(--wa-color-text-quiet);
}
::slotted([slot='start']) {
margin-inline-end: var(--wa-space-s);
}
::slotted([slot='end']) {
margin-inline-start: var(--wa-space-s);
}
:host(:last-of-type) .separator {
display: none;
}
.separator {
color: var(--wa-color-text-quiet);
display: inline-flex;
align-items: center;
margin: 0 var(--wa-space-s);
user-select: none;
-webkit-user-select: none;
}

View File

@@ -0,0 +1,85 @@
import { css } from 'lit';
export default css`
:host {
color: var(--wa-color-text-link);
display: inline-flex;
align-items: center;
font: inherit;
font-weight: var(--wa-font-weight-action);
line-height: var(--wa-line-height-normal);
white-space: nowrap;
}
:host(:last-of-type) {
color: var(--wa-color-text-quiet);
}
.label {
display: inline-block;
font: inherit;
text-decoration: none;
color: currentColor;
background: none;
border: none;
border-radius: var(--wa-border-radius-m);
padding: 0;
margin: 0;
cursor: pointer;
transition: color var(--wa-transition-normal) var(--wa-transition-easing);
}
@media (hover: hover) {
:host(:not(:last-of-type)) .label:hover {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover));
}
}
:host(:not(:last-of-type)) .label:active {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-active));
}
.label:focus {
outline: none;
}
.label:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
.start,
.end {
display: none;
flex: 0 0 auto;
display: flex;
align-items: center;
}
.start,
.end {
display: inline-flex;
color: var(--wa-color-text-quiet);
}
::slotted([slot='start']) {
margin-inline-end: var(--wa-space-s);
}
::slotted([slot='end']) {
margin-inline-start: var(--wa-space-s);
}
:host(:last-of-type) .separator {
display: none;
}
.separator {
color: var(--wa-color-text-quiet);
display: inline-flex;
align-items: center;
margin: 0 var(--wa-space-s);
user-select: none;
-webkit-user-select: none;
}
`;

View File

@@ -3,7 +3,7 @@ import { customElement, property, query, state } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './breadcrumb-item.css';
import styles from './breadcrumb-item.styles.js';
/**
* @summary Breadcrumb Items are used inside breadcrumbs to represent different links.

View File

@@ -1,5 +0,0 @@
.breadcrumb {
display: flex;
align-items: center;
flex-wrap: wrap;
}

View File

@@ -0,0 +1,9 @@
import { css } from 'lit';
export default css`
.breadcrumb {
display: flex;
align-items: center;
flex-wrap: wrap;
}
`;

View File

@@ -4,7 +4,7 @@ import WebAwesomeElement from '../../internal/webawesome-element.js';
import { LocalizeController } from '../../utilities/localize.js';
import type WaBreadcrumbItem from '../breadcrumb-item/breadcrumb-item.js';
import '../icon/icon.js';
import styles from './breadcrumb.css';
import styles from './breadcrumb.styles.js';
/**
* @summary Breadcrumbs provide a group of links so users can easily navigate a website's hierarchy.

View File

@@ -1,44 +0,0 @@
:host {
display: inline-flex;
}
.button-group {
display: flex;
position: relative;
isolation: isolate;
flex-wrap: wrap;
gap: 1px;
@media (hover: hover) {
> :hover,
&::slotted(:hover) {
z-index: 1;
}
}
/* Focus and checked are always on top */
> :focus,
&::slotted(:focus),
> [aria-checked='true'],
&::slotted([aria-checked='true']),
> [checked],
&::slotted([checked]) {
z-index: 2 !important;
}
}
:host([orientation='vertical']) .button-group {
flex-direction: column;
}
/* Button groups with at least one outlined button will not have a gap and instead have borders overlap */
.button-group.has-outlined {
gap: 0;
&:not([aria-orientation='vertical']):not(.button-group-vertical)::slotted(:not(:first-child)) {
margin-inline-start: calc(-1 * var(--border-width));
}
&:is([aria-orientation='vertical'], .button-group-vertical)::slotted(:not(:first-child)) {
margin-block-start: calc(-1 * var(--border-width));
}
}

View File

@@ -0,0 +1,48 @@
import { css } from 'lit';
export default css`
:host {
display: inline-flex;
}
.button-group {
display: flex;
position: relative;
isolation: isolate;
flex-wrap: wrap;
gap: 1px;
@media (hover: hover) {
> :hover,
&::slotted(:hover) {
z-index: 1;
}
}
/* Focus and checked are always on top */
> :focus,
&::slotted(:focus),
> [aria-checked='true'],
&::slotted([aria-checked='true']),
> [checked],
&::slotted([checked]) {
z-index: 2 !important;
}
}
:host([orientation='vertical']) .button-group {
flex-direction: column;
}
/* Button groups with at least one outlined button will not have a gap and instead have borders overlap */
.button-group.has-outlined {
gap: 0;
&:not([aria-orientation='vertical']):not(.button-group-vertical)::slotted(:not(:first-child)) {
margin-inline-start: calc(-1 * var(--border-width));
}
&:is([aria-orientation='vertical'], .button-group-vertical)::slotted(:not(:first-child)) {
margin-block-start: calc(-1 * var(--border-width));
}
}
`;

View File

@@ -4,7 +4,7 @@ import { customElement, property, query, state } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import type WaButton from '../button/button.js';
import styles from './button-group.css';
import styles from './button-group.styles.js';
/**
* @summary Button groups can be used to group related buttons into sections.

View File

@@ -1,372 +0,0 @@
@layer wa-component {
:host {
display: inline-block;
/* Workaround because Chrome doesn't like :host(:has()) below
* https://issues.chromium.org/issues/40062355
* Firefox doesn't like this nested rule, so both are needed */
&:has(wa-badge) {
position: relative;
}
}
/* Apply relative positioning only when needed to position wa-badge
* This avoids creating a new stacking context for every button */
:host(:has(wa-badge)) {
position: relative;
}
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
text-decoration: none;
user-select: none;
-webkit-user-select: none;
white-space: nowrap;
vertical-align: middle;
transition-property: background, border, box-shadow, color;
transition-duration: var(--wa-transition-fast);
transition-timing-function: var(--wa-transition-easing);
cursor: pointer;
padding: 0 var(--wa-form-control-padding-inline);
font-family: inherit;
font-size: inherit;
font-weight: var(--wa-font-weight-action);
line-height: calc(var(--wa-form-control-height) - var(--border-width) * 2);
height: var(--wa-form-control-height);
width: 100%;
background-color: var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud));
border-color: transparent;
color: var(--wa-color-on-loud, var(--wa-color-neutral-on-loud));
border-radius: var(--wa-form-control-border-radius);
border-style: var(--wa-border-style);
border-width: var(--wa-border-width-s);
}
/* Appearance modifiers */
:host([appearance='plain']) {
.button {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: transparent;
border-color: transparent;
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet));
}
}
.button:not(.disabled):not(.loading):active {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: color-mix(
in oklab,
var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)),
var(--wa-color-mix-active)
);
}
}
:host([appearance='outlined']) {
.button {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: transparent;
border-color: var(--wa-color-border-loud, var(--wa-color-neutral-border-loud));
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet));
}
}
.button:not(.disabled):not(.loading):active {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: color-mix(
in oklab,
var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)),
var(--wa-color-mix-active)
);
}
}
:host([appearance='filled']) {
.button {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal));
border-color: transparent;
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: color-mix(
in oklab,
var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)),
var(--wa-color-mix-hover)
);
}
}
.button:not(.disabled):not(.loading):active {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: color-mix(
in oklab,
var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)),
var(--wa-color-mix-active)
);
}
}
:host([appearance='filled-outlined']) {
.button {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal));
border-color: var(--wa-color-border-normal, var(--wa-color-neutral-border-normal));
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: color-mix(
in oklab,
var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)),
var(--wa-color-mix-hover)
);
}
}
.button:not(.disabled):not(.loading):active {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: color-mix(
in oklab,
var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)),
var(--wa-color-mix-active)
);
}
}
:host([appearance='accent']) {
.button {
color: var(--wa-color-on-loud, var(--wa-color-neutral-on-loud));
background-color: var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud));
border-color: transparent;
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
background-color: color-mix(
in oklab,
var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)),
var(--wa-color-mix-hover)
);
}
}
.button:not(.disabled):not(.loading):active {
background-color: color-mix(
in oklab,
var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)),
var(--wa-color-mix-active)
);
}
}
/* Focus states */
.button:focus {
outline: none;
}
.button:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
/* Disabled state */
.button.disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* When disabled, prevent mouse events from bubbling up from children */
.button.disabled * {
pointer-events: none;
}
/* Keep it last so Safari doesn't stop parsing this block */
.button::-moz-focus-inner {
border: 0;
}
/* Icon buttons */
.button.is-icon-button {
outline-offset: 2px;
width: var(--wa-form-control-height);
aspect-ratio: 1;
}
.button.is-icon-button:has(wa-icon) {
width: auto;
}
/* Pill modifier */
:host([pill]) .button {
border-radius: var(--wa-border-radius-pill);
}
/*
* Label
*/
.start,
.end {
flex: 0 0 auto;
display: flex;
align-items: center;
pointer-events: none;
}
.label {
display: inline-block;
}
.is-icon-button .label {
display: flex;
}
.label::slotted(wa-icon) {
align-self: center;
}
/*
* Caret modifier
*/
wa-icon[part='caret'] {
display: flex;
align-self: center;
align-items: center;
&::part(svg) {
width: 0.875em;
height: 0.875em;
}
.button:has(&) .end {
display: none;
}
}
/*
* Loading modifier
*/
.loading {
position: relative;
cursor: wait;
.start,
.label,
.end,
.caret {
visibility: hidden;
}
wa-spinner {
--indicator-color: currentColor;
--track-color: color-mix(in oklab, currentColor, transparent 90%);
position: absolute;
font-size: 1em;
height: 1em;
width: 1em;
top: calc(50% - 0.5em);
left: calc(50% - 0.5em);
}
}
/*
* Badges
*/
.button ::slotted(wa-badge) {
border-color: var(--wa-color-surface-default);
position: absolute;
inset-block-start: 0;
inset-inline-end: 0;
translate: 50% -50%;
pointer-events: none;
}
:host(:dir(rtl)) ::slotted(wa-badge) {
translate: -50% -50%;
}
/*
* Button spacing
*/
slot[name='start']::slotted(*) {
margin-inline-end: 0.75em;
}
slot[name='end']::slotted(*),
.button:not(.visually-hidden-label) [part='caret'] {
margin-inline-start: 0.75em;
}
/*
* Button group border radius modifications
*/
/* Remove border radius from all grouped buttons by default */
:host(.wa-button-group__button) .button {
border-radius: 0;
}
/* Horizontal orientation */
:host(.wa-button-group__horizontal.wa-button-group__button-first) .button {
border-start-start-radius: var(--wa-form-control-border-radius);
border-end-start-radius: var(--wa-form-control-border-radius);
}
:host(.wa-button-group__horizontal.wa-button-group__button-last) .button {
border-start-end-radius: var(--wa-form-control-border-radius);
border-end-end-radius: var(--wa-form-control-border-radius);
}
/* Vertical orientation */
:host(.wa-button-group__vertical) {
flex: 1 1 auto;
}
:host(.wa-button-group__vertical) .button {
width: 100%;
justify-content: start;
}
:host(.wa-button-group__vertical.wa-button-group__button-first) .button {
border-start-start-radius: var(--wa-form-control-border-radius);
border-start-end-radius: var(--wa-form-control-border-radius);
}
:host(.wa-button-group__vertical.wa-button-group__button-last) .button {
border-end-start-radius: var(--wa-form-control-border-radius);
border-end-end-radius: var(--wa-form-control-border-radius);
}
/* Handle pill modifier for button groups */
:host([pill].wa-button-group__horizontal.wa-button-group__button-first) .button {
border-start-start-radius: var(--wa-border-radius-pill);
border-end-start-radius: var(--wa-border-radius-pill);
}
:host([pill].wa-button-group__horizontal.wa-button-group__button-last) .button {
border-start-end-radius: var(--wa-border-radius-pill);
border-end-end-radius: var(--wa-border-radius-pill);
}
:host([pill].wa-button-group__vertical.wa-button-group__button-first) .button {
border-start-start-radius: var(--wa-border-radius-pill);
border-start-end-radius: var(--wa-border-radius-pill);
}
:host([pill].wa-button-group__vertical.wa-button-group__button-last) .button {
border-end-start-radius: var(--wa-border-radius-pill);
border-end-end-radius: var(--wa-border-radius-pill);
}

View File

@@ -0,0 +1,376 @@
import { css } from 'lit';
export default css`
@layer wa-component {
:host {
display: inline-block;
/* Workaround because Chrome doesn't like :host(:has()) below
* https://issues.chromium.org/issues/40062355
* Firefox doesn't like this nested rule, so both are needed */
&:has(wa-badge) {
position: relative;
}
}
/* Apply relative positioning only when needed to position wa-badge
* This avoids creating a new stacking context for every button */
:host(:has(wa-badge)) {
position: relative;
}
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
text-decoration: none;
user-select: none;
-webkit-user-select: none;
white-space: nowrap;
vertical-align: middle;
transition-property: background, border, box-shadow, color, opacity;
transition-duration: var(--wa-transition-fast);
transition-timing-function: var(--wa-transition-easing);
cursor: pointer;
padding: 0 var(--wa-form-control-padding-inline);
font-family: inherit;
font-size: inherit;
font-weight: var(--wa-font-weight-action);
line-height: calc(var(--wa-form-control-height) - var(--border-width) * 2);
height: var(--wa-form-control-height);
width: 100%;
background-color: var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud));
border-color: transparent;
color: var(--wa-color-on-loud, var(--wa-color-neutral-on-loud));
border-radius: var(--wa-form-control-border-radius);
border-style: var(--wa-border-style);
border-width: var(--wa-border-width-s);
}
/* Appearance modifiers */
:host([appearance='plain']) {
.button {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: transparent;
border-color: transparent;
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet));
}
}
.button:not(.disabled):not(.loading):active {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: color-mix(
in oklab,
var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)),
var(--wa-color-mix-active)
);
}
}
:host([appearance='outlined']) {
.button {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: transparent;
border-color: var(--wa-color-border-loud, var(--wa-color-neutral-border-loud));
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet));
}
}
.button:not(.disabled):not(.loading):active {
color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet));
background-color: color-mix(
in oklab,
var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)),
var(--wa-color-mix-active)
);
}
}
:host([appearance='filled']) {
.button {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal));
border-color: transparent;
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: color-mix(
in oklab,
var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)),
var(--wa-color-mix-hover)
);
}
}
.button:not(.disabled):not(.loading):active {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: color-mix(
in oklab,
var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)),
var(--wa-color-mix-active)
);
}
}
:host([appearance='filled-outlined']) {
.button {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal));
border-color: var(--wa-color-border-normal, var(--wa-color-neutral-border-normal));
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: color-mix(
in oklab,
var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)),
var(--wa-color-mix-hover)
);
}
}
.button:not(.disabled):not(.loading):active {
color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal));
background-color: color-mix(
in oklab,
var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)),
var(--wa-color-mix-active)
);
}
}
:host([appearance='accent']) {
.button {
color: var(--wa-color-on-loud, var(--wa-color-neutral-on-loud));
background-color: var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud));
border-color: transparent;
}
@media (hover: hover) {
.button:not(.disabled):not(.loading):hover {
background-color: color-mix(
in oklab,
var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)),
var(--wa-color-mix-hover)
);
}
}
.button:not(.disabled):not(.loading):active {
background-color: color-mix(
in oklab,
var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)),
var(--wa-color-mix-active)
);
}
}
/* Focus states */
.button:focus {
outline: none;
}
.button:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
/* Disabled state */
.button.disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* When disabled, prevent mouse events from bubbling up from children */
.button.disabled * {
pointer-events: none;
}
/* Keep it last so Safari doesn't stop parsing this block */
.button::-moz-focus-inner {
border: 0;
}
/* Icon buttons */
.button.is-icon-button {
outline-offset: 2px;
width: var(--wa-form-control-height);
aspect-ratio: 1;
}
.button.is-icon-button:has(wa-icon) {
width: auto;
}
/* Pill modifier */
:host([pill]) .button {
border-radius: var(--wa-border-radius-pill);
}
/*
* Label
*/
.start,
.end {
flex: 0 0 auto;
display: flex;
align-items: center;
pointer-events: none;
}
.label {
display: inline-block;
}
.is-icon-button .label {
display: flex;
}
.label::slotted(wa-icon) {
align-self: center;
}
/*
* Caret modifier
*/
wa-icon[part='caret'] {
display: flex;
align-self: center;
align-items: center;
&::part(svg) {
width: 0.875em;
height: 0.875em;
}
.button:has(&) .end {
display: none;
}
}
/*
* Loading modifier
*/
.loading {
position: relative;
cursor: wait;
.start,
.label,
.end,
.caret {
visibility: hidden;
}
wa-spinner {
--indicator-color: currentColor;
--track-color: color-mix(in oklab, currentColor, transparent 90%);
position: absolute;
font-size: 1em;
height: 1em;
width: 1em;
top: calc(50% - 0.5em);
left: calc(50% - 0.5em);
}
}
/*
* Badges
*/
.button ::slotted(wa-badge) {
border-color: var(--wa-color-surface-default);
position: absolute;
inset-block-start: 0;
inset-inline-end: 0;
translate: 50% -50%;
pointer-events: none;
}
:host(:dir(rtl)) ::slotted(wa-badge) {
translate: -50% -50%;
}
/*
* Button spacing
*/
slot[name='start']::slotted(*) {
margin-inline-end: 0.75em;
}
slot[name='end']::slotted(*),
.button:not(.visually-hidden-label) [part='caret'] {
margin-inline-start: 0.75em;
}
/*
* Button group border radius modifications
*/
/* Remove border radius from all grouped buttons by default */
:host(.wa-button-group__button) .button {
border-radius: 0;
}
/* Horizontal orientation */
:host(.wa-button-group__horizontal.wa-button-group__button-first) .button {
border-start-start-radius: var(--wa-form-control-border-radius);
border-end-start-radius: var(--wa-form-control-border-radius);
}
:host(.wa-button-group__horizontal.wa-button-group__button-last) .button {
border-start-end-radius: var(--wa-form-control-border-radius);
border-end-end-radius: var(--wa-form-control-border-radius);
}
/* Vertical orientation */
:host(.wa-button-group__vertical) {
flex: 1 1 auto;
}
:host(.wa-button-group__vertical) .button {
width: 100%;
justify-content: start;
}
:host(.wa-button-group__vertical.wa-button-group__button-first) .button {
border-start-start-radius: var(--wa-form-control-border-radius);
border-start-end-radius: var(--wa-form-control-border-radius);
}
:host(.wa-button-group__vertical.wa-button-group__button-last) .button {
border-end-start-radius: var(--wa-form-control-border-radius);
border-end-end-radius: var(--wa-form-control-border-radius);
}
/* Handle pill modifier for button groups */
:host([pill].wa-button-group__horizontal.wa-button-group__button-first) .button {
border-start-start-radius: var(--wa-border-radius-pill);
border-end-start-radius: var(--wa-border-radius-pill);
}
:host([pill].wa-button-group__horizontal.wa-button-group__button-last) .button {
border-start-end-radius: var(--wa-border-radius-pill);
border-end-end-radius: var(--wa-border-radius-pill);
}
:host([pill].wa-button-group__vertical.wa-button-group__button-first) .button {
border-start-start-radius: var(--wa-border-radius-pill);
border-start-end-radius: var(--wa-border-radius-pill);
}
:host([pill].wa-button-group__vertical.wa-button-group__button-last) .button {
border-end-start-radius: var(--wa-border-radius-pill);
border-end-end-radius: var(--wa-border-radius-pill);
}
`;

View File

@@ -7,13 +7,13 @@ import { HasSlotController } from '../../internal/slot.js';
import { MirrorValidator } from '../../internal/validators/mirror-validator.js';
import { watch } from '../../internal/watch.js';
import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-form-associated-element.js';
import sizeStyles from '../../styles/utilities/size.css';
import variantStyles from '../../styles/utilities/variants.css';
import sizeStyles from '../../styles/component/size.styles.js';
import variantStyles from '../../styles/component/variants.styles.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../icon/icon.js';
import type WaIcon from '../icon/icon.js';
import '../spinner/spinner.js';
import styles from './button.css';
import styles from './button.styles.js';
/**
* @summary Buttons represent actions that are available to the user.
@@ -115,7 +115,6 @@ export default class WaButton extends WebAwesomeFormAssociatedElement {
* The "form owner" to associate the button with. If omitted, the closest containing form will be used instead. The
* value of this attribute must be an id of a form in the same document or shadow root as the button.
*/
@property({ reflect: true }) form: string | null = null;
/** Used to override the form owner's `action` attribute. */
@property({ attribute: 'formaction' }) formAction: string;
@@ -135,24 +134,27 @@ export default class WaButton extends WebAwesomeFormAssociatedElement {
private constructLightDOMButton() {
const button = document.createElement('button');
for (const attribute of this.attributes) {
if (attribute.name === 'style') {
// Skip style attributes as they *shouldn't* be necessary
continue;
}
button.setAttribute(attribute.name, attribute.value);
}
button.type = this.type;
button.style.position = 'absolute';
button.style.width = '0';
button.style.height = '0';
button.style.clipPath = 'inset(50%)';
button.style.overflow = 'hidden';
button.style.whiteSpace = 'nowrap';
button.style.position = 'absolute !important';
button.style.width = '0 !important';
button.style.height = '0 !important';
button.style.clipPath = 'inset(50%) !important';
button.style.overflow = 'hidden !important';
button.style.whiteSpace = 'nowrap !important';
if (this.name) {
button.name = this.name;
}
button.value = this.value || '';
['form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach(attr => {
if (this.hasAttribute(attr)) {
button.setAttribute(attr, this.getAttribute(attr)!);
}
});
return button;
}

View File

@@ -1,60 +0,0 @@
:host {
display: flex;
position: relative;
align-items: stretch;
border-radius: var(--wa-panel-border-radius);
background-color: var(--wa-color-fill-quiet, var(--wa-color-brand-fill-quiet));
border-color: var(--wa-color-border-quiet, var(--wa-color-brand-border-quiet));
border-style: var(--wa-panel-border-style);
border-width: var(--wa-panel-border-width);
color: var(--wa-color-text-normal);
padding: 1em;
}
/* Appearance modifiers */
:host([appearance~='plain']) {
background-color: transparent;
border-color: transparent;
}
:host([appearance~='outlined']) {
background-color: transparent;
border-color: var(--wa-color-border-loud, var(--wa-color-brand-border-loud));
}
:host([appearance~='filled']) {
background-color: var(--wa-color-fill-quiet, var(--wa-color-brand-fill-quiet));
border-color: transparent;
}
:host([appearance~='filled-outlined']) {
border-color: var(--wa-color-border-quiet, var(--wa-color-brand-border-quiet));
}
:host([appearance~='accent']) {
color: var(--wa-color-on-loud, var(--wa-color-brand-on-loud));
background-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
border-color: transparent;
[part~='icon'] {
color: currentColor;
}
}
[part~='icon'] {
flex: 0 0 auto;
display: flex;
align-items: center;
color: var(--wa-color-on-quiet);
font-size: 1.25em;
}
::slotted([slot='icon']) {
margin-inline-end: var(--wa-form-control-padding-inline);
}
[part~='message'] {
flex: 1 1 auto;
display: block;
overflow: hidden;
}

View File

@@ -0,0 +1,64 @@
import { css } from 'lit';
export default css`
:host {
display: flex;
position: relative;
align-items: stretch;
border-radius: var(--wa-panel-border-radius);
background-color: var(--wa-color-fill-quiet, var(--wa-color-brand-fill-quiet));
border-color: var(--wa-color-border-quiet, var(--wa-color-brand-border-quiet));
border-style: var(--wa-panel-border-style);
border-width: var(--wa-panel-border-width);
color: var(--wa-color-text-normal);
padding: 1em;
}
/* Appearance modifiers */
:host([appearance~='plain']) {
background-color: transparent;
border-color: transparent;
}
:host([appearance~='outlined']) {
background-color: transparent;
border-color: var(--wa-color-border-loud, var(--wa-color-brand-border-loud));
}
:host([appearance~='filled']) {
background-color: var(--wa-color-fill-quiet, var(--wa-color-brand-fill-quiet));
border-color: transparent;
}
:host([appearance~='filled-outlined']) {
border-color: var(--wa-color-border-quiet, var(--wa-color-brand-border-quiet));
}
:host([appearance~='accent']) {
color: var(--wa-color-on-loud, var(--wa-color-brand-on-loud));
background-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud));
border-color: transparent;
[part~='icon'] {
color: currentColor;
}
}
[part~='icon'] {
flex: 0 0 auto;
display: flex;
align-items: center;
color: var(--wa-color-on-quiet);
font-size: 1.25em;
}
::slotted([slot='icon']) {
margin-inline-end: var(--wa-form-control-padding-inline);
}
[part~='message'] {
flex: 1 1 auto;
display: block;
overflow: hidden;
}
`;

View File

@@ -1,9 +1,9 @@
import { html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import sizeStyles from '../../styles/utilities/size.css';
import variantStyles from '../../styles/utilities/variants.css';
import styles from './callout.css';
import sizeStyles from '../../styles/component/size.styles.js';
import variantStyles from '../../styles/component/variants.styles.js';
import styles from './callout.styles.js';
/**
* @summary Callouts are used to display important messages inline.

View File

@@ -1,140 +0,0 @@
:host {
--spacing: var(--wa-space-l);
/* Internal calculated properties */
--inner-border-radius: calc(var(--wa-panel-border-radius) - var(--wa-panel-border-width));
display: flex;
flex-direction: column;
background-color: var(--wa-color-surface-default);
border-color: var(--wa-color-surface-border);
border-radius: var(--wa-panel-border-radius);
border-style: var(--wa-panel-border-style);
box-shadow: var(--wa-shadow-s);
border-width: var(--wa-panel-border-width);
color: var(--wa-color-text-normal);
}
/* Appearance modifiers */
:host([appearance~='plain']) {
background-color: transparent;
border-color: transparent;
box-shadow: none;
}
:host([appearance~='outlined']) {
background-color: var(--wa-color-surface-default);
border-color: var(--wa-color-surface-border);
}
:host([appearance~='filled']) {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: transparent;
}
:host([appearance~='filled'][appearance~='outlined']) {
border-color: var(--wa-color-neutral-border-quiet);
}
:host([appearance~='accent']) {
color: var(--wa-color-neutral-on-loud);
background-color: var(--wa-color-neutral-fill-loud);
border-color: transparent;
}
/* Take care of top and bottom radii */
.media,
:host(:not([with-media])) .header,
:host(:not([with-media], [with-header])) .body {
border-start-start-radius: var(--inner-border-radius);
border-start-end-radius: var(--inner-border-radius);
}
:host(:not([with-footer])) .body,
.footer {
border-end-start-radius: var(--inner-border-radius);
border-end-end-radius: var(--inner-border-radius);
}
.media {
display: flex;
overflow: hidden;
&::slotted(*) {
display: block;
width: 100%;
border-radius: 0 !important;
}
}
/* Round all corners for plain appearance */
:host([appearance='plain']) .media {
border-radius: var(--inner-border-radius);
&::slotted(*) {
border-radius: inherit !important;
}
}
.header {
display: block;
border-block-end-style: inherit;
border-block-end-color: var(--wa-color-surface-border);
border-block-end-width: var(--wa-panel-border-width);
padding: calc(var(--spacing) / 2) var(--spacing);
}
.body {
display: block;
padding: var(--spacing);
}
.footer {
display: block;
border-block-start-style: inherit;
border-block-start-color: var(--wa-color-surface-border);
border-block-start-width: var(--wa-panel-border-width);
padding: var(--spacing);
}
/* Push slots to sides when the action slots renders */
.has-actions {
display: flex;
align-items: center;
justify-content: space-between;
}
:host(:not([with-header])) .header,
:host(:not([with-footer])) .footer,
:host(:not([with-media])) .media {
display: none;
}
/* Orientation Styles */
:host([orientation='horizontal']) {
flex-direction: row;
.media {
border-start-start-radius: var(--inner-border-radius);
border-end-start-radius: var(--inner-border-radius);
border-start-end-radius: 0;
&::slotted(*) {
block-size: 100%;
inline-size: 100%;
object-fit: cover;
}
}
}
:host([orientation='horizontal']) ::slotted([slot='body']) {
display: block;
height: 100%;
margin: 0;
}
:host([orientation='horizontal']) ::slotted([slot='actions']) {
display: flex;
align-items: center;
padding: var(--spacing);
}

View File

@@ -0,0 +1,145 @@
import { css } from 'lit';
export default css`
:host {
--spacing: var(--wa-space-l);
/* Internal calculated properties */
--inner-border-radius: calc(var(--wa-panel-border-radius) - var(--wa-panel-border-width));
display: flex;
flex-direction: column;
background-color: var(--wa-color-surface-default);
border-color: var(--wa-color-surface-border);
border-radius: var(--wa-panel-border-radius);
border-style: var(--wa-panel-border-style);
box-shadow: var(--wa-shadow-s);
border-width: var(--wa-panel-border-width);
color: var(--wa-color-text-normal);
}
/* Appearance modifiers */
:host([appearance='plain']) {
background-color: transparent;
border-color: transparent;
box-shadow: none;
}
:host([appearance='outlined']) {
background-color: var(--wa-color-surface-default);
border-color: var(--wa-color-surface-border);
}
:host([appearance='filled']) {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: transparent;
}
:host([appearance='filled-outlined']) {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: var(--wa-color-surface-border);
}
:host([appearance='accent']) {
color: var(--wa-color-neutral-on-loud);
background-color: var(--wa-color-neutral-fill-loud);
border-color: transparent;
}
/* Take care of top and bottom radii */
.media,
:host(:not([with-media])) .header,
:host(:not([with-media], [with-header])) .body {
border-start-start-radius: var(--inner-border-radius);
border-start-end-radius: var(--inner-border-radius);
}
:host(:not([with-footer])) .body,
.footer {
border-end-start-radius: var(--inner-border-radius);
border-end-end-radius: var(--inner-border-radius);
}
.media {
display: flex;
overflow: hidden;
&::slotted(*) {
display: block;
width: 100%;
border-radius: 0 !important;
}
}
/* Round all corners for plain appearance */
:host([appearance='plain']) .media {
border-radius: var(--inner-border-radius);
&::slotted(*) {
border-radius: inherit !important;
}
}
.header {
display: block;
border-block-end-style: inherit;
border-block-end-color: var(--wa-color-surface-border);
border-block-end-width: var(--wa-panel-border-width);
padding: calc(var(--spacing) / 2) var(--spacing);
}
.body {
display: block;
padding: var(--spacing);
}
.footer {
display: block;
border-block-start-style: inherit;
border-block-start-color: var(--wa-color-surface-border);
border-block-start-width: var(--wa-panel-border-width);
padding: var(--spacing);
}
/* Push slots to sides when the action slots renders */
.has-actions {
display: flex;
align-items: center;
justify-content: space-between;
}
:host(:not([with-header])) .header,
:host(:not([with-footer])) .footer,
:host(:not([with-media])) .media {
display: none;
}
/* Orientation Styles */
:host([orientation='horizontal']) {
flex-direction: row;
.media {
border-start-start-radius: var(--inner-border-radius);
border-end-start-radius: var(--inner-border-radius);
border-start-end-radius: 0;
&::slotted(*) {
block-size: 100%;
inline-size: 100%;
object-fit: cover;
}
}
}
:host([orientation='horizontal']) ::slotted([slot='body']) {
display: block;
height: 100%;
margin: 0;
}
:host([orientation='horizontal']) ::slotted([slot='actions']) {
display: flex;
align-items: center;
padding: var(--spacing);
}
`;

View File

@@ -2,8 +2,8 @@ import { html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { HasSlotController } from '../../internal/slot.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import sizeStyles from '../../styles/utilities/size.css';
import styles from './card.css';
import sizeStyles from '../../styles/component/size.styles.js';
import styles from './card.styles.js';
/**
* @summary Cards can be used to group related subjects in a container.
@@ -42,7 +42,7 @@ export default class WaCard extends WebAwesomeElement {
/** The card's visual appearance. */
@property({ reflect: true })
appearance: 'accent' | 'filled' | 'outlined' | 'plain' = 'outlined';
appearance: 'accent' | 'filled' | 'outlined' | 'filled-outlined' | 'plain' = 'outlined';
/** Renders the card with a header. Only needed for SSR, otherwise is automatically added. */
@property({ attribute: 'with-header', type: Boolean, reflect: true }) withHeader = false;

View File

@@ -1,19 +0,0 @@
:host {
--aspect-ratio: inherit;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100%;
max-height: 100%;
aspect-ratio: var(--aspect-ratio);
scroll-snap-align: start;
scroll-snap-stop: always;
}
::slotted(img) {
width: 100% !important;
height: 100% !important;
object-fit: cover;
}

View File

@@ -0,0 +1,23 @@
import { css } from 'lit';
export default css`
:host {
--aspect-ratio: inherit;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100%;
max-height: 100%;
aspect-ratio: var(--aspect-ratio);
scroll-snap-align: start;
scroll-snap-stop: always;
}
::slotted(img) {
width: 100% !important;
height: 100% !important;
object-fit: cover;
}
`;

View File

@@ -1,7 +1,7 @@
import { html } from 'lit';
import { customElement } from 'lit/decorators.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './carousel-item.css';
import styles from './carousel-item.styles.js';
/**
* @summary A carousel item represent a slide within a carousel.

View File

@@ -1,154 +0,0 @@
:host {
--aspect-ratio: 16 / 9;
--scroll-hint: 0px;
--slide-gap: var(--wa-space-m, 1rem); /* fallback value is necessary */
display: flex;
}
.carousel {
display: grid;
grid-template-columns: min-content 1fr min-content;
grid-template-rows: 1fr min-content;
grid-template-areas:
'. slides .'
'. pagination .';
gap: var(--wa-space-m);
align-items: center;
min-height: 100%;
min-width: 100%;
position: relative;
}
.pagination {
grid-area: pagination;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: var(--wa-space-s);
}
.slides {
grid-area: slides;
display: grid;
height: 100%;
width: 100%;
align-items: center;
justify-items: center;
overflow: auto;
overscroll-behavior-x: contain;
scrollbar-width: none;
aspect-ratio: calc(var(--aspect-ratio) * var(--slides-per-page));
border-radius: var(--wa-border-radius-m);
--slide-size: calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));
}
@media (prefers-reduced-motion) {
:where(.slides) {
scroll-behavior: auto;
}
}
.slides-horizontal {
grid-auto-flow: column;
grid-auto-columns: var(--slide-size);
grid-auto-rows: 100%;
column-gap: var(--slide-gap);
scroll-snap-type: x mandatory;
scroll-padding-inline: var(--scroll-hint);
padding-inline: var(--scroll-hint);
overflow-y: hidden;
}
.slides-vertical {
grid-auto-flow: row;
grid-auto-columns: 100%;
grid-auto-rows: var(--slide-size);
row-gap: var(--slide-gap);
scroll-snap-type: y mandatory;
scroll-padding-block: var(--scroll-hint);
padding-block: var(--scroll-hint);
overflow-x: hidden;
}
.slides-dragging,
.slides-dropping {
scroll-snap-type: unset;
}
:host([vertical]) ::slotted(wa-carousel-item) {
height: 100%;
}
.slides::-webkit-scrollbar {
display: none;
}
.navigation {
grid-area: navigation;
display: contents;
font-size: var(--wa-font-size-l);
}
.navigation-button {
flex: 0 0 auto;
display: flex;
align-items: center;
background: none;
border: none;
border-radius: var(--wa-border-radius-m);
font-size: inherit;
color: var(--wa-color-text-quiet);
padding: var(--wa-space-xs);
cursor: pointer;
transition: var(--wa-transition-normal) color;
appearance: none;
}
.navigation-button-disabled {
opacity: 0.5;
cursor: not-allowed;
}
.navigation-button-disabled::part(base) {
pointer-events: none;
}
.navigation-button-previous {
grid-column: 1;
grid-row: 1;
}
.navigation-button-next {
grid-column: 3;
grid-row: 1;
}
.pagination-item {
display: block;
cursor: pointer;
background: none;
border: 0;
border-radius: var(--wa-border-radius-circle);
width: var(--wa-space-s);
height: var(--wa-space-s);
background-color: var(--wa-color-neutral-fill-normal);
padding: 0;
margin: 0;
transition: transform var(--wa-transition-slow);
}
.pagination-item-active {
background-color: var(--wa-form-control-activated-color);
transform: scale(1.25);
}
/* Focus styles */
.slides:focus-visible,
.navigation-button:focus-visible,
.pagination-item:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}

View File

@@ -0,0 +1,158 @@
import { css } from 'lit';
export default css`
:host {
--aspect-ratio: 16 / 9;
--scroll-hint: 0px;
--slide-gap: var(--wa-space-m, 1rem); /* fallback value is necessary */
display: flex;
}
.carousel {
display: grid;
grid-template-columns: min-content 1fr min-content;
grid-template-rows: 1fr min-content;
grid-template-areas:
'. slides .'
'. pagination .';
gap: var(--wa-space-m);
align-items: center;
min-height: 100%;
min-width: 100%;
position: relative;
}
.pagination {
grid-area: pagination;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: var(--wa-space-s);
}
.slides {
grid-area: slides;
display: grid;
height: 100%;
width: 100%;
align-items: center;
justify-items: center;
overflow: auto;
overscroll-behavior-x: contain;
scrollbar-width: none;
aspect-ratio: calc(var(--aspect-ratio) * var(--slides-per-page));
border-radius: var(--wa-border-radius-m);
--slide-size: calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));
}
@media (prefers-reduced-motion) {
:where(.slides) {
scroll-behavior: auto;
}
}
.slides-horizontal {
grid-auto-flow: column;
grid-auto-columns: var(--slide-size);
grid-auto-rows: 100%;
column-gap: var(--slide-gap);
scroll-snap-type: x mandatory;
scroll-padding-inline: var(--scroll-hint);
padding-inline: var(--scroll-hint);
overflow-y: hidden;
}
.slides-vertical {
grid-auto-flow: row;
grid-auto-columns: 100%;
grid-auto-rows: var(--slide-size);
row-gap: var(--slide-gap);
scroll-snap-type: y mandatory;
scroll-padding-block: var(--scroll-hint);
padding-block: var(--scroll-hint);
overflow-x: hidden;
}
.slides-dragging,
.slides-dropping {
scroll-snap-type: unset;
}
:host([vertical]) ::slotted(wa-carousel-item) {
height: 100%;
}
.slides::-webkit-scrollbar {
display: none;
}
.navigation {
grid-area: navigation;
display: contents;
font-size: var(--wa-font-size-l);
}
.navigation-button {
flex: 0 0 auto;
display: flex;
align-items: center;
background: none;
border: none;
border-radius: var(--wa-border-radius-m);
font-size: inherit;
color: var(--wa-color-text-quiet);
padding: var(--wa-space-xs);
cursor: pointer;
transition: var(--wa-transition-normal) color;
appearance: none;
}
.navigation-button-disabled {
opacity: 0.5;
cursor: not-allowed;
}
.navigation-button-disabled::part(base) {
pointer-events: none;
}
.navigation-button-previous {
grid-column: 1;
grid-row: 1;
}
.navigation-button-next {
grid-column: 3;
grid-row: 1;
}
.pagination-item {
display: block;
cursor: pointer;
background: none;
border: 0;
border-radius: var(--wa-border-radius-circle);
width: var(--wa-space-s);
height: var(--wa-space-s);
background-color: var(--wa-color-neutral-fill-normal);
padding: 0;
margin: 0;
transition: transform var(--wa-transition-slow);
}
.pagination-item-active {
background-color: var(--wa-form-control-activated-color);
transform: scale(1.25);
}
/* Focus styles */
.slides:focus-visible,
.navigation-button:focus-visible,
.pagination-item:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
`;

View File

@@ -16,7 +16,7 @@ import { LocalizeController } from '../../utilities/localize.js';
import type WaCarouselItem from '../carousel-item/carousel-item.js';
import '../icon/icon.js';
import { AutoplayController } from './autoplay-controller.js';
import styles from './carousel.css';
import styles from './carousel.styles.js';
/**
* @summary Carousels display an arbitrary number of content slides along a horizontal or vertical axis.

View File

@@ -1,100 +0,0 @@
:host {
--checked-icon-color: var(--wa-color-brand-on-loud);
--checked-icon-scale: 0.8;
display: inline-flex;
color: var(--wa-form-control-value-color);
font-family: inherit;
font-weight: var(--wa-form-control-value-font-weight);
line-height: var(--wa-form-control-value-line-height);
user-select: none;
-webkit-user-select: none;
}
[part~='control'] {
display: inline-flex;
flex: 0 0 auto;
position: relative;
align-items: center;
justify-content: center;
width: var(--wa-form-control-toggle-size);
height: var(--wa-form-control-toggle-size);
border-color: var(--wa-form-control-border-color);
border-radius: min(
calc(var(--wa-form-control-toggle-size) * 0.375),
var(--wa-border-radius-s)
); /* min prevents entirely circular checkbox */
border-style: var(--wa-border-style);
border-width: var(--wa-form-control-border-width);
background-color: var(--wa-form-control-background-color);
transition:
background var(--wa-transition-normal),
border-color var(--wa-transition-fast),
box-shadow var(--wa-transition-fast),
color var(--wa-transition-fast);
transition-timing-function: var(--wa-transition-easing);
margin-inline-end: 0.5em;
}
[part~='base'] {
display: flex;
align-items: flex-start;
position: relative;
color: currentColor;
vertical-align: middle;
cursor: pointer;
}
[part~='label'] {
display: inline;
}
/* Checked */
[part~='control']:has(:checked, :indeterminate) {
color: var(--checked-icon-color);
border-color: var(--wa-form-control-activated-color);
background-color: var(--wa-form-control-activated-color);
}
/* Focus */
[part~='control']:has(> input:focus-visible:not(:disabled)) {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
/* Disabled */
:host [part~='base']:has(input:disabled) {
opacity: 0.5;
cursor: not-allowed;
}
input {
position: absolute;
padding: 0;
margin: 0;
height: 100%;
width: 100%;
opacity: 0;
pointer-events: none;
}
[part~='icon'] {
display: flex;
scale: var(--checked-icon-scale);
/* Without this, Safari renders the icon slightly to the left */
&::part(svg) {
translate: 0.0009765625em;
}
input:not(:checked, :indeterminate) + & {
visibility: hidden;
}
}
:host([required]) [part~='label']::after {
content: var(--wa-form-control-required-content);
color: var(--wa-form-control-required-content-color);
margin-inline-start: var(--wa-form-control-required-content-offset);
}

View File

@@ -0,0 +1,104 @@
import { css } from 'lit';
export default css`
:host {
--checked-icon-color: var(--wa-color-brand-on-loud);
--checked-icon-scale: 0.8;
display: inline-flex;
color: var(--wa-form-control-value-color);
font-family: inherit;
font-weight: var(--wa-form-control-value-font-weight);
line-height: var(--wa-form-control-value-line-height);
user-select: none;
-webkit-user-select: none;
}
[part~='control'] {
display: inline-flex;
flex: 0 0 auto;
position: relative;
align-items: center;
justify-content: center;
width: var(--wa-form-control-toggle-size);
height: var(--wa-form-control-toggle-size);
border-color: var(--wa-form-control-border-color);
border-radius: min(
calc(var(--wa-form-control-toggle-size) * 0.375),
var(--wa-border-radius-s)
); /* min prevents entirely circular checkbox */
border-style: var(--wa-border-style);
border-width: var(--wa-form-control-border-width);
background-color: var(--wa-form-control-background-color);
transition:
background var(--wa-transition-normal),
border-color var(--wa-transition-fast),
box-shadow var(--wa-transition-fast),
color var(--wa-transition-fast);
transition-timing-function: var(--wa-transition-easing);
margin-inline-end: 0.5em;
}
[part~='base'] {
display: flex;
align-items: flex-start;
position: relative;
color: currentColor;
vertical-align: middle;
cursor: pointer;
}
[part~='label'] {
display: inline;
}
/* Checked */
[part~='control']:has(:checked, :indeterminate) {
color: var(--checked-icon-color);
border-color: var(--wa-form-control-activated-color);
background-color: var(--wa-form-control-activated-color);
}
/* Focus */
[part~='control']:has(> input:focus-visible:not(:disabled)) {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
/* Disabled */
:host [part~='base']:has(input:disabled) {
opacity: 0.5;
cursor: not-allowed;
}
input {
position: absolute;
padding: 0;
margin: 0;
height: 100%;
width: 100%;
opacity: 0;
pointer-events: none;
}
[part~='icon'] {
display: flex;
scale: var(--checked-icon-scale);
/* Without this, Safari renders the icon slightly to the left */
&::part(svg) {
translate: 0.0009765625em;
}
input:not(:checked, :indeterminate) + & {
visibility: hidden;
}
}
:host([required]) [part~='label']::after {
content: var(--wa-form-control-required-content);
color: var(--wa-form-control-required-content-color);
margin-inline-start: var(--wa-form-control-required-content-offset);
}
`;

View File

@@ -8,10 +8,10 @@ import { HasSlotController } from '../../internal/slot.js';
import { RequiredValidator } from '../../internal/validators/required-validator.js';
import { watch } from '../../internal/watch.js';
import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-form-associated-element.js';
import formControlStyles from '../../styles/component/form-control.css';
import sizeStyles from '../../styles/utilities/size.css';
import formControlStyles from '../../styles/component/form-control.styles.js';
import sizeStyles from '../../styles/component/size.styles.js';
import '../icon/icon.js';
import styles from './checkbox.css';
import styles from './checkbox.styles.js';
/**
* @summary Checkboxes allow the user to toggle an option on or off.
@@ -108,13 +108,6 @@ export default class WaCheckbox extends WebAwesomeFormAssociatedElement {
@property({ type: Boolean, reflect: true, attribute: 'checked' }) defaultChecked: boolean =
this.hasAttribute('checked');
/**
* By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
* to place the form control outside of a form and associate it with the form that has this `id`. The form must be in
* the same document or shadow root for this to work.
*/
@property({ reflect: true }) form = null;
/** Makes the checkbox a required field. */
@property({ type: Boolean, reflect: true }) required = false;

View File

@@ -1,341 +0,0 @@
:host {
--grid-width: 17em;
--grid-height: 12em;
--grid-handle-size: 1.25em;
--slider-height: 1em;
--slider-handle-size: calc(var(--slider-height) + 0.25em);
}
.color-picker {
background-color: var(--wa-color-surface-raised);
border-radius: var(--wa-border-radius-m);
border-style: var(--wa-border-style);
border-width: var(--wa-border-width-s);
border-color: var(--wa-color-surface-border);
box-shadow: var(--wa-shadow-m);
color: var(--color);
font: inherit;
font-size: inherit;
user-select: none;
width: var(--grid-width);
-webkit-user-select: none;
}
.grid {
position: relative;
height: var(--grid-height);
background-image:
linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%),
linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
border-top-left-radius: calc(var(--wa-border-radius-m) - var(--wa-border-width-s));
border-top-right-radius: calc(var(--wa-border-radius-m) - var(--wa-border-width-s));
cursor: crosshair;
forced-color-adjust: none;
}
.grid-handle {
position: absolute;
width: var(--grid-handle-size);
height: var(--grid-handle-size);
border-radius: var(--wa-border-radius-circle);
box-shadow: 0 0 0 0.0625rem rgba(0, 0, 0, 0.2);
border: solid 0.125rem white;
margin-top: calc(var(--grid-handle-size) / -2);
margin-left: calc(var(--grid-handle-size) / -2);
transition: scale var(--wa-transition-normal) var(--wa-transition-easing);
}
.grid-handle-dragging {
cursor: none;
scale: 1.5;
}
.grid-handle:focus-visible {
outline: var(--wa-focus-ring);
}
.controls {
padding: 0.75em;
display: flex;
align-items: center;
}
.sliders {
flex: 1 1 auto;
}
.slider {
position: relative;
height: var(--slider-height);
border-radius: var(--wa-border-radius-s);
box-shadow: inset 0 0 0 0.0625rem rgba(0, 0, 0, 0.2);
forced-color-adjust: none;
}
.slider:not(:last-of-type) {
margin-bottom: 0.75em;
}
.slider-handle {
position: absolute;
top: calc(50% - var(--slider-handle-size) / 2);
width: var(--slider-handle-size);
height: var(--slider-handle-size);
border-radius: var(--wa-border-radius-circle);
border: solid 0.125rem white;
box-shadow: 0 0 0 0.0625rem rgba(0, 0, 0, 0.2);
margin-left: calc(var(--slider-handle-size) / -2);
}
.slider-handle:focus-visible {
outline: var(--wa-focus-ring);
}
.hue {
background-image: linear-gradient(
to right,
rgb(255, 0, 0) 0%,
rgb(255, 255, 0) 17%,
rgb(0, 255, 0) 33%,
rgb(0, 255, 255) 50%,
rgb(0, 0, 255) 67%,
rgb(255, 0, 255) 83%,
rgb(255, 0, 0) 100%
);
}
.alpha .alpha-gradient {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: inherit;
}
.preview {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
width: 3em;
height: 3em;
border: none;
border-radius: var(--wa-border-radius-circle);
background: none;
font-size: inherit;
margin-inline-start: 0.75em;
cursor: copy;
forced-color-adjust: none;
}
.preview:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: inherit;
box-shadow: inset 0 0 0 0.0625rem rgba(0, 0, 0, 0.2);
/* We use a custom property in lieu of currentColor because of https://bugs.webkit.org/show_bug.cgi?id=216780 */
background-color: var(--preview-color);
}
.preview:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
.preview-color {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: solid 0.0625rem rgba(0, 0, 0, 0.125);
}
.preview-color-copied {
animation: pulse 850ms;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 var(--wa-color-brand-fill-loud);
}
70% {
box-shadow: 0 0 0 0.5rem transparent;
}
100% {
box-shadow: 0 0 0 0 transparent;
}
}
.user-input {
display: flex;
align-items: center;
padding: 0 0.75em 0.75em 0.75em;
}
.user-input wa-input {
min-width: 0; /* fix input width in Safari */
flex: 1 1 auto;
&::part(form-control-label) {
/* Visually hidden */
position: absolute !important;
width: 1px !important;
height: 1px !important;
clip: rect(0 0 0 0) !important;
clip-path: inset(50%) !important;
border: none !important;
overflow: hidden !important;
white-space: nowrap !important;
padding: 0 !important;
}
}
.user-input wa-button-group {
margin-inline-start: 0.75em;
&::part(base) {
flex-wrap: nowrap;
}
}
.user-input wa-button:first-of-type {
min-width: 3em;
max-width: 3em;
}
.swatches {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(1.5em, 100%), 1fr));
grid-gap: 0.5em;
justify-items: center;
border-block-start: var(--wa-form-control-border-style) var(--wa-form-control-border-width)
var(--wa-color-surface-border);
padding: 0.5em;
forced-color-adjust: none;
}
.swatch {
position: relative;
aspect-ratio: 1 / 1;
width: 100%;
border-radius: var(--wa-border-radius-s);
}
.swatch .swatch-color {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: solid 0.0625rem rgba(0, 0, 0, 0.125);
border-radius: inherit;
cursor: pointer;
}
.swatch:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
.transparent-bg {
background-image:
linear-gradient(45deg, var(--wa-color-neutral-fill-normal) 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, var(--wa-color-neutral-fill-normal) 75%),
linear-gradient(45deg, transparent 75%, var(--wa-color-neutral-fill-normal) 75%),
linear-gradient(45deg, var(--wa-color-neutral-fill-normal) 25%, transparent 25%);
background-size: 0.5rem 0.5rem;
background-position:
0 0,
0 0,
-0.25rem -0.25rem,
0.25rem 0.25rem;
}
:host([disabled]) {
opacity: 0.5;
cursor: not-allowed;
.grid,
.grid-handle,
.slider,
.slider-handle,
.preview,
.swatch,
.swatch-color {
pointer-events: none;
}
}
/*
* Color dropdown
*/
.color-dropdown {
display: contents;
}
.color-dropdown::part(panel) {
max-height: none;
background-color: var(--wa-color-surface-raised);
border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border);
border-radius: var(--wa-border-radius-m);
overflow: visible;
}
.trigger {
display: block;
position: relative;
background-color: transparent;
border: none;
cursor: pointer;
font-size: inherit;
forced-color-adjust: none;
width: var(--wa-form-control-height);
height: var(--wa-form-control-height);
border-radius: var(--wa-form-control-border-radius);
}
.trigger:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: inherit;
background-color: currentColor;
box-shadow:
inset 0 0 0 var(--wa-form-control-border-width) var(--wa-form-control-border-color),
inset 0 0 0 calc(var(--wa-form-control-border-width) * 3) var(--wa-color-surface-default);
}
.trigger-empty:before {
background-color: transparent;
}
.trigger:focus-visible {
outline: none;
}
.trigger:focus-visible:not(.trigger:disabled) {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
:host([disabled]) :is(.label, .trigger) {
opacity: 0.5;
cursor: not-allowed;
}
.form-control.form-control-has-label .label {
cursor: pointer;
display: inline-block;
}

View File

@@ -0,0 +1,345 @@
import { css } from 'lit';
export default css`
:host {
--grid-width: 17em;
--grid-height: 12em;
--grid-handle-size: 1.25em;
--slider-height: 1em;
--slider-handle-size: calc(var(--slider-height) + 0.25em);
}
.color-picker {
background-color: var(--wa-color-surface-raised);
border-radius: var(--wa-border-radius-m);
border-style: var(--wa-border-style);
border-width: var(--wa-border-width-s);
border-color: var(--wa-color-surface-border);
box-shadow: var(--wa-shadow-m);
color: var(--color);
font: inherit;
font-size: inherit;
user-select: none;
width: var(--grid-width);
-webkit-user-select: none;
}
.grid {
position: relative;
height: var(--grid-height);
background-image:
linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%),
linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
border-top-left-radius: calc(var(--wa-border-radius-m) - var(--wa-border-width-s));
border-top-right-radius: calc(var(--wa-border-radius-m) - var(--wa-border-width-s));
cursor: crosshair;
forced-color-adjust: none;
}
.grid-handle {
position: absolute;
width: var(--grid-handle-size);
height: var(--grid-handle-size);
border-radius: var(--wa-border-radius-circle);
box-shadow: 0 0 0 0.0625rem rgba(0, 0, 0, 0.2);
border: solid 0.125rem white;
margin-top: calc(var(--grid-handle-size) / -2);
margin-left: calc(var(--grid-handle-size) / -2);
transition: scale var(--wa-transition-normal) var(--wa-transition-easing);
}
.grid-handle-dragging {
cursor: none;
scale: 1.5;
}
.grid-handle:focus-visible {
outline: var(--wa-focus-ring);
}
.controls {
padding: 0.75em;
display: flex;
align-items: center;
}
.sliders {
flex: 1 1 auto;
}
.slider {
position: relative;
height: var(--slider-height);
border-radius: var(--wa-border-radius-s);
box-shadow: inset 0 0 0 0.0625rem rgba(0, 0, 0, 0.2);
forced-color-adjust: none;
}
.slider:not(:last-of-type) {
margin-bottom: 0.75em;
}
.slider-handle {
position: absolute;
top: calc(50% - var(--slider-handle-size) / 2);
width: var(--slider-handle-size);
height: var(--slider-handle-size);
border-radius: var(--wa-border-radius-circle);
border: solid 0.125rem white;
box-shadow: 0 0 0 0.0625rem rgba(0, 0, 0, 0.2);
margin-left: calc(var(--slider-handle-size) / -2);
}
.slider-handle:focus-visible {
outline: var(--wa-focus-ring);
}
.hue {
background-image: linear-gradient(
to right,
rgb(255, 0, 0) 0%,
rgb(255, 255, 0) 17%,
rgb(0, 255, 0) 33%,
rgb(0, 255, 255) 50%,
rgb(0, 0, 255) 67%,
rgb(255, 0, 255) 83%,
rgb(255, 0, 0) 100%
);
}
.alpha .alpha-gradient {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: inherit;
}
.preview {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
width: 3em;
height: 3em;
border: none;
border-radius: var(--wa-border-radius-circle);
background: none;
font-size: inherit;
margin-inline-start: 0.75em;
cursor: copy;
forced-color-adjust: none;
}
.preview:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: inherit;
box-shadow: inset 0 0 0 0.0625rem rgba(0, 0, 0, 0.2);
/* We use a custom property in lieu of currentColor because of https://bugs.webkit.org/show_bug.cgi?id=216780 */
background-color: var(--preview-color);
}
.preview:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
.preview-color {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: solid 0.0625rem rgba(0, 0, 0, 0.125);
}
.preview-color-copied {
animation: pulse 850ms;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 var(--wa-color-brand-fill-loud);
}
70% {
box-shadow: 0 0 0 0.5rem transparent;
}
100% {
box-shadow: 0 0 0 0 transparent;
}
}
.user-input {
display: flex;
align-items: center;
padding: 0 0.75em 0.75em 0.75em;
}
.user-input wa-input {
min-width: 0; /* fix input width in Safari */
flex: 1 1 auto;
&::part(form-control-label) {
/* Visually hidden */
position: absolute !important;
width: 1px !important;
height: 1px !important;
clip: rect(0 0 0 0) !important;
clip-path: inset(50%) !important;
border: none !important;
overflow: hidden !important;
white-space: nowrap !important;
padding: 0 !important;
}
}
.user-input wa-button-group {
margin-inline-start: 0.75em;
&::part(base) {
flex-wrap: nowrap;
}
}
.user-input wa-button:first-of-type {
min-width: 3em;
max-width: 3em;
}
.swatches {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(1.5em, 100%), 1fr));
grid-gap: 0.5em;
justify-items: center;
border-block-start: var(--wa-form-control-border-style) var(--wa-form-control-border-width)
var(--wa-color-surface-border);
padding: 0.5em;
forced-color-adjust: none;
}
.swatch {
position: relative;
aspect-ratio: 1 / 1;
width: 100%;
border-radius: var(--wa-border-radius-s);
}
.swatch .swatch-color {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: solid 0.0625rem rgba(0, 0, 0, 0.125);
border-radius: inherit;
cursor: pointer;
}
.swatch:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
.transparent-bg {
background-image:
linear-gradient(45deg, var(--wa-color-neutral-fill-normal) 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, var(--wa-color-neutral-fill-normal) 75%),
linear-gradient(45deg, transparent 75%, var(--wa-color-neutral-fill-normal) 75%),
linear-gradient(45deg, var(--wa-color-neutral-fill-normal) 25%, transparent 25%);
background-size: 0.5rem 0.5rem;
background-position:
0 0,
0 0,
-0.25rem -0.25rem,
0.25rem 0.25rem;
}
:host([disabled]) {
opacity: 0.5;
cursor: not-allowed;
.grid,
.grid-handle,
.slider,
.slider-handle,
.preview,
.swatch,
.swatch-color {
pointer-events: none;
}
}
/*
* Color dropdown
*/
.color-dropdown {
display: contents;
}
.color-dropdown::part(panel) {
max-height: none;
background-color: var(--wa-color-surface-raised);
border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border);
border-radius: var(--wa-border-radius-m);
overflow: visible;
}
.trigger {
display: block;
position: relative;
background-color: transparent;
border: none;
cursor: pointer;
font-size: inherit;
forced-color-adjust: none;
width: var(--wa-form-control-height);
height: var(--wa-form-control-height);
border-radius: var(--wa-form-control-border-radius);
}
.trigger:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: inherit;
background-color: currentColor;
box-shadow:
inset 0 0 0 var(--wa-form-control-border-width) var(--wa-form-control-border-color),
inset 0 0 0 calc(var(--wa-form-control-border-width) * 3) var(--wa-color-surface-default);
}
.trigger-empty:before {
background-color: transparent;
}
.trigger:focus-visible {
outline: none;
}
.trigger:focus-visible:not(.trigger:disabled) {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
:host([disabled]) :is(.label, .trigger) {
opacity: 0.5;
cursor: not-allowed;
}
.form-control.form-control-has-label .label {
cursor: pointer;
display: inline-block;
}
`;

View File

@@ -14,9 +14,9 @@ import { HasSlotController } from '../../internal/slot.js';
import { RequiredValidator } from '../../internal/validators/required-validator.js';
import { watch } from '../../internal/watch.js';
import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-form-associated-element.js';
import formControlStyles from '../../styles/component/form-control.css';
import sizeStyles from '../../styles/utilities/size.css';
import visuallyHidden from '../../styles/utilities/visually-hidden.css';
import formControlStyles from '../../styles/component/form-control.styles.js';
import sizeStyles from '../../styles/component/size.styles.js';
import visuallyHidden from '../../styles/component/visually-hidden.styles.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../button-group/button-group.js';
import '../button/button.js';
@@ -25,7 +25,7 @@ import '../input/input.js';
import type WaInput from '../input/input.js';
import '../popup/popup.js';
import type WaPopup from '../popup/popup.js';
import styles from './color-picker.css';
import styles from './color-picker.styles.js';
interface EyeDropperConstructor {
new (): EyeDropperInterface;
@@ -220,13 +220,6 @@ export default class WaColorPicker extends WebAwesomeFormAssociatedElement {
*/
@property() swatches: string | string[] = '';
/**
* By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
* to place the form control outside of a form and associate it with the form that has this `id`. The form must be in
* the same document or shadow root for this to work.
*/
@property({ reflect: true }) form = null;
/** Makes the color picker a required field. */
@property({ type: Boolean, reflect: true }) required = false;

View File

@@ -1,76 +0,0 @@
:host {
--divider-width: 0.125rem;
--handle-size: 2.5rem;
display: block;
position: relative;
max-width: 100%;
max-height: 100%;
overflow: hidden;
}
.before,
.after {
display: block;
&::slotted(img),
&::slotted(svg) {
display: block;
max-width: 100% !important;
height: auto;
}
&::slotted(:not(img, svg)) {
isolation: isolate;
}
}
.after {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}
/* Disable pointer-events while dragging. This is especially important for iframes. */
:host(:state(dragging)) {
.before,
.after {
pointer-events: none;
}
}
.divider {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
width: var(--divider-width);
height: 100%;
background-color: var(--wa-color-surface-default);
translate: calc(var(--divider-width) / -2);
cursor: ew-resize;
}
.handle {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: calc(50% - (var(--handle-size) / 2));
width: var(--handle-size);
height: var(--handle-size);
background-color: var(--wa-color-surface-default);
border-radius: var(--wa-border-radius-circle);
font-size: calc(var(--handle-size) * 0.4);
color: var(--wa-color-neutral-on-quiet);
cursor: inherit;
z-index: 10;
}
.handle:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}

View File

@@ -0,0 +1,80 @@
import { css } from 'lit';
export default css`
:host {
--divider-width: 0.125rem;
--handle-size: 2.5rem;
display: block;
position: relative;
max-width: 100%;
max-height: 100%;
overflow: hidden;
}
.before,
.after {
display: block;
&::slotted(img),
&::slotted(svg) {
display: block;
max-width: 100% !important;
height: auto;
}
&::slotted(:not(img, svg)) {
isolation: isolate;
}
}
.after {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}
/* Disable pointer-events while dragging. This is especially important for iframes. */
:host(:state(dragging)) {
.before,
.after {
pointer-events: none;
}
}
.divider {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
width: var(--divider-width);
height: 100%;
background-color: var(--wa-color-surface-default);
translate: calc(var(--divider-width) / -2);
cursor: ew-resize;
}
.handle {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: calc(50% - (var(--handle-size) / 2));
width: var(--handle-size);
height: var(--handle-size);
background-color: var(--wa-color-surface-default);
border-radius: var(--wa-border-radius-circle);
font-size: calc(var(--handle-size) * 0.4);
color: var(--wa-color-neutral-on-quiet);
cursor: inherit;
z-index: 10;
}
.handle:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
`;

View File

@@ -7,7 +7,7 @@ import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../icon/icon.js';
import styles from './comparison.css';
import styles from './comparison.styles.js';
/**
* @summary Compare visual differences between similar content with a sliding panel.

View File

@@ -1,75 +0,0 @@
:host {
display: inline-block;
color: var(--wa-color-neutral-on-quiet);
}
.button {
flex: 0 0 auto;
display: flex;
align-items: center;
background-color: transparent;
border: none;
border-radius: var(--wa-form-control-border-radius);
color: inherit;
font-size: inherit;
padding: 0.5em;
cursor: pointer;
transition: color var(--wa-transition-fast) var(--wa-transition-easing);
}
@media (hover: hover) {
.button:hover:not([disabled]) {
background-color: var(--wa-color-neutral-fill-quiet);
color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover));
}
}
.button:focus-visible:not([disabled]) {
background-color: var(--wa-color-neutral-fill-quiet);
color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover));
}
.button:active:not([disabled]) {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-active));
}
slot[name='success-icon'] {
color: var(--wa-color-success-on-quiet);
}
slot[name='error-icon'] {
color: var(--wa-color-danger-on-quiet);
}
.button:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
.button[disabled] {
opacity: 0.5;
cursor: not-allowed !important;
}
slot {
display: inline-flex;
}
.show {
animation: show 100ms ease;
}
.hide {
animation: show 100ms ease reverse;
}
@keyframes show {
from {
scale: 0.25;
opacity: 0.25;
}
to {
scale: 1;
opacity: 1;
}
}

View File

@@ -0,0 +1,79 @@
import { css } from 'lit';
export default css`
:host {
display: inline-block;
color: var(--wa-color-neutral-on-quiet);
}
.button {
flex: 0 0 auto;
display: flex;
align-items: center;
background-color: transparent;
border: none;
border-radius: var(--wa-form-control-border-radius);
color: inherit;
font-size: inherit;
padding: 0.5em;
cursor: pointer;
transition: color var(--wa-transition-fast) var(--wa-transition-easing);
}
@media (hover: hover) {
.button:hover:not([disabled]) {
background-color: var(--wa-color-neutral-fill-quiet);
color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover));
}
}
.button:focus-visible:not([disabled]) {
background-color: var(--wa-color-neutral-fill-quiet);
color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover));
}
.button:active:not([disabled]) {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-active));
}
slot[name='success-icon'] {
color: var(--wa-color-success-on-quiet);
}
slot[name='error-icon'] {
color: var(--wa-color-danger-on-quiet);
}
.button:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
.button[disabled] {
opacity: 0.5;
cursor: not-allowed !important;
}
slot {
display: inline-flex;
}
.show {
animation: show 100ms ease;
}
.hide {
animation: show 100ms ease reverse;
}
@keyframes show {
from {
scale: 0.25;
opacity: 0.25;
}
to {
scale: 1;
opacity: 1;
}
}
`;

View File

@@ -5,12 +5,12 @@ import { WaCopyEvent } from '../../events/copy.js';
import { WaErrorEvent } from '../../events/error.js';
import { animateWithClass } from '../../internal/animate.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import visuallyHidden from '../../styles/utilities/visually-hidden.css';
import visuallyHidden from '../../styles/component/visually-hidden.styles.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../icon/icon.js';
import '../tooltip/tooltip.js';
import type WaTooltip from '../tooltip/tooltip.js';
import styles from './copy-button.css';
import styles from './copy-button.styles.js';
/**
* @summary Copies text data to the clipboard when the user clicks the trigger.

View File

@@ -1,122 +0,0 @@
:host {
--spacing: var(--wa-space-m);
--show-duration: 200ms;
--hide-duration: 200ms;
display: block;
}
details {
display: block;
overflow-anchor: none;
border: var(--wa-panel-border-width) var(--wa-color-surface-border) var(--wa-panel-border-style);
background-color: var(--wa-color-surface-default);
border-radius: var(--wa-panel-border-radius);
color: var(--wa-color-text-normal);
/* Print styles */
@media print {
background: none;
border: solid var(--wa-border-width-s) var(--wa-color-surface-border);
summary {
list-style: none;
}
}
}
/* Appearance modifiers */
:host([appearance='plain']) details {
background-color: transparent;
border-color: transparent;
border-radius: 0;
}
:host([appearance='outlined']) details {
background-color: var(--wa-color-surface-default);
border-color: var(--wa-color-surface-border);
}
:host([appearance='filled']) details {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: transparent;
}
:host([appearance='filled-outlined']) details {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: var(--wa-color-neutral-border-quiet);
}
:host([disabled]) details {
opacity: 0.5;
cursor: not-allowed;
}
summary {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--spacing);
padding: var(--spacing); /* Add padding here */
border-radius: calc(var(--wa-panel-border-radius) - var(--wa-panel-border-width));
user-select: none;
-webkit-user-select: none;
cursor: pointer;
&::marker,
&::-webkit-details-marker {
display: none;
}
&:focus {
outline: none;
}
&:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: calc(var(--wa-panel-border-width) + var(--wa-focus-ring-offset));
}
}
:host([open]) summary {
border-end-start-radius: 0;
border-end-end-radius: 0;
}
/* 'Start' icon placement */
:host([icon-placement='start']) summary {
flex-direction: row-reverse;
justify-content: start;
}
[part~='icon'] {
flex: 0 0 auto;
display: flex;
align-items: center;
color: var(--wa-color-text-quiet);
transition: rotate var(--wa-transition-normal) var(--wa-transition-easing);
}
:host([open]) [part~='icon'] {
rotate: 90deg;
}
:host([open]:dir(rtl)) [part~='icon'] {
rotate: -90deg;
}
:host([open]) slot[name='expand-icon'],
:host(:not([open])) slot[name='collapse-icon'] {
display: none;
}
.body.animating {
overflow: hidden;
}
.content {
display: block;
padding-block-start: var(--spacing);
padding-inline: var(--spacing); /* Add horizontal padding */
padding-block-end: var(--spacing); /* Add bottom padding */
}

View File

@@ -0,0 +1,126 @@
import { css } from 'lit';
export default css`
:host {
--spacing: var(--wa-space-m);
--show-duration: 200ms;
--hide-duration: 200ms;
display: block;
}
details {
display: block;
overflow-anchor: none;
border: var(--wa-panel-border-width) var(--wa-color-surface-border) var(--wa-panel-border-style);
background-color: var(--wa-color-surface-default);
border-radius: var(--wa-panel-border-radius);
color: var(--wa-color-text-normal);
/* Print styles */
@media print {
background: none;
border: solid var(--wa-border-width-s) var(--wa-color-surface-border);
summary {
list-style: none;
}
}
}
/* Appearance modifiers */
:host([appearance='plain']) details {
background-color: transparent;
border-color: transparent;
border-radius: 0;
}
:host([appearance='outlined']) details {
background-color: var(--wa-color-surface-default);
border-color: var(--wa-color-surface-border);
}
:host([appearance='filled']) details {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: transparent;
}
:host([appearance='filled-outlined']) details {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: var(--wa-color-neutral-border-quiet);
}
:host([disabled]) details {
opacity: 0.5;
cursor: not-allowed;
}
summary {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--spacing);
padding: var(--spacing); /* Add padding here */
border-radius: calc(var(--wa-panel-border-radius) - var(--wa-panel-border-width));
user-select: none;
-webkit-user-select: none;
cursor: pointer;
&::marker,
&::-webkit-details-marker {
display: none;
}
&:focus {
outline: none;
}
&:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: calc(var(--wa-panel-border-width) + var(--wa-focus-ring-offset));
}
}
:host([open]) summary {
border-end-start-radius: 0;
border-end-end-radius: 0;
}
/* 'Start' icon placement */
:host([icon-placement='start']) summary {
flex-direction: row-reverse;
justify-content: start;
}
[part~='icon'] {
flex: 0 0 auto;
display: flex;
align-items: center;
color: var(--wa-color-text-quiet);
transition: rotate var(--wa-transition-normal) var(--wa-transition-easing);
}
:host([open]) [part~='icon'] {
rotate: 90deg;
}
:host([open]:dir(rtl)) [part~='icon'] {
rotate: -90deg;
}
:host([open]) slot[name='expand-icon'],
:host(:not([open])) slot[name='collapse-icon'] {
display: none;
}
.body.animating {
overflow: hidden;
}
.content {
display: block;
padding-block-start: var(--spacing);
padding-inline: var(--spacing); /* Add horizontal padding */
padding-block-end: var(--spacing); /* Add bottom padding */
}
`;

View File

@@ -13,7 +13,7 @@ import WebAwesomeElement from '../../internal/webawesome-element.js';
import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-form-associated-element.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../icon/icon.js';
import styles from './details.css';
import styles from './details.styles.js';
/**
* @summary Details show a brief summary and expand to show additional content.

View File

@@ -1,183 +0,0 @@
:host {
--width: 31rem;
--spacing: var(--wa-space-l);
--show-duration: 200ms;
--hide-duration: 200ms;
display: none;
}
:host([open]) {
display: block;
}
.dialog {
display: flex;
flex-direction: column;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: var(--width);
max-width: calc(100% - var(--wa-space-2xl));
max-height: calc(100% - var(--wa-space-2xl));
background-color: var(--wa-color-surface-raised);
border-radius: var(--wa-panel-border-radius);
border: none;
box-shadow: var(--wa-shadow-l);
padding: 0;
margin: auto;
&.show {
animation: show-dialog var(--show-duration) ease;
&::backdrop {
animation: show-backdrop var(--show-duration, 200ms) ease;
}
}
&.hide {
animation: show-dialog var(--hide-duration) ease reverse;
&::backdrop {
animation: show-backdrop var(--hide-duration, 200ms) ease reverse;
}
}
&.pulse {
animation: pulse 250ms ease;
}
}
.dialog:focus {
outline: none;
}
/* Ensure there's enough vertical padding for phones that don't update vh when chrome appears (e.g. iPhone) */
@media screen and (max-width: 420px) {
.dialog {
max-height: 80vh;
}
}
.open {
display: flex;
opacity: 1;
}
.header {
flex: 0 0 auto;
display: flex;
flex-wrap: nowrap;
padding-inline-start: var(--spacing);
padding-block-end: 0;
/* Subtract the close button's padding so that the X is visually aligned with the edges of the dialog content */
padding-inline-end: calc(var(--spacing) - var(--wa-form-control-padding-block));
padding-block-start: calc(var(--spacing) - var(--wa-form-control-padding-block));
}
.title {
align-self: center;
flex: 1 1 auto;
font-family: inherit;
font-size: var(--wa-font-size-l);
font-weight: var(--wa-font-weight-heading);
line-height: var(--wa-line-height-condensed);
margin: 0;
}
.header-actions {
align-self: start;
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
justify-content: end;
gap: var(--wa-space-2xs);
padding-inline-start: var(--spacing);
}
.header-actions wa-button,
.header-actions ::slotted(wa-button) {
flex: 0 0 auto;
display: flex;
align-items: center;
}
.body {
flex: 1 1 auto;
display: block;
padding: var(--spacing);
overflow: auto;
-webkit-overflow-scrolling: touch;
&:focus {
outline: none;
}
&:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
}
.footer {
flex: 0 0 auto;
display: flex;
flex-wrap: wrap;
gap: var(--wa-space-xs);
justify-content: end;
padding: var(--spacing);
padding-block-start: 0;
}
.footer ::slotted(wa-button:not(:first-of-type)) {
margin-inline-start: var(--wa-spacing-xs);
}
.dialog::backdrop {
/*
NOTE: the ::backdrop element doesn't inherit properly in Safari yet, but it will in 17.4! At that time, we can
remove the fallback values here.
*/
background-color: var(--wa-color-overlay-modal, rgb(0 0 0 / 0.25));
}
@keyframes pulse {
0% {
scale: 1;
}
50% {
scale: 1.02;
}
100% {
scale: 1;
}
}
@keyframes show-dialog {
from {
opacity: 0;
scale: 0.8;
}
to {
opacity: 1;
scale: 1;
}
}
@keyframes show-backdrop {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@media (forced-colors: active) {
.dialog {
border: solid 1px white;
}
}

View File

@@ -0,0 +1,187 @@
import { css } from 'lit';
export default css`
:host {
--width: 31rem;
--spacing: var(--wa-space-l);
--show-duration: 200ms;
--hide-duration: 200ms;
display: none;
}
:host([open]) {
display: block;
}
.dialog {
display: flex;
flex-direction: column;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: var(--width);
max-width: calc(100% - var(--wa-space-2xl));
max-height: calc(100% - var(--wa-space-2xl));
background-color: var(--wa-color-surface-raised);
border-radius: var(--wa-panel-border-radius);
border: none;
box-shadow: var(--wa-shadow-l);
padding: 0;
margin: auto;
&.show {
animation: show-dialog var(--show-duration) ease;
&::backdrop {
animation: show-backdrop var(--show-duration, 200ms) ease;
}
}
&.hide {
animation: show-dialog var(--hide-duration) ease reverse;
&::backdrop {
animation: show-backdrop var(--hide-duration, 200ms) ease reverse;
}
}
&.pulse {
animation: pulse 250ms ease;
}
}
.dialog:focus {
outline: none;
}
/* Ensure there's enough vertical padding for phones that don't update vh when chrome appears (e.g. iPhone) */
@media screen and (max-width: 420px) {
.dialog {
max-height: 80vh;
}
}
.open {
display: flex;
opacity: 1;
}
.header {
flex: 0 0 auto;
display: flex;
flex-wrap: nowrap;
padding-inline-start: var(--spacing);
padding-block-end: 0;
/* Subtract the close button's padding so that the X is visually aligned with the edges of the dialog content */
padding-inline-end: calc(var(--spacing) - var(--wa-form-control-padding-block));
padding-block-start: calc(var(--spacing) - var(--wa-form-control-padding-block));
}
.title {
align-self: center;
flex: 1 1 auto;
font-family: inherit;
font-size: var(--wa-font-size-l);
font-weight: var(--wa-font-weight-heading);
line-height: var(--wa-line-height-condensed);
margin: 0;
}
.header-actions {
align-self: start;
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
justify-content: end;
gap: var(--wa-space-2xs);
padding-inline-start: var(--spacing);
}
.header-actions wa-button,
.header-actions ::slotted(wa-button) {
flex: 0 0 auto;
display: flex;
align-items: center;
}
.body {
flex: 1 1 auto;
display: block;
padding: var(--spacing);
overflow: auto;
-webkit-overflow-scrolling: touch;
&:focus {
outline: none;
}
&:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
}
.footer {
flex: 0 0 auto;
display: flex;
flex-wrap: wrap;
gap: var(--wa-space-xs);
justify-content: end;
padding: var(--spacing);
padding-block-start: 0;
}
.footer ::slotted(wa-button:not(:first-of-type)) {
margin-inline-start: var(--wa-spacing-xs);
}
.dialog::backdrop {
/*
NOTE: the ::backdrop element doesn't inherit properly in Safari yet, but it will in 17.4! At that time, we can
remove the fallback values here.
*/
background-color: var(--wa-color-overlay-modal, rgb(0 0 0 / 0.25));
}
@keyframes pulse {
0% {
scale: 1;
}
50% {
scale: 1.02;
}
100% {
scale: 1;
}
}
@keyframes show-dialog {
from {
opacity: 0;
scale: 0.8;
}
to {
opacity: 1;
scale: 1;
}
}
@keyframes show-backdrop {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@media (forced-colors: active) {
.dialog {
border: solid 1px white;
}
}
`;

View File

@@ -13,7 +13,7 @@ import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../button/button.js';
import styles from './dialog.css';
import styles from './dialog.styles.js';
/**
* @summary Dialogs, sometimes called "modals", appear above the page and require the user's immediate attention.

View File

@@ -1,19 +0,0 @@
:host {
--color: var(--wa-color-surface-border);
--width: var(--wa-border-width-s);
--spacing: var(--wa-space-m);
}
:host(:not([orientation='vertical'])) {
display: block;
border-top: solid var(--width) var(--color);
margin: var(--spacing) 0;
}
:host([orientation='vertical']) {
display: inline-block;
height: 100%;
border-inline-start: solid var(--width) var(--color);
margin: 0 var(--spacing);
min-block-size: 1lh;
}

View File

@@ -0,0 +1,23 @@
import { css } from 'lit';
export default css`
:host {
--color: var(--wa-color-surface-border);
--width: var(--wa-border-width-s);
--spacing: var(--wa-space-m);
}
:host(:not([orientation='vertical'])) {
display: block;
border-top: solid var(--width) var(--color);
margin: var(--spacing) 0;
}
:host([orientation='vertical']) {
display: inline-block;
height: 100%;
border-inline-start: solid var(--width) var(--color);
margin: 0 var(--spacing);
min-block-size: 1lh;
}
`;

View File

@@ -1,7 +1,7 @@
import { customElement, property } from 'lit/decorators.js';
import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './divider.css';
import styles from './divider.styles.js';
/**
* @summary Dividers are used to visually separate or group elements.

View File

@@ -1,290 +0,0 @@
:host {
--size: 25rem;
--spacing: var(--wa-space-l);
--show-duration: 200ms;
--hide-duration: 200ms;
display: none;
}
:host([open]) {
display: block;
}
.drawer {
display: flex;
flex-direction: column;
top: 0;
inset-inline-start: 0;
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
overflow: hidden;
background-color: var(--wa-color-surface-raised);
border: none;
box-shadow: var(--wa-shadow-l);
overflow: auto;
padding: 0;
margin: 0;
animation-duration: var(--show-duration);
animation-timing-function: ease;
&.show::backdrop {
animation: show-backdrop var(--show-duration, 200ms) ease;
}
&.hide::backdrop {
animation: show-backdrop var(--hide-duration, 200ms) ease reverse;
}
&.show.top {
animation: show-drawer-from-top var(--show-duration) ease;
}
&.hide.top {
animation: show-drawer-from-top var(--hide-duration) ease reverse;
}
&.show.end {
animation: show-drawer-from-end var(--show-duration) ease;
&:dir(rtl) {
animation-name: show-drawer-from-start;
}
}
&.hide.end {
animation: show-drawer-from-end var(--hide-duration) ease reverse;
&:dir(rtl) {
animation-name: show-drawer-from-start;
}
}
&.show.bottom {
animation: show-drawer-from-bottom var(--show-duration) ease;
}
&.hide.bottom {
animation: show-drawer-from-bottom var(--hide-duration) ease reverse;
}
&.show.start {
animation: show-drawer-from-start var(--show-duration) ease;
&:dir(rtl) {
animation-name: show-drawer-from-end;
}
}
&.hide.start {
animation: show-drawer-from-start var(--hide-duration) ease reverse;
&:dir(rtl) {
animation-name: show-drawer-from-end;
}
}
&.pulse {
animation: pulse 250ms ease;
}
}
.drawer:focus {
outline: none;
}
.top {
top: 0;
inset-inline-end: auto;
bottom: auto;
inset-inline-start: 0;
width: 100%;
height: var(--size);
}
.end {
top: 0;
inset-inline-end: 0;
bottom: auto;
inset-inline-start: auto;
width: var(--size);
height: 100%;
}
.bottom {
top: auto;
inset-inline-end: auto;
bottom: 0;
inset-inline-start: 0;
width: 100%;
height: var(--size);
}
.start {
top: 0;
inset-inline-end: auto;
bottom: auto;
inset-inline-start: 0;
width: var(--size);
height: 100%;
}
.header {
display: flex;
flex-wrap: nowrap;
padding-inline-start: var(--spacing);
padding-block-end: 0;
/* Subtract the close button's padding so that the X is visually aligned with the edges of the dialog content */
padding-inline-end: calc(var(--spacing) - var(--wa-form-control-padding-block));
padding-block-start: calc(var(--spacing) - var(--wa-form-control-padding-block));
}
.title {
align-self: center;
flex: 1 1 auto;
font: inherit;
font-size: var(--wa-font-size-l);
font-weight: var(--wa-font-weight-heading);
line-height: var(--wa-line-height-condensed);
margin: 0;
}
.header-actions {
align-self: start;
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
justify-content: end;
gap: var(--wa-space-2xs);
padding-inline-start: var(--spacing);
}
.header-actions wa-button,
.header-actions ::slotted(wa-button) {
flex: 0 0 auto;
display: flex;
align-items: center;
}
.body {
flex: 1 1 auto;
display: block;
padding: var(--spacing);
overflow: auto;
-webkit-overflow-scrolling: touch;
&:focus {
outline: none;
}
&:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
}
.footer {
display: flex;
flex-wrap: wrap;
gap: var(--wa-space-xs);
justify-content: end;
padding: var(--spacing);
padding-block-start: 0;
}
.footer ::slotted(wa-button:not(:last-of-type)) {
margin-inline-end: var(--wa-spacing-xs);
}
.drawer::backdrop {
/*
NOTE: the ::backdrop element doesn't inherit properly in Safari yet, but it will in 17.4! At that time, we can
remove the fallback values here.
*/
background-color: var(--wa-color-overlay-modal, rgb(0 0 0 / 0.25));
}
@keyframes pulse {
0% {
scale: 1;
}
50% {
scale: 1.01;
}
100% {
scale: 1;
}
}
@keyframes show-drawer {
from {
opacity: 0;
scale: 0.8;
}
to {
opacity: 1;
scale: 1;
}
}
@keyframes show-drawer-from-top {
from {
opacity: 0;
translate: 0 -100%;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes show-drawer-from-end {
from {
opacity: 0;
translate: 100%;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes show-drawer-from-bottom {
from {
opacity: 0;
translate: 0 100%;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes show-drawer-from-start {
from {
opacity: 0;
translate: -100% 0;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes show-backdrop {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@media (forced-colors: active) {
.drawer {
border: solid 1px white;
}
}

View File

@@ -0,0 +1,294 @@
import { css } from 'lit';
export default css`
:host {
--size: 25rem;
--spacing: var(--wa-space-l);
--show-duration: 200ms;
--hide-duration: 200ms;
display: none;
}
:host([open]) {
display: block;
}
.drawer {
display: flex;
flex-direction: column;
top: 0;
inset-inline-start: 0;
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
overflow: hidden;
background-color: var(--wa-color-surface-raised);
border: none;
box-shadow: var(--wa-shadow-l);
overflow: auto;
padding: 0;
margin: 0;
animation-duration: var(--show-duration);
animation-timing-function: ease;
&.show::backdrop {
animation: show-backdrop var(--show-duration, 200ms) ease;
}
&.hide::backdrop {
animation: show-backdrop var(--hide-duration, 200ms) ease reverse;
}
&.show.top {
animation: show-drawer-from-top var(--show-duration) ease;
}
&.hide.top {
animation: show-drawer-from-top var(--hide-duration) ease reverse;
}
&.show.end {
animation: show-drawer-from-end var(--show-duration) ease;
&:dir(rtl) {
animation-name: show-drawer-from-start;
}
}
&.hide.end {
animation: show-drawer-from-end var(--hide-duration) ease reverse;
&:dir(rtl) {
animation-name: show-drawer-from-start;
}
}
&.show.bottom {
animation: show-drawer-from-bottom var(--show-duration) ease;
}
&.hide.bottom {
animation: show-drawer-from-bottom var(--hide-duration) ease reverse;
}
&.show.start {
animation: show-drawer-from-start var(--show-duration) ease;
&:dir(rtl) {
animation-name: show-drawer-from-end;
}
}
&.hide.start {
animation: show-drawer-from-start var(--hide-duration) ease reverse;
&:dir(rtl) {
animation-name: show-drawer-from-end;
}
}
&.pulse {
animation: pulse 250ms ease;
}
}
.drawer:focus {
outline: none;
}
.top {
top: 0;
inset-inline-end: auto;
bottom: auto;
inset-inline-start: 0;
width: 100%;
height: var(--size);
}
.end {
top: 0;
inset-inline-end: 0;
bottom: auto;
inset-inline-start: auto;
width: var(--size);
height: 100%;
}
.bottom {
top: auto;
inset-inline-end: auto;
bottom: 0;
inset-inline-start: 0;
width: 100%;
height: var(--size);
}
.start {
top: 0;
inset-inline-end: auto;
bottom: auto;
inset-inline-start: 0;
width: var(--size);
height: 100%;
}
.header {
display: flex;
flex-wrap: nowrap;
padding-inline-start: var(--spacing);
padding-block-end: 0;
/* Subtract the close button's padding so that the X is visually aligned with the edges of the dialog content */
padding-inline-end: calc(var(--spacing) - var(--wa-form-control-padding-block));
padding-block-start: calc(var(--spacing) - var(--wa-form-control-padding-block));
}
.title {
align-self: center;
flex: 1 1 auto;
font: inherit;
font-size: var(--wa-font-size-l);
font-weight: var(--wa-font-weight-heading);
line-height: var(--wa-line-height-condensed);
margin: 0;
}
.header-actions {
align-self: start;
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
justify-content: end;
gap: var(--wa-space-2xs);
padding-inline-start: var(--spacing);
}
.header-actions wa-button,
.header-actions ::slotted(wa-button) {
flex: 0 0 auto;
display: flex;
align-items: center;
}
.body {
flex: 1 1 auto;
display: block;
padding: var(--spacing);
overflow: auto;
-webkit-overflow-scrolling: touch;
&:focus {
outline: none;
}
&:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
}
.footer {
display: flex;
flex-wrap: wrap;
gap: var(--wa-space-xs);
justify-content: end;
padding: var(--spacing);
padding-block-start: 0;
}
.footer ::slotted(wa-button:not(:last-of-type)) {
margin-inline-end: var(--wa-spacing-xs);
}
.drawer::backdrop {
/*
NOTE: the ::backdrop element doesn't inherit properly in Safari yet, but it will in 17.4! At that time, we can
remove the fallback values here.
*/
background-color: var(--wa-color-overlay-modal, rgb(0 0 0 / 0.25));
}
@keyframes pulse {
0% {
scale: 1;
}
50% {
scale: 1.01;
}
100% {
scale: 1;
}
}
@keyframes show-drawer {
from {
opacity: 0;
scale: 0.8;
}
to {
opacity: 1;
scale: 1;
}
}
@keyframes show-drawer-from-top {
from {
opacity: 0;
translate: 0 -100%;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes show-drawer-from-end {
from {
opacity: 0;
translate: 100%;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes show-drawer-from-bottom {
from {
opacity: 0;
translate: 0 100%;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes show-drawer-from-start {
from {
opacity: 0;
translate: -100% 0;
}
to {
opacity: 1;
translate: 0 0;
}
}
@keyframes show-backdrop {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@media (forced-colors: active) {
.drawer {
border: solid 1px white;
}
}
`;

View File

@@ -13,7 +13,7 @@ import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../button/button.js';
import styles from './drawer.css';
import styles from './drawer.styles.js';
/**
* @summary Drawers slide in from a container to expose additional options and information.

View File

@@ -1,227 +0,0 @@
:host {
display: flex;
position: relative;
align-items: center;
padding: 0.5em 1em;
border-radius: var(--wa-border-radius-s);
isolation: isolate;
color: var(--wa-color-text-normal);
line-height: var(--wa-line-height-condensed);
cursor: pointer;
transition:
100ms background-color ease,
100ms color ease;
}
@media (hover: hover) {
:host(:hover:not(:state(disabled))) {
background-color: var(--wa-color-neutral-fill-normal);
}
}
:host(:focus-visible) {
z-index: 1;
outline: var(--wa-focus-ring);
background-color: var(--wa-color-neutral-fill-normal);
}
:host(:state(disabled)) {
opacity: 0.5;
cursor: not-allowed;
}
/* Danger variant */
:host([variant='danger']),
:host([variant='danger']) #details {
color: var(--wa-color-danger-on-quiet);
}
@media (hover: hover) {
:host([variant='danger']:hover) {
background-color: var(--wa-color-danger-fill-normal);
color: var(--wa-color-danger-on-normal);
}
}
:host([variant='danger']:focus-visible) {
background-color: var(--wa-color-danger-fill-normal);
color: var(--wa-color-danger-on-normal);
}
:host([checkbox-adjacent]) {
padding-inline-start: 2em;
}
/* Only add padding when item actually has a submenu */
:host([submenu-adjacent]:not(:state(has-submenu))) #details {
padding-inline-end: 0;
}
:host(:state(has-submenu)[submenu-adjacent]) #details {
padding-inline-end: 1.75em;
}
#check {
visibility: hidden;
margin-inline-start: -1.5em;
margin-inline-end: 0.5em;
font-size: var(--wa-font-size-smaller);
}
:host(:state(checked)) #check {
visibility: visible;
}
#icon ::slotted(*) {
display: flex;
flex: 0 0 auto;
align-items: center;
margin-inline-end: 0.75em !important;
font-size: var(--wa-font-size-smaller);
}
#label {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#details {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: end;
color: var(--wa-color-text-quiet);
font-size: var(--wa-font-size-smaller) !important;
}
#details ::slotted(*) {
margin-inline-start: 2em !important;
}
/* Submenu indicator icon */
#submenu-indicator {
position: absolute;
inset-inline-end: 1em;
color: var(--wa-color-neutral-on-quiet);
font-size: var(--wa-font-size-smaller);
}
/* Flip chevron icon when RTL */
:host(:dir(rtl)) #submenu-indicator {
transform: scaleX(-1);
}
/* Submenu styles */
#submenu {
display: flex;
z-index: 10;
position: absolute;
top: 0;
left: 0;
flex-direction: column;
width: max-content;
margin: 0;
padding: 0.25em;
border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border);
border-radius: var(--wa-border-radius-m);
background-color: var(--wa-color-surface-raised);
box-shadow: var(--wa-shadow-m);
color: var(--wa-color-text-normal);
text-align: start;
user-select: none;
/* Override default popover styles */
&[popover] {
margin: 0;
inset: auto;
padding: 0.25em;
overflow: visible;
border-radius: var(--wa-border-radius-m);
}
&.show {
animation: submenu-show var(--show-duration, 50ms) ease;
}
&.hide {
animation: submenu-show var(--show-duration, 50ms) ease reverse;
}
/* Submenu placement transform origins */
&[data-placement^='top'] {
transform-origin: bottom;
}
&[data-placement^='bottom'] {
transform-origin: top;
}
&[data-placement^='left'] {
transform-origin: right;
}
&[data-placement^='right'] {
transform-origin: left;
}
&[data-placement='left-start'] {
transform-origin: right top;
}
&[data-placement='left-end'] {
transform-origin: right bottom;
}
&[data-placement='right-start'] {
transform-origin: left top;
}
&[data-placement='right-end'] {
transform-origin: left bottom;
}
/* Safe triangle styling */
&::before {
display: none;
z-index: 9;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: transparent;
content: '';
clip-path: polygon(
var(--safe-triangle-cursor-x, 0) var(--safe-triangle-cursor-y, 0),
var(--safe-triangle-submenu-start-x, 0) var(--safe-triangle-submenu-start-y, 0),
var(--safe-triangle-submenu-end-x, 0) var(--safe-triangle-submenu-end-y, 0)
);
pointer-events: auto; /* Enable mouse events on the triangle */
}
&[data-visible]::before {
display: block;
}
}
::slotted(wa-dropdown-item) {
font-size: inherit;
}
::slotted(wa-divider) {
--spacing: 0.25em;
}
@keyframes submenu-show {
from {
scale: 0.9;
opacity: 0;
}
to {
scale: 1;
opacity: 1;
}
}

View File

@@ -0,0 +1,231 @@
import { css } from 'lit';
export default css`
:host {
display: flex;
position: relative;
align-items: center;
padding: 0.5em 1em;
border-radius: var(--wa-border-radius-s);
isolation: isolate;
color: var(--wa-color-text-normal);
line-height: var(--wa-line-height-condensed);
cursor: pointer;
transition:
var(--wa-transition-fast) background-color var(--wa-transition-easing),
var(--wa-transition-fast) color var(--wa-transition-easing);
}
@media (hover: hover) {
:host(:hover:not(:state(disabled))) {
background-color: var(--wa-color-neutral-fill-normal);
}
}
:host(:focus-visible) {
z-index: 1;
outline: var(--wa-focus-ring);
background-color: var(--wa-color-neutral-fill-normal);
}
:host(:state(disabled)) {
opacity: 0.5;
cursor: not-allowed;
}
/* Danger variant */
:host([variant='danger']),
:host([variant='danger']) #details {
color: var(--wa-color-danger-on-quiet);
}
@media (hover: hover) {
:host([variant='danger']:hover) {
background-color: var(--wa-color-danger-fill-normal);
color: var(--wa-color-danger-on-normal);
}
}
:host([variant='danger']:focus-visible) {
background-color: var(--wa-color-danger-fill-normal);
color: var(--wa-color-danger-on-normal);
}
:host([checkbox-adjacent]) {
padding-inline-start: 2em;
}
/* Only add padding when item actually has a submenu */
:host([submenu-adjacent]:not(:state(has-submenu))) #details {
padding-inline-end: 0;
}
:host(:state(has-submenu)[submenu-adjacent]) #details {
padding-inline-end: 1.75em;
}
#check {
visibility: hidden;
margin-inline-start: -1.5em;
margin-inline-end: 0.5em;
font-size: var(--wa-font-size-smaller);
}
:host(:state(checked)) #check {
visibility: visible;
}
#icon ::slotted(*) {
display: flex;
flex: 0 0 auto;
align-items: center;
margin-inline-end: 0.75em !important;
font-size: var(--wa-font-size-smaller);
}
#label {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#details {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: end;
color: var(--wa-color-text-quiet);
font-size: var(--wa-font-size-smaller) !important;
}
#details ::slotted(*) {
margin-inline-start: 2em !important;
}
/* Submenu indicator icon */
#submenu-indicator {
position: absolute;
inset-inline-end: 1em;
color: var(--wa-color-neutral-on-quiet);
font-size: var(--wa-font-size-smaller);
}
/* Flip chevron icon when RTL */
:host(:dir(rtl)) #submenu-indicator {
transform: scaleX(-1);
}
/* Submenu styles */
#submenu {
display: flex;
z-index: 10;
position: absolute;
top: 0;
left: 0;
flex-direction: column;
width: max-content;
margin: 0;
padding: 0.25em;
border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border);
border-radius: var(--wa-border-radius-m);
background-color: var(--wa-color-surface-raised);
box-shadow: var(--wa-shadow-m);
color: var(--wa-color-text-normal);
text-align: start;
user-select: none;
/* Override default popover styles */
&[popover] {
margin: 0;
inset: auto;
padding: 0.25em;
overflow: visible;
border-radius: var(--wa-border-radius-m);
}
&.show {
animation: submenu-show var(--show-duration, 50ms) ease;
}
&.hide {
animation: submenu-show var(--show-duration, 50ms) ease reverse;
}
/* Submenu placement transform origins */
&[data-placement^='top'] {
transform-origin: bottom;
}
&[data-placement^='bottom'] {
transform-origin: top;
}
&[data-placement^='left'] {
transform-origin: right;
}
&[data-placement^='right'] {
transform-origin: left;
}
&[data-placement='left-start'] {
transform-origin: right top;
}
&[data-placement='left-end'] {
transform-origin: right bottom;
}
&[data-placement='right-start'] {
transform-origin: left top;
}
&[data-placement='right-end'] {
transform-origin: left bottom;
}
/* Safe triangle styling */
&::before {
display: none;
z-index: 9;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: transparent;
content: '';
clip-path: polygon(
var(--safe-triangle-cursor-x, 0) var(--safe-triangle-cursor-y, 0),
var(--safe-triangle-submenu-start-x, 0) var(--safe-triangle-submenu-start-y, 0),
var(--safe-triangle-submenu-end-x, 0) var(--safe-triangle-submenu-end-y, 0)
);
pointer-events: auto; /* Enable mouse events on the triangle */
}
&[data-visible]::before {
display: block;
}
}
::slotted(wa-dropdown-item) {
font-size: inherit;
}
::slotted(wa-divider) {
--spacing: 0.25em;
}
@keyframes submenu-show {
from {
scale: 0.9;
opacity: 0;
}
to {
scale: 1;
opacity: 1;
}
}
`;

View File

@@ -4,7 +4,8 @@ import { customElement, property, query, state } from 'lit/decorators.js';
import { animateWithClass } from '../../internal/animate.js';
import { HasSlotController } from '../../internal/slot.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './dropdown-item.css';
import '../icon/icon.js';
import styles from './dropdown-item.styles.js';
/**
* @summary Represents an individual item within a dropdown menu, supporting standard items, checkboxes, and submenus.

View File

@@ -1,93 +0,0 @@
:host {
--show-duration: 50ms;
--hide-duration: 50ms;
display: contents;
}
#menu {
display: flex;
flex-direction: column;
width: max-content;
margin: 0;
padding: 0.25em;
border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border);
border-radius: var(--wa-border-radius-m);
background-color: var(--wa-color-surface-raised);
box-shadow: var(--wa-shadow-m);
color: var(--wa-color-text-normal);
text-align: start;
user-select: none;
overflow: auto;
max-width: var(--auto-size-available-width) !important;
max-height: var(--auto-size-available-height) !important;
&.show {
animation: show var(--show-duration) ease;
}
&.hide {
animation: show var(--hide-duration) ease reverse;
}
::slotted(h1),
::slotted(h2),
::slotted(h3),
::slotted(h4),
::slotted(h5),
::slotted(h6) {
display: block !important;
margin: 0.25em 0 !important;
padding: 0.25em 0.75em !important;
color: var(--wa-color-text-quiet) !important;
font-family: var(--wa-font-family-body) !important;
font-weight: var(--wa-font-weight-semibold) !important;
font-size: var(--wa-font-size-smaller) !important;
}
::slotted(wa-divider) {
--spacing: 0.25em; /* Component-specific, left as-is */
}
}
wa-popup[data-current-placement^='top'] #menu {
transform-origin: bottom;
}
wa-popup[data-current-placement^='bottom'] #menu {
transform-origin: top;
}
wa-popup[data-current-placement^='left'] #menu {
transform-origin: right;
}
wa-popup[data-current-placement^='right'] #menu {
transform-origin: left;
}
wa-popup[data-current-placement='left-start'] #menu {
transform-origin: right top;
}
wa-popup[data-current-placement='left-end'] #menu {
transform-origin: right bottom;
}
wa-popup[data-current-placement='right-start'] #menu {
transform-origin: left top;
}
wa-popup[data-current-placement='right-end'] #menu {
transform-origin: left bottom;
}
@keyframes show {
from {
scale: 0.9;
opacity: 0;
}
to {
scale: 1;
opacity: 1;
}
}

View File

@@ -0,0 +1,97 @@
import { css } from 'lit';
export default css`
:host {
--show-duration: 50ms;
--hide-duration: 50ms;
display: contents;
}
#menu {
display: flex;
flex-direction: column;
width: max-content;
margin: 0;
padding: 0.25em;
border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border);
border-radius: var(--wa-border-radius-m);
background-color: var(--wa-color-surface-raised);
box-shadow: var(--wa-shadow-m);
color: var(--wa-color-text-normal);
text-align: start;
user-select: none;
overflow: auto;
max-width: var(--auto-size-available-width) !important;
max-height: var(--auto-size-available-height) !important;
&.show {
animation: show var(--show-duration) ease;
}
&.hide {
animation: show var(--hide-duration) ease reverse;
}
::slotted(h1),
::slotted(h2),
::slotted(h3),
::slotted(h4),
::slotted(h5),
::slotted(h6) {
display: block !important;
margin: 0.25em 0 !important;
padding: 0.25em 0.75em !important;
color: var(--wa-color-text-quiet) !important;
font-family: var(--wa-font-family-body) !important;
font-weight: var(--wa-font-weight-semibold) !important;
font-size: var(--wa-font-size-smaller) !important;
}
::slotted(wa-divider) {
--spacing: 0.25em; /* Component-specific, left as-is */
}
}
wa-popup[data-current-placement^='top'] #menu {
transform-origin: bottom;
}
wa-popup[data-current-placement^='bottom'] #menu {
transform-origin: top;
}
wa-popup[data-current-placement^='left'] #menu {
transform-origin: right;
}
wa-popup[data-current-placement^='right'] #menu {
transform-origin: left;
}
wa-popup[data-current-placement='left-start'] #menu {
transform-origin: right top;
}
wa-popup[data-current-placement='left-end'] #menu {
transform-origin: right bottom;
}
wa-popup[data-current-placement='right-start'] #menu {
transform-origin: left top;
}
wa-popup[data-current-placement='right-end'] #menu {
transform-origin: left bottom;
}
@keyframes show {
from {
scale: 0.9;
opacity: 0;
}
to {
scale: 1;
opacity: 1;
}
}
`;

View File

@@ -1,4 +1,6 @@
import { expect, fixture, html } from '@open-wc/testing';
import { aTimeout, expect, fixture, html, waitUntil } from '@open-wc/testing';
import sinon from 'sinon';
import type WaDropdown from './dropdown.js';
describe('<wa-dropdown>', () => {
it('should render a component', async () => {
@@ -6,4 +8,112 @@ describe('<wa-dropdown>', () => {
expect(el).to.exist;
});
it('should respect the open attribute when included', async () => {
const el = await fixture<WaDropdown>(html`
<wa-dropdown open>
<wa-button slot="trigger">Dropdown</wa-button>
<wa-dropdown-item>One</wa-dropdown-item>
</wa-dropdown>
`);
await el.updateComplete;
await aTimeout(200);
expect(el.open).to.be.true;
});
it('should fire a single show/after-show and hide/after-hide in normal open/close flow', async () => {
const el = await fixture<WaDropdown>(html`
<wa-dropdown>
<wa-button slot="trigger">Dropdown</wa-button>
<wa-dropdown-item>One</wa-dropdown-item>
<wa-dropdown-item>Two</wa-dropdown-item>
</wa-dropdown>
`);
// setup spies to track how often we see different show/hide events
const showSpy = sinon.spy();
const afterShowSpy = sinon.spy();
const hideSpy = sinon.spy();
const afterHideSpy = sinon.spy();
el.addEventListener('wa-show', showSpy);
el.addEventListener('wa-after-show', afterShowSpy);
el.addEventListener('wa-hide', hideSpy);
el.addEventListener('wa-after-hide', afterHideSpy);
// open the dropdown by triggering a click on the trigger
const trigger = el.querySelector<HTMLElement>('[slot="trigger"]')!;
trigger.click();
await waitUntil(() => showSpy.calledOnce);
await waitUntil(() => afterShowSpy.calledOnce);
expect(showSpy.callCount).to.equal(1);
expect(afterShowSpy.callCount).to.equal(1);
expect(el.open).to.be.true;
// close the dropdown by clicking the trigger again
trigger.click();
await waitUntil(() => hideSpy.calledOnce);
await waitUntil(() => afterHideSpy.calledOnce);
expect(hideSpy.callCount).to.equal(1);
expect(afterHideSpy.callCount).to.equal(1);
expect(el.open).to.be.false;
});
it('should fire a single show/after-show and hide/after-hide when wa-hide event is cancelled', async () => {
const el = await fixture<WaDropdown>(html`
<wa-dropdown>
<wa-button slot="trigger">Dropdown</wa-button>
<wa-dropdown-item>One</wa-dropdown-item>
<wa-dropdown-item>Two</wa-dropdown-item>
</wa-dropdown>
`);
// setup spies to track how often we see different show/hide events
const showSpy = sinon.spy();
const afterShowSpy = sinon.spy();
const hideSpy = sinon.spy();
const afterHideSpy = sinon.spy();
el.addEventListener('wa-show', showSpy);
el.addEventListener('wa-after-show', afterShowSpy);
// Intercept wa-hide and prevent it
el.addEventListener('wa-hide', event => {
event.preventDefault();
hideSpy(event);
});
el.addEventListener('wa-after-hide', afterHideSpy);
// open the dropdown by triggering a click on the trigger
const trigger = el.querySelector<HTMLElement>('[slot="trigger"]')!;
trigger.click();
await waitUntil(() => showSpy.calledOnce);
await waitUntil(() => afterShowSpy.calledOnce);
expect(showSpy.callCount).to.equal(1);
expect(afterShowSpy.callCount).to.equal(1);
expect(el.open).to.be.true;
// click on the trigger (which should do nothing to the open state)
trigger.click();
await waitUntil(() => hideSpy.calledOnce);
expect(hideSpy.callCount).to.equal(1);
// after-hide should not have been called if hide is cancelled
expect(afterHideSpy.callCount).to.equal(0);
expect(el.open).to.be.true;
});
});

View File

@@ -12,13 +12,13 @@ import { activeElements } from '../../internal/active-elements.js';
import { animateWithClass } from '../../internal/animate.js';
import { uniqueId } from '../../internal/math.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import sizeStyles from '../../styles/utilities/size.css';
import sizeStyles from '../../styles/component/size.styles.js';
import { LocalizeController } from '../../utilities/localize.js';
import type WaButton from '../button/button.js';
import '../dropdown-item/dropdown-item.js';
import type WaDropdownItem from '../dropdown-item/dropdown-item.js';
import WaPopup from '../popup/popup.js'; // Added import for wa-popup
import styles from './dropdown.css';
import styles from './dropdown.styles.js';
const openDropdowns = new Set<WaDropdown>();
@@ -109,6 +109,18 @@ export default class WaDropdown extends WebAwesomeElement {
async updated(changedProperties: PropertyValues) {
if (changedProperties.has('open')) {
const previousOpen = changedProperties.get('open');
// check if the previous value is the same
// (if they are, do not trigger menu showing / hiding)
if (previousOpen === this.open) {
return;
}
// check if we are changing from undefined to false
// (if we are, we can skip menu hiding)
if (previousOpen === undefined && this.open === false) {
return;
}
this.customStates.set('open', this.open);
if (this.open) {
@@ -227,6 +239,12 @@ export default class WaDropdown extends WebAwesomeElement {
return;
}
// if this dropdown is already open, do nothing
// (this can happen when wa-hide was cancelled)
if (this.popup.active) {
return;
}
openDropdowns.forEach(dropdown => (dropdown.open = false));
this.popup.active = true; // Use wa-popup's active property instead of showPopover

View File

@@ -1,41 +0,0 @@
:host {
--primary-color: currentColor;
--primary-opacity: 1;
--secondary-color: currentColor;
--secondary-opacity: 0.4;
box-sizing: content-box;
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: -0.125em;
}
/* Standard */
:host(:not([auto-width])) {
width: 1.25em;
height: 1em;
}
/* Auto-width */
:host([auto-width]) {
width: auto;
height: 1em;
}
svg {
height: 1em;
fill: currentColor;
overflow: visible;
/* Duotone colors with path-specific opacity fallback */
path[data-duotone-primary] {
color: var(--primary-color);
opacity: var(--path-opacity, var(--primary-opacity));
}
path[data-duotone-secondary] {
color: var(--secondary-color);
opacity: var(--path-opacity, var(--secondary-opacity));
}
}

View File

@@ -0,0 +1,44 @@
import { css } from 'lit';
export default css`
:host {
--primary-color: currentColor;
--primary-opacity: 1;
--secondary-color: currentColor;
--secondary-opacity: 0.4;
box-sizing: content-box;
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: -0.125em;
}
/* Standard */
:host(:not([auto-width])) {
width: 1.25em;
height: 1em;
}
/* Auto-width */
:host([auto-width]) {
width: auto;
height: 1em;
}
svg {
height: 1em;
overflow: visible;
/* Duotone colors with path-specific opacity fallback */
path[data-duotone-primary] {
color: var(--primary-color);
opacity: var(--path-opacity, var(--primary-opacity));
}
path[data-duotone-secondary] {
color: var(--secondary-color);
opacity: var(--path-opacity, var(--secondary-opacity));
}
}
`;

View File

@@ -5,7 +5,7 @@ import { WaErrorEvent } from '../../events/error.js';
import { WaLoadEvent } from '../../events/load.js';
import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './icon.css';
import styles from './icon.styles.js';
import { getDefaultIconFamily, getIconLibrary, unwatchIcon, watchIcon, type IconLibrary } from './library.js';
import type { HTMLTemplateResult, PropertyValues } from 'lit';
@@ -249,7 +249,7 @@ export default class WaIcon extends WebAwesomeElement {
return this.svg;
}
return html`<svg part="svg" fill="currentColor" width="16" height="16"></svg>`;
return html`<svg part="svg" width="16" height="16"></svg>`;
}
}

View File

@@ -1,3 +0,0 @@
:host {
display: block;
}

View File

@@ -0,0 +1,7 @@
import { css } from 'lit';
export default css`
:host {
display: block;
}
`;

View File

@@ -4,7 +4,7 @@ import { WaIncludeErrorEvent } from '../../events/include-error.js';
import { WaLoadEvent } from '../../events/load.js';
import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './include.css';
import styles from './include.styles.js';
import { requestInclude } from './request.js';
/**

View File

@@ -1,227 +0,0 @@
:host {
border-width: 0;
}
.text-field {
flex: auto;
display: flex;
align-items: stretch;
justify-content: start;
position: relative;
transition: inherit;
height: var(--wa-form-control-height);
border-color: var(--wa-form-control-border-color);
border-radius: var(--wa-form-control-border-radius);
border-style: var(--wa-form-control-border-style);
border-width: var(--wa-form-control-border-width);
cursor: text;
color: var(--wa-form-control-value-color);
font-size: var(--wa-form-control-value-font-size);
font-family: inherit;
font-weight: var(--wa-form-control-value-font-weight);
line-height: var(--wa-form-control-value-line-height);
vertical-align: middle;
width: 100%;
transition:
background-color var(--wa-transition-normal),
border var(--wa-transition-normal),
outline var(--wa-transition-fast);
transition-timing-function: var(--wa-transition-easing);
background-color: var(--wa-form-control-background-color);
box-shadow: var(--box-shadow);
padding: 0 var(--wa-form-control-padding-inline);
&:focus-within {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
/* Style disabled inputs */
&:has(:disabled) {
cursor: not-allowed;
opacity: 0.5;
}
}
/* Appearance modifiers */
:host([appearance='outlined']) .text-field {
background-color: var(--wa-form-control-background-color);
border-color: var(--wa-form-control-border-color);
}
:host([appearance='filled']) .text-field {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: var(--wa-color-neutral-fill-quiet);
}
:host([appearance='filled-outlined']) .text-field {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: var(--wa-form-control-border-color);
}
:host([pill]) .text-field {
border-radius: var(--wa-border-radius-pill) !important;
}
.text-field {
/* Show autofill styles over the entire text field, not just the native <input> */
&:has(:autofill),
&:has(:-webkit-autofill) {
background-color: var(--wa-color-brand-fill-quiet) !important;
}
input,
textarea {
/*
Fixes an alignment issue with placeholders.
https://github.com/shoelace-style/webawesome/issues/342
*/
height: 100%;
padding: 0;
border: none;
outline: none;
box-shadow: none;
margin: 0;
cursor: inherit;
-webkit-appearance: none;
font: inherit;
/* Turn off Safari's autofill styles */
&:-webkit-autofill,
&:-webkit-autofill:hover,
&:-webkit-autofill:focus,
&:-webkit-autofill:active {
-webkit-background-clip: text;
background-color: transparent;
-webkit-text-fill-color: inherit;
}
}
}
input {
flex: 1 1 auto;
min-width: 0;
height: 100%;
transition: inherit;
/* prettier-ignore */
background-color: rgb(118 118 118 / 0); /* ensures proper placeholder styles in webkit's date input */
height: calc(var(--wa-form-control-height) - var(--border-width) * 2);
padding-block: 0;
color: inherit;
&:autofill {
&,
&:hover,
&:focus,
&:active {
box-shadow: none;
caret-color: var(--wa-form-control-value-color);
}
}
&::placeholder {
color: var(--wa-form-control-placeholder-color);
user-select: none;
-webkit-user-select: none;
}
&::-webkit-search-decoration,
&::-webkit-search-cancel-button,
&::-webkit-search-results-button,
&::-webkit-search-results-decoration {
-webkit-appearance: none;
}
&:focus {
outline: none;
}
}
textarea {
&:autofill {
&,
&:hover,
&:focus,
&:active {
box-shadow: none;
caret-color: var(--wa-form-control-value-color);
}
}
&::placeholder {
color: var(--wa-form-control-placeholder-color);
user-select: none;
-webkit-user-select: none;
}
}
.start,
.end {
display: inline-flex;
flex: 0 0 auto;
align-items: center;
cursor: default;
&::slotted(wa-icon) {
color: var(--wa-color-neutral-on-quiet);
}
}
.start::slotted(*) {
margin-inline-end: var(--wa-form-control-padding-inline);
}
.end::slotted(*) {
margin-inline-start: var(--wa-form-control-padding-inline);
}
/*
* Clearable + Password Toggle
*/
.clear,
.password-toggle {
display: inline-flex;
align-items: center;
justify-content: center;
font-size: inherit;
color: var(--wa-color-neutral-on-quiet);
border: none;
background: none;
padding: 0;
transition: var(--wa-transition-normal) color;
cursor: pointer;
margin-inline-start: var(--wa-form-control-padding-inline);
@media (hover: hover) {
&:hover {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover));
}
}
&:active {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-active));
}
&:focus {
outline: none;
}
}
/* Don't show the browser's password toggle in Edge */
::-ms-reveal {
display: none;
}
/* Hide the built-in number spinner */
:host([without-spin-buttons]) input[type='number'] {
-moz-appearance: textfield;
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;
}
}

View File

@@ -0,0 +1,231 @@
import { css } from 'lit';
export default css`
:host {
border-width: 0;
}
.text-field {
flex: auto;
display: flex;
align-items: stretch;
justify-content: start;
position: relative;
transition: inherit;
height: var(--wa-form-control-height);
border-color: var(--wa-form-control-border-color);
border-radius: var(--wa-form-control-border-radius);
border-style: var(--wa-form-control-border-style);
border-width: var(--wa-form-control-border-width);
cursor: text;
color: var(--wa-form-control-value-color);
font-size: var(--wa-form-control-value-font-size);
font-family: inherit;
font-weight: var(--wa-form-control-value-font-weight);
line-height: var(--wa-form-control-value-line-height);
vertical-align: middle;
width: 100%;
transition:
background-color var(--wa-transition-normal),
border var(--wa-transition-normal),
outline var(--wa-transition-fast);
transition-timing-function: var(--wa-transition-easing);
background-color: var(--wa-form-control-background-color);
box-shadow: var(--box-shadow);
padding: 0 var(--wa-form-control-padding-inline);
&:focus-within {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
/* Style disabled inputs */
&:has(:disabled) {
cursor: not-allowed;
opacity: 0.5;
}
}
/* Appearance modifiers */
:host([appearance='outlined']) .text-field {
background-color: var(--wa-form-control-background-color);
border-color: var(--wa-form-control-border-color);
}
:host([appearance='filled']) .text-field {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: var(--wa-color-neutral-fill-quiet);
}
:host([appearance='filled-outlined']) .text-field {
background-color: var(--wa-color-neutral-fill-quiet);
border-color: var(--wa-form-control-border-color);
}
:host([pill]) .text-field {
border-radius: var(--wa-border-radius-pill) !important;
}
.text-field {
/* Show autofill styles over the entire text field, not just the native <input> */
&:has(:autofill),
&:has(:-webkit-autofill) {
background-color: var(--wa-color-brand-fill-quiet) !important;
}
input,
textarea {
/*
Fixes an alignment issue with placeholders.
https://github.com/shoelace-style/webawesome/issues/342
*/
height: 100%;
padding: 0;
border: none;
outline: none;
box-shadow: none;
margin: 0;
cursor: inherit;
-webkit-appearance: none;
font: inherit;
/* Turn off Safari's autofill styles */
&:-webkit-autofill,
&:-webkit-autofill:hover,
&:-webkit-autofill:focus,
&:-webkit-autofill:active {
-webkit-background-clip: text;
background-color: transparent;
-webkit-text-fill-color: inherit;
}
}
}
input {
flex: 1 1 auto;
min-width: 0;
height: 100%;
transition: inherit;
/* prettier-ignore */
background-color: rgb(118 118 118 / 0); /* ensures proper placeholder styles in webkit's date input */
height: calc(var(--wa-form-control-height) - var(--border-width) * 2);
padding-block: 0;
color: inherit;
&:autofill {
&,
&:hover,
&:focus,
&:active {
box-shadow: none;
caret-color: var(--wa-form-control-value-color);
}
}
&::placeholder {
color: var(--wa-form-control-placeholder-color);
user-select: none;
-webkit-user-select: none;
}
&::-webkit-search-decoration,
&::-webkit-search-cancel-button,
&::-webkit-search-results-button,
&::-webkit-search-results-decoration {
-webkit-appearance: none;
}
&:focus {
outline: none;
}
}
textarea {
&:autofill {
&,
&:hover,
&:focus,
&:active {
box-shadow: none;
caret-color: var(--wa-form-control-value-color);
}
}
&::placeholder {
color: var(--wa-form-control-placeholder-color);
user-select: none;
-webkit-user-select: none;
}
}
.start,
.end {
display: inline-flex;
flex: 0 0 auto;
align-items: center;
cursor: default;
&::slotted(wa-icon) {
color: var(--wa-color-neutral-on-quiet);
}
}
.start::slotted(*) {
margin-inline-end: var(--wa-form-control-padding-inline);
}
.end::slotted(*) {
margin-inline-start: var(--wa-form-control-padding-inline);
}
/*
* Clearable + Password Toggle
*/
.clear,
.password-toggle {
display: inline-flex;
align-items: center;
justify-content: center;
font-size: inherit;
color: var(--wa-color-neutral-on-quiet);
border: none;
background: none;
padding: 0;
transition: var(--wa-transition-normal) color;
cursor: pointer;
margin-inline-start: var(--wa-form-control-padding-inline);
@media (hover: hover) {
&:hover {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover));
}
}
&:active {
color: color-mix(in oklab, currentColor, var(--wa-color-mix-active));
}
&:focus {
outline: none;
}
}
/* Don't show the browser's password toggle in Edge */
::-ms-reveal {
display: none;
}
/* Hide the built-in number spinner */
:host([without-spin-buttons]) input[type='number'] {
-moz-appearance: textfield;
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;
}
}
`;

View File

@@ -9,11 +9,11 @@ import { submitOnEnter } from '../../internal/submit-on-enter.js';
import { MirrorValidator } from '../../internal/validators/mirror-validator.js';
import { watch } from '../../internal/watch.js';
import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-form-associated-element.js';
import formControlStyles from '../../styles/component/form-control.css';
import sizeStyles from '../../styles/utilities/size.css';
import formControlStyles from '../../styles/component/form-control.styles.js';
import sizeStyles from '../../styles/component/size.styles.js';
import { LocalizeController } from '../../utilities/localize.js';
import '../icon/icon.js';
import styles from './input.css';
import styles from './input.styles.js';
/**
* @summary Inputs collect data from the user.
@@ -140,13 +140,6 @@ export default class WaInput extends WebAwesomeFormAssociatedElement {
/** Hides the browser's built-in increment/decrement spin buttons for number inputs. */
@property({ attribute: 'without-spin-buttons', type: Boolean }) withoutSpinButtons = false;
/**
* By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
* to place the form control outside of a form and associate it with the form that has this `id`. The form must be in
* the same document or shadow root for this to work.
*/
@property({ reflect: true }) form = null;
/** Makes the input a required field. */
@property({ type: Boolean, reflect: true }) required = false;

View File

@@ -1,3 +0,0 @@
:host {
display: contents;
}

View File

@@ -0,0 +1,7 @@
import { css } from 'lit';
export default css`
:host {
display: contents;
}
`;

View File

@@ -5,7 +5,7 @@ import { clamp } from '../../internal/math.js';
import { parseSpaceDelimitedTokens } from '../../internal/parse.js';
import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './intersection-observer.css';
import styles from './intersection-observer.styles.js';
/**
* @summary Tracks immediate child elements and fires events as they move in and out of view.

View File

@@ -1,3 +0,0 @@
:host {
display: contents;
}

View File

@@ -0,0 +1,7 @@
import { css } from 'lit';
export default css`
:host {
display: contents;
}
`;

View File

@@ -3,7 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
import { WaMutationEvent } from '../../events/mutation.js';
import { watch } from '../../internal/watch.js';
import WebAwesomeElement from '../../internal/webawesome-element.js';
import styles from './mutation-observer.css';
import styles from './mutation-observer.styles.js';
/**
* @summary The Mutation Observer component offers a thin, declarative interface to the [`MutationObserver API`](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver).

View File

@@ -1,80 +0,0 @@
:host {
display: block;
color: var(--wa-color-text-normal);
-webkit-user-select: none;
user-select: none;
position: relative;
display: flex;
align-items: center;
font: inherit;
padding: 0.5em 1em 0.5em 0.25em;
line-height: var(--wa-line-height-condensed);
transition: fill var(--wa-transition-normal) var(--wa-transition-easing);
cursor: pointer;
}
:host(:focus) {
outline: none;
}
@media (hover: hover) {
:host(:not([disabled], :state(current)):is(:state(hover), :hover)) {
background-color: var(--wa-color-neutral-fill-normal);
color: var(--wa-color-neutral-on-normal);
}
}
:host(:state(current)),
:host([disabled]:state(current)) {
background-color: var(--wa-color-brand-fill-loud);
color: var(--wa-color-brand-on-loud);
opacity: 1;
}
:host([disabled]) {
outline: none;
opacity: 0.5;
cursor: not-allowed;
}
.label {
flex: 1 1 auto;
display: inline-block;
}
.check {
flex: 0 0 auto;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--wa-font-size-smaller);
visibility: hidden;
width: 2em;
}
:host(:state(selected)) .check {
visibility: visible;
}
.start,
.end {
flex: 0 0 auto;
display: flex;
align-items: center;
}
.start::slotted(*) {
margin-inline-end: 0.5em;
}
.end::slotted(*) {
margin-inline-start: 0.5em;
}
@media (forced-colors: active) {
:host(:hover:not([aria-disabled='true'])) {
outline: dashed 1px SelectedItem;
outline-offset: -1px;
}
}

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