@nordhealth/components 1.2.0 → 1.5.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/custom-elements.json +2376 -1339
- package/lib/Avatar.js.map +1 -1
- package/lib/Banner.js.map +1 -1
- package/lib/Button.js +1 -1
- package/lib/Button.js.map +1 -1
- package/lib/Calendar-a389d216.js +2 -0
- package/lib/{Calendar-73a2fcfd.js.map → Calendar-a389d216.js.map} +1 -1
- package/lib/Calendar.js +1 -1
- package/lib/CommandMenu.js +1 -1
- package/lib/CommandMenu.js.map +1 -1
- package/lib/DatePicker.js +1 -1
- package/lib/DatePicker.js.map +1 -1
- package/lib/DropdownItem.js +1 -1
- package/lib/DropdownItem.js.map +1 -1
- package/lib/Header.js.map +1 -1
- package/lib/Icon.js +1 -1
- package/lib/Layout.js +1 -1
- package/lib/Layout.js.map +1 -1
- package/lib/NavGroup.js +1 -1
- package/lib/NavGroup.js.map +1 -1
- package/lib/NavItem.js +1 -1
- package/lib/NavItem.js.map +1 -1
- package/lib/Navigation.js +1 -1
- package/lib/Navigation.js.map +1 -1
- package/lib/Table.js +1 -1
- package/lib/Table.js.map +1 -1
- package/lib/Toggle.js +2 -0
- package/lib/Toggle.js.map +1 -0
- package/lib/Tooltip.js.map +1 -1
- package/lib/bundle.js +9 -9
- package/lib/bundle.js.map +1 -1
- package/lib/fsm-50373df9.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/number-c3ab3e95.js +2 -0
- package/lib/number-c3ab3e95.js.map +1 -0
- package/lib/observe-a9c6dfb6.js.map +1 -1
- package/lib/repeat-ed796481.js +7 -0
- package/lib/repeat-ed796481.js.map +1 -0
- package/lib/src/avatar/Avatar.d.ts +1 -1
- package/lib/src/banner/Banner.d.ts +1 -1
- package/lib/src/button/Button.d.ts +1 -1
- package/lib/src/common/controllers/MediaQueryController.d.ts +14 -0
- package/lib/src/common/fsm.d.ts +3 -2
- package/lib/src/common/number.d.ts +1 -0
- package/lib/src/common/storage.d.ts +7 -0
- package/lib/src/header/Header.d.ts +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/layout/Layout.d.ts +47 -3
- package/lib/src/layout/Layout.test.d.ts +4 -0
- package/lib/src/nav-group/NavGroup.d.ts +1 -1
- package/lib/src/nav-item/NavItem.d.ts +1 -1
- package/lib/src/navigation/Navigation.d.ts +2 -4
- package/lib/src/navigation/Navigation.test.d.ts +1 -0
- package/lib/src/toggle/Toggle.d.ts +38 -0
- package/lib/src/toggle/Toggle.test.d.ts +3 -0
- package/lib/src/tooltip/Tooltip.d.ts +1 -1
- package/package.json +7 -7
- package/lib/Calendar-73a2fcfd.js +0 -2
- package/lib/DraftComponentMixin-9e4b7b34.js +0 -2
- package/lib/DraftComponentMixin-9e4b7b34.js.map +0 -1
- package/lib/number-1c122a1e.js +0 -7
- package/lib/number-1c122a1e.js.map +0 -1
package/lib/fsm-50373df9.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fsm-50373df9.js","sources":["../src/common/fsm.ts"],"sourcesContent":["type
|
|
1
|
+
{"version":3,"file":"fsm-50373df9.js","sources":["../src/common/fsm.ts"],"sourcesContent":["type EventsFromTransitions<T> = { [Prop in keyof T]: keyof T[Prop] }[keyof T]\n\nexport function fsm<\n TTransitions extends Record<TStates, Partial<Record<TEvents, TStates>>>,\n TStates extends keyof TTransitions,\n TEvents extends EventsFromTransitions<TTransitions>\n>(config: TTransitions) {\n return {\n transition(currentState: TStates, event: TEvents) {\n const nextState = config[currentState][event] as TStates\n return nextState || currentState\n },\n }\n}\n\nexport type Machine = ReturnType<typeof fsm>\n\nexport type States<T extends Machine | Machine[\"transition\"]> = T extends Machine\n ? Parameters<T[\"transition\"]>[0]\n : T extends Machine[\"transition\"]\n ? Parameters<T>[0]\n : never\n\nexport type Events<T extends Machine | Machine[\"transition\"]> = T extends Machine\n ? Parameters<T[\"transition\"]>[1]\n : T extends Machine[\"transition\"]\n ? Parameters<T>[1]\n : never\n"],"names":["fsm","config","transition","currentState","event"],"mappings":"AAEM,SAAUA,EAIdC,GACA,MAAO,CACLC,WAAU,CAACC,EAAuBC,IACdH,EAAOE,GAAcC,IACnBD"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{default as Icon}from"./Icon.js";export{default as CommandMenu}from"./CommandMenu.js";export{default as CommandMenuAction}from"./CommandMenuAction.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Spinner}from"./Spinner.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";export{C as Calendar}from"./Calendar-
|
|
1
|
+
export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{default as Icon}from"./Icon.js";export{default as CommandMenu}from"./CommandMenu.js";export{default as CommandMenuAction}from"./CommandMenuAction.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Spinner}from"./Spinner.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";export{C as Calendar}from"./Calendar-a389d216.js";export{default as DatePicker}from"./DatePicker.js";export{default as Checkbox}from"./Checkbox.js";export{default as Tooltip}from"./Tooltip.js";export{default as Fieldset}from"./Fieldset.js";export{default as Radio}from"./Radio.js";export{default as Header}from"./Header.js";export{default as NavGroup}from"./NavGroup.js";export{default as NavItem}from"./NavItem.js";export{default as Navigation}from"./Navigation.js";export{default as Layout}from"./Layout.js";export{default as EmptyState}from"./EmptyState.js";export{default as Banner}from"./Banner.js";export{default as Avatar}from"./Avatar.js";export{default as ProgressBar}from"./ProgressBar.js";export{default as Popout}from"./Popout.js";export{default as Dropdown}from"./Dropdown.js";export{default as DropdownItem}from"./DropdownItem.js";export{default as DropdownGroup}from"./DropdownGroup.js";export{isTranslationRegistered,registerTranslation}from"./translation.js";export{default as Toggle}from"./Toggle.js";import"./query-assigned-elements-ef860822.js";import"./lit-element-e382250e.js";import"./property-03f59dce.js";import"./Component-fa316972.js";import"./ref-adf41565.js";import"./directive-de55b00a.js";import"./EventController-d99ebeef.js";import"./LightDomController-e0762f0d.js";import"./cond-ed8742b5.js";import"./FocusableMixin-4c85ced9.js";import"./InputMixin-84ca72ae.js";import"./SlotController-ea6eff46.js";import"./if-defined-4d1db15c.js";import"./unsafe-html-76575c49.js";import"./FormAssociatedMixin-9d38814c.js";import"./events-731d0007.js";import"./FormField-44e865a4.js";import"./TextField-f8848f28.js";import"./state-70f38ceb.js";import"./observe-a9c6dfb6.js";import"./repeat-ed796481.js";import"./class-map-9e39244c.js";import"./collection-800f5002.js";import"./number-c3ab3e95.js";import"./LightDismissController-a2645ae6.js";import"./ShortcutController-87615e31.js";import"./tinykeys.module-84e6cc41.js";import"./KeyboardController.js";import"./SelectEvent.js";import"./LocalizeController.js";import"./DirectionController-8b298382.js";import"./query-2d22378e.js";import"./dates-56f73760.js";import"./month-view.js";import"./DateSelectEvent.js";import"./date-adapter.js";import"./positioning-763efb3a.js";import"./fsm-50373df9.js";import"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-c3ab3e95.js","sources":["../src/common/number.ts"],"sourcesContent":["/**\n * Wraps a value so that it always falls within min/max,\n * where a value greater than max gets set to min, and vice versa\n */\nexport function wrap(val: number, min: number, max: number) {\n if (val > max) return min\n if (val < min) return max\n return val\n}\n\nexport function range(from: number, to: number) {\n const result: number[] = []\n\n for (let i = from; i <= to; i++) {\n result.push(i)\n }\n\n return result\n}\n\nexport function clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max))\n}\n"],"names":["wrap","val","min","max","range","from","to","result","i","push","clamp","value","Math"],"mappings":"SAIgBA,EAAKC,EAAaC,EAAaC,GAC7C,OAAIF,EAAME,EAAYD,EAClBD,EAAMC,EAAYC,EACfF,EAGO,SAAAG,EAAMC,EAAcC,GAClC,MAAMC,EAAmB,GAEzB,IAAK,IAAIC,EAAIH,EAAMG,GAAKF,EAAIE,IAC1BD,EAAOE,KAAKD,GAGd,OAAOD,WAGOG,EAAMC,EAAeT,EAAaC,GAChD,OAAOS,KAAKT,IAAID,EAAKU,KAAKV,IAAIS,EAAOR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe-a9c6dfb6.js","sources":["../src/common/decorators/observe.ts"],"sourcesContent":["import { ReactiveController, ReactiveElement } from \"lit\"\n\ntype ObserveFunction = (oldValue: any, newValue: any, name: PropertyKey) => void\ntype ObserveLifecycle = \"update\" | \"updated\"\n\nclass PropertyObserverController<T extends ReactiveElement, TKey extends keyof T> implements ReactiveController {\n private _value?: T[TKey]\n\n constructor(private host: T, private key: TKey, private cb: ObserveFunction, private lifecycle: ObserveLifecycle) {\n host.addController(this)\n }\n\n hostUpdate() {\n if (this.lifecycle === \"update\") {\n this.handle()\n }\n }\n\n hostUpdated() {\n if (this.lifecycle === \"updated\") {\n this.handle()\n }\n }\n\n private handle() {\n const { key, _value, host } = this\n const newValue = host[key]\n\n if (_value !== newValue) {\n this._value = newValue\n this.cb.call(host, _value, newValue, key)\n }\n }\n}\n\nexport function observe(propertyName: string, lifecycle: ObserveLifecycle = \"update\") {\n return function decorator(target: any, methodName: string) {\n const proto = target.constructor as typeof ReactiveElement\n\n proto.addInitializer(el => {\n type Key = keyof typeof el\n const cb = el[methodName as Key] as ObserveFunction\n\n // since we can't get strong typing here, we can add a runtime check\n // this will get stripped out in prod, and should only ever happen in dev anyway\n if (process.env.NODE_ENV === \"development\") {\n if (!(propertyName in el)) {\n throw new TypeError(\n `@observe:
|
|
1
|
+
{"version":3,"file":"observe-a9c6dfb6.js","sources":["../src/common/decorators/observe.ts"],"sourcesContent":["import { ReactiveController, ReactiveElement } from \"lit\"\n\ntype ObserveFunction = (oldValue: any, newValue: any, name: PropertyKey) => void\ntype ObserveLifecycle = \"update\" | \"updated\"\n\nclass PropertyObserverController<T extends ReactiveElement, TKey extends keyof T> implements ReactiveController {\n private _value?: T[TKey]\n\n constructor(private host: T, private key: TKey, private cb: ObserveFunction, private lifecycle: ObserveLifecycle) {\n host.addController(this)\n }\n\n hostUpdate() {\n if (this.lifecycle === \"update\") {\n this.handle()\n }\n }\n\n hostUpdated() {\n if (this.lifecycle === \"updated\") {\n this.handle()\n }\n }\n\n private handle() {\n const { key, _value, host } = this\n const newValue = host[key]\n\n if (_value !== newValue) {\n this._value = newValue\n this.cb.call(host, _value, newValue, key)\n }\n }\n}\n\nexport function observe(propertyName: string, lifecycle: ObserveLifecycle = \"update\") {\n return function decorator(target: any, methodName: string) {\n const proto = target.constructor as typeof ReactiveElement\n\n proto.addInitializer(el => {\n type Key = keyof typeof el\n const cb = el[methodName as Key] as ObserveFunction\n\n // since we can't get strong typing here, we can add a runtime check\n // this will get stripped out in prod, and should only ever happen in dev anyway\n if (process.env.NODE_ENV === \"development\") {\n if (!(propertyName in el)) {\n throw new TypeError(\n `@observe: property '${propertyName}' does not exist.\\nPossible properties: ${Object.keys(target)\n .map(p => `'${p}'`)\n .join(\", \")}`\n )\n }\n }\n\n el.addController(new PropertyObserverController(el, propertyName as Key, cb, lifecycle))\n })\n }\n}\n"],"names":["PropertyObserverController","constructor","host","key","cb","lifecycle","this","addController","hostUpdate","handle","hostUpdated","_value","newValue","call","observe","propertyName","target","methodName","addInitializer","el"],"mappings":"AAKA,MAAMA,EAGJC,YAAoBC,EAAiBC,EAAmBC,EAA6BC,GAAjEC,KAAIJ,KAAJA,EAAiBI,KAAGH,IAAHA,EAAmBG,KAAEF,GAAFA,EAA6BE,KAASD,UAATA,EACnFH,EAAKK,cAAcD,MAGrBE,aACyB,WAAnBF,KAAKD,WACPC,KAAKG,SAITC,cACyB,YAAnBJ,KAAKD,WACPC,KAAKG,SAIDA,SACN,MAAMN,IAAEA,EAAGQ,OAAEA,EAAMT,KAAEA,GAASI,KACxBM,EAAWV,EAAKC,GAElBQ,IAAWC,IACbN,KAAKK,OAASC,EACdN,KAAKF,GAAGS,KAAKX,EAAMS,EAAQC,EAAUT,cAK3BW,EAAQC,EAAsBV,EAA8B,UAC1E,OAAO,SAAmBW,EAAaC,GACvBD,EAAOf,YAEfiB,gBAAeC,IAEnB,MAAMf,EAAKe,EAAGF,GAcdE,EAAGZ,cAAc,IAAIP,EAA2BmB,EAAIJ,EAAqBX,EAAIC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b as e}from"./lit-element-e382250e.js";import{e as t,i as s,t as r}from"./directive-de55b00a.js";import{a as l,c as o,u as n,m as i,s as u}from"./ref-adf41565.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2017 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/const f=(e,t,s)=>{const r=new Map;for(let l=t;l<=s;l++)r.set(e[l],l);return r},a=t(class extends s{constructor(e){if(super(e),e.type!==r.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,s){let r;void 0===s?s=t:void 0!==t&&(r=t);const l=[],o=[];let n=0;for(const t of e)l[n]=r?r(t,n):n,o[n]=s(t,n),n++;return{values:o,keys:l}}render(e,t,s){return this.dt(e,t,s).values}update(t,[s,r,a]){var c;const d=l(t),{values:h,keys:p}=this.dt(s,r,a);if(!Array.isArray(d))return this.ut=p,h;const v=null!==(c=this.ut)&&void 0!==c?c:this.ut=[],m=[];let y,x,g=0,j=d.length-1,b=0,k=h.length-1;for(;g<=j&&b<=k;)if(null===d[g])g++;else if(null===d[j])j--;else if(v[g]===p[b])m[b]=o(d[g],h[b]),g++,b++;else if(v[j]===p[k])m[k]=o(d[j],h[k]),j--,k--;else if(v[g]===p[k])m[k]=o(d[g],h[k]),n(t,m[k+1],d[g]),g++,k--;else if(v[j]===p[b])m[b]=o(d[j],h[b]),n(t,d[g],d[j]),j--,b++;else if(void 0===y&&(y=f(p,b,k),x=f(v,g,j)),y.has(v[g]))if(y.has(v[j])){const e=x.get(p[b]),s=void 0!==e?d[e]:null;if(null===s){const e=n(t,d[g]);o(e,h[b]),m[b]=e}else m[b]=o(s,h[b]),n(t,d[g],s),d[e]=null;b++}else i(d[j]),j--;else i(d[g]),g++;for(;b<=k;){const e=n(t,m[k+1]);o(e,h[b]),m[b++]=e}for(;g<=j;){const e=d[g++];null!==e&&i(e)}return this.ut=p,u(t,m),e}});export{a as c};
|
|
7
|
+
//# sourceMappingURL=repeat-ed796481.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeat-ed796481.js","sources":["../node_modules/lit-html/directives/repeat.js"],"sourcesContent":["import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){var d;const a=l(s),{values:p,keys:v}=this.dt(t,r,c);if(!Array.isArray(a))return this.ut=v,p;const h=null!==(d=this.ut)&&void 0!==d?d:this.ut=[],m=[];let y,x,j=0,k=a.length-1,w=0,A=p.length-1;for(;j<=k&&w<=A;)if(null===a[j])j++;else if(null===a[k])k--;else if(h[j]===v[w])m[w]=o(a[j],p[w]),j++,w++;else if(h[k]===v[A])m[A]=o(a[k],p[A]),k--,A--;else if(h[j]===v[A])m[A]=o(a[j],p[A]),i(s,m[A+1],a[j]),j++,A--;else if(h[k]===v[w])m[w]=o(a[k],p[w]),i(s,a[j],a[k]),k--,w++;else if(void 0===y&&(y=u(v,w,A),x=u(h,j,k)),y.has(h[j]))if(y.has(h[k])){const e=x.get(v[w]),t=void 0!==e?a[e]:null;if(null===t){const e=i(s,a[j]);o(e,p[w]),m[w]=e}else m[w]=o(t,p[w]),i(s,a[j],t),a[e]=null;w++}else n(a[k]),k--;else n(a[j]),j++;for(;w<=A;){const e=i(s,m[A+1]);o(e,p[w]),m[w++]=e}for(;j<=k;){const e=a[j++];null!==e&&n(e)}return this.ut=v,f(s,m),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n"],"names":["u","e","s","t","r","Map","l","set","c","constructor","super","type","CHILD","Error","dt","o","i","values","keys","render","this","update","d","a","p","v","Array","isArray","ut","h","m","y","x","j","k","length","w","A","has","get","n","f"],"mappings":";;;;;GAMK,MAACA,EAAE,CAACC,EAAEC,EAAEC,KAAK,MAAMC,EAAE,IAAIC,IAAI,IAAI,IAAIC,EAAEJ,EAAEI,GAAGH,EAAEG,IAAIF,EAAEG,IAAIN,EAAEK,GAAGA,GAAG,OAAOF,GAAGI,EAAEN,EAAE,cAAcC,EAAEM,YAAYR,GAAG,GAAGS,MAAMT,GAAGA,EAAEU,OAAOP,EAAEQ,MAAM,MAAMC,MAAM,iDAAiDC,GAAGb,EAAEC,EAAEC,GAAG,IAAIC,OAAE,IAASD,EAAEA,EAAED,OAAE,IAASA,IAAIE,EAAEF,GAAG,MAAMI,EAAE,GAAGS,EAAE,GAAG,IAAIC,EAAE,EAAE,IAAI,MAAMd,KAAKD,EAAEK,EAAEU,GAAGZ,EAAEA,EAAEF,EAAEc,GAAGA,EAAED,EAAEC,GAAGb,EAAED,EAAEc,GAAGA,IAAI,MAAM,CAACC,OAAOF,EAAEG,KAAKZ,GAAG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AEO,IAAIT,EAAEK,IAAI,CAAC,MAAMjC,EAAE+B,EAAEO,IAAId,EAAEW,IAAIjC,OAAE,IAASF,EAAEsB,EAAEtB,GAAG,KAAK,GAAG,OAAOE,EAAE,CAAC,MAAMF,EAAEe,EAAEd,EAAEqB,EAAEU,IAAIlB,EAAEd,EAAEuB,EAAEY,IAAIN,EAAEM,GAAGnC,OAAO6B,EAAEM,GAAGrB,EAAEZ,EAAEqB,EAAEY,IAAIpB,EAAEd,EAAEqB,EAAEU,GAAG9B,GAAGoB,EAAEtB,GAAG,KAAKmC,SAASI,EAAEjB,EAAEW,IAAIA,SAASM,EAAEjB,EAAEU,IAAIA,IAAI,KAAKG,GAAGC,GAAG,CAAC,MAAMpC,EAAEe,EAAEd,EAAE4B,EAAEO,EAAE,IAAItB,EAAEd,EAAEuB,EAAEY,IAAIN,EAAEM,KAAKnC,EAAE,KAAKgC,GAAGC,GAAG,CAAC,MAAMjC,EAAEsB,EAAEU,KAAK,OAAOhC,GAAGuC,EAAEvC,GAAG,OAAOmB,KAAKQ,GAAGH,EAAEgB,EAAEvC,EAAE4B,GAAG7B"}
|
|
@@ -3,7 +3,7 @@ import { LitElement, nothing } from "lit";
|
|
|
3
3
|
* Avatar is used for showing a thumbnail representation of a user or entity.
|
|
4
4
|
* Default avatar illustration is displayed when no src is specified.
|
|
5
5
|
*
|
|
6
|
-
* @status
|
|
6
|
+
* @status ready
|
|
7
7
|
* @category image
|
|
8
8
|
*/
|
|
9
9
|
export default class Avatar extends LitElement {
|
|
@@ -19,7 +19,7 @@ export default class Button extends Button_base {
|
|
|
19
19
|
/**
|
|
20
20
|
* The style variant of the button.
|
|
21
21
|
*/
|
|
22
|
-
variant: "default" | "primary" | "dashed" | "plain" | "danger";
|
|
22
|
+
variant: "default" | "primary" | "dashed" | "plain" | "danger" | "switch";
|
|
23
23
|
/**
|
|
24
24
|
* The type of the button.
|
|
25
25
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from "lit";
|
|
2
|
+
declare type MediaQueryChange = () => void;
|
|
3
|
+
export declare class MediaQueryController implements ReactiveController {
|
|
4
|
+
private host;
|
|
5
|
+
private onChange?;
|
|
6
|
+
private mq;
|
|
7
|
+
constructor(host: ReactiveControllerHost, mediaQuery: MediaQueryList, onChange?: MediaQueryChange);
|
|
8
|
+
constructor(host: ReactiveControllerHost, mediaQuery: string, onChange?: MediaQueryChange);
|
|
9
|
+
get matches(): boolean;
|
|
10
|
+
hostConnected(): void;
|
|
11
|
+
hostDisconnected(): void;
|
|
12
|
+
handleChange: () => void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
package/lib/src/common/fsm.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
declare type
|
|
1
|
+
declare type EventsFromTransitions<T> = {
|
|
2
2
|
[Prop in keyof T]: keyof T[Prop];
|
|
3
3
|
}[keyof T];
|
|
4
|
-
export declare function fsm<TTransitions extends Record<TStates, Partial<Record<TEvents, TStates>>>, TStates extends keyof TTransitions, TEvents extends
|
|
4
|
+
export declare function fsm<TTransitions extends Record<TStates, Partial<Record<TEvents, TStates>>>, TStates extends keyof TTransitions, TEvents extends EventsFromTransitions<TTransitions>>(config: TTransitions): {
|
|
5
5
|
transition(currentState: TStates, event: TEvents): TStates;
|
|
6
6
|
};
|
|
7
7
|
export declare type Machine = ReturnType<typeof fsm>;
|
|
8
8
|
export declare type States<T extends Machine | Machine["transition"]> = T extends Machine ? Parameters<T["transition"]>[0] : T extends Machine["transition"] ? Parameters<T>[0] : never;
|
|
9
|
+
export declare type Events<T extends Machine | Machine["transition"]> = T extends Machine ? Parameters<T["transition"]>[1] : T extends Machine["transition"] ? Parameters<T>[1] : never;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin wrapper around local storage which simplifies (de)serialization and default values.
|
|
3
|
+
* By default, (de)serializes as JSON.
|
|
4
|
+
*/
|
|
5
|
+
export declare function storage<T>(key: string, defaultValue: T, serialize?: (value: T) => string, deserialize?: (value: string) => T): {
|
|
6
|
+
value: T;
|
|
7
|
+
};
|
|
@@ -3,7 +3,7 @@ import { LitElement } from "lit";
|
|
|
3
3
|
* The header is a block of designated space for labelling the currently
|
|
4
4
|
* viewed context as well as providing primary actions.
|
|
5
5
|
*
|
|
6
|
-
* @status
|
|
6
|
+
* @status ready
|
|
7
7
|
* @category structure
|
|
8
8
|
* @slot - The header content.
|
|
9
9
|
* @slot end - Optional slot for buttons, toggles, etc.
|
package/lib/src/index.d.ts
CHANGED
|
@@ -32,3 +32,4 @@ export { default as DropdownItem } from "./dropdown-item/DropdownItem.js";
|
|
|
32
32
|
export { default as DropdownGroup } from "./dropdown-group/DropdownGroup.js";
|
|
33
33
|
export { registerTranslation, isTranslationRegistered } from "./localization/translation.js";
|
|
34
34
|
export type { Translation } from "./localization/translation.js";
|
|
35
|
+
export { default as Toggle } from "./toggle/Toggle.js";
|
|
@@ -1,18 +1,62 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
|
|
2
|
+
import { States } from "../common/fsm.js";
|
|
3
|
+
declare const navMachine: {
|
|
4
|
+
transition(currentState: "closed" | "opened" | "peek" | "unpeek" | "wait" | "blocked", event: "click" | "close" | "focusin" | "focusout" | "pointerenter" | "pointerleave" | "toggle" | "transitionend" | "open" | "timeout" | "dropdownOpen" | "dropdownClose"): "closed" | "opened" | "peek" | "unpeek" | "wait" | "blocked";
|
|
5
|
+
};
|
|
6
|
+
declare type NavState = States<typeof navMachine>;
|
|
3
7
|
/**
|
|
4
8
|
* Layout component is used to create the main layout of an app. Layout
|
|
5
9
|
* currently comes with one main configuration: two-column.
|
|
6
10
|
*
|
|
7
|
-
* @status
|
|
11
|
+
* @status ready
|
|
8
12
|
* @category structure
|
|
9
13
|
* @slot - The default main section content.
|
|
10
14
|
* @slot nav - Used to place content inside the navigation sidebar.
|
|
11
15
|
* @slot header - Used to place content inside the header section.
|
|
12
16
|
*/
|
|
13
|
-
export default class Layout extends
|
|
17
|
+
export default class Layout extends LitElement {
|
|
14
18
|
static styles: import("lit").CSSResult[];
|
|
19
|
+
private peekTimeoutId?;
|
|
20
|
+
private navToggleEl?;
|
|
21
|
+
private navEl;
|
|
22
|
+
private navWidth;
|
|
23
|
+
private isDragging;
|
|
24
|
+
private navState;
|
|
25
|
+
/**
|
|
26
|
+
* Controls whether the navigation is hidden off-screen or not.
|
|
27
|
+
* Defaults to `true` for wide viewports, and `false` otherwise.
|
|
28
|
+
*/
|
|
29
|
+
navOpen: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* ID reference of element used to toggle the navigation.
|
|
32
|
+
*/
|
|
33
|
+
navToggle?: string;
|
|
34
|
+
private lightDismiss;
|
|
35
|
+
private mq;
|
|
36
|
+
private direction;
|
|
37
|
+
disconnectedCallback(): void;
|
|
15
38
|
render(): import("lit-html").TemplateResult<1>;
|
|
39
|
+
protected getToggleElement(): void;
|
|
40
|
+
private cleanup;
|
|
41
|
+
protected handleNavWidthChange(): void;
|
|
42
|
+
protected handleNavStateChange(prev: NavState): void;
|
|
43
|
+
protected handleOpenChange(): void;
|
|
44
|
+
private navTransition;
|
|
45
|
+
private handleClick;
|
|
46
|
+
private handleDropdownOpen;
|
|
47
|
+
private handleDropdownClose;
|
|
48
|
+
private handleMediaQueryChange;
|
|
49
|
+
private handleToggleClick;
|
|
50
|
+
private handleNavFocus;
|
|
51
|
+
private handleMainFocus;
|
|
52
|
+
private handleMouseEnter;
|
|
53
|
+
private handleMouseLeave;
|
|
54
|
+
private handleTransitionEnd;
|
|
55
|
+
private handleKeyboardResize;
|
|
56
|
+
private setNavWidth;
|
|
57
|
+
private startDragging;
|
|
58
|
+
private stopDragging;
|
|
59
|
+
private handleDrag;
|
|
16
60
|
}
|
|
17
61
|
declare global {
|
|
18
62
|
interface HTMLElementTagNameMap {
|
|
@@ -12,3 +12,7 @@ import "../navigation/Navigation.js";
|
|
|
12
12
|
import "../select/Select.js";
|
|
13
13
|
import "../tooltip/Tooltip.js";
|
|
14
14
|
import "../banner/Banner.js";
|
|
15
|
+
import "../popout/Popout.js";
|
|
16
|
+
import "../dropdown/Dropdown.js";
|
|
17
|
+
import "../dropdown-group/DropdownGroup.js";
|
|
18
|
+
import "../dropdown-item/DropdownItem.js";
|
|
@@ -5,7 +5,7 @@ import "../icon/Icon.js";
|
|
|
5
5
|
* group and is used for grouping items into related categories.
|
|
6
6
|
*
|
|
7
7
|
* @category navigation
|
|
8
|
-
* @status
|
|
8
|
+
* @status ready
|
|
9
9
|
* @slot - The default slot used for the nav items.
|
|
10
10
|
*/
|
|
11
11
|
export default class NavGroup extends LitElement {
|
|
@@ -4,7 +4,7 @@ declare const NavItem_base: (new (...args: any[]) => import("../common/mixins/Fo
|
|
|
4
4
|
* Navigation item populates sidebar navigation with links.
|
|
5
5
|
* Every item should be placed inside a navigation group.
|
|
6
6
|
*
|
|
7
|
-
* @status
|
|
7
|
+
* @status ready
|
|
8
8
|
* @category navigation
|
|
9
9
|
* @slot - The default slot used for the nav item's text.
|
|
10
10
|
* @slot subnav - Used for nesting navigation. When used the nav-item becomes a button to collapse the subnav, rather than a link.
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
declare const Navigation_base: typeof LitElement;
|
|
3
2
|
/**
|
|
4
3
|
* Navigation is used to display the primary navigation in the sidebar
|
|
5
4
|
* of an application. Navigation includes a list of links that users
|
|
6
5
|
* use to move between sections of the application.
|
|
7
6
|
*
|
|
8
|
-
* @status
|
|
7
|
+
* @status ready
|
|
9
8
|
* @category navigation
|
|
10
9
|
* @slot - The main section of the sidebar, for holding nav components.
|
|
11
10
|
* @slot header - The top section of the sidebar.
|
|
12
11
|
* @slot footer - The bottom section of the sidebar.
|
|
13
12
|
*/
|
|
14
|
-
export default class Navigation extends
|
|
13
|
+
export default class Navigation extends LitElement {
|
|
15
14
|
static styles: import("lit").CSSResult;
|
|
16
15
|
render(): import("lit-html").TemplateResult<1>;
|
|
17
16
|
}
|
|
@@ -20,4 +19,3 @@ declare global {
|
|
|
20
19
|
"nord-navigation": Navigation;
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare const Toggle_base: (new (...args: any[]) => import("../common/mixins/FormAssociatedMixin.js").FormAssociatedMixinInterface) & (new (...args: any[]) => import("../common/mixins/InputMixin.js").InputMixinInterface) & (new (...args: any[]) => import("../common/mixins/FocusableMixin.js").FocusableMixinInterface) & typeof LitElement;
|
|
3
|
+
/**
|
|
4
|
+
* Toggle switch gives control over a feature or option that can be
|
|
5
|
+
* turned on or off. If a physical switch would work for the action, a
|
|
6
|
+
* toggle is probably the best component to use.
|
|
7
|
+
*
|
|
8
|
+
* @status draft
|
|
9
|
+
* @category form
|
|
10
|
+
* @slot label - Use when a label requires more than plain text.
|
|
11
|
+
* @slot hint - Optional slot that holds hint text for the input.
|
|
12
|
+
* @slot error - Optional slot that holds error text for the input.
|
|
13
|
+
*/
|
|
14
|
+
export default class Toggle extends Toggle_base {
|
|
15
|
+
static styles: import("lit").CSSResult[];
|
|
16
|
+
protected get formValue(): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Controls whether the toggle is checked or not.
|
|
19
|
+
*/
|
|
20
|
+
checked: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Controls whether the contents are displayed in reverse order,
|
|
23
|
+
* putting the label before the toggle.
|
|
24
|
+
*/
|
|
25
|
+
reverse: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The size of the toggle switch.
|
|
28
|
+
*/
|
|
29
|
+
size: "s" | "m" | "l";
|
|
30
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
31
|
+
protected handleChange(e: Event): void;
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface HTMLElementTagNameMap {
|
|
35
|
+
"nord-toggle": Toggle;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -11,7 +11,7 @@ import { LitElement } from "lit";
|
|
|
11
11
|
*/
|
|
12
12
|
export default class Tooltip extends LitElement {
|
|
13
13
|
static styles: import("lit").CSSResult[];
|
|
14
|
-
static lastOpened
|
|
14
|
+
private static lastOpened?;
|
|
15
15
|
private shortcutSlot;
|
|
16
16
|
private events;
|
|
17
17
|
private currentElement?;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordhealth/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "This package includes Nord Design System web components",
|
|
5
5
|
"author": "Nordhealth <support@nordhealth.design>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@floating-ui/dom": "0.4.4",
|
|
33
|
-
"@nordhealth/icons": "^1.3.
|
|
33
|
+
"@nordhealth/icons": "^1.3.8",
|
|
34
34
|
"lit": "2.2.2",
|
|
35
35
|
"tinykeys": "1.4.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@custom-elements-manifest/analyzer": "^0.5.5",
|
|
39
|
-
"@nordhealth/css": "^1.
|
|
40
|
-
"@nordhealth/fonts": "^2.0.
|
|
41
|
-
"@nordhealth/themes": "^
|
|
42
|
-
"@nordhealth/tokens": "^
|
|
39
|
+
"@nordhealth/css": "^1.2.1",
|
|
40
|
+
"@nordhealth/fonts": "^2.0.14",
|
|
41
|
+
"@nordhealth/themes": "^6.0.0",
|
|
42
|
+
"@nordhealth/tokens": "^5.0.0",
|
|
43
43
|
"@open-wc/eslint-config": "^7.0.0",
|
|
44
44
|
"@open-wc/testing": "3.1.3",
|
|
45
45
|
"@rollup/plugin-node-resolve": "13.2.1",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
}
|
|
169
169
|
]
|
|
170
170
|
},
|
|
171
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "ce78354459bd954ace8877f5fd1f1d4f10f511eb"
|
|
172
172
|
}
|
package/lib/Calendar-73a2fcfd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e,n as t}from"./query-assigned-elements-ef860822.js";import{r as a,s as n,$ as o}from"./lit-element-e382250e.js";import{e as i}from"./property-03f59dce.js";import{t as s}from"./state-70f38ceb.js";import{i as r}from"./query-2d22378e.js";import{c as l,r as d}from"./number-1c122a1e.js";import{o as c}from"./tinykeys.module-84e6cc41.js";import"./Button.js";import"./VisuallyHidden.js";import h from"./Icon.js";import{E as u}from"./EventController-d99ebeef.js";import{D as p}from"./DirectionController-8b298382.js";import{LocalizeController as v}from"./LocalizeController.js";import{i as m,p as f,a as g,s as y,e as b,b as x,g as w,c as D,d as z,f as k,h as F,j as M,k as S,l as Y}from"./dates-56f73760.js";import{o as $}from"./observe-a9c6dfb6.js";import{monthView as j}from"./month-view.js";import{DateSelectEvent as C}from"./DateSelectEvent.js";import{s as L}from"./Component-fa316972.js";var N=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M105 57.4 47.6 2.8a10.566 10.566 0 1 0-14.56 15.316l51.968 49.35a3.486 3.486 0 0 1 0 5.068l-51.968 49.35a10.502 10.502 0 0 0 14.462 15.232l57.638-54.74A17.584 17.584 0 0 0 105 57.4z"/></svg>',title:"arrow-right-small",tags:"nordicon arrow right small caret pointing triangle chevron"});var T=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M99.736 140a10.486 10.486 0 0 1-7.238-2.884L35 82.6a17.598 17.598 0 0 1-.14-24.976l57.638-54.74a10.502 10.502 0 1 1 14.462 15.232l-51.968 49.35a3.486 3.486 0 0 0 0 5.068l51.968 49.35A10.5 10.5 0 0 1 99.736 140z"/></svg>',title:"arrow-left-small",tags:"nordicon arrow left small caret pointing triangle chevron"});var O=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M70 110.236a17.332 17.332 0 0 1-12.306-5.096L2.884 47.502A10.502 10.502 0 1 1 18.116 33.04l49.35 51.968a3.486 3.486 0 0 0 5.068 0l49.35-51.968a10.502 10.502 0 1 1 15.232 14.462L82.6 105a17.766 17.766 0 0 1-12.6 5.236z"/></svg>',title:"arrow-down-small",tags:"nordicon arrow down small caret pointing triangle chevron"});const _=e=>e.preventDefault();class I{constructor(e,t){this.hadFirstUpdate=!1,this.initialTouchX=0,this.initialTouchY=0,this.handleTouchStart=e=>{const[{pageX:t,pageY:a}]=e.changedTouches;this.initialTouchX=t,this.initialTouchY=a},this.handleTouchEnd=e=>{const[{pageX:t,pageY:a}]=e.changedTouches,{matchesGesture:n,onSwipeEnd:o}=this.options,i=t-this.initialTouchX,s=a-this.initialTouchY,r={initialX:this.initialTouchX,initialY:this.initialTouchY,pageX:t,pageY:a,distX:i,distY:s};n(r)&&(e.preventDefault(),o(r))},e.addController(this),this.events=new u(e),this.options={target:()=>e,...t}}hostUpdated(){if(!this.hadFirstUpdate){this.hadFirstUpdate=!0;const e=this.options.target();this.events.listen(e,"touchstart",this.handleTouchStart),this.events.listen(e,"touchmove",_),this.events.listen(e,"touchend",this.handleTouchEnd)}}hostDisconnected(){this.hadFirstUpdate=!1}}const X=({distX:e,distY:t})=>Math.abs(e)>=70&&Math.abs(t)<=70,A=({distX:e,distY:t})=>Math.abs(t)>=70&&Math.abs(e)<=70&&t>0,E=a`:host{font-feature-settings:var(--n-font-features-reduced)}.n-calendar{-webkit-user-select:none;user-select:none;background:var(--n-color-surface);box-shadow:var(--n-calendar-box-shadow,var(--n-box-shadow-popout));border-radius:var(--n-border-radius-s);max-inline-size:310px;min-inline-size:290px;padding:var(--n-calendar-padding,16px 16px 20px)}:host([expand]) .n-calendar{max-inline-size:100%;inline-size:100%}@media (max-width:35.9375em){.n-calendar{max-inline-size:100%}}.n-calendar-table{border-collapse:collapse;border-spacing:0;color:var(--n-color-text);font-size:var(--n-font-size-m);font-weight:var(--n-font-weight);line-height:var(--n-date-picker-line-height);text-align:center;inline-size:100%}.n-calendar-table-header{font-size:var(--n-font-size-s);font-weight:var(--n-font-weight-active);letter-spacing:1px;line-height:var(--n-date-picker-line-height);padding-block-end:8px;text-decoration:none;text-transform:uppercase}.n-calendar-cell{text-align:center}.n-calendar-day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:0 0;border:0;border-radius:var(--n-border-radius-s);color:var(--n-color-text);cursor:pointer;display:inline-block;font-family:var(--n-font-family);font-size:var(--n-font-size-m);font-variant-numeric:tabular-nums;font-weight:var(--n-font-weight);block-size:36px;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;inline-size:36px;z-index:1}.n-calendar-day[aria-current=date]{box-shadow:0 0 0 1px var(--n-color-accent);color:var(--n-color-text-link);position:relative;z-index:200}.n-calendar-day:hover{background:var(--n-color-active)}.n-calendar-day:focus,.n-calendar-day[aria-pressed=true]{background:var(--n-color-accent);box-shadow:none;color:var(--n-color-text-on-accent);outline:0}.n-calendar-day:active{background:var(--n-color-accent);box-shadow:none!important;color:var(--n-color-text-on-accent);z-index:200}.n-calendar-day:focus{box-shadow:0 0 5px var(--n-color-accent);z-index:200}.n-calendar-day:not(.is-month){box-shadow:none}.n-calendar-day:not(.is-month),.n-calendar-day[aria-disabled=true]{background:0 0;color:var(--n-color-text-weakest);cursor:default}.n-calendar-day[aria-disabled=true]{color:var(--n-color-text-weaker);text-decoration:line-through}.n-calendar-day:not(.is-month)[aria-disabled=true]{color:var(--n-color-text-weakest);text-decoration:none}.n-calendar-day[aria-disabled=true][aria-current=date]{box-shadow:0 0 0 1px var(--n-color-accent);color:var(--n-color-text-link)}.n-calendar-day[aria-disabled=true][aria-current=date]:focus{box-shadow:0 0 5px var(--n-color-accent);background:var(--n-color-accent);color:var(--n-color-text-on-accent)}.n-calendar-day[aria-disabled=true]:not([aria-current=date])::before{display:none}.n-calendar-day.is-outside{background:0 0;box-shadow:none;color:var(--n-color-text-weakest);cursor:default;pointer-events:none}.n-calendar-day.is-outside::before{display:none}.n-calendar-header{align-items:start;display:flex;justify-content:space-between;margin-block-end:16px;inline-size:100%}.n-calendar-nav{white-space:nowrap}.n-calendar-nav nord-button{--n-button-padding-x:11px;margin-inline-start:calc(var(--n-space-s)/ 2)}.n-calendar-select{display:inline-flex;margin-block-start:4px;position:relative;line-height:var(--n-line-height)}.n-calendar-select span{margin-inline-end:var(--n-space-s)}.n-calendar-select select{cursor:pointer;font-size:var(--n-font-size-l);block-size:100%;inset-inline-start:0;opacity:0;position:absolute;inset-block-start:0;inline-size:100%;z-index:2}.n-calendar-select select:focus+.n-calendar-select-label{box-shadow:0 0 0 2px var(--n-color-accent)}.n-calendar-select-label{align-items:center;border-radius:var(--n-border-radius-s);color:var(--n-color-text);display:flex;font-size:var(--n-font-size-xl);font-weight:var(--n-font-weight-active);line-height:var(--n-date-picker-line-height);padding:0 4px 0 8px;pointer-events:none;position:relative;inline-size:100%;z-index:1;text-transform:capitalize}`;h.registerIcon(N),h.registerIcon(T),h.registerIcon(O);const W=e=>t=>{t.preventDefault(),e(t)},U=()=>!1;let B=class extends n{constructor(){super(...arguments),this.dialogLabelId="dialog-header",this.direction=new p(this),this.swipe=new I(this,{matchesGesture:X,onSwipeEnd:({distX:e})=>this.addMonths(e<0?1:-1)}),this.shortcuts=c({ArrowRight:W((()=>this.addDays(this.direction.isLTR?1:-1))),ArrowLeft:W((()=>this.addDays(this.direction.isLTR?-1:1))),ArrowDown:W((()=>this.addDays(7))),ArrowUp:W((()=>this.addDays(-7))),Home:W((()=>this.startOfWeek())),End:W((()=>this.endOfWeek())),PageUp:W((()=>this.addMonths(-1))),PageDown:W((()=>this.addMonths(1))),"Shift+PageUp":W((()=>this.addYears(-1))),"Shift+PageDown":W((()=>this.addYears(1)))}),this.localize=new v(this,{onLangChange:()=>this.handleLangChange()}),this.value="",this.firstDayOfWeek=1,this.min="",this.max="",this.expand=!1,this.isDateDisabled=U,this.activeFocus=!1,this.focusedDay=new Date,this.handleDaySelect=e=>{const t=m(e,f(this.min),f(this.max)),a=!this.isDateDisabled(e);t&&a&&(this.value=g(e),this.dispatchEvent(new C("change",e)))},this.handleMonthSelect=e=>{this.setMonth(parseInt(e.target.value,10))},this.handleYearSelect=e=>{this.setYear(parseInt(e.target.value,10))},this.handleNextMonthClick=e=>{e.preventDefault(),this.addMonths(1)},this.handlePreviousMonthClick=e=>{e.preventDefault(),this.addMonths(-1)},this.enableActiveFocus=()=>{this.activeFocus=!0},this.disableActiveFocus=()=>{this.activeFocus=!1}}focus(e){var t;const a=null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"day";"day"===a?this.focusedDayNode.focus():"month"===a&&this.monthSelectNode.focus()}render(){const e=f(this.value),t=this.focusedDay.getMonth(),a=this.focusedDay.getFullYear(),n=f(this.min),i=f(this.max),s=n?y(n):void 0,r=i?b(i):void 0,c=(e||this.focusedDay).getFullYear(),h=n?n.getFullYear():c-10,u=i?i.getFullYear():c+10;return o`<div class="n-calendar"><div class="n-calendar-header"><div><nord-visually-hidden><h2 id="${this.dialogLabelId}" aria-live="polite" aria-atomic="true">${this.monthNames[t]}, ${this.focusedDay.getFullYear()}</h2></nord-visually-hidden><div class="n-calendar-select"><select aria-label="${this.localize.term("monthSelectLabel")}" class="n-calendar-select-month" @input="${this.handleMonthSelect}">${this.monthNames.map(((e,n)=>o`<option value="${n}" ?selected="${n===t}" ?disabled="${!m(new Date(a,n,1),s,r)}">${e}</option>`))}</select><div class="n-calendar-select-label" aria-hidden="true"><span>${this.monthNamesShort[t]}</span><nord-icon color="var(--n-color-icon)" name="arrow-down-small" size="xs"></nord-icon></div></div><div class="n-calendar-select"><select aria-label="${this.localize.term("yearSelectLabel")}" class="n-calendar-select-year" @input="${this.handleYearSelect}">${l(d(h,u),(e=>e),(e=>o`<option ?selected="${e===a}">${e}</option>`))}</select><div class="n-calendar-select-label" aria-hidden="true"><span>${this.focusedDay.getFullYear()}</span><nord-icon color="var(--n-color-icon)" name="arrow-down-small" size="xs"></nord-icon></div></div></div><div class="n-calendar-nav"><nord-button class="n-calendar-prev" @click="${this.handlePreviousMonthClick}" ?disabled="${x(n,this.focusedDay)}" type="button"><nord-visually-hidden>${this.localize.term("prevMonthLabel")}</nord-visually-hidden><nord-icon color="var(--n-color-icon)" name="${this.direction.isLTR?"arrow-left-small":"arrow-right-small"}" size="s"></nord-icon></nord-button><nord-button class="n-calendar-next" @click="${this.handleNextMonthClick}" ?disabled="${x(i,this.focusedDay)}" type="button"><nord-visually-hidden>${this.localize.term("nextMonthLabel")}</nord-visually-hidden><nord-icon color="var(--n-color-icon)" name="${this.direction.isLTR?"arrow-right-small":"arrow-left-small"}" size="s"></nord-icon></nord-button></div></div>${j({onFocusOut:this.disableActiveFocus,onFocusIn:this.enableActiveFocus,dateFormatter:this.dateFormatShort,selectedDate:e,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.shortcuts,labelledById:this.dialogLabelId,dayNames:this.dayNames,dayNamesShort:this.dayNamesShort,firstDayOfWeek:this.firstDayOfWeek,min:n,max:i,isDateDisabled:this.isDateDisabled})}</div>`}handleValueChange(){this.setFocusedDay(f(this.value)||new Date)}handleFocusedDayChange(){this.activeFocus&&this.focusedDayNode.focus()}handleLangChange(){const e=this.localize.resolvedLang;this.dateFormatShort=new Intl.DateTimeFormat(e,{day:"numeric",month:"long"}),this.monthNames=w(e,"long"),this.monthNamesShort=w(e,"short"),this.dayNames=D(e,"long"),this.dayNamesShort=D(e,"narrow")}addDays(e){this.setFocusedDay(z(this.focusedDay,e))}addMonths(e){this.setMonth(this.focusedDay.getMonth()+e)}addYears(e){this.setYear(this.focusedDay.getFullYear()+e)}startOfWeek(){this.setFocusedDay(k(this.focusedDay,this.firstDayOfWeek))}endOfWeek(){this.setFocusedDay(F(this.focusedDay,this.firstDayOfWeek))}setMonth(e){const t=M(y(this.focusedDay),e),a=b(t),n=M(this.focusedDay,e);this.setFocusedDay(S(n,t,a))}setYear(e){const t=Y(y(this.focusedDay),e),a=b(t),n=Y(this.focusedDay,e);this.setFocusedDay(S(n,t,a))}setFocusedDay(e){this.focusedDay=S(e,f(this.min),f(this.max)),this.dispatchEvent(new C("nord-focus-date",this.focusedDay))}};B.styles=[L,E],e([r(".n-calendar-select-month",!0)],B.prototype,"monthSelectNode",void 0),e([r('button[tabindex="0"]')],B.prototype,"focusedDayNode",void 0),e([i()],B.prototype,"value",void 0),e([i({type:Number})],B.prototype,"firstDayOfWeek",void 0),e([i()],B.prototype,"min",void 0),e([i()],B.prototype,"max",void 0),e([i({reflect:!0,type:Boolean})],B.prototype,"expand",void 0),e([i({attribute:!1})],B.prototype,"isDateDisabled",void 0),e([s()],B.prototype,"activeFocus",void 0),e([s()],B.prototype,"focusedDay",void 0),e([$("value")],B.prototype,"handleValueChange",null),e([$("focusedDay","updated")],B.prototype,"handleFocusedDayChange",null),B=e([t("nord-calendar")],B);var P=B;export{P as C,I as S,A as i};
|
|
2
|
-
//# sourceMappingURL=Calendar-73a2fcfd.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function n(n){class e extends n{connectedCallback(){super.connectedCallback(),e._warningLogged||(console.warn(`NORD: %c${this.localName}%c should not be used in production, as it is in draft status.`,"font-weight:bold","font-weight:normal"),e._warningLogged=!0)}}return e._warningLogged=!1,e}export{n as D};
|
|
2
|
-
//# sourceMappingURL=DraftComponentMixin-9e4b7b34.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DraftComponentMixin-9e4b7b34.js","sources":["../src/common/mixins/DraftComponentMixin.ts"],"sourcesContent":["import { LitElement } from \"lit\"\n\ntype Constructable<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport function DraftComponentMixin<T extends Constructable<LitElement>>(superClass: T) {\n class DraftComponent extends superClass {\n private static _warningLogged = false\n\n connectedCallback() {\n super.connectedCallback()\n\n if (process.env.NODE_ENV !== \"development\" && !DraftComponent._warningLogged) {\n // eslint-disable-next-line no-console\n console.warn(\n `NORD: %c${this.localName}%c should not be used in production, as it is in draft status.`,\n \"font-weight:bold\",\n \"font-weight:normal\"\n )\n DraftComponent._warningLogged = true\n }\n }\n }\n\n return DraftComponent as T\n}\n"],"names":["DraftComponentMixin","superClass","DraftComponent","connectedCallback","super","_warningLogged","console","warn","this","localName"],"mappings":"AAIM,SAAUA,EAAyDC,GACvE,MAAMC,UAAuBD,EAG3BE,oBACEC,MAAMD,oBAEyCD,EAAeG,iBAE5DC,QAAQC,KACN,WAAWC,KAAKC,0EAChB,mBACA,sBAEFP,EAAeG,gBAAiB,IAKtC,OAjBiBH,EAAcG,gBAAG,EAiB3BH"}
|
package/lib/number-1c122a1e.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./lit-element-e382250e.js";import{e as t,i as s,t as r}from"./directive-de55b00a.js";import{a as n,c as o,u as l,m as i,s as u}from"./ref-adf41565.js";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2017 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/const f=(e,t,s)=>{const r=new Map;for(let n=t;n<=s;n++)r.set(e[n],n);return r},a=t(class extends s{constructor(e){if(super(e),e.type!==r.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,s){let r;void 0===s?s=t:void 0!==t&&(r=t);const n=[],o=[];let l=0;for(const t of e)n[l]=r?r(t,l):l,o[l]=s(t,l),l++;return{values:o,keys:n}}render(e,t,s){return this.dt(e,t,s).values}update(t,[s,r,a]){var c;const d=n(t),{values:h,keys:p}=this.dt(s,r,a);if(!Array.isArray(d))return this.ut=p,h;const v=null!==(c=this.ut)&&void 0!==c?c:this.ut=[],m=[];let y,x,g=0,j=d.length-1,w=0,b=h.length-1;for(;g<=j&&w<=b;)if(null===d[g])g++;else if(null===d[j])j--;else if(v[g]===p[w])m[w]=o(d[g],h[w]),g++,w++;else if(v[j]===p[b])m[b]=o(d[j],h[b]),j--,b--;else if(v[g]===p[b])m[b]=o(d[g],h[b]),l(t,m[b+1],d[g]),g++,b--;else if(v[j]===p[w])m[w]=o(d[j],h[w]),l(t,d[g],d[j]),j--,w++;else if(void 0===y&&(y=f(p,w,b),x=f(v,g,j)),y.has(v[g]))if(y.has(v[j])){const e=x.get(p[w]),s=void 0!==e?d[e]:null;if(null===s){const e=l(t,d[g]);o(e,h[w]),m[w]=e}else m[w]=o(s,h[w]),l(t,d[g],s),d[e]=null;w++}else i(d[j]),j--;else i(d[g]),g++;for(;w<=b;){const e=l(t,m[b+1]);o(e,h[w]),m[w++]=e}for(;g<=j;){const e=d[g++];null!==e&&i(e)}return this.ut=p,u(t,m),e}});function c(e,t,s){return e>s?t:e<t?s:e}function d(e,t){const s=[];for(let r=e;r<=t;r++)s.push(r);return s}export{a as c,d as r,c as w};
|
|
7
|
-
//# sourceMappingURL=number-1c122a1e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number-1c122a1e.js","sources":["../node_modules/lit-html/directives/repeat.js","../src/common/number.ts"],"sourcesContent":["import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){var d;const a=l(s),{values:p,keys:v}=this.dt(t,r,c);if(!Array.isArray(a))return this.ut=v,p;const h=null!==(d=this.ut)&&void 0!==d?d:this.ut=[],m=[];let y,x,j=0,k=a.length-1,w=0,A=p.length-1;for(;j<=k&&w<=A;)if(null===a[j])j++;else if(null===a[k])k--;else if(h[j]===v[w])m[w]=o(a[j],p[w]),j++,w++;else if(h[k]===v[A])m[A]=o(a[k],p[A]),k--,A--;else if(h[j]===v[A])m[A]=o(a[j],p[A]),i(s,m[A+1],a[j]),j++,A--;else if(h[k]===v[w])m[w]=o(a[k],p[w]),i(s,a[j],a[k]),k--,w++;else if(void 0===y&&(y=u(v,w,A),x=u(h,j,k)),y.has(h[j]))if(y.has(h[k])){const e=x.get(v[w]),t=void 0!==e?a[e]:null;if(null===t){const e=i(s,a[j]);o(e,p[w]),m[w]=e}else m[w]=o(t,p[w]),i(s,a[j],t),a[e]=null;w++}else n(a[k]),k--;else n(a[j]),j++;for(;w<=A;){const e=i(s,m[A+1]);o(e,p[w]),m[w++]=e}for(;j<=k;){const e=a[j++];null!==e&&n(e)}return this.ut=v,f(s,m),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","/**\n * Wraps a value so that it always falls within min/max,\n * where a value greater than max gets set to min, and vice versa\n */\nexport function wrap(val: number, min: number, max: number) {\n if (val > max) return min\n if (val < min) return max\n return val\n}\n\nexport function range(from: number, to: number) {\n const result: number[] = []\n\n for (let i = from; i <= to; i++) {\n result.push(i)\n }\n\n return result\n}\n"],"names":["u","e","s","t","r","Map","l","set","c","constructor","super","type","CHILD","Error","dt","o","i","values","keys","render","this","update","d","a","p","v","Array","isArray","ut","h","m","y","x","j","k","length","w","A","has","get","n","f","wrap","val","min","max","range","from","to","result","push"],"mappings":";;;;;GAMK,MAACA,EAAE,CAACC,EAAEC,EAAEC,KAAK,MAAMC,EAAE,IAAIC,IAAI,IAAI,IAAIC,EAAEJ,E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