@lmvz-ds/components 0.13.2 → 0.14.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.
Files changed (59) hide show
  1. package/dist/cjs/{aria-loader-BhgXpCuo.js → aria-loader-BBKbBZLq.js} +20 -21
  2. package/dist/cjs/{index-BVxGxK9i.js → index-QRnWYctw.js} +1 -1
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/lmvz-button.cjs.entry.js +2 -2
  5. package/dist/cjs/lmvz-components.cjs.js +1 -1
  6. package/dist/cjs/lmvz-header.cjs.entry.js +6 -3
  7. package/dist/cjs/lmvz-icon.cjs.entry.js +2 -2
  8. package/dist/cjs/lmvz-input.cjs.entry.js +2 -2
  9. package/dist/cjs/lmvz-menuitem.cjs.entry.js +2 -2
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/{reactive-controller-host-t3uLq_s2.js → reactive-controller-host-DWpVosFu.js} +1 -1
  12. package/dist/collection/components/lmvz-header/lmvz-header.css +0 -2
  13. package/dist/collection/components/lmvz-header/lmvz-header.js +3 -1
  14. package/dist/components/index.js +1 -1
  15. package/dist/components/lmvz-button.js +1 -1
  16. package/dist/components/lmvz-header.js +1 -1
  17. package/dist/components/lmvz-icon.js +1 -1
  18. package/dist/components/lmvz-input.js +1 -1
  19. package/dist/components/lmvz-menuitem.js +1 -1
  20. package/dist/components/p-DugBvwmd.js +1 -0
  21. package/dist/esm/{aria-loader-BQXogs4-.js → aria-loader-DB71Xewa.js} +20 -21
  22. package/dist/esm/{index-BRxn9h5l.js → index-CekEw3_K.js} +1 -1
  23. package/dist/esm/index.js +1 -1
  24. package/dist/esm/lmvz-button.entry.js +2 -2
  25. package/dist/esm/lmvz-components.js +1 -1
  26. package/dist/esm/lmvz-header.entry.js +6 -3
  27. package/dist/esm/lmvz-icon.entry.js +2 -2
  28. package/dist/esm/lmvz-input.entry.js +2 -2
  29. package/dist/esm/lmvz-menuitem.entry.js +2 -2
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/esm/{reactive-controller-host-puHvKP9Y.js → reactive-controller-host-1nFoJEdT.js} +1 -1
  32. package/dist/lmvz-components/index.esm.js +1 -1
  33. package/dist/lmvz-components/lmvz-components.esm.js +1 -1
  34. package/dist/lmvz-components/p-18c18de4.entry.js +1 -0
  35. package/dist/lmvz-components/{p-470f6f56.entry.js → p-5775a56c.entry.js} +1 -1
  36. package/dist/lmvz-components/{p-67af4826.entry.js → p-814ee542.entry.js} +1 -1
  37. package/dist/lmvz-components/{p-DWVncv6N.js → p-B3j8zrhV.js} +1 -1
  38. package/dist/lmvz-components/p-BTpia82J.js +1 -0
  39. package/dist/lmvz-components/{p-2df3646d.entry.js → p-c61f7daa.entry.js} +1 -1
  40. package/dist/lmvz-components/{p-0f930140.entry.js → p-c6bae21b.entry.js} +1 -1
  41. package/dist/manifest.json +5 -17
  42. package/hydrate/index.js +6 -3
  43. package/hydrate/index.mjs +6 -3
  44. package/package.json +10 -35
  45. package/readme.md +11 -73
  46. package/dist/components/p-DFXwtZsD.js +0 -1
  47. package/dist/components/p-dQa_lGo8.js +0 -1
  48. package/dist/lmvz-components/p-775b737d.entry.js +0 -1
  49. package/dist/lmvz-components/p-qPGwETYT.js +0 -1
  50. package/dist/styles/buttons.css +0 -1
  51. package/dist/styles/router-font-inline.css +0 -1
  52. package/dist/styles/router-font.css +0 -26
  53. package/dist/styles/tokens.css +0 -1
  54. package/dist/styles/typography.css +0 -1
  55. package/dist/themes/all.css +0 -1
  56. package/dist/themes/dark.css +0 -1
  57. package/dist/themes/light.css +0 -1
  58. /package/dist/components/{p-B68hOTYN.js → p-DK2hpvEW.js} +0 -0
  59. /package/dist/lmvz-components/{p-DJp2UHon.js → p-cM67HC0Z.js} +0 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@lmvz-ds/components",
3
3
  "private": false,
4
4
  "type": "module",
5
- "version": "0.13.2",
5
+ "version": "0.14.0",
6
6
  "description": "The components of the design system",
7
7
  "author": "Patrick Nemenz <patrick.nemenz@adesso.at>",
8
8
  "volta": {
@@ -48,8 +48,6 @@
48
48
  },
49
49
  "./manifest.json": "./dist/manifest.json",
50
50
  "./assets/*": "./assets/*",
