@webtides/element-library 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/LICENSE +21 -0
- package/README.md +125 -0
- package/all.js +26 -0
- package/custom-elements.json +7683 -0
- package/index.js +3 -0
- package/package.json +132 -0
- package/patches/@glidejs+glide+3.6.2.patch +11 -0
- package/src/components/accordion/accordion.changelog.md +47 -0
- package/src/components/accordion/accordion.define.js +3 -0
- package/src/components/accordion/accordion.events.js +3 -0
- package/src/components/accordion/accordion.js +144 -0
- package/src/components/accordion/accordion.readme.md +71 -0
- package/src/components/accordion/accordion.style.js +64 -0
- package/src/components/accordion-group/accordion-group.changelog.md +35 -0
- package/src/components/accordion-group/accordion-group.define.js +3 -0
- package/src/components/accordion-group/accordion-group.js +63 -0
- package/src/components/accordion-group/accordion-group.readme.md +56 -0
- package/src/components/amount-field/amount-field.changelog.md +40 -0
- package/src/components/amount-field/amount-field.define.js +3 -0
- package/src/components/amount-field/amount-field.js +91 -0
- package/src/components/amount-field/amount-field.readme.md +65 -0
- package/src/components/amount-field/amount-field.style.js +58 -0
- package/src/components/button/button.changelog.md +19 -0
- package/src/components/button/button.define.js +3 -0
- package/src/components/button/button.js +174 -0
- package/src/components/button/button.readme.md +91 -0
- package/src/components/button/button.style.js +251 -0
- package/src/components/carousel/carousel.changelog.md +58 -0
- package/src/components/carousel/carousel.define.js +3 -0
- package/src/components/carousel/carousel.events.js +3 -0
- package/src/components/carousel/carousel.js +232 -0
- package/src/components/carousel/carousel.readme.md +78 -0
- package/src/components/carousel/carousel.style.js +142 -0
- package/src/components/carousel/glide/components/ShadowAnchors.js +12 -0
- package/src/components/carousel/glide/components/ShadowClones.js +41 -0
- package/src/components/carousel/glide/components/ShadowGaps.js +28 -0
- package/src/components/carousel/glide/components/ShadowHtml.js +32 -0
- package/src/components/checkbox-field/checkbox-field.changelog.md +47 -0
- package/src/components/checkbox-field/checkbox-field.define.js +3 -0
- package/src/components/checkbox-field/checkbox-field.js +102 -0
- package/src/components/checkbox-field/checkbox-field.readme.md +66 -0
- package/src/components/checkbox-field/checkbox-field.style.js +69 -0
- package/src/components/dialog/dialog.changelog.md +24 -0
- package/src/components/dialog/dialog.define.js +3 -0
- package/src/components/dialog/dialog.events.js +8 -0
- package/src/components/dialog/dialog.js +271 -0
- package/src/components/dialog/dialog.readme.md +122 -0
- package/src/components/dialog/dialog.style.js +124 -0
- package/src/components/dropdown/dropdown.changelog.md +39 -0
- package/src/components/dropdown/dropdown.define.js +3 -0
- package/src/components/dropdown/dropdown.js +98 -0
- package/src/components/dropdown/dropdown.readme.md +69 -0
- package/src/components/dropdown/dropdown.style.js +17 -0
- package/src/components/form-field/form-field.changelog.md +35 -0
- package/src/components/form-field/form-field.define.js +3 -0
- package/src/components/form-field/form-field.events.js +4 -0
- package/src/components/form-field/form-field.js +210 -0
- package/src/components/form-field/form-field.readme.md +80 -0
- package/src/components/form-field/form-field.style.js +25 -0
- package/src/components/input-field/input-field.changelog.md +39 -0
- package/src/components/input-field/input-field.define.js +3 -0
- package/src/components/input-field/input-field.js +71 -0
- package/src/components/input-field/input-field.readme.md +90 -0
- package/src/components/input-field/input-field.style.js +33 -0
- package/src/components/lazy-src/lazy-src.changelog.md +57 -0
- package/src/components/lazy-src/lazy-src.define.js +3 -0
- package/src/components/lazy-src/lazy-src.events.js +5 -0
- package/src/components/lazy-src/lazy-src.js +100 -0
- package/src/components/lazy-src/lazy-src.readme.md +63 -0
- package/src/components/notification/notification.changelog.md +22 -0
- package/src/components/notification/notification.define.js +3 -0
- package/src/components/notification/notification.events.js +6 -0
- package/src/components/notification/notification.js +280 -0
- package/src/components/notification/notification.readme.md +98 -0
- package/src/components/notification/notification.style.js +113 -0
- package/src/components/password-field/password-field.changelog.md +22 -0
- package/src/components/password-field/password-field.define.js +3 -0
- package/src/components/password-field/password-field.js +113 -0
- package/src/components/password-field/password-field.readme.md +60 -0
- package/src/components/password-field/password-field.style.js +62 -0
- package/src/components/radio-field/radio-field.changelog.md +21 -0
- package/src/components/radio-field/radio-field.define.js +3 -0
- package/src/components/radio-field/radio-field.js +140 -0
- package/src/components/radio-field/radio-field.readme.md +72 -0
- package/src/components/radio-field/radio-field.style.js +108 -0
- package/src/components/scroll-to/scroll-to.changelog.md +39 -0
- package/src/components/scroll-to/scroll-to.define.js +3 -0
- package/src/components/scroll-to/scroll-to.js +40 -0
- package/src/components/scroll-to/scroll-to.readme.md +50 -0
- package/src/components/scroll-to-top/scroll-to-top.changelog.md +39 -0
- package/src/components/scroll-to-top/scroll-to-top.define.js +3 -0
- package/src/components/scroll-to-top/scroll-to-top.js +78 -0
- package/src/components/scroll-to-top/scroll-to-top.readme.md +48 -0
- package/src/components/scroll-to-top/scroll-to-top.style.js +9 -0
- package/src/components/select-field/select-field.changelog.md +30 -0
- package/src/components/select-field/select-field.define.js +3 -0
- package/src/components/select-field/select-field.js +83 -0
- package/src/components/select-field/select-field.readme.md +131 -0
- package/src/components/select-field/select-field.style.js +24 -0
- package/src/components/slider/slider.changelog.md +177 -0
- package/src/components/slider/slider.define.js +3 -0
- package/src/components/slider/slider.events.js +4 -0
- package/src/components/slider/slider.js +338 -0
- package/src/components/slider/slider.readme.md +87 -0
- package/src/components/slider/slider.style.js +107 -0
- package/src/components/sticky/sticky.changelog.md +43 -0
- package/src/components/sticky/sticky.define.js +3 -0
- package/src/components/sticky/sticky.js +105 -0
- package/src/components/sticky/sticky.readme.md +63 -0
- package/src/components/sticky/sticky.style.js +21 -0
- package/src/components/svg-use/svg-use.changelog.md +41 -0
- package/src/components/svg-use/svg-use.define.js +3 -0
- package/src/components/svg-use/svg-use.js +39 -0
- package/src/components/svg-use/svg-use.readme.md +50 -0
- package/src/components/svg-use/svg-use.style.js +20 -0
- package/src/components/switch-field/switch-field.changelog.md +21 -0
- package/src/components/switch-field/switch-field.define.js +3 -0
- package/src/components/switch-field/switch-field.js +99 -0
- package/src/components/switch-field/switch-field.readme.md +58 -0
- package/src/components/switch-field/switch-field.style.js +98 -0
- package/src/components/tab-group/tab-group.changelog.md +35 -0
- package/src/components/tab-group/tab-group.define.js +3 -0
- package/src/components/tab-group/tab-group.js +109 -0
- package/src/components/tab-group/tab-group.readme.md +61 -0
- package/src/components/tab-group/tab-group.style.js +7 -0
- package/src/components/tab-link/tab-link.changelog.md +35 -0
- package/src/components/tab-link/tab-link.define.js +3 -0
- package/src/components/tab-link/tab-link.js +50 -0
- package/src/components/tab-link/tab-link.readme.md +66 -0
- package/src/components/tab-link/tab-link.style.js +32 -0
- package/src/components/tab-panel/tab-panel.changelog.md +39 -0
- package/src/components/tab-panel/tab-panel.define.js +3 -0
- package/src/components/tab-panel/tab-panel.js +30 -0
- package/src/components/tab-panel/tab-panel.readme.md +57 -0
- package/src/components/tab-panel/tab-panel.style.js +7 -0
- package/src/components/textarea-field/textarea-field.changelog.md +39 -0
- package/src/components/textarea-field/textarea-field.define.js +3 -0
- package/src/components/textarea-field/textarea-field.js +62 -0
- package/src/components/textarea-field/textarea-field.readme.md +102 -0
- package/src/components/textarea-field/textarea-field.style.js +7 -0
- package/src/components/transition-classes/transition-classes.changelog.md +39 -0
- package/src/components/transition-classes/transition-classes.define.js +3 -0
- package/src/components/transition-classes/transition-classes.js +154 -0
- package/src/components/transition-classes/transition-classes.readme.md +71 -0
- package/src/themes/default.css +165 -0
- package/src/themes/high-contrast.css +147 -0
- package/src/themes/sketchy.css +238 -0
- package/types/all.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/src/components/accordion/accordion.d.ts +60 -0
- package/types/src/components/accordion/accordion.define.d.ts +1 -0
- package/types/src/components/accordion/accordion.events.d.ts +4 -0
- package/types/src/components/accordion/accordion.style.d.ts +2 -0
- package/types/src/components/accordion-group/accordion-group.d.ts +28 -0
- package/types/src/components/accordion-group/accordion-group.define.d.ts +1 -0
- package/types/src/components/amount-field/amount-field.d.ts +53 -0
- package/types/src/components/amount-field/amount-field.define.d.ts +1 -0
- package/types/src/components/amount-field/amount-field.style.d.ts +2 -0
- package/types/src/components/button/button.d.ts +73 -0
- package/types/src/components/button/button.define.d.ts +1 -0
- package/types/src/components/button/button.style.d.ts +2 -0
- package/types/src/components/carousel/carousel.d.ts +79 -0
- package/types/src/components/carousel/carousel.define.d.ts +1 -0
- package/types/src/components/carousel/carousel.events.d.ts +4 -0
- package/types/src/components/carousel/carousel.style.d.ts +2 -0
- package/types/src/components/carousel/glide/components/ShadowAnchors.d.ts +1 -0
- package/types/src/components/carousel/glide/components/ShadowClones.d.ts +1 -0
- package/types/src/components/carousel/glide/components/ShadowGaps.d.ts +1 -0
- package/types/src/components/carousel/glide/components/ShadowHtml.d.ts +1 -0
- package/types/src/components/checkbox-field/checkbox-field.d.ts +69 -0
- package/types/src/components/checkbox-field/checkbox-field.define.d.ts +1 -0
- package/types/src/components/checkbox-field/checkbox-field.style.d.ts +2 -0
- package/types/src/components/dialog/dialog.d.ts +103 -0
- package/types/src/components/dialog/dialog.define.d.ts +1 -0
- package/types/src/components/dialog/dialog.events.d.ts +9 -0
- package/types/src/components/dialog/dialog.style.d.ts +2 -0
- package/types/src/components/dropdown/dropdown.d.ts +45 -0
- package/types/src/components/dropdown/dropdown.define.d.ts +1 -0
- package/types/src/components/dropdown/dropdown.style.d.ts +2 -0
- package/types/src/components/form-field/form-field.d.ts +110 -0
- package/types/src/components/form-field/form-field.define.d.ts +1 -0
- package/types/src/components/form-field/form-field.events.d.ts +5 -0
- package/types/src/components/form-field/form-field.style.d.ts +2 -0
- package/types/src/components/input-field/input-field.d.ts +38 -0
- package/types/src/components/input-field/input-field.define.d.ts +1 -0
- package/types/src/components/input-field/input-field.style.d.ts +2 -0
- package/types/src/components/lazy-src/lazy-src.d.ts +46 -0
- package/types/src/components/lazy-src/lazy-src.define.d.ts +1 -0
- package/types/src/components/lazy-src/lazy-src.events.d.ts +6 -0
- package/types/src/components/notification/notification.d.ts +92 -0
- package/types/src/components/notification/notification.define.d.ts +1 -0
- package/types/src/components/notification/notification.events.d.ts +7 -0
- package/types/src/components/notification/notification.style.d.ts +2 -0
- package/types/src/components/password-field/password-field.d.ts +66 -0
- package/types/src/components/password-field/password-field.define.d.ts +1 -0
- package/types/src/components/password-field/password-field.style.d.ts +2 -0
- package/types/src/components/radio-field/radio-field.d.ts +62 -0
- package/types/src/components/radio-field/radio-field.define.d.ts +1 -0
- package/types/src/components/radio-field/radio-field.style.d.ts +2 -0
- package/types/src/components/scroll-to/scroll-to.d.ts +24 -0
- package/types/src/components/scroll-to/scroll-to.define.d.ts +1 -0
- package/types/src/components/scroll-to-top/scroll-to-top.d.ts +32 -0
- package/types/src/components/scroll-to-top/scroll-to-top.define.d.ts +1 -0
- package/types/src/components/scroll-to-top/scroll-to-top.style.d.ts +2 -0
- package/types/src/components/select-field/select-field.d.ts +39 -0
- package/types/src/components/select-field/select-field.define.d.ts +1 -0
- package/types/src/components/select-field/select-field.style.d.ts +2 -0
- package/types/src/components/slider/slider.d.ts +129 -0
- package/types/src/components/slider/slider.define.d.ts +1 -0
- package/types/src/components/slider/slider.events.d.ts +5 -0
- package/types/src/components/slider/slider.style.d.ts +2 -0
- package/types/src/components/sticky/sticky.d.ts +47 -0
- package/types/src/components/sticky/sticky.define.d.ts +1 -0
- package/types/src/components/sticky/sticky.style.d.ts +2 -0
- package/types/src/components/svg-use/svg-use.d.ts +18 -0
- package/types/src/components/svg-use/svg-use.define.d.ts +1 -0
- package/types/src/components/svg-use/svg-use.style.d.ts +2 -0
- package/types/src/components/switch-field/switch-field.d.ts +67 -0
- package/types/src/components/switch-field/switch-field.define.d.ts +1 -0
- package/types/src/components/switch-field/switch-field.style.d.ts +2 -0
- package/types/src/components/tab-group/tab-group.d.ts +48 -0
- package/types/src/components/tab-group/tab-group.define.d.ts +1 -0
- package/types/src/components/tab-group/tab-group.style.d.ts +2 -0
- package/types/src/components/tab-link/tab-link.d.ts +30 -0
- package/types/src/components/tab-link/tab-link.define.d.ts +1 -0
- package/types/src/components/tab-link/tab-link.style.d.ts +2 -0
- package/types/src/components/tab-panel/tab-panel.d.ts +18 -0
- package/types/src/components/tab-panel/tab-panel.define.d.ts +1 -0
- package/types/src/components/tab-panel/tab-panel.style.d.ts +2 -0
- package/types/src/components/textarea-field/textarea-field.d.ts +34 -0
- package/types/src/components/textarea-field/textarea-field.define.d.ts +1 -0
- package/types/src/components/textarea-field/textarea-field.style.d.ts +2 -0
- package/types/src/components/transition-classes/transition-classes.d.ts +52 -0
- package/types/src/components/transition-classes/transition-classes.define.d.ts +1 -0
- package/types/src/utils/body-scroll.d.ts +4 -0
- package/types/src/utils/transitions.d.ts +9 -0
- package/web-types.json +3956 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to `@webtides/element-library` will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/). Per-component changelogs live next to each component (`src/components/<name>/<name>.changelog.md`); this file is the aggregated, package-level view.
|
|
6
|
+
|
|
7
|
+
<!--
|
|
8
|
+
PRs should add an entry to the Unreleased section below, grouped by component.
|
|
9
|
+
Mirror the same entry in the component's own changelog. Uncomment subsection
|
|
10
|
+
headings as needed.
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
## Unreleased
|
|
14
|
+
|
|
15
|
+
## [0.1.0] - 2026-06-03
|
|
16
|
+
|
|
17
|
+
### Components
|
|
18
|
+
|
|
19
|
+
- Added: new `el-button` component — a themeable button modelled on Shoelace's `<sl-button>` (variants, sizes, outline/pill/circle, caret, loading, prefix/suffix slots, link mode).
|
|
20
|
+
- Added: new `el-dialog` component — a modal dialog built on the native `<dialog>` element (platform-provided focus trap, background `inert`, focus restore and `<form method="dialog">` auto-close), with an animated, cancelable open/close lifecycle and ref-counted body-scroll locking that compensates for the removed scrollbar width (no layout shift on open). API modelled on Shoelace's `<sl-dialog>`.
|
|
21
|
+
- Added: new `el-notification` component — an alert/notification that can be shown inline or as a transient toast (`toast()` floats it into a shared top-right stack). Semantic variants, optional close button, optional auto-dismiss that pauses on hover/focus, and an ARIA live-region host (`role="alert"` for danger/warning, `role="status"` otherwise). API modelled on Shoelace's `<sl-alert>`.
|
|
22
|
+
- Added: new `el-radio-field` component — a single-choice radio group extending `FormField`, rendering a native `<fieldset>`/`<legend>` of mutually-exclusive radios from an `options` array (strings or `{ value, label?, disabled? }`) with a custom, headless-by-default indicator. Inherits the `input-change` event and `touched`/`valid`/`invalid` states.
|
|
23
|
+
- Added: new `el-switch-field` component — an on/off toggle extending `FormField`, rendering a native `<input type="checkbox">` with `role="switch"` behind a custom, headless-by-default track/thumb. Reflects `checked`, adds a `checked` custom state, and inherits the `input-change` event and `touched`/`valid`/`invalid` states.
|
|
24
|
+
- Added: new `el-password-field` component — a masked password input extending `InputField`, pinning the input `type` to `password` (flipping to `text` while revealed) and adding an optional show/hide reveal button (`password-toggle`, default on). Inherits the `input-change` event and `touched`/`valid`/`invalid` states. All three shipped themes decorate its native input identically to `el-input-field`, so themed password and text fields match.
|
|
25
|
+
- Changed (BREAKING): dropped the `-element` suffix from five components. The tags `el-accordion-element / el-carousel-element / el-dropdown-element / el-slider-element / el-sticky-element` are now `el-accordion / el-carousel / el-dropdown / el-slider / el-sticky`; their import subpaths (`@webtides/element-library/<name>` and `/<name>/define`) and exported classes (`AccordionElement → Accordion`, `CarouselElement → Carousel`, `DropdownElement → Dropdown`, `SliderElement → Slider`, `StickyElement → Sticky`) change to match. `accordion-group` is unchanged.
|
|
26
|
+
|
|
27
|
+
### Theming
|
|
28
|
+
|
|
29
|
+
- Added: dialog tokens (`--el-dialog-width`, `--el-dialog-overlay-background`) wired into all three shipped themes (default / high-contrast / sketchy), so themed `el-dialog`s get a visible, per-theme overlay scrim. Unthemed dialogs keep a `transparent` backdrop (headless). Documented in the Storybook _Docs / Theming_ token reference.
|
|
30
|
+
- Added: opt-in default theme stylesheet at `@webtides/element-library/themes/default.css`. Defines the `--el-*` token vocabulary at `:root` with `light-dark()` color values; without it imported, components stay headless.
|
|
31
|
+
- Added: opt-in high-contrast theme stylesheet at `@webtides/element-library/themes/high-contrast.css`. Same token contract, accessibility-leaning identity: near-black/white surfaces, 2px borders, 3px focus rings, no shadows, larger touch targets. Supports both color schemes via `light-dark()`.
|
|
32
|
+
- Added: Storybook toolbar gains a "Theme" switch (None / Default / High contrast) and a "Color scheme" switch (System / Light / Dark) for previewing themed and unthemed states.
|
|
33
|
+
- Added: Theming docs page in Storybook (`Docs / Theming`) covering the headless philosophy, themes vs color schemes, the full `--el-*` token reference, and a recipe for writing custom themes. README gains a short Theming section pointing at it.
|
|
34
|
+
- Added: both shipped themes respect `prefers-reduced-motion: reduce` (collapses `--el-duration-md` to `0s`). Default theme also responds to `prefers-contrast: more` (bumps fg/border to pure black/white, raises border-width to 2px and focus-ring-width to 3px). High-contrast theme is already at its contrast ceiling.
|
|
35
|
+
- Added: both shipped themes suppress the native `<select>` chevron and position `el-select-field`'s `.dropdown-indicator` over the right edge, so themed selects show a single, theme-colored glyph instead of duplicating the native one. Unthemed selects still render the native chevron with the custom indicator hidden — no double chevron either way.
|
|
36
|
+
- Added: Storybook preview decorator mirrors the active theme's `--el-color-bg` / `--el-color-fg` onto the iframe `<body>`, so flipping Theme or Color scheme also flips the page background. Stays inside Storybook; doesn't leak into consumer themes.
|
|
37
|
+
- Changed: `el-dropdown` panel now reads `--el-shadow-lg` and `--el-radius-lg` (previously `-md`). Floating surfaces conventionally use more pronounced elevation. Themes that already set both tokens get the upgrade automatically.
|
|
38
|
+
- Changed: expanded token-driven surfaces across components so the theme toggle is actually visible — dropdown panel, accordion title/content padding + divider, checkbox indicator + accent, tab-link active accent + hover, tab-group bottom border, form-field label margin/color, amount-field wrapper border + button/input padding. All fallbacks are null-ish (`0` widths, `transparent` colors, `none` shadows) so unthemed components remain headless.
|
|
39
|
+
- Changed: default theme decorates native form controls (`input`, `textarea`, `select`) directly via component selectors, since those live in light DOM and can't be safely overridden from component CSS without losing the native unthemed look.
|
|
40
|
+
- Changed: slider fallbacks for dot color and arrow background are now `currentColor` / `transparent` instead of `#333` / `white` — unthemed slider matches surrounding text instead of imposing a light-mode-assuming palette.
|
|
41
|
+
- Changed: both themes render native form controls (`input`, `textarea`, `select`) full-width (`width: 100%; box-sizing: border-box`), so themed forms are consistent and the select's custom chevron sits flush at the control's right edge.
|
|
42
|
+
|
|
43
|
+
### accordion
|
|
44
|
+
|
|
45
|
+
- Added: `open` custom state on the host (`:host(:state(open))`).
|
|
46
|
+
- Changed (BREAKING): renamed CSS parts `title-wrapper` → `title` and `content-wrapper` → `content`; the internal `.content-wrapper` class is now `.content`.
|
|
47
|
+
- Changed (BREAKING): replaced the `open-icon` / `close-icon` parts with a single `icon` part — one SVG chevron that rotates 180° when open — instead of two `∨` / `∧` text glyphs.
|
|
48
|
+
- Changed: internal style now uses `:host(:state(open))` instead of `:host([open='true'])`. The reflected `open` attribute is unchanged.
|
|
49
|
+
- Changed: expand/collapse transition is token-driven (`--el-duration-md`, `--el-ease`).
|
|
50
|
+
- Fixed: collapsed content no longer leaves a padding-sized sliver — the `.content` padding moved to an inner `.content-inner` wrapper so closing the accordion clips it. Only surfaced once a theme set `--el-space-3`.
|
|
51
|
+
|
|
52
|
+
### accordion-group
|
|
53
|
+
|
|
54
|
+
- Fixed: single-open mode (`show-multiple="false"`) now correctly closes the previously open accordion when one starts open declaratively. The `connected()` preselection scan had an inverted guard (it ran only in multi-open mode) and queried the whole document instead of the group's own children.
|
|
55
|
+
|
|
56
|
+
### carousel
|
|
57
|
+
|
|
58
|
+
- Fixed: `ShadowHtml` now forwards Glide's `Events` argument to the wrapped html component (like the other `Shadow*` wrappers). It previously called the factory with `(Glide, Components)` only, so `Events.on('update', …)` threw `Cannot read properties of undefined (reading 'on')` on every mount.
|
|
59
|
+
- Fixed: Glide's core + theme CSS is inlined into the component style instead of `@import`-ed. The `@import` was dropped inside the shadow-DOM adopted stylesheet, so arrows/bullets weren't positioned over the slides (they appeared as a strip below the image) and the track wasn't clipped.
|
|
60
|
+
|
|
61
|
+
### checkbox-field
|
|
62
|
+
|
|
63
|
+
- Added: `checked` custom state on the host. Inherits the `touched / valid / invalid` states from `FormField`.
|
|
64
|
+
- Fixed: the native `<input type="checkbox">` is now visually hidden (still focusable / in the a11y tree) instead of rendering a second box next to the custom indicator; the duplicated label is gone (the base `FormField` label is suppressed in favour of the inline one). `.checked-indicator` gained `currentColor` fallbacks so unthemed checkboxes stay visible, plus `:focus-visible` styling.
|
|
65
|
+
|
|
66
|
+
### dropdown
|
|
67
|
+
|
|
68
|
+
- Added: `open` custom state on the host.
|
|
69
|
+
|
|
70
|
+
### form-field
|
|
71
|
+
|
|
72
|
+
- Added: host-level `touched`, `valid` and `invalid` custom states. Inherited by all field subclasses. The inner `.field.is-*` classes still exist for internal use.
|
|
73
|
+
|
|
74
|
+
### input-field
|
|
75
|
+
|
|
76
|
+
- Changed: hardcoded values now reference design tokens (`--el-space-*`, `--el-color-success`, `--el-color-danger`, `--el-font-size-sm`) with the previous values as fallbacks.
|
|
77
|
+
- Fixed: the `pattern` attribute is now omitted when unset (via element-js's `optionalAttribute` directive) instead of falling back to a `[sS]*` regex that matched only runs of `s` / `S` and so rejected any ordinary value as invalid.
|
|
78
|
+
|
|
79
|
+
### lazy-src
|
|
80
|
+
|
|
81
|
+
- Added: `loaded` custom state on the host (alongside the existing reflected `loaded` attribute).
|
|
82
|
+
|
|
83
|
+
### select-field
|
|
84
|
+
|
|
85
|
+
- Changed (BREAKING): renamed the dropdown indicator's CSS class from `.icon` to `.dropdown-indicator`.
|
|
86
|
+
- Changed: the `.dropdown-indicator` renders an SVG chevron (`currentColor`) instead of the `∨` text glyph. Still hidden by default; themes show and position it.
|
|
87
|
+
|
|
88
|
+
### slider
|
|
89
|
+
|
|
90
|
+
- Changed: hardcoded colors and paddings now reference design tokens (`--el-color-fg`, `--el-color-bg`, `--el-space-*`). Color fallbacks use `light-dark()` so unthemed dark mode renders sensibly.
|
|
91
|
+
|
|
92
|
+
### sticky
|
|
93
|
+
|
|
94
|
+
- Changed (BREAKING): replaced the `.is-sticky / .is-up / .is-down` host classes with the custom states `:state(sticky) / :state(up) / :state(down)`.
|
|
95
|
+
- Changed: sticky transition is token-driven (`--el-duration-md`, `--el-ease`).
|
|
96
|
+
|
|
97
|
+
### tab-group
|
|
98
|
+
|
|
99
|
+
- Changed: selection is mirrored onto child `<el-tab-link>` elements via the `active` custom state instead of the `[active]` attribute.
|
|
100
|
+
|
|
101
|
+
### tab-link
|
|
102
|
+
|
|
103
|
+
- Changed (BREAKING): the active state is now exposed as `:state(active)` instead of `[active]`.
|
|
104
|
+
|
|
105
|
+
## [0.1.0] - TBD
|
|
106
|
+
|
|
107
|
+
Initial public release on npm under the consolidated single-package layout.
|
|
108
|
+
|
|
109
|
+
Pre-merge per-component release history is preserved in each component's `*.changelog.md` under the "Legacy (pre-merge)" heading.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Eddy Löwen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# element-library
|
|
2
|
+
|
|
3
|
+
> IMPORTANT: The elements are work in progress and subject to major (& breaking) changes until the 1.0 release. Until then, we would encourage everyone to use pinned versions and not rely on semantic versioning.
|
|
4
|
+
|
|
5
|
+
A set of web components built with `@webtides/element-js`
|
|
6
|
+
|
|
7
|
+
## Introduction
|
|
8
|
+
|
|
9
|
+
`@webtides/element-library` provides a set of pre-built custom elements based on `@webtides/element-js` with performance and accessibility in mind. They provide a starting point for rapidly building UIs without having to re-implement the same elements over and over again.
|
|
10
|
+
|
|
11
|
+
## Demo
|
|
12
|
+
|
|
13
|
+
See our [live Storybook](https://webtides.github.io/element-library) to preview examples of all our elements.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm i --save @webtides/element-library
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Register all components at once:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import '@webtides/element-library/all';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Register a single component (tree-shakable):
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import '@webtides/element-library/accordion/define';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Import a component class without registering it:
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
import { Accordion } from '@webtides/element-library/accordion';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Theming
|
|
42
|
+
|
|
43
|
+
Components are **headless by default** — no theme imported means no opinionated colors, borders, or shadows. To opt in to a coherent look, import one of the shipped themes:
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
import '@webtides/element-library/themes/default.css'; // neutral, system-feeling
|
|
47
|
+
import '@webtides/element-library/themes/high-contrast.css'; // WCAG-AAA-leaning
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Each theme defines the library's `--el-*` design-token contract at `:root` and uses `light-dark()`, so a single import covers both light and dark color schemes. You can override individual tokens to customize, or ship a full custom theme using the same pattern — see the [Theming guide](https://webtides.github.io/element-library/?path=/docs/docs-theming--docs) in the live Storybook for the token reference, custom states, and CSS Parts.
|
|
51
|
+
|
|
52
|
+
## Components
|
|
53
|
+
|
|
54
|
+
| Package | Description | Version |
|
|
55
|
+
| ------------------ | ----------------------------------------------------------------------------- | ------- |
|
|
56
|
+
| accordion | Single Accordion element | `0.1.0` |
|
|
57
|
+
| accordion-group | Accordion group to hold multiple elements | `0.1.0` |
|
|
58
|
+
| amount-field | A simple element to create amount stepping input fields | `0.1.1` |
|
|
59
|
+
| button | A themeable button with variants, sizes, icon slots, caret and loading | `0.1.0` |
|
|
60
|
+
| carousel | A carousel element that wraps the glide.js library for sliding elements | `0.1.1` |
|
|
61
|
+
| checkbox-field | | `0.1.1` |
|
|
62
|
+
| dialog | A modal dialog built on the native `<dialog>` element | `0.1.0` |
|
|
63
|
+
| dropdown | A dropdown element | `0.1.0` |
|
|
64
|
+
| form-field | | `0.1.0` |
|
|
65
|
+
| input-field | | `0.1.0` |
|
|
66
|
+
| lazy-src | | `0.2.0` |
|
|
67
|
+
| notification | An inline alert / toast with variants, auto-dismiss and a live region | `0.1.0` |
|
|
68
|
+
| password-field | A masked password input with an optional show/hide reveal toggle | `0.1.0` |
|
|
69
|
+
| radio-field | A single-choice radio group built on a native fieldset | `0.1.0` |
|
|
70
|
+
| scroll-to | | `0.1.0` |
|
|
71
|
+
| scroll-to-top | | `0.1.0` |
|
|
72
|
+
| select-field | | `0.1.0` |
|
|
73
|
+
| slider | CSS only slider element to slide child elements | `0.4.3` |
|
|
74
|
+
| sticky | | `0.2.0` |
|
|
75
|
+
| svg-use | | `0.1.0` |
|
|
76
|
+
| switch-field | An on/off toggle backed by a native checkbox with role="switch" | `0.1.0` |
|
|
77
|
+
| tab-group | A tab group wraps a list of tab-links and tab-panels and shows one at a time | `0.1.0` |
|
|
78
|
+
| tab-link | A link that serves as a label for one of the tab panels to display that panel | `0.1.0` |
|
|
79
|
+
| tab-panel | The element that contains the content associated with a tab | `0.1.0` |
|
|
80
|
+
| textarea-field | | `0.1.0` |
|
|
81
|
+
| transition-classes | An element that applies classes for various stages of a transition | `0.1.0` |
|
|
82
|
+
|
|
83
|
+
<!-- Please move these up once they are implemented
|
|
84
|
+
| modal-element | | TBD |
|
|
85
|
+
| bottom-sheet | | TBD |
|
|
86
|
+
| side-sheet | | TBD |
|
|
87
|
+
| breadcrumb-element | | TBD |
|
|
88
|
+
| horizontal-scroll | | TBD |
|
|
89
|
+
| load-more | show/load more | TBD |
|
|
90
|
+
| show-hide | | TBD |
|
|
91
|
+
| progress-bar | | TBD |
|
|
92
|
+
| star-rating | | TBD |
|
|
93
|
+
| navigation-drawer ?! | | TBD |
|
|
94
|
+
| hover-indicator | | TBD |
|
|
95
|
+
| pinch-zoom | | TBD |
|
|
96
|
+
| cookie-consent | | TBD |
|
|
97
|
+
| rich-text | | TBD |
|
|
98
|
+
| code-block | | TBD |
|
|
99
|
+
| spread-sheet | | TBD |
|
|
100
|
+
| line-through | | TBD |
|
|
101
|
+
| divider-element ?! | | TBD |
|
|
102
|
+
| scroll-entrance | | TBD |
|
|
103
|
+
| chip-element | Tag, Label ?! | TBD |
|
|
104
|
+
| read-time ?! | | TBD |
|
|
105
|
+
| code-tabs | | TBD |
|
|
106
|
+
| empty-state ?! | | TBD |
|
|
107
|
+
| compare-images | | TBD |
|
|
108
|
+
| text-highlight | | TBD |
|
|
109
|
+
| tooltip-element | Popover ?! | TBD |
|
|
110
|
+
| dropdown-field | | TBD |
|
|
111
|
+
| range-field | | TBD |
|
|
112
|
+
| input-group | | TBD |
|
|
113
|
+
| tag-field | multiple | TBD |
|
|
114
|
+
| autocomplete-field | | TBD |
|
|
115
|
+
| date-picker | | TBD |
|
|
116
|
+
| multi-range-field | | TBD |
|
|
117
|
+
-->
|
|
118
|
+
|
|
119
|
+
## Contributing & Development
|
|
120
|
+
|
|
121
|
+
For contributions and development see [contributing docs](.github/CONTRIBUTING.md)
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
`@webtides/element-library` is open-sourced software licensed under the MIT [license](LICENSE).
|
package/all.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import './src/components/accordion/accordion.define.js';
|
|
2
|
+
import './src/components/accordion-group/accordion-group.define.js';
|
|
3
|
+
import './src/components/amount-field/amount-field.define.js';
|
|
4
|
+
import './src/components/button/button.define.js';
|
|
5
|
+
import './src/components/carousel/carousel.define.js';
|
|
6
|
+
import './src/components/checkbox-field/checkbox-field.define.js';
|
|
7
|
+
import './src/components/dialog/dialog.define.js';
|
|
8
|
+
import './src/components/dropdown/dropdown.define.js';
|
|
9
|
+
import './src/components/form-field/form-field.define.js';
|
|
10
|
+
import './src/components/input-field/input-field.define.js';
|
|
11
|
+
import './src/components/lazy-src/lazy-src.define.js';
|
|
12
|
+
import './src/components/notification/notification.define.js';
|
|
13
|
+
import './src/components/password-field/password-field.define.js';
|
|
14
|
+
import './src/components/radio-field/radio-field.define.js';
|
|
15
|
+
import './src/components/scroll-to/scroll-to.define.js';
|
|
16
|
+
import './src/components/scroll-to-top/scroll-to-top.define.js';
|
|
17
|
+
import './src/components/select-field/select-field.define.js';
|
|
18
|
+
import './src/components/slider/slider.define.js';
|
|
19
|
+
import './src/components/sticky/sticky.define.js';
|
|
20
|
+
import './src/components/svg-use/svg-use.define.js';
|
|
21
|
+
import './src/components/switch-field/switch-field.define.js';
|
|
22
|
+
import './src/components/tab-group/tab-group.define.js';
|
|
23
|
+
import './src/components/tab-link/tab-link.define.js';
|
|
24
|
+
import './src/components/tab-panel/tab-panel.define.js';
|
|
25
|
+
import './src/components/textarea-field/textarea-field.define.js';
|
|
26
|
+
import './src/components/transition-classes/transition-classes.define.js';
|