@warp-ds/elements 2.8.2-next.2 → 2.8.2-next.3
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/dist/custom-elements.json +166 -69
- package/dist/index.d.ts +63 -11
- package/dist/packages/affix/affix.hydration.test.d.ts +1 -0
- package/dist/packages/affix/affix.hydration.test.js +33 -0
- package/dist/packages/affix/affix.js +3 -3
- package/dist/packages/affix/affix.js.map +3 -3
- package/dist/packages/alert/alert.hydration.test.d.ts +1 -0
- package/dist/packages/alert/alert.hydration.test.js +47 -0
- package/dist/packages/alert/alert.js +5 -5
- package/dist/packages/alert/alert.js.map +3 -3
- package/dist/packages/attention/attention.hydration.test.d.ts +1 -0
- package/dist/packages/attention/attention.hydration.test.js +66 -0
- package/dist/packages/attention/attention.js +11 -11
- package/dist/packages/attention/attention.js.map +3 -3
- package/dist/packages/badge/badge.hydration.test.d.ts +1 -0
- package/dist/packages/badge/badge.hydration.test.js +50 -0
- package/dist/packages/box/box.hydration.test.d.ts +1 -0
- package/dist/packages/box/box.hydration.test.js +37 -0
- package/dist/packages/breadcrumbs/breadcrumbs.hydration.test.d.ts +1 -0
- package/dist/packages/breadcrumbs/breadcrumbs.hydration.test.js +141 -0
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +2 -2
- package/dist/packages/button/button.hydration.test.d.ts +1 -0
- package/dist/packages/button/button.hydration.test.js +43 -0
- package/dist/packages/button/button.js +3 -3
- package/dist/packages/button/button.js.map +3 -3
- package/dist/packages/button/button.react.stories.d.ts +1 -1
- package/dist/packages/card/card.hydration.test.d.ts +1 -0
- package/dist/packages/card/card.hydration.test.js +38 -0
- package/dist/packages/card/card.react.stories.d.ts +1 -1
- package/dist/packages/checkbox/checkbox.d.ts +17 -1
- package/dist/packages/checkbox/checkbox.hydration.test.d.ts +1 -0
- package/dist/packages/checkbox/checkbox.hydration.test.js +47 -0
- package/dist/packages/checkbox/checkbox.js +20 -19
- package/dist/packages/checkbox/checkbox.js.map +3 -3
- package/dist/packages/checkbox/styles.js +10 -9
- package/dist/packages/checkbox-group/checkbox-group.d.ts +7 -0
- package/dist/packages/checkbox-group/checkbox-group.hydration.test.d.ts +2 -0
- package/dist/packages/checkbox-group/checkbox-group.hydration.test.js +40 -0
- package/dist/packages/checkbox-group/checkbox-group.js +14 -14
- package/dist/packages/checkbox-group/checkbox-group.js.map +3 -3
- package/dist/packages/checkbox-group/checkbox-group.test.js +10 -0
- package/dist/packages/combobox/combobox.hydration.test.d.ts +1 -0
- package/dist/packages/combobox/combobox.hydration.test.js +43 -0
- package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
- package/dist/packages/datepicker/datepicker.hydration.test.d.ts +1 -0
- package/dist/packages/datepicker/datepicker.hydration.test.js +40 -0
- package/dist/packages/datepicker/datepicker.js +1 -1
- package/dist/packages/datepicker/datepicker.js.map +3 -3
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +1 -1
- package/dist/packages/expandable/expandable.hydration.test.d.ts +1 -0
- package/dist/packages/expandable/expandable.hydration.test.js +47 -0
- package/dist/packages/expandable/expandable.js +3 -3
- package/dist/packages/expandable/expandable.js.map +3 -3
- package/dist/packages/icon/icon.hydration.test.d.ts +1 -0
- package/dist/packages/icon/icon.hydration.test.js +47 -0
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +3 -3
- package/dist/packages/link/link.hydration.test.d.ts +1 -0
- package/dist/packages/link/link.hydration.test.js +54 -0
- package/dist/packages/modal/modal.hydration.test.d.ts +1 -0
- package/dist/packages/modal/modal.hydration.test.js +25 -0
- package/dist/packages/modal-header/modal-header.js +6 -6
- package/dist/packages/modal-header/modal-header.js.map +3 -3
- package/dist/packages/page-indicator/page-indicator.hydration.test.d.ts +1 -0
- package/dist/packages/page-indicator/page-indicator.hydration.test.js +41 -0
- package/dist/packages/pagination/pagination.hydration.test.d.ts +1 -0
- package/dist/packages/pagination/pagination.hydration.test.js +38 -0
- package/dist/packages/pagination/pagination.js +11 -11
- package/dist/packages/pagination/pagination.js.map +3 -3
- package/dist/packages/pill/pill.hydration.test.d.ts +1 -0
- package/dist/packages/pill/pill.hydration.test.js +32 -0
- package/dist/packages/pill/pill.js +1 -1
- package/dist/packages/pill/pill.js.map +3 -3
- package/dist/packages/radio/radio.d.ts +33 -1
- package/dist/packages/radio/radio.hydration.test.d.ts +1 -0
- package/dist/packages/radio/radio.hydration.test.js +29 -0
- package/dist/packages/radio/radio.js +7 -7
- package/dist/packages/radio/radio.js.map +3 -3
- package/dist/packages/radio/radio.test.js +15 -8
- package/dist/packages/radio-group/radio-group.a11y.test.js +4 -0
- package/dist/packages/radio-group/radio-group.hydration.test.d.ts +2 -0
- package/dist/packages/radio-group/radio-group.hydration.test.js +32 -0
- package/dist/packages/radio-group/radio-group.js +17 -17
- package/dist/packages/radio-group/radio-group.js.map +3 -3
- package/dist/packages/select/select.hydration.test.d.ts +1 -0
- package/dist/packages/select/select.hydration.test.js +37 -0
- package/dist/packages/select/select.js +1 -1
- package/dist/packages/select/select.js.map +3 -3
- package/dist/packages/select/select.react.stories.d.ts +1 -1
- package/dist/packages/slider/slider.hydration.test.d.ts +1 -0
- package/dist/packages/slider/slider.hydration.test.js +33 -0
- package/dist/packages/slider/slider.js +9 -9
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/slider.test.js +13 -0
- package/dist/packages/slider-thumb/slider-thumb.hydration.test.d.ts +1 -0
- package/dist/packages/slider-thumb/slider-thumb.hydration.test.js +35 -0
- package/dist/packages/slider-thumb/slider-thumb.js +16 -16
- package/dist/packages/slider-thumb/slider-thumb.js.map +3 -3
- package/dist/packages/step/step.hydration.test.d.ts +1 -0
- package/dist/packages/step/step.hydration.test.js +25 -0
- package/dist/packages/step/step.js +1 -1
- package/dist/packages/step/step.js.map +3 -3
- package/dist/packages/step-indicator/step-indicator.hydration.test.d.ts +1 -0
- package/dist/packages/step-indicator/step-indicator.hydration.test.js +25 -0
- package/dist/packages/switch/switch.a11y.test.js +13 -3
- package/dist/packages/switch/switch.d.ts +6 -0
- package/dist/packages/switch/switch.hydration.test.d.ts +1 -0
- package/dist/packages/switch/switch.hydration.test.js +54 -0
- package/dist/packages/switch/switch.js +7 -13
- package/dist/packages/switch/switch.js.map +2 -2
- package/dist/packages/tab/tab.d.ts +37 -2
- package/dist/packages/tab/tab.hydration.test.d.ts +1 -0
- package/dist/packages/tab/tab.hydration.test.js +25 -0
- package/dist/packages/tab/tab.js +22 -12
- package/dist/packages/tab/tab.js.map +3 -3
- package/dist/packages/tab-panel/tab-panel.d.ts +21 -0
- package/dist/packages/tab-panel/tab-panel.hydration.test.d.ts +1 -0
- package/dist/packages/tab-panel/tab-panel.hydration.test.js +21 -0
- package/dist/packages/tab-panel/tab-panel.js +16 -5
- package/dist/packages/tab-panel/tab-panel.js.map +3 -3
- package/dist/packages/tabs/tabs.a11y.test.js +45 -3
- package/dist/packages/tabs/tabs.hydration.test.d.ts +1 -0
- package/dist/packages/tabs/tabs.hydration.test.js +20 -0
- package/dist/packages/tabs/tabs.js +6 -6
- package/dist/packages/tabs/tabs.js.map +3 -3
- package/dist/packages/tabs/tabs.test.js +52 -4
- package/dist/packages/textarea/textarea.hydration.test.d.ts +1 -0
- package/dist/packages/textarea/textarea.hydration.test.js +43 -0
- package/dist/packages/textarea/textarea.react.stories.d.ts +1 -1
- package/dist/packages/textfield/textfield.hydration.test.d.ts +1 -0
- package/dist/packages/textfield/textfield.hydration.test.js +43 -0
- package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
- package/dist/packages/toast/toast.js +4 -4
- package/dist/packages/toast/toast.js.map +3 -3
- package/dist/setup-tests.d.ts +2 -1
- package/dist/setup-tests.js +4 -3
- package/dist/tests/react-hydration.d.ts +20 -0
- package/dist/tests/react-hydration.js +138 -0
- package/dist/web-types.json +59 -21
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { DatePicker } from './react';
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
render(args: Omit<React.HTMLAttributes<import("./datepicker").WarpDatepicker>, "
|
|
6
|
+
render(args: Omit<React.HTMLAttributes<import("./datepicker").WarpDatepicker>, "value" | "input" | "form" | "label" | "name" | "locale" | "onchange" | "onChange" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "updated" | "resetFormControl" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "month" | "calendar" | "wrapper" | "headerFormat" | "weekdayFormat" | "isDayDisabled" | "dayFormat" | "isCalendarOpen" | "navigationDate" | "selectedDate" | "weeks" | "toggleButton" | "previousMonthButton" | "todayCell" | "selectedCell"> & {
|
|
7
7
|
onChange?: (e: Event) => void;
|
|
8
8
|
onchange?: (e: Event) => void;
|
|
9
9
|
} & Partial<Omit<import("./datepicker").WarpDatepicker, keyof HTMLElement>> & React.RefAttributes<import("./datepicker").WarpDatepicker>): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './expandable.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, expect, test, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { setupHydrationWarningCapture, testHydration } from '../../tests/react-hydration';
|
|
3
|
+
import './expandable.js';
|
|
4
|
+
describe('w-expandable React SSR hydration', () => {
|
|
5
|
+
beforeEach(() => setupHydrationWarningCapture());
|
|
6
|
+
afterEach(() => {
|
|
7
|
+
window.__HYDRATION_WARNINGS__ = [];
|
|
8
|
+
});
|
|
9
|
+
test('default (no attributes) hydrates without warnings', async () => {
|
|
10
|
+
const warnings = await testHydration('w-expandable', {});
|
|
11
|
+
expect(warnings).toEqual([]);
|
|
12
|
+
});
|
|
13
|
+
test('with title hydrates without warnings', async () => {
|
|
14
|
+
const warnings = await testHydration('w-expandable', {
|
|
15
|
+
title: 'Show more',
|
|
16
|
+
});
|
|
17
|
+
expect(warnings).toEqual([]);
|
|
18
|
+
});
|
|
19
|
+
test('expanded state hydrates without warnings', async () => {
|
|
20
|
+
const warnings = await testHydration('w-expandable', {
|
|
21
|
+
title: 'Show more',
|
|
22
|
+
expanded: true,
|
|
23
|
+
});
|
|
24
|
+
expect(warnings).toEqual([]);
|
|
25
|
+
});
|
|
26
|
+
test('with box variant hydrates without warnings', async () => {
|
|
27
|
+
const warnings = await testHydration('w-expandable', {
|
|
28
|
+
title: 'Show more',
|
|
29
|
+
box: true,
|
|
30
|
+
});
|
|
31
|
+
expect(warnings).toEqual([]);
|
|
32
|
+
});
|
|
33
|
+
test('with bleed hydrates without warnings', async () => {
|
|
34
|
+
const warnings = await testHydration('w-expandable', {
|
|
35
|
+
title: 'Show more',
|
|
36
|
+
bleed: true,
|
|
37
|
+
});
|
|
38
|
+
expect(warnings).toEqual([]);
|
|
39
|
+
});
|
|
40
|
+
test('with animated hydrates without warnings', async () => {
|
|
41
|
+
const warnings = await testHydration('w-expandable', {
|
|
42
|
+
title: 'Show more',
|
|
43
|
+
animated: true,
|
|
44
|
+
});
|
|
45
|
+
expect(warnings).toEqual([]);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var X=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=e=>{throw TypeError(e)};var V=(e,r,o)=>r in e?X(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var n=(e,r,o,t)=>{for(var a=t>1?void 0:t?q(r,o):r,
|
|
1
|
+
var X=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=e=>{throw TypeError(e)};var V=(e,r,o)=>r in e?X(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var n=(e,r,o,t)=>{for(var a=t>1?void 0:t?q(r,o):r,c=e.length-1,u;c>=0;c--)(u=e[c])&&(a=(t?u(r,o,a):u(a))||a);return t&&a&&X(r,o,a),a};var g=(e,r,o)=>V(e,typeof r!="symbol"?r+"":r,o),G=(e,r,o)=>r.has(e)||_("Cannot "+o);var w=(e,r,o)=>(G(e,r,"read from private field"),o?o.call(e):r.get(e)),C=(e,r,o)=>r.has(e)?_("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,o);var b=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return e.reduce(function(o,t){return o.concat(typeof t=="string"?t:Array.isArray(t)?b.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};import{css as ve,html as p,LitElement as we}from"lit";import{property as d}from"lit/decorators.js";import{ifDefined as ge}from"lit/directives/if-defined.js";import{html as I,LitElement as J}from"lit";import{property as x,state as K}from"lit/decorators.js";import{classMap as Q}from"lit/directives/class-map.js";import{css as H}from"lit";var E=H`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
}
|
|
@@ -23,7 +23,7 @@ var X=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=e=>{thro
|
|
|
23
23
|
--w-icon-size: 32px;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
`;var k=new Map,W='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function ee(e,r={}){var t;let o=(t=r.responseParser)!=null?t:(a=>a.text());return k.has(e)||k.set(e,fetch(e).then(o)),k.get(e)}var v=class extends J{constructor(){super(...arguments);this.
|
|
26
|
+
`;var k=new Map,W='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function ee(e,r={}){var t;let o=(t=r.responseParser)!=null?t:(a=>a.text());return k.has(e)||k.set(e,fetch(e).then(o)),k.get(e)}var v=class extends J{constructor(){super(...arguments);this.svg=null}async fetchIcon(o){let a=`https://assets.finn.no/pkg/eikons/v1/${this.locale||"en"}/${o}.svg`;try{let c=await ee(a);return new DOMParser().parseFromString(c,"text/html").body.querySelector("svg")}catch(c){return null}}firstUpdated(){this.loadIcon()}updated(o){(o.has("name")||o.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let o=await this.fetchIcon(this.name);o||(o=new DOMParser().parseFromString(W,"text/html").body.firstElementChild),this.svg=o}render(){let o=this.size||"medium",t=this.name||"",a={"w-icon":!0,"w-icon--s":o==="small","w-icon--m":o==="medium","w-icon--l":o==="large"},c=typeof o=="string"&&o.endsWith("px")?`--w-icon-size: ${o};`:"";return I`<div class="${Q(a)}" style="${c}" part="w-${t.toLowerCase()}">${this.svg}</div>`}};v.styles=[E],n([x({type:String,reflect:!0})],v.prototype,"name",2),n([x({type:String,reflect:!0})],v.prototype,"size",2),n([x({type:String,reflect:!0})],v.prototype,"locale",2),n([K()],v.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",v);var y=typeof window!="undefined",Z=!0;if(y){let e=window.matchMedia("(prefers-reduced-motion: reduce)"),r=({matches:o})=>Z=!o;e.addEventListener&&e.addEventListener("change",r),r(e)}var $=e=>{e.style.transition=null,e.style.backfaceVisibility=null,e.style.overflow=null},L=e=>{let r=Z?"var(--f-expansion-duration, 0.3s)":"0.01s";e.style.transition=`height ${r}`,e.style.backfaceVisibility="hidden",e.style.overflow="hidden"},re=(e,r)=>()=>{e.style.height="auto",e.style.overflow=null,r&&r()},oe=e=>()=>{e&&e()},T=(e,r)=>{let o=(()=>{if(!r)return new Promise(c=>{r=c})})(),t=re(e,r);$(e),e.style.height="auto";let a=e.scrollHeight;if(y&&requestAnimationFrame(()=>{e.addEventListener("transitionend",t,{once:!0}),e.style.height="0px",e.style.transitionTimingFunction="ease-out",L(e),requestAnimationFrame(()=>e.style.height=a+"px")}),o)return o},M=(e,r)=>{let o=(()=>{if(!r)return new Promise(c=>{r=c})})(),t=oe(r);$(e);let a=e.scrollHeight;if(y&&requestAnimationFrame(()=>{e.addEventListener("transitionend",t,{once:!0}),e.style.height=a+"px",e.style.transitionTimingFunction="ease-in",L(e),requestAnimationFrame(()=>e.style.height="0px")}),o)return o};import{css as te,html as z,LitElement as ae}from"lit";import{ifDefined as ne}from"lit/directives/if-defined.js";var h=class extends ae{constructor(){super(),this.show=!1,this._mounted=!1,this._removeElement=!1}willUpdate(){this._mounted||(this._removeElement=!this.show),this.show&&this._removeElement&&(this._removeElement=!1)}updated(){if(this._wrapper){if(!this._mounted){this._mounted=!0;return}this.show&&T(this._wrapper),!this.show&&!this._removeElement&&M(this._wrapper,()=>this._removeElement=!0)}}get _wrapper(){return this!=null?this:null}render(){return z`<div aria-hidden=${ne(this.show?void 0:"true")}>${this._removeElement?z``:z`<slot></slot>`}</div>`}};g(h,"properties",{show:{type:Boolean,reflect:!0},_removeElement:{type:Boolean,state:!0}}),g(h,"styles",[te`
|
|
27
27
|
:host {
|
|
28
28
|
display: block;
|
|
29
29
|
}
|
|
@@ -2496,5 +2496,5 @@ var X=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=e=>{thro
|
|
|
2496
2496
|
::slotted(:last-child) {
|
|
2497
2497
|
margin-bottom: 0px !important;
|
|
2498
2498
|
}
|
|
2499
|
-
`],n([
|
|
2499
|
+
`],n([d({type:Boolean,reflect:!0})],s.prototype,"expanded",2),n([d({type:String})],s.prototype,"title",2),n([d({type:Boolean})],s.prototype,"box",2),n([d({type:Boolean})],s.prototype,"bleed",2),n([d({attribute:"button-class",type:String})],s.prototype,"buttonClass",2),n([d({attribute:"content-class",type:String})],s.prototype,"contentClass",2),n([d({attribute:"no-chevron",type:Boolean})],s.prototype,"noChevron",2),n([d({type:Boolean})],s.prototype,"animated",2),n([d({attribute:"heading-level",type:Number})],s.prototype,"headingLevel",2),n([d({type:Boolean,state:!0})],s.prototype,"_hasTitle",2),n([d({type:Boolean,state:!0})],s.prototype,"_showChevronUp",2);customElements.get("w-expandable")||customElements.define("w-expandable",s);export{s as WarpExpandable};
|
|
2500
2500
|
//# sourceMappingURL=expandable.js.map
|