51
- "./themes/*": "./dist/themes/*",
52
- "./styles/*": "./dist/styles/*",
53
51
  "./components/hydrate": {
54
52
  "types": "./hydrate/index.d.ts",
55
53
  "import": "./hydrate/index.js"
@@ -108,10 +106,9 @@
108
106
  },
109
107
  "scripts": {
110
108
  "start": "npm run start:integration",
111
- "start:integration": "concurrently 'npm run build:css -- --watch' 'npm run build:integration -- --watch'",
109
+ "start:integration": "npm run build:integration -- --watch",
112
110
  "start:dev": "stencil build --watch --dev --serve --config stencil.config.dev.ts",
113
- "build": "npm run build:css && npm run build:components",
114
- "build:css": "vite build --config vite-style.config.js",
111
+ "build": "npm run build:components",
115
112
  "build:components": "stencil build --docs --prod --config stencil.config.prod.ts",
116
113
  "build:debug": "node --inspect-brk ../../node_modules/.bin/stencil build --debug --docs --config ./stencil.config.dev.ts",
117
114
  "build:integration": "stencil build --config stencil.config.integration.ts",
@@ -133,19 +130,9 @@
133
130
  "^build"
134
131
  ]
135
132
  },
136
- "build:css": {
137
- "cache": true,
138
- "dependsOn": [
139
- "^build"
140
- ],
141
- "outputs": [
142
- "{projectRoot}/vite-generated"
143
- ]
144
- },
145
133
  "build:integration": {
146
134
  "dependsOn": [
147
- "^build",
148
- "build:css"
135
+ "^build"
149
136
  ]
150
137
  },
151
138
  "build:components": {
@@ -162,20 +149,6 @@
162
149
  "{projectRoot}/assets"
163
150
  ]
164
151
  },
165
- "postpack": {
166
- "cache": true,
167
- "dependsOn": [],
168
- "outputs": [
169
- "{projectRoot}/pom.xml",
170
- "{projectRoot}/target"
171
- ]
172
- },
173
- "version:mvn": {
174
- "dependsOn": [],
175
- "outputs": [
176
- "{projectRoot}/pom.xml"
177
- ]
178
- },
179
152
  "lint": {
180
153
  "dependsOn": [
181
154
  "^build"
@@ -184,12 +157,14 @@
184
157
  }
185
158
  },
186
159
  "dependencies": {
187
- "@lmvz-ds/aria-validation": "^0.13.2",
160
+ "@lmvz-ds/aria-validation": "^0.14.0",
188
161
  "classnames": "^2.5.1",
189
162
  "effect": "3.19.14"
190
163
  },
191
164
  "devDependencies": {
192
- "@lmvz-ds/design-tokens": "^0.13.2",
165
+ "@lmvz-ds/design-tokens": "^0.14.0",
166
+ "@lmvz-ds/lib-styles": "^0.14.0",
167
+ "@lmvz-ds/styles": "^0.14.0",
193
168
  "@stencil-community/postcss": "^2.2.0",
194
169
  "@stencil/angular-output-target": "1.3.0",
195
170
  "@stencil/core": "4.43.2",
@@ -204,11 +179,11 @@
204
179
  "rollup-plugin-postcss": "^4.0.2",
205
180
  "stylelint": "^17.0.0",
206
181
  "stylelint-config-standard": "^40.0.0",
207
- "stylelint-value-no-unknown-custom-properties": "^6.1.1",
182
+ "stylelint-value-no-unknown-custom-properties": "file:../../stylelint-value-no-unknown-custom-properties",
208
183
  "ts-deepmerge": "^7.0.3",
209
184
  "tsx": "^4.21.0",
210
185
  "vite": "^7.3.1",
211
186
  "vitest": "^4.1.0"
212
187
  },
213
- "gitHead": "8b3b58d2f00bf83f4b54a4f21a4cca4887cbcf50"
188
+ "gitHead": "271fe2c4dd8e113b1fba7350eccfc2fa48062625"
214
189
  }
package/readme.md CHANGED
@@ -15,12 +15,6 @@ It also uses **Effect** (aka. effect-ts) for improved type-safety error handling
15
15
 
16
16
  Always consider the Integration chapter in the Design Guide. In the context of a UI framework, consider using the specific wrapper packages: `@lmvz-ds/angular`, `@lmvz-ds/react`, `@lmvz-ds/vue`.
17
17
 
