@warp-ds/elements 2.9.0 → 2.9.1-next.2
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 +31 -0
- package/dist/docs/box/accessibility.md +29 -0
- package/dist/docs/box/api.md +16 -11
- package/dist/docs/box/box.md +189 -11
- package/dist/docs/box/examples.md +98 -0
- package/dist/docs/box/usage.md +47 -0
- package/dist/index.d.ts +40 -20
- package/dist/packages/box/box.d.ts +15 -14
- package/dist/packages/box/box.js +6 -6
- package/dist/packages/box/box.js.map +4 -4
- package/dist/packages/box/box.react.stories.d.ts +1 -1
- package/dist/packages/box/box.stories.d.ts +1 -0
- package/dist/packages/box/box.stories.js +12 -5
- package/dist/packages/checkbox/checkbox.js +3 -3
- package/dist/packages/checkbox/checkbox.js.map +2 -2
- package/dist/packages/checkbox/checkbox.test.js +20 -0
- package/dist/packages/datepicker/datepicker.js +6 -6
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/datepicker/datepicker.stories.js +8 -1
- package/dist/packages/datepicker/datepicker.test.js +23 -1
- package/dist/packages/radio/radio.js +2 -2
- package/dist/packages/radio/radio.js.map +2 -2
- package/dist/packages/radio/radio.test.js +21 -1
- package/dist/packages/radio-group/radio-group.js +5 -5
- package/dist/packages/radio-group/radio-group.js.map +2 -2
- package/dist/packages/select/select.js +10 -10
- package/dist/packages/select/select.js.map +3 -3
- package/dist/packages/select/select.stories.js +7 -5
- package/dist/packages/select/select.test.js +23 -2
- package/dist/packages/slider/slider.stories.js +6 -3
- package/dist/packages/slider-thumb/slider-thumb.js +16 -16
- package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
- package/dist/packages/textfield/textfield.js +9 -8
- package/dist/packages/textfield/textfield.js.map +3 -3
- package/dist/packages/textfield/textfield.test.js +17 -0
- package/dist/web-types.json +35 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -616,28 +616,38 @@ Use this with a parent element that has `position: relative`. Accepted values ar
|
|
|
616
616
|
};
|
|
617
617
|
|
|
618
618
|
export type WarpBoxProps = {
|
|
619
|
-
/**
|
|
619
|
+
/** Makes the box bleed to the container edge.
|
|
620
|
+
Extends the box into the horizontal gutter on narrow screens. Adds negative horizontal margins and square side corners below the small breakpoint, then restores the normal margins and rounded corners from the small breakpoint and up. */
|
|
620
621
|
bleed?: WarpBox["bleed"];
|
|
621
|
-
/**
|
|
622
|
+
/** Shows the box as a bordered surface.
|
|
623
|
+
Use this when the content needs a clear visual boundary from the surrounding page. */
|
|
622
624
|
bordered?: WarpBox["bordered"];
|
|
623
|
-
/**
|
|
625
|
+
/** Shows the box with information styling.
|
|
626
|
+
Use this for supporting informational content that should be visually separated from the surrounding page. */
|
|
624
627
|
info?: WarpBox["info"];
|
|
625
|
-
/**
|
|
628
|
+
/** Shows the box with neutral styling.
|
|
629
|
+
Use this for quiet grouped content that needs a background without strong emphasis. */
|
|
626
630
|
neutral?: WarpBox["neutral"];
|
|
627
|
-
/**
|
|
631
|
+
/** ARIA role for the box wrapper.
|
|
632
|
+
Defaults to a role of `region`. Set `role="none"` to override this behaviour for purely visual grouping, or set a specific role when the box has a clearer semantic purpose. */
|
|
628
633
|
role?: WarpBox["role"];
|
|
629
634
|
};
|
|
630
635
|
|
|
631
636
|
export type WarpBoxSolidJsProps = {
|
|
632
|
-
/**
|
|
637
|
+
/** Makes the box bleed to the container edge.
|
|
638
|
+
Extends the box into the horizontal gutter on narrow screens. Adds negative horizontal margins and square side corners below the small breakpoint, then restores the normal margins and rounded corners from the small breakpoint and up. */
|
|
633
639
|
"prop:bleed"?: WarpBox["bleed"];
|
|
634
|
-
/**
|
|
640
|
+
/** Shows the box as a bordered surface.
|
|
641
|
+
Use this when the content needs a clear visual boundary from the surrounding page. */
|
|
635
642
|
"prop:bordered"?: WarpBox["bordered"];
|
|
636
|
-
/**
|
|
643
|
+
/** Shows the box with information styling.
|
|
644
|
+
Use this for supporting informational content that should be visually separated from the surrounding page. */
|
|
637
645
|
"prop:info"?: WarpBox["info"];
|
|
638
|
-
/**
|
|
646
|
+
/** Shows the box with neutral styling.
|
|
647
|
+
Use this for quiet grouped content that needs a background without strong emphasis. */
|
|
639
648
|
"prop:neutral"?: WarpBox["neutral"];
|
|
640
|
-
/**
|
|
649
|
+
/** ARIA role for the box wrapper.
|
|
650
|
+
Defaults to a role of `region`. Set `role="none"` to override this behaviour for purely visual grouping, or set a specific role when the box has a clearer semantic purpose. */
|
|
641
651
|
"prop:role"?: WarpBox["role"];
|
|
642
652
|
|
|
643
653
|
/** Set the innerHTML of the element */
|
|
@@ -2156,11 +2166,16 @@ export type CustomElements = {
|
|
|
2156
2166
|
*
|
|
2157
2167
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2158
2168
|
*
|
|
2159
|
-
* - `bleed`:
|
|
2160
|
-
*
|
|
2161
|
-
* - `
|
|
2162
|
-
*
|
|
2163
|
-
* - `
|
|
2169
|
+
* - `bleed`: Makes the box bleed to the container edge.
|
|
2170
|
+
* Extends the box into the horizontal gutter on narrow screens. Adds negative horizontal margins and square side corners below the small breakpoint, then restores the normal margins and rounded corners from the small breakpoint and up.
|
|
2171
|
+
* - `bordered`: Shows the box as a bordered surface.
|
|
2172
|
+
* Use this when the content needs a clear visual boundary from the surrounding page.
|
|
2173
|
+
* - `info`: Shows the box with information styling.
|
|
2174
|
+
* Use this for supporting informational content that should be visually separated from the surrounding page.
|
|
2175
|
+
* - `neutral`: Shows the box with neutral styling.
|
|
2176
|
+
* Use this for quiet grouped content that needs a background without strong emphasis.
|
|
2177
|
+
* - `role`: ARIA role for the box wrapper.
|
|
2178
|
+
* Defaults to a role of `region`. Set `role="none"` to override this behaviour for purely visual grouping, or set a specific role when the box has a clearer semantic purpose.
|
|
2164
2179
|
*/
|
|
2165
2180
|
"w-box": Partial<WarpBoxProps & BaseProps<WarpBox> & BaseEvents>;
|
|
2166
2181
|
|
|
@@ -3194,11 +3209,16 @@ export type CustomElementsSolidJs = {
|
|
|
3194
3209
|
*
|
|
3195
3210
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
3196
3211
|
*
|
|
3197
|
-
* - `bleed`:
|
|
3198
|
-
*
|
|
3199
|
-
* - `
|
|
3200
|
-
*
|
|
3201
|
-
* - `
|
|
3212
|
+
* - `bleed`: Makes the box bleed to the container edge.
|
|
3213
|
+
* Extends the box into the horizontal gutter on narrow screens. Adds negative horizontal margins and square side corners below the small breakpoint, then restores the normal margins and rounded corners from the small breakpoint and up.
|
|
3214
|
+
* - `bordered`: Shows the box as a bordered surface.
|
|
3215
|
+
* Use this when the content needs a clear visual boundary from the surrounding page.
|
|
3216
|
+
* - `info`: Shows the box with information styling.
|
|
3217
|
+
* Use this for supporting informational content that should be visually separated from the surrounding page.
|
|
3218
|
+
* - `neutral`: Shows the box with neutral styling.
|
|
3219
|
+
* Use this for quiet grouped content that needs a background without strong emphasis.
|
|
3220
|
+
* - `role`: ARIA role for the box wrapper.
|
|
3221
|
+
* Defaults to a role of `region`. Set `role="none"` to override this behaviour for purely visual grouping, or set a specific role when the box has a clearer semantic purpose.
|
|
3202
3222
|
*/
|
|
3203
3223
|
"w-box": Partial<
|
|
3204
3224
|
WarpBoxProps & WarpBoxSolidJsProps & BaseProps<WarpBox> & BaseEvents
|
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import { LitElement,
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
declare const WarpBox_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
|
|
2
3
|
/**
|
|
3
4
|
* Box is a layout component used for separating content areas on a page.
|
|
4
5
|
*
|
|
5
6
|
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/layout-box--docs)
|
|
6
7
|
*/
|
|
7
|
-
declare class WarpBox extends
|
|
8
|
+
declare class WarpBox extends WarpBox_base {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* Makes the box bleed to the container edge.
|
|
11
|
+
* Extends the box into the horizontal gutter on narrow screens. Adds negative horizontal margins and square side corners below the small breakpoint, then restores the normal margins and rounded corners from the small breakpoint and up.
|
|
11
12
|
*/
|
|
12
13
|
bleed: boolean;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* Shows the box as a bordered surface.
|
|
16
|
+
* Use this when the content needs a clear visual boundary from the surrounding page.
|
|
16
17
|
*/
|
|
17
18
|
bordered: boolean;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
20
|
+
* Shows the box with information styling.
|
|
21
|
+
* Use this for supporting informational content that should be visually separated from the surrounding page.
|
|
21
22
|
*/
|
|
22
23
|
info: boolean;
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* Shows the box with neutral styling.
|
|
26
|
+
* Use this for quiet grouped content that needs a background without strong emphasis.
|
|
26
27
|
*/
|
|
27
28
|
neutral: boolean;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
30
|
+
* ARIA role for the box wrapper.
|
|
31
|
+
* Defaults to a role of `region`. Set `role="none"` to override this behaviour for purely visual grouping, or set a specific role when the box has a clearer semantic purpose.
|
|
31
32
|
*/
|
|
32
33
|
role: string;
|
|
33
34
|
static styles: import("lit").CSSResult[];
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
34
37
|
/** @internal */
|
|
35
38
|
get _class(): string;
|
|
36
|
-
/** @internal */
|
|
37
|
-
get _optOutRoleWithDefault(): string | typeof nothing;
|
|
38
39
|
render(): import("lit").TemplateResult<1>;
|
|
39
40
|
}
|
|
40
41
|
export { WarpBox };
|
package/dist/packages/box/box.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var f=(d,e,n,o)=>{for(var i=o>1?void 0:o?$(e,n):e,h=d.length-1,u;h>=0;h--)(u=d[h])&&(i=(o?u(e,n,i):u(i))||i);return o&&i&&O(e,n,i),i};var Z=function(){for(var d=[],e=arguments.length;e--;)d[e]=arguments[e];return d.reduce(function(n,o){return n.concat(typeof o=="string"?o:Array.isArray(o)?Z.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(i){return o[i]?i:""}):"")},[]).join(" ")};import{css as D,html as H,LitElement as J}from"lit";import{property as F}from"lit/decorators.js";var a=function(d,e,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?d!==e||!o:!e.has(d))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(d):o?o.value:e.get(d)},l=function(d,e,n,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?d!==e||!i:!e.has(d))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(d,n):i?i.value=n:e.set(d,n),n};function N(d){var e,n,o,i,h,u,m,R,x,Y,j,E,V,k,M,v,A,P,S;class q extends d{constructor(...r){var t,s,c;super(...r),e.add(this),this.internals=this.attachInternals(),n.set(this,!1),o.set(this,!1),i.set(this,!1),h.set(this,void 0),u.set(this,void 0),m.set(this,!0),x.set(this,""),Y.set(this,()=>{l(this,i,!0,"f"),l(this,n,!0,"f"),a(this,e,"m",v).call(this)}),j.set(this,()=>{l(this,n,!1,"f"),a(this,e,"m",A).call(this,this.shouldFormValueUpdate()?a(this,x,"f"):""),!this.validity.valid&&a(this,i,"f")&&l(this,o,!0,"f");let p=a(this,e,"m",v).call(this);this.validationMessageCallback&&this.validationMessageCallback(p?this.internals.validationMessage:"")}),E.set(this,()=>{var p;a(this,m,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),l(this,m,!1,"f")),l(this,i,!0,"f"),l(this,o,!0,"f"),a(this,e,"m",v).call(this),(p=this===null||this===void 0?void 0:this.validationMessageCallback)===null||p===void 0||p.call(this,this.showError?this.internals.validationMessage:"")}),V.set(this,void 0),k.set(this,!1),M.set(this,Promise.resolve()),(t=this.addEventListener)===null||t===void 0||t.call(this,"focus",a(this,Y,"f")),(s=this.addEventListener)===null||s===void 0||s.call(this,"blur",a(this,j,"f")),(c=this.addEventListener)===null||c===void 0||c.call(this,"invalid",a(this,E,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let r=this.validators.map(c=>c.attribute).flat(),t=super.observedAttributes||[];return[...new Set([...t,...r])]}static getValidator(r){return this.validators.find(t=>t.attribute===r)||null}static getValidators(r){return this.validators.filter(t=>{var s;if(t.attribute===r||!((s=t.attribute)===null||s===void 0)&&s.includes(r))return!0})}get form(){return this.internals.form}get showError(){return a(this,e,"m",v).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(r,t,s){var c;(c=super.attributeChangedCallback)===null||c===void 0||c.call(this,r,t,s);let z=this.constructor.getValidators(r);z!=null&&z.length&&this.validationTarget&&this.setValue(a(this,x,"f"))}setValue(r){var t;l(this,o,!1,"f"),(t=this.validationMessageCallback)===null||t===void 0||t.call(this,""),l(this,x,r,"f");let c=this.shouldFormValueUpdate()?r:null;this.internals.setFormValue(c),a(this,e,"m",A).call(this,c),this.valueChangedCallback&&this.valueChangedCallback(c),a(this,e,"m",v).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(r=>r(a(this,M,"f")))}formResetCallback(){var r,t;l(this,i,!1,"f"),l(this,o,!1,"f"),a(this,e,"m",v).call(this),(r=this.resetFormControl)===null||r===void 0||r.call(this),(t=this.validationMessageCallback)===null||t===void 0||t.call(this,a(this,e,"m",v).call(this)?this.validationMessage:"")}}return n=new WeakMap,o=new WeakMap,i=new WeakMap,h=new WeakMap,u=new WeakMap,m=new WeakMap,x=new WeakMap,Y=new WeakMap,j=new WeakMap,E=new WeakMap,V=new WeakMap,k=new WeakMap,M=new WeakMap,e=new WeakSet,R=function(){let r=this.getRootNode(),t=`${this.localName}[name="${this.getAttribute("name")}"]`;return r.querySelectorAll(t)},v=function(){if(this.hasAttribute("disabled"))return!1;let r=a(this,o,"f")||a(this,i,"f")&&!this.validity.valid&&!a(this,n,"f");return r&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),r},A=function(r){let t=this.constructor,s={},c=t.validators,p=[],z=c.some(b=>b.isValid instanceof Promise);a(this,k,"f")||(l(this,M,new Promise(b=>{l(this,V,b,"f")}),"f"),l(this,k,!0,"f")),a(this,h,"f")&&(a(this,h,"f").abort(),l(this,u,a(this,h,"f"),"f"));let _=new AbortController;l(this,h,_,"f");let C,W=!1;c.length&&(c.forEach(b=>{let T=b.key||"customError",w=b.isValid(this,r,_.signal);w instanceof Promise?(p.push(w),w.then(X=>{X!=null&&(s[T]=!X,C=a(this,e,"m",S).call(this,b,r),a(this,e,"m",P).call(this,s,C))})):(s[T]=!w,this.validity[T]!==!w&&(W=!0),!w&&!C&&(C=a(this,e,"m",S).call(this,b,r)))}),Promise.allSettled(p).then(()=>{var b;_!=null&&_.signal.aborted||(l(this,k,!1,"f"),(b=a(this,V,"f"))===null||b===void 0||b.call(this))}),(W||!z)&&a(this,e,"m",P).call(this,s,C))},P=function(r,t){if(this.validationTarget)this.internals.setValidity(r,t,this.validationTarget),l(this,m,!1,"f");else{if(this.internals.setValidity(r,t),this.internals.validity.valid)return;l(this,m,!0,"f")}},S=function(r,t){if(this.validityCallback){let s=this.validityCallback(r.key||"customError");if(s)return s}return r.message instanceof Function?r.message(this,t):r.message},q}import{css as U}from"lit";var L=U`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -271,7 +271,7 @@ var v=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var n=(i,o,a,r
|
|
|
271
271
|
svg {
|
|
272
272
|
pointer-events: none;
|
|
273
273
|
}
|
|
274
|
-
`,
|
|
274
|
+
`,or=U`*, :before, :after {
|
|
275
275
|
--w-rotate: 0;
|
|
276
276
|
--w-rotate-x: 0;
|
|
277
277
|
--w-rotate-y: 0;
|
|
@@ -2437,16 +2437,16 @@ var v=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var n=(i,o,a,r
|
|
|
2437
2437
|
display: none
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
`;import{css as
|
|
2441
|
-
<div
|
|
2440
|
+
`;import{css as I}from"lit";var G=I`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.border-2{border-width:2px}.rounded-8{border-radius:8px}.rounded-l-0{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-0{border-top-right-radius:0;border-bottom-right-radius:0}.block{display:block}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-info-subtle{background-color:var(--w-s-color-background-info-subtle)}.s-border{border-color:var(--w-s-color-border)}.s-surface-sunken{background-color:var(--w-s-color-surface-sunken)}.-mx-16{margin-left:-1.6rem;margin-right:-1.6rem}.last-child\\:mb-0>:last-child{margin-bottom:0}.p-16{padding:1.6rem}.break-words{overflow-wrap:break-word}@media (min-width:480px){.sm\\:rounded-8{border-radius:8px}.sm\\:mx-0{margin-left:0;margin-right:0}}`;var g=class extends N(J){constructor(){super(...arguments);this.bleed=!1;this.bordered=!1;this.info=!1;this.neutral=!1;this.role="region"}connectedCallback(){super.connectedCallback(),this.internals.role=this.role}updated(n){super.updated(n),n.has("role")&&(this.internals.role=this.role)}get _class(){return Z(["group block relative break-words last-child:mb-0 p-16 rounded-8",this.bleed&&"-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",this.info&&"s-bg-info-subtle",this.neutral&&"s-surface-sunken",this.bordered&&"border-2 s-border s-bg"])}render(){return H`
|
|
2441
|
+
<div class="${this._class}">
|
|
2442
2442
|
<slot></slot>
|
|
2443
2443
|
</div>
|
|
2444
|
-
`}};
|
|
2444
|
+
`}};g.styles=[L,G,D`
|
|
2445
2445
|
:host {
|
|
2446
2446
|
display: block;
|
|
2447
2447
|
}
|
|
2448
2448
|
::slotted(:last-child) {
|
|
2449
2449
|
margin-bottom: 0px !important;
|
|
2450
2450
|
}
|
|
2451
|
-
`],
|
|
2451
|
+
`],f([F({type:Boolean,reflect:!0})],g.prototype,"bleed",2),f([F({type:Boolean,reflect:!0})],g.prototype,"bordered",2),f([F({type:Boolean,reflect:!0})],g.prototype,"info",2),f([F({type:Boolean,reflect:!0})],g.prototype,"neutral",2),f([F({type:String,reflect:!0,useDefault:!0})],g.prototype,"role",2);customElements.get("w-box")||customElements.define("w-box",g);export{g as WarpBox};
|
|
2452
2452
|
//# sourceMappingURL=box.js.map
|