18
- ### Limitations
19
-
20
- Currently, the only way to get hold of the pre-built component bundle is by installing it as a dependency from our private npm or maven repos (behind adesso's VPN). Make sure to setup this registry by copying the `.npmrc` from the @lmvz-ds root project to your workspace root.
21
-
22
- Use the Maven WebJars variant when importing into a Spring Boot project without a node-built client. In this case, import paths described here have to be adjusted. Also see the Usage section in MAVEN_DEPLOYMENT.md.
23
-
24
18
  ## NPM Integration
25
19
 
26
20
  ### Installation
@@ -29,46 +23,6 @@ Use the Maven WebJars variant when importing into a Spring Boot project without
29
23
  npm i @lmvz-ds/components
30
24
  ```
31
25
 
32
- ## Maven Integration
33
-
34
- ### Local Config
35
-
36
- In your pom.xml add the following:
37
-
38
- ```xml
39
- <repositories>
40
- <repository>
41
- <id>gitlab-maven</id>
42
- <url>https://git.adesso.ch/api/v4/projects/1000/packages/maven</url>
43
- </repository>
44
- </repositories>
45
-
46
- <dependencies>
47
- <dependency>
48
- <groupId>ch.lmvz.ds</groupId>
49
- <artifactId>components</artifactId>
50
- <version>0.3.6</version>
51
- </dependency>
52
- </dependencies>
53
- ```
54
-
55
- Then run `mvn clean install`in your project folder.
56
-
57
- ### Accessing Resources
58
-
59
- Once the WebJar is on your classpath, the resources are automatically available at:
60
-
61
- ```
62
- /webjars/lmvz-ds/components/{version}/{filename}
63
- ```
64
-
65
- For example, in a Spring Boot application:
66
-
67
- ```html
68
- <link rel="stylesheet" href="/webjars/lmvz-ds/components/0.3.6/themes/light.css" />
69
- <script src="/webjars/lmvz-ds/components/0.3.6/components/lmvz-button.js"></script>
70
- ```
71
-
72
26
  ## Usage
73
27
 
74
28
  In a web app, import components directly (`import LmvzCard from '.../components/lmvz-card.js'`) or the loader (e.g., `import { defineCustomElements } from '.../loader';`) and call `defineCustomElements(window)` to register all components globally.
@@ -93,27 +47,6 @@ import { disableAriaValidation } from '@lmvz-ds/components/ariaValidation';
93
47
  disableAriaValidation();
94
48
  ```
95
49
 
96
- ### Styles
97
-
98
- Always import one of the available themes as early in your application as possible in your main CSS file:
99
-
100
- ```css
101
- @import '@lmvz-ds/components/themes/light.css';
102
- ```
103
-
104
- ... or in your HTML
105
-
106
- ```html
107
- <link rel="stylesheet" "baseUrl/@lmvz-ds/components/themes/light.css">
108
- ```
109
-
110
- Optionally, you can then import available `style/`-Packages:
111
-
112
- - @lmvz-ds/components/styles/typography.css
113
- - @lmvz-ds/components/styles/button.css
114
-
115
- These will provide styles in the global CSS scope and target native DOM elements.
116
-
117
50
  ### Components
118
51
 
119
52
  Components are built in standalone mode, using [`dist-custom-elements`](https://stenciljs.com/docs/custom-elements). This way, you can import the components individually, wherever they are needed.
@@ -150,6 +83,17 @@ npm install
150
83
 
151
84
  See the parent project's readme for the overarching process' description.
152
85
 
86
+ ### Guidelines
87
+
88
+ - Components must each be provided as stand-alone bundles.
89
+ - Components must bring their own, ds-aligned, default styles. This increases flexibility (as components are usable stand-alone) and is achieved by build-time injection of defaults (based on base- and light-theme-variables). There is no need for importing any variables definitions. Instead, add base variables to the plugin config's list (`stencil.base.config.ts`).
90
+ - Font file contents are exempt from bundling, to allow for browser-caching!
91
+ - To prevent styles from leaking out of your Components (into the global scope), wrap your own styles and `@import`s in `:host`.
92
+ - Components depending on Fragments must import them into their :host selector, for proper encapsulation.
93
+ - This use of CSS' @import syntax is invalid, but properly handled by postcss.
94
+ - Consider using custom-property abstractions instead of importing whole fragments!
95
+
96
+
153
97
  ### Configuration
154
98
 
155
99
  Different Stencil configs are necessary, since we need the following constellations (which are not possible with a single config):
@@ -181,12 +125,6 @@ Always use the `lmvz-` prefix when creating new components!
181
125
  npm run @stencil/core generate lmvz-[component name]
182
126
  ```
183
127
 
184
- ### Styling
185
-
186
- Exported styles are built using vite/postcss. See `vite-style.config.js`.
187
-
188
- For usage notes see `./styles/readme.md`.
189
-
190
128
  ### Testing
191
129
 
192
130
  To run the unit tests for the components, run:
@@ -1 +0,0 @@
1
- import{B as t,H as i}from"./p-BaPwpeMs.js";const s=Symbol("__lmvzAriaValidationRuntimeState"),o="lmvz:aria-validation-runtime-changed",e=()=>{const t=globalThis;return t[s]||(t[s]={enabled:!1}),t[s]},n=()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(o))},h=()=>e().enabled,r=()=>e().verboseLogging??!1,l=(t={})=>{const i=e();i.enabled||(Object.assign(i,t),i.enabled=!0,function(...t){return(async()=>{const t=e();if(!t.enabled)return null;if(t.runtime)return t.runtime;t.loadPromise||(t.loadPromise=import("./p-B68hOTYN.js").catch((()=>null)));const i=await t.loadPromise;return i&&(t.runtime=i),i})().then((i=>{e().enabled&&(i?i.initializeValidationStream(...t):console.warn("Failed to load aria validation runtime"))}))}().then((()=>{n()})))},a=()=>{const t=e();t.enabled&&(t.enabled=!1,n())};function c(...t){const i=e();i.enabled&&i.runtime&&i.runtime.enqueueValidation(...t)}class d{host;config;visibilityObserver;elementQueued=!1;elementValidated=!1;elementLoaded=!1;static knownValidationErrors=[];get disabled(){return!h()}get useVerboseLogging(){return this.config?.verboseLogging||t.isDev||r()}constructor(t,i){this.host=t,this.config=i}onRuntimeConfigChange=()=>{h()&&this.checkLazyValidation()};hostDidLoad(){this.elementLoaded=!0,"undefined"!=typeof window&&window.addEventListener(o,this.onRuntimeConfigChange),this.elementQueued||this.elementValidated||("slot"!==this.config?.validationTiming?this.host.validationEl?.checkVisibility()&&"load"===this.config?.validationTiming?this.enqueueValidation():this.observeVisibilityOnce():this.observeSlot())}hostDidUpdate(){this.checkLazyValidation()}hostDisconnected(){this.discardVisibilityObserver(),"undefined"!=typeof window&&window.removeEventListener(o,this.onRuntimeConfigChange)}revalidateAria(){this.enqueueValidation()}observeSlot(){this.host.validationSlot?.addEventListener("slotchange",this.enqueueValidation.bind(this))}observeVisibilityOnce(){window.setTimeout((()=>{this.host.validationEl&&(this.visibilityObserver=new IntersectionObserver((t=>{for(const i of t)i.target===this.host.validationEl&&i.isIntersecting&&(this.checkLazyValidation(),this.discardVisibilityObserver())}),{root:this.host.validationEl?.parentElement,rootMargin:"0px",threshold:.01}),this.visibilityObserver.observe(this.host.validationEl))}))}checkLazyValidation(){this.elementLoaded&&(this.config?.reValidateOnPropChanges||!this.elementQueued&&!this.elementValidated)&&this.host.validationEl?.checkVisibility()&&this.enqueueValidation()}enqueueValidation(){h()&&(this.elementQueued=!0,c({context:{include:this.host.validationEl,exclude:d.knownValidationErrors},onComplete:(t,i)=>{this.elementValidated=!0;const s=this.host.tagName||this.host.validationEl?.tagName||"Element";if(t)return console.error("Error running ARIA validation:",t,s),void(this.host.validationEl?.tagName||console.dir(this.host));const o=[s];if(!i?.violations.length)return void(this.useVerboseLogging&&(console.log(...o,"has no ARIA violations"),this.host.validationEl?.tagName||console.dir(this.host)));const e=i.violations.length,n=[...o,i.violations.at(0).id,e>1?`(+${e-1} more)`:""].filter(Boolean).join(" ");this.useVerboseLogging?console.group(n):console.groupCollapsed(n);const h=i.violations.flatMap((t=>(console.dir(t,{showHidden:!0,compact:!1}),t.nodes.map((t=>t.target)))));this.host.validationEl?console.log("element:",this.host.validationEl):console.dir(this.host),console.groupEnd(),d.knownValidationErrors.push(...h)}}))}discardVisibilityObserver(){this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=void 0)}}const u=class extends i{constructor(){super(!1)}controllers=new Set;addController(t){this.controllers.add(t)}removeController(t){this.controllers.delete(t)}get activeControllers(){return Array.from(this.controllers).filter((t=>!t.disabled))}connectedCallback(){this.controllers.size||console.warn("ReactiveControllerHost connected with no controllers registered.",this),this.activeControllers.forEach((t=>t.hostConnected?.()))}disconnectedCallback(){this.activeControllers.forEach((t=>t.hostDisconnected?.()))}componentWillLoad(){this.activeControllers.forEach((t=>t.hostWillLoad?.()))}componentDidLoad(){this.activeControllers.forEach((t=>t.hostDidLoad?.()))}componentWillRender(){this.activeControllers.forEach((t=>t.hostWillRender?.()))}componentDidRender(){this.activeControllers.forEach((t=>t.hostDidRender?.()))}componentWillUpdate(){this.activeControllers.forEach((t=>t.hostWillUpdate?.()))}componentDidUpdate(){this.activeControllers.forEach((t=>t.hostDidUpdate?.()))}};export{o as A,u as R,d as a,a as d,l as e,h as i,c as q,r as u}
@@ -1 +0,0 @@
1
- import{p as t,h as s,d as e,t as i}from"./p-BaPwpeMs.js";import{g as r,a as n,l as o,i as a,b as c,c as h,m as l,d as m,e as u,f as d,h as v,j as p,k as f,s as g,n as w,o as z,p as y,q as b,t as S,u as k,v as x,w as E,x as C,y as D,z as M,A as O,B as _,C as P,D as R,E as V,F as L,G as j,H as N,I as B,J as T,K as I,L as $,M as A,N as F,O as H,P as K,Q as G,R as J,S as U,T as W,U as X,_ as Z,V as q,W as Q,X as Y,Y as tt,Z as st,$ as et,a0 as it,a1 as rt,a2 as nt,a3 as ot,a4 as at,a5 as ct,a6 as ht,a7 as lt,a8 as mt,a9 as ut,aa as dt,r as vt,ab as pt,ac as ft,ad as gt,ae as wt}from"./p-CSRpdnrt.js";import{R as zt,a as yt}from"./p-DFXwtZsD.js";import{c as bt}from"./p-DcMNH3fv.js";const St=Symbol.for("effect/Brand/Refined"),kt=(t,s,e,i)=>O({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),xt=(t,s)=>O({_tag:"Pending",key:t,deferred:s}),Et=Symbol.for("effect/Cache/MapKey");class Ct{current;[Et]=Et;previous=void 0;next=void 0;constructor(t){this.current=t}[A](){return F(G(this.current),K(G(this.previous)),K(G(this.next)),H(this))}[J](t){return this===t||Mt(t)&&W(this.current,t.current)&&W(this.previous,t.previous)&&W(this.next,t.next)}}const Dt=t=>new Ct(t),Mt=t=>U(t,Et);class Ot{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const s=t.previous,e=t.next;void 0!==e&&(t.next=void 0,void 0!==s?(s.next=e,e.previous=s):(this.head=e,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const s=t.next;void 0!==s?(t.next=void 0,this.head=s,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const _t=Symbol.for("effect/Cache"),Pt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Rt=Symbol.for("effect/ConsumerCache"),Vt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Lt=t=>({loadedMillis:t});class jt{capacity;context;fiberId;lookup;timeToLive;[_t]=Pt;[Rt]=Vt;cacheState;constructor(t,s,e,i,r){this.capacity=t,this.context=s,this.fiberId=e,this.lookup=i,this.timeToLive=r,this.cacheState={map:R(),keys:new Ot,accesses:$(),updating:I(!1),hits:0,misses:0}}get(t){return u(this.getEither(t),f)}get cacheStats(){return g((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:w(this.cacheState.map)})))}getOption(t){return z((()=>l(y(this.cacheState.map,t),{onNone:()=>{const s=Dt(t);return this.trackAccess(s),this.trackMiss(),b(S())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return z((()=>l(y(this.cacheState.map,t),{onNone:()=>{const s=Dt(t);return this.trackAccess(s),this.trackMiss(),b(S())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return g((()=>k(this.cacheState.map,t)))}entryStats(t){return g((()=>{const s=y(this.cacheState.map,t);if(x(s))switch(s.value._tag){case"Complete":return E(Lt(s.value.entryStats.loadedMillis));case"Pending":return S();case"Refreshing":return E(Lt(s.value.complete.entryStats.loadedMillis))}return S()}))}getEither(t){return z((()=>{const s=t;let e,i,r=C(y(this.cacheState.map,s));return void 0===r&&(i=D(this.fiberId),e=Dt(s),k(this.cacheState.map,s)?r=C(y(this.cacheState.map,s)):M(this.cacheState.map,s,xt(e,i))),void 0===r?(this.trackAccess(e),this.trackMiss(),u(this.lookupValueOf(t,i),n)):_(this.resolveMapValue(r),l({onNone:()=>this.getEither(t),onSome:t=>b(o(t))}))}))}invalidate(t){return g((()=>{P(this.cacheState.map,t)}))}invalidateWhen(t,s){return g((()=>{const e=y(this.cacheState.map,t);x(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&P(this.cacheState.map,t)}))}get invalidateAll(){return g((()=>{this.cacheState.map=R()}))}refresh(t){return V((s=>z((()=>{const e=t,i=D(this.fiberId);let r=C(y(this.cacheState.map,e));if(void 0===r&&(k(this.cacheState.map,e)?r=C(y(this.cacheState.map,e)):M(this.cacheState.map,e,xt(Dt(e),i))),void 0===r)return X(this.lookupValueOf(t,i));switch(r._tag){case"Complete":if(this.hasExpired(s,r.timeToLiveMillis)){const s=C(y(this.cacheState.map,e));return W(s,r)&&P(this.cacheState.map,e),X(this.get(t))}return F(this.lookupValueOf(t,i),q((()=>{const t=C(y(this.cacheState.map,e));if(W(t,r)){const t=((t,s)=>O({_tag:"Refreshing",deferred:t,complete:s}))(i,r);return M(this.cacheState.map,e,t),!0}return!1})),X);case"Pending":case"Refreshing":return Z(r.deferred)}}))))}set(t,s){return V((e=>g((()=>{const i=e.unsafeCurrentTimeMillis(),r=t,n=Q(s),o=kt(Dt(r),n,Lt(i),i+Y(m(this.timeToLive(n))));M(this.cacheState.map,r,o)}))))}get size(){return g((()=>w(this.cacheState.map)))}get values(){return g((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[1].exit.value);return t}))}get entries(){return g((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push([s[0],s[1].exit.value]);return t}))}get keys(){return g((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[0]);return t}))}resolveMapValue(t,s=!1){return V((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(P(this.cacheState.map,t.key.current),b(S())):(this.trackHit(),u(t.exit,E));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?b(S()):u(Z(t.deferred),E);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?b(S()):u(Z(t.deferred),E):u(t.complete.exit,E)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(L(this.cacheState.accesses,t),j(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=N(this.cacheState.accesses,B);s===B?t=!1:this.cacheState.keys.add(s)}let s=w(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?k(this.cacheState.map,e.current)&&(P(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}T(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return V((e=>z((()=>{const i=t;return F(this.lookup(t),nt(this.context),rt,_((t=>{const r=e.unsafeCurrentTimeMillis(),n=Lt(r),o=kt(Dt(i),t,n,r+Y(m(this.timeToLive(t))));return M(this.cacheState.map,i,o),st(it(s,t),t)})),tt((()=>st(et(s),g((()=>{P(this.cacheState.map,i)}))))))}))))}}const Nt=t=>{const s=m(t.timeToLive);return(t=>u(d([v(),p]),(([s,e])=>new jt(t.capacity,s,e,t.lookup,(s=>m(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})},Bt=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends ot{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,t,{value:s,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),Tt=t=>{const s={BaseEffectError:class extends Bt{_tag=t}};return s.BaseEffectError.prototype.name=t,s.BaseEffectError};class It extends(Tt("FetchError")){}class $t extends(Tt("NotFoundError")){}class At extends(Tt("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}const Ft=function(...t){const s=2===t.length?s=>t[0](s)?n(s):o(t[1](s)):s=>l(t[0](s),{onNone:()=>n(s),onSome:o});return Object.assign((t=>r(s(t),a)),{[St]:St,option:t=>h(s(t)),either:s,is:t=>c(s(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class Ht extends(Tt("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}let Kt=null;function Gt(){return mt((function*(){Kt?yield*Kt.invalidateAll:ut("Attempted to clear icon cache before it was initialized")}))}const Jt=t(class extends zt{intersectionObserver;ariaValidationController=new yt(this);get el(){return this}validationEl;icon;weight="medium";size="md";iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(t){super(!1),!1!==t&&this.__registerHost(),this.addController(this.ariaValidationController)}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()})),super.connectedCallback()}disconnectedCallback(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),super.disconnectedCallback()}async loadIconPathData(){const{icon:t,visible:s}=this;t&&s&&(this.iconData=await vt(function(t){const s=t;return mt((function*(){return Kt||(Kt=yield*Nt({capacity:200,timeToLive:dt,lookup:t=>mt((function*(){const s=bt(`${t}.svg`,"icons"),e=yield*(i=s,at((function*(){const t=yield*ct({try:()=>fetch(i,void 0),catch:t=>new It({cause:t})});return 404===t.status?yield*ht(new $t({url:t.url})):t})));var i;const r=yield*(t=>ct({try:()=>t.text(),catch:t=>new At(t)}))(e);return yield*(n=r,lt({try:()=>Ft(n),catch:t=>new Ht(t,"SVGString")}));var n}))})),yield*Kt.get(s)}))}(this.icon).pipe(pt((s=>ft(`Error loading icon "${t}":`,s.message,s.cause,s.stack))),gt((()=>wt(Ft('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>')))))))}componentDidRender(){this.validationEl=this.el.querySelector("svg"),this.ariaValidationController.revalidateAria(),super.componentDidRender()}render(){return s(e,{key:"8b1ce550253e994650fe91de38496aff7c7eccc2",role:"img","aria-hidden":`${this.ariaHidden}`,innerHTML:this.iconData})}waitUntilVisible(t,s=50){"undefined"!=typeof window&&window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver((s=>{s.some((s=>!!s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t(),!0)))}),{rootMargin:`${s}px`}),this.intersectionObserver.observe(this.el)):t()}static get assetsDirs(){return["../../assets/icons"]}static get watchers(){return{icon:[{loadIconPathData:0}]}}static get style(){return".sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height:inherit}}[weight='light'].sc-lmvz-icon-h{svg>path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg>path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg>path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg>path{stroke-width:2;fill:var(--lmvz-icon-color)}}"}},[514,"lmvz-icon",{icon:[513],weight:[513],size:[513],ariaLabel:[513,"aria-label"],iconData:[32],visible:[32]},void 0,{icon:[{loadIconPathData:0}]}]);function Ut(){"undefined"!=typeof customElements&&["lmvz-icon"].forEach((t=>{"lmvz-icon"===t&&(customElements.get(i(t))||customElements.define(i(t),Jt))}))}export{Jt as L,Gt as c,Ut as d}
@@ -1 +0,0 @@
1
- import{g as e,r as a,h as t,H as r}from"./p-smGPjoDX.js";import{R as n,A as s}from"./p-DWVncv6N.js";import{g as i,c as l}from"./p-B3JVFwO1.js";import"./p-qPGwETYT.js";class o{host;elements=[];constructor(e){this.host=e}hostDidRender(){this.host.el.addEventListener("keydown",this.handleKeydown)}updateElements(e){this.elements=e}handleKeydown=e=>{const{key:a}=e;if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(a))return;const t=i(document),r=this.getNextFocusableElement(t,["ArrowDown","ArrowRight"].includes(a)?"down":"up");r&&(e.preventDefault(),r.focus?.())};getNextFocusableElement(e,a){const{elements:t}=this,r=t.indexOf(e);if(-1===r)return null;let n=null;if("down"===a?n=(r+1)%t.length:"up"===a&&(n=(r-1+t.length)%t.length),null==n)return null;const s=t[n];return l(s)?s:this.getNextFocusableElement(s,a)}}const c=class extends n{get el(){return e(this)}validationEl=this.el;primarySlot;secondarySlot;secondaryNav;keyboardNavigationController=new o(this);get primaryMenuitems(){return this.primarySlot.assignedElements({flatten:!1})}get secondaryMenuitems(){return this.secondarySlot.assignedElements({flatten:!0})}get role(){return"banner"}lmvzActiveNav;get secondarySlotName(){return`connect-nav-${this.lmvzActiveNav}`}constructor(e){super(),a(this,e),this.addController(new s(this,{reValidateOnPropChanges:!0})),this.addController(this.keyboardNavigationController)}handleActiveNavChange(){this.updateElementsActive()}componentDidLoad(){this.primarySlot.addEventListener("slotchange",this.handlePrimaryNavItemsChange.bind(this)),this.handlePrimaryNavItemsChange(),this.secondarySlot.addEventListener("slotchange",this.handleSecondaryNavItemsChange.bind(this)),super.componentDidLoad()}handlePrimaryNavItemsChange(){const e=this.primaryMenuitems;e.length?(e.forEach((e=>{e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-controls","nav-secondary")})),this.updateElementsActive()):console.warn("Primary slot has no assigned elements. Please add navigation items to the primary slot.")}handleSecondaryNavItemsChange(){this.secondaryMenuitems.length&&this.updateKeyboardNavSubjects()}updateKeyboardNavSubjects(){this.keyboardNavigationController.updateElements([...this.primaryMenuitems,...this.secondaryMenuitems])}updateElementsActive(){let e;this.primaryMenuitems.forEach((a=>{const t=a.id===this.lmvzActiveNav;t&&(e=a.textContent||a.id),a.setAttribute("aria-expanded",t?"true":"false")})),this.secondaryNav.setAttribute("aria-label",`Untermenü für ${e}`)}delegateFocus(){const e=this.primaryMenuitems[0];e&&e.focus()}render(){return t(r,{key:"7c257913615a89b9be8f959b4dc43664ee474113",onFocus:this.delegateFocus.bind(this)},t("div",{key:"70f33263e629170d1b19cbfb1a00ca1adbbe91e0",class:"brand"},t("slot",{key:"d9c99c51da3210e5459684e59e66baf1622a8946",name:"brand"},t("lmvz-icon",{key:"18bd0e88032c023d319bc3fac43c2b09d5098893",id:"fallback-logo-lmvz",icon:"Logo",size:"inherit","aria-label":"Lehrmittelverlag Zürich"}))),t("nav",{key:"c56a1e63344e42b1be26fe817705f0265bdb2bcf","aria-label":"Hauptnavigation"},t("div",{key:"fbaebcb4857b0fba7b81cc35ef6092bb98ae89f8",role:"menubar",class:"primary-menubar"},t("slot",{key:"4a408eacbb41fa57d838581c18389241dce0e634",name:"nav-primary",ref:e=>this.primarySlot=e}),t("div",{key:"6229842569958c724478c6aa15adc75b07d8417e",role:"menu",id:"nav-secondary",class:"secondary-menubar",hidden:!this.lmvzActiveNav,ref:e=>this.secondaryNav=e},t("slot",{key:"4dd4278eaa77cfc984e338da6bb1aa7321c6a545",name:this.secondarySlotName,ref:e=>this.secondarySlot=e})))),t("div",{key:"98b7802b0dc2dfe3a7a38bf89ae2b68994734396",class:"actions"},t("slot",{key:"5f7682fe0ad34496b887baab7b19641a86c01acb",name:"actions"})))}static get watchers(){return{lmvzActiveNav:[{handleActiveNavChange:0}]}}};c.style=":host{display:flex;width:100vw;flex-direction:row;align-items:center;box-sizing:border-box;background-color:var(--lmvz-semantic-color-surface-primary, #ffffff);--lmvz-header-x-spacing-level-1:var(--lmvz-dimension-8-28, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));--lmvz-header-x-spacing-level-2:var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));padding:var(--lmvz-dimension-8-16, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);gap:var(--lmvz-header-x-spacing-level-1);.brand{display:inline-flex;justify-content:center;align-items:center}#fallback-logo-lmvz{height:34px;width:auto}nav{flex-grow:1}.primary-menubar{display:flex;flex-direction:row;align-items:center}.secondary-menubar{display:flex;flex-direction:row;align-items:center;margin-left:var(--lmvz-header-x-spacing-level-2);padding-left:var(--lmvz-header-x-spacing-level-2);border-left:1px solid var(--lmvz-semantic-color-border-default, #e0e0e0)}}";export{c as lmvz_header}
@@ -1 +0,0 @@
1
- const n=Symbol("__lmvzAriaValidationRuntimeState"),t="lmvz:aria-validation-runtime-changed",a=()=>{const t=globalThis;return t[n]||(t[n]={enabled:!1}),t[n]},o=()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(t))},i=()=>a().enabled,e=()=>a().verboseLogging??!1,s=(n={})=>{const t=a();t.enabled||(Object.assign(t,n),t.enabled=!0,function(...n){return(async()=>{const n=a();if(!n.enabled)return null;if(n.runtime)return n.runtime;n.loadPromise||(n.loadPromise=import("./p-DJp2UHon.js").catch((()=>null)));const t=await n.loadPromise;return t&&(n.runtime=t),t})().then((t=>{a().enabled&&(t?t.initializeValidationStream(...n):console.warn("Failed to load aria validation runtime"))}))}().then((()=>{o()})))},r=()=>{const n=a();n.enabled&&(n.enabled=!1,o())};function l(...n){const t=a();t.enabled&&t.runtime&&t.runtime.enqueueValidation(...n)}export{t as A,r as d,s as e,i,l as q,e as u}
@@ -1 +0,0 @@
1
- @layer lmvz-ds.reset,lmvz-ds.theme,lmvz-ds.components,lmvz-ds.overrides;@layer lmvz-ds.reset{h1,h2,h3,h4,h5,h6{margin:0}}@layer lmvz-ds.components{button{--lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary));--lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x));--lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y));--lmvz-button-gap: var(--lmvz-component-input-md-gap-x);--lmvz-button-font: var(--lmvz-typography-body-lg);--lmvz-button-radius: var(--lmvz-component-input-radius-default);--lmvz-button-border-width: 0;--lmvz-button-border-color: transparent;--lmvz-button-background: var(--lmvz-semantic-color-int-primary);display:inline-flex;align-items:center;justify-content:center;gap:var(--lmvz-button-gap);padding-block:var(--lmvz-button-padding-block);padding-inline:var(--lmvz-button-padding-inline);border-radius:var(--lmvz-button-radius);border:var(--lmvz-button-border-width) solid var(--lmvz-button-border-color);background-color:var(--lmvz-button-background);color:var(--lmvz-button-color);cursor:pointer;font:var(--lmvz-button-font);text-align:center;text-decoration:none;white-space:nowrap;transition:background-color .15s ease,color .15s ease,border-color .15s ease,box-shadow .15s ease}button>*{font:inherit;color:inherit}button:focus-visible{outline:var(--lmvz-semantic-border-width-default) solid var(--lmvz-semantic-color-status-selected);outline-offset:var(--lmvz-component-input-sm-padding-x)}button:is([disabled],.disabled){cursor:not-allowed;pointer-events:none;opacity:var(--lmvz-component-input-disabled-opacity)}button:not([disabled]):hover{--lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover)}button:not([disabled]):active{--lmvz-button-background: var(--lmvz-semantic-color-int-primary-active)}button.secondary{--lmvz-button-background: var(--lmvz-semantic-color-int-secondary);--lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary);--lmvz-button-border-width: var(--lmvz-semantic-border-width-default);--lmvz-button-border-color: var(--lmvz-semantic-color-border-default)}button.secondary:not([disabled],.disabled):hover{--lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover);--lmvz-button-border-color: var(--lmvz-semantic-color-border-hover)}button.secondary:not([disabled],.disabled):active{--lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active);--lmvz-button-border-color: var(--lmvz-semantic-color-border-active)}button.tertiary{--lmvz-button-background: var(--lmvz-semantic-color-int-tertiary);--lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary)}button.tertiary:not([disabled],.disabled):hover{--lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover)}button.tertiary:not([disabled],.disabled):active{--lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active)}button.small{--lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x);--lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y);--lmvz-button-gap: var(--lmvz-component-input-sm-gap-x);--lmvz-button-font: var(--lmvz-typography-body-md)}button.large{--lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x);--lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y);--lmvz-button-gap: var(--lmvz-component-input-lg-gap-x);--lmvz-button-font: var(--lmvz-typography-body-lg)}}