@warp-ds/elements 1.2.0 → 1.2.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/README.md +27 -4
- package/dist/api.js +52 -1
- package/dist/api.js.map +2 -2
- package/dist/index.js +3353 -3813
- package/dist/index.js.map +7 -0
- package/dist/packages/affix/index.js +1748 -8
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/alert/index.js +1881 -9
- package/dist/packages/alert/index.js.map +4 -4
- package/dist/packages/attention/index.js +2364 -17
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/index.js +289 -2
- package/dist/packages/badge/index.js.map +4 -4
- package/dist/packages/box/index.js +279 -3
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/breadcrumbs/index.js +1703 -10
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/broadcast/index.js +93 -8
- package/dist/packages/broadcast/index.js.map +2 -2
- package/dist/packages/button/index.js +1778 -8
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/card/index.js +318 -9
- package/dist/packages/card/index.js.map +4 -4
- package/dist/packages/expandable/index.d.ts +0 -2
- package/dist/packages/expandable/index.js +1822 -55
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/select/index.js +1841 -19
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/textfield/index.js +378 -17
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/toast/index.js +2165 -23
- package/dist/packages/toast/index.js.map +4 -4
- package/package.json +23 -19
- package/dist/elements.min.js +0 -5
- package/dist/packages/expandable/locales/en/messages.d.mts +0 -1
- package/dist/packages/expandable/locales/fi/messages.d.mts +0 -1
- package/dist/packages/expandable/locales/nb/messages.d.mts +0 -1
|
@@ -1,25 +1,322 @@
|
|
|
1
|
-
var f=Object.defineProperty;var k=(n,l,c)=>l in n?f(n,l,{enumerable:!0,configurable:!0,writable:!0,value:c}):n[l]=c;var s=(n,l,c)=>(k(n,typeof l!="symbol"?l+"":l,c),c);import{html as p,css as S}from"lit";import x from"@warp-ds/elements-core";import{ifDefined as L}from"lit/directives/if-defined.js";var u={box:"group block relative break-words last-child:mb-0 p-16 rounded-8",bleed:"-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",info:"i-bg-$color-box-info-background i-text-$color-box-info-text",neutral:"i-bg-$color-box-neutral-background i-text-$color-box-neutral-text",bordered:"border-2 i-border-$color-box-bordered-border i-bg-$color-box-bordered-background i-text-$color-box-bordered-text",infoClickable:"hover:i-bg-$color-box-info-background-hover active:i-bg-$color-box-info-background-hover",neutralClickable:"hover:i-bg-$color-box-neutral-background-hover active:i-bg-$color-box-neutral-background-hover",borderedClickable:"hover:i-bg-$color-box-bordered-background-hover active:i-bg-$color-box-bordered-background-hover hover:i-border-$color-box-bordered-border-hover active:i-border-$color-box-bordered-border-hover"};var a={card:"cursor-pointer overflow-hidden relative transition-all",cardShadow:"rounded-8 i-shadow-$shadow-card hover:i-shadow-$shadow-card-hover hover:i-bg-$color-card-background-hover tap-highlight-transparent",cardFlat:"border-2 rounded-4",cardFlatUnselected:"i-bg-$color-card-flat-background i-border-$color-card-flat-border hover:i-bg-$color-card-flat-background-hover hover:i-border-$color-card-flat-border-hover active:i-bg-$color-card-flat-background-active active:i-border-$color-card-flat-border-active",cardFlatSelected:"i-border-$color-card-flat-border-selected i-bg-$color-card-flat-background-selected hover:i-bg-$color-card-flat-background-selected-hover hover:i-border-$color-card-flat-border-selected-hover active:i-border-$color-card-flat-border-active active:i-bg-$color-card-flat-background-active",cardSelected:"i-border-$color-card-border-selected i-bg-$color-card-background-selected hover:i-border-$color-card-border-selected-hover hover:i-bg-$color-card-background-selected-hover active:i-border-$color-card-border-selected-active",cardOutline:"active:i-border-$color-card-flat-border absolute rounded-8 inset-0 transition-all border-2",cardOutlineUnselected:"i-border-$color-card-border",cardOutlineSelected:"i-border-$color-card-border-selected hover:i-border-$color-card-border-selected-hover",a11y:"sr-only"};var y="focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block",B={expandable:"will-change-height",expandableTitle:"font-bold i-text-$color-expandable-title-text",expandableBox:"i-bg-$color-expandable-background hover:i-bg-$color-expandable-background-hover py-0 px-0 "+u.box,expandableBleed:u.bleed,chevron:"inline-block align-middle i-text-$color-expandable-icon",chevronNonBox:"relative left-8",chevronBox:"absolute right-16",chevronTransform:"transform transition-transform transform-gpu ease-in-out",chevronExpand:"-rotate-180",chevronCollapse:"rotate-180",expansion:"overflow-hidden",expansionNotExpanded:"h-0 invisible",button:y+" hover:underline focus:underline",buttonBox:"w-full text-left relative inline-flex items-center "+u.box,paddingTop:"pt-0",title:"flex justify-between items-center",titleType:"h4"},d="font-bold focusable justify-center transition-colors ease-in-out",i={primary:"i-text-$color-button-primary-text hover:i-text-$color-button-primary-text i-bg-$color-button-primary-background hover:i-bg-$color-button-primary-background-hover active:i-bg-$color-button-primary-background-active",secondary:"i-text-$color-button-secondary-text hover:i-text-$color-button-secondary-text i-border-$color-button-secondary-border i-bg-$color-button-secondary-background hover:i-bg-$color-button-secondary-background-hover hover:i-border-$color-button-secondary-border-hover active:i-bg-$color-button-secondary-background-active",utility:"i-text-$color-button-utility-text hover:i-text-$color-button-utility-text i-bg-$color-button-utility-background i-border-$color-button-utility-border hover:i-bg-$color-button-utility-background hover:i-border-$color-button-utility-border-hover active:i-border-$color-button-utility-border-active",destructive:"i-bg-$color-button-negative-background i-text-$color-button-negative-text hover:i-text-$color-button-negative-text hover:i-bg-$color-button-negative-background-hover active:i-bg-$color-button-negative-background-active",pill:"i-text-$color-button-pill-icon hover:i-text-$color-button-pill-icon-hover active:i-text-$color-button-pill-icon-active i-bg-$color-button-pill-background hover:i-bg-$color-button-pill-background-hover active:i-bg-$color-button-pill-background-active",disabled:"i-text-$color-button-disabled-text i-bg-$color-button-disabled-background",quiet:"i-bg-$color-button-quiet-background i-text-$color-button-quiet-text hover:i-bg-$color-button-quiet-background-hover active:i-bg-$color-button-quiet-background-active",utilityQuiet:"i-text-$color-button-utility-quiet-text i-bg-$color-button-utility-quiet-background hover:i-bg-$color-button-utility-quiet-background-hover",negativeQuiet:"i-bg-$color-button-negative-quiet-background i-text-$color-button-negative-quiet-text hover:i-bg-$color-button-negative-quiet-background-hover active:i-bg-$color-button-negative-quiet-background-active",loading:"i-text-$color-button-loading-text i-bg-$color-button-loading-background",link:"i-text-$color-button-link-text"},t={primary:`border-0 rounded-8 ${d}`,secondary:`border-2 rounded-8 ${d}`,utility:`border rounded-4 ${d}`,negative:`border-0 rounded-8 ${d}`,pill:`p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${d}`,link:`bg-transparent focusable ease-in-out inline active:underline hover:underline ${i.link}`},r={xsmall:"py-6 px-16",small:"py-8 px-16",medium:"py-10 px-14",large:"py-12 px-16",utility:"py-[11px] px-[15px]",smallUtility:"py-[7px] px-[15px]",pill:"min-h-[44px] min-w-[44px]",pillSmall:"min-h-32 min-w-32",link:"p-0"},o={medium:"text-m leading-[24]",xsmall:"text-xs"},e={inProgress:`border-transparent animate-inprogress pointer-events-none ${i.loading}`,quiet:`border-0 rounded-8 ${d}`,utilityQuiet:`border-0 rounded-4 ${d}`,negativeQuiet:`border-0 rounded-8 ${d}`,isDisabled:`font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${i.disabled}`},q={secondary:`${r.medium} ${o.medium} ${t.secondary} ${i.secondary}`,secondaryHref:`${r.medium} ${o.medium} ${t.secondary} ${i.secondary}`,secondaryDisabled:`${r.medium} ${o.medium} ${t.secondary} ${e.isDisabled}`,secondarySmall:`${o.xsmall} ${r.xsmall} ${t.secondary} ${i.secondary}`,secondarySmallDisabled:`${o.xsmall} ${r.xsmall} ${t.secondary} ${e.isDisabled}`,secondaryQuiet:`${r.medium} ${o.medium} ${e.quiet} ${i.quiet}`,secondaryQuietDisabled:`${r.medium} ${o.medium} ${e.quiet} ${e.isDisabled}`,secondarySmallQuiet:`${o.xsmall} ${r.xsmall} ${e.quiet} ${i.quiet}`,secondarySmallQuietDisabled:`${o.xsmall} ${r.xsmall} ${e.quiet} ${e.isDisabled}`,secondaryLoading:`${r.medium} ${o.medium} ${t.secondary} ${e.inProgress}`,secondarySmallLoading:`${o.xsmall} ${r.xsmall} ${t.secondary} ${e.inProgress}`,secondarySmallQuietLoading:`${o.xsmall} ${r.xsmall} ${e.quiet} ${e.inProgress}`,secondaryQuietLoading:`${r.medium} ${o.medium} ${e.quiet} ${e.inProgress}`,primary:`${r.large} ${o.medium} ${t.primary} ${i.primary}`,primaryDisabled:`${r.large} ${o.medium} ${e.isDisabled} ${t.primary}`,primarySmall:`${r.small} ${o.xsmall} ${t.primary} ${i.primary}`,primarySmallDisabled:`${r.small} ${o.xsmall} ${e.isDisabled} ${t.primary} `,primaryQuiet:`${r.large} ${o.medium} ${e.quiet} ${i.quiet}`,primaryQuietDisabled:`${r.large} ${o.medium} ${e.quiet} ${e.isDisabled}`,primarySmallQuiet:`${r.small} ${o.xsmall} ${e.quiet} ${i.quiet}`,primarySmallQuietDisabled:`${r.small} ${o.xsmall} ${e.quiet} ${e.isDisabled}`,primaryLoading:`${r.large} ${o.medium} ${e.inProgress} ${t.primary}`,primarySmallLoading:`${r.small} ${o.xsmall} ${e.inProgress} ${t.primary}`,primarySmallQuietLoading:`${r.small} ${o.xsmall} ${e.quiet} ${e.inProgress} ${t.primary}`,primaryQuietLoading:`${r.large} ${o.medium} ${e.quiet} ${e.inProgress}`,utility:`${r.utility} ${o.medium} ${t.utility} ${i.utility}`,utilityDisabled:`${r.utility} ${o.medium} ${t.utility} ${e.isDisabled}`,utilityQuiet:`${r.large} ${o.medium} ${e.utilityQuiet} ${i.utilityQuiet}`,utilityQuietDisabled:`${r.large} ${o.medium} ${e.utilityQuiet} ${e.isDisabled}`,utilitySmall:`${r.smallUtility} ${o.xsmall} ${t.utility} ${i.utility}`,utilitySmallDisabled:`${r.smallUtility} ${o.xsmall} ${t.utility} ${e.isDisabled}`,utilitySmallQuiet:`${r.smallUtility} ${o.xsmall} ${e.utilityQuiet} ${i.utilityQuiet}`,utilitySmallQuietDisabled:`${r.smallUtility} ${o.xsmall} ${e.utilityQuiet} ${e.isDisabled}`,utilityLoading:`${r.large} ${o.medium} ${t.utility} ${e.inProgress}`,utilitySmallLoading:`${r.smallUtility} ${o.xsmall} ${t.utility} ${e.inProgress}`,utilityQuietLoading:`${r.large} ${o.medium} ${e.inProgress} ${e.utilityQuiet}`,utilitySmallQuietLoading:`${r.smallUtility} ${o.xsmall} ${e.inProgress} ${e.utilityQuiet}`,negative:`${r.large} ${o.medium} ${t.negative} ${i.destructive}`,negativeDisabled:`${r.large} ${o.medium} ${t.negative} ${e.isDisabled}`,negativeQuiet:`${r.large} ${o.medium} ${e.negativeQuiet} ${i.negativeQuiet}`,negativeQuietDisabled:`${r.large} ${o.medium} ${e.negativeQuiet}${e.isDisabled}`,negativeSmall:`${r.small} ${o.xsmall} ${t.negative} ${i.destructive}`,negativeSmallDisabled:`${r.small} ${o.xsmall} ${t.negative} ${e.isDisabled}`,negativeSmallQuiet:`${r.small} ${o.xsmall} ${e.negativeQuiet} ${i.negativeQuiet}`,negativeSmallQuietDisabled:`${r.small} ${o.xsmall} ${e.negativeQuiet} ${e.isDisabled}`,negativeLoading:`${r.large} ${o.medium} ${t.negative} ${e.inProgress}`,negativeSmallLoading:`${r.small} ${o.xsmall} ${e.inProgress} ${t.negative}`,negativeQuietLoading:`${r.large} ${o.medium} ${e.negativeQuiet} ${t.negative} ${e.inProgress}`,negativeSmallQuietLoading:`${r.small} ${o.xsmall} ${e.negativeQuiet} ${e.inProgress}`,pill:`${r.pill} ${o.medium} ${t.pill} ${i.pill}`,pillSmall:`${r.pillSmall} ${o.xsmall} ${t.pill} ${i.pill}`,pillLoading:`${r.pill} ${o.medium} ${t.pill} ${e.inProgress}`,pillSmallLoading:`${r.pillSmall} ${o.xsmall} ${t.pill} ${e.inProgress}`,link:`${r.link} ${o.medium} ${t.link}`,linkSmall:`${r.link} ${o.xsmall} ${t.link}`,linkAsButton:"inline-block hover:no-underline text-center",a11y:"sr-only",fullWidth:"w-full max-w-full",contentWidth:"max-w-max"};var T={transparentBg:'before:i-bg-$color-modal-backdrop-background before:content-[""] before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:opacity-25',backdrop:"fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-20 [--w-modal-max-height:80%] [--w-modal-width:640px]",modal:"pb-safe-[32] i-shadow-$shadow-modal max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 i-bg-$color-modal-background flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",content:"block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",footer:"flex justify-end shrink-0 px-16 sm:px-32",transitionTitle:"transition-all duration-300",transitionTitleCenter:"justify-self-center",transitionTitleColSpan:"col-span-2",title:"-mt-4 sm:-mt-8 h-40 sm:h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-center px-16 sm:px-32 border-b sm:border-b-0 shrink-0",titleText:"mb-0 h4 sm:h3",titleButton:`${o.medium} ${t.pill} ${i.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,titleButtonLeft:"-ml-8 sm:-ml-12 justify-self-start",titleButtonRight:"-mr-8 sm:-mr-12 justify-self-end",titleButtonIcon:"h-16 w-16 sm:h-24 sm:w-24",titleButtonIconRotated:"transform rotate-90"};var w={label:"antialiased block relative text-s font-bold pb-4 cursor-pointer i-text-$color-label-text",labelInvalid:"i-text-$color-label-text-negative",optional:"pl-8 font-normal text-s i-text-$color-label-optional-text"};var $="absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ",C={wrapper:$+"right-0",wrapperWithLabel:"w-max pr-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"},P={wrapper:$+"left-0",wrapperWithLabel:"w-max pl-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"};var j={toggle:"absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",label:`px-12 ${w.label} py-8! cursor-pointer focusable focusable-inset`,buttonOrLink:"bg-transparent focusable",buttonOrLinkStretch:"inset-0 absolute"};var z={base:"border-2 relative flex items-start",tooltip:"i-bg-$color-tooltip-background i-border-$color-tooltip-background i-shadow-$shadow-tooltip i-text-$color-tooltip-text rounded-4 py-6 px-8",callout:"i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8",highlight:"i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8 drop-shadow-m",popover:"i-bg-$color-popover-background i-border-$color-popover-background i-text-$color-popover-paragraph-text rounded-8 p-16 drop-shadow-m",arrowBase:"absolute h-[14px] w-[14px] border-2 border-b-0 border-r-0 rounded-tl-4 transform",arrowDirectionLeft:"-left-[8px]",arrowDirectionRight:"-right-[8px]",arrowDirectionBottom:"-bottom-[8px]",arrowDirectionTop:"-top-[8px]",arrowTooltip:"i-bg-$color-tooltip-background i-border-$color-tooltip-background",arrowCallout:"i-bg-$color-callout-background i-border-$color-callout-border",arrowPopover:"i-bg-$color-popover-background i-border-$color-popover-background",arrowHighlight:"i-bg-$color-callout-background i-border-$color-callout-border",content:"last-child:mb-0",notCallout:"absolute z-50",closeBtn:`${o.medium} ${t.pill} ${i.pill} justify-self-end -mr-8 ml-8`};import{classMap as D}from"lit/directives/class-map.js";function g(n){let l={};for(let[c,m]of Object.entries(n))for(let v of c.split(" "))l[v]=m;return D(l)}var h={ENTER:"Enter",SPACE:" "},b=class extends x{constructor(){super(),this.selected=!1,this.flat=!1,this.clickable=!1}get _outerClasses(){return g({[a.card]:!0,[a.cardShadow]:!this.flat,[a.cardSelected]:this.selected,[a.cardFlat]:this.flat,[this.selected?a.cardFlatSelected:a.cardFlatUnselected]:this.flat})}get _innerClasses(){return g({[a.cardOutline]:!0,[this.selected?a.cardOutlineSelected:a.cardOutlineUnselected]:!0})}get uuButton(){return p`<button
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// packages/card/index.js
|
|
9
|
+
import { html, css } from "lit";
|
|
10
|
+
import WarpElement from "@warp-ds/elements-core";
|
|
11
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
12
|
+
|
|
13
|
+
// node_modules/.pnpm/@warp-ds+css@1.4.2/node_modules/@warp-ds/css/component-classes/index.js
|
|
14
|
+
var box = {
|
|
15
|
+
box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
16
|
+
// Relative here enables w-clickable
|
|
17
|
+
bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
|
|
18
|
+
// We target L and R to override the default rounded-8
|
|
19
|
+
info: "i-bg-$color-box-info-background i-text-$color-box-info-text",
|
|
20
|
+
neutral: "i-bg-$color-box-neutral-background i-text-$color-box-neutral-text",
|
|
21
|
+
bordered: "border-2 i-border-$color-box-bordered-border i-bg-$color-box-bordered-background i-text-$color-box-bordered-text",
|
|
22
|
+
infoClickable: "hover:i-bg-$color-box-info-background-hover active:i-bg-$color-box-info-background-hover",
|
|
23
|
+
neutralClickable: "hover:i-bg-$color-box-neutral-background-hover active:i-bg-$color-box-neutral-background-hover",
|
|
24
|
+
borderedClickable: "hover:i-bg-$color-box-bordered-background-hover active:i-bg-$color-box-bordered-background-hover hover:i-border-$color-box-bordered-border-hover active:i-border-$color-box-bordered-border-hover"
|
|
25
|
+
};
|
|
26
|
+
var card = {
|
|
27
|
+
card: "cursor-pointer overflow-hidden relative transition-all",
|
|
28
|
+
cardShadow: "rounded-8 i-shadow-$shadow-card hover:i-shadow-$shadow-card-hover hover:i-bg-$color-card-background-hover tap-highlight-transparent",
|
|
29
|
+
cardFlat: "border-2 rounded-4",
|
|
30
|
+
cardFlatUnselected: "i-bg-$color-card-flat-background i-border-$color-card-flat-border hover:i-bg-$color-card-flat-background-hover hover:i-border-$color-card-flat-border-hover active:i-bg-$color-card-flat-background-active active:i-border-$color-card-flat-border-active",
|
|
31
|
+
cardFlatSelected: "i-border-$color-card-flat-border-selected i-bg-$color-card-flat-background-selected hover:i-bg-$color-card-flat-background-selected-hover hover:i-border-$color-card-flat-border-selected-hover active:i-border-$color-card-flat-border-active active:i-bg-$color-card-flat-background-active",
|
|
32
|
+
cardSelected: "i-border-$color-card-border-selected i-bg-$color-card-background-selected hover:i-border-$color-card-border-selected-hover hover:i-bg-$color-card-background-selected-hover active:i-border-$color-card-border-selected-active",
|
|
33
|
+
cardOutline: "active:i-border-$color-card-flat-border absolute rounded-8 inset-0 transition-all border-2",
|
|
34
|
+
cardOutlineUnselected: "i-border-$color-card-border",
|
|
35
|
+
cardOutlineSelected: "i-border-$color-card-border-selected hover:i-border-$color-card-border-selected-hover",
|
|
36
|
+
a11y: "sr-only"
|
|
37
|
+
};
|
|
38
|
+
var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
|
|
39
|
+
var expandable = {
|
|
40
|
+
expandable: "will-change-height",
|
|
41
|
+
expandableTitle: "font-bold i-text-$color-expandable-title-text",
|
|
42
|
+
expandableBox: "i-bg-$color-expandable-background hover:i-bg-$color-expandable-background-hover py-0 px-0 " + box.box,
|
|
43
|
+
expandableBleed: box.bleed,
|
|
44
|
+
chevron: "inline-block align-middle i-text-$color-expandable-icon",
|
|
45
|
+
chevronNonBox: "ml-8",
|
|
46
|
+
chevronBox: "",
|
|
47
|
+
chevronTransform: "transform transition-transform transform-gpu ease-in-out",
|
|
48
|
+
chevronExpand: "-rotate-180",
|
|
49
|
+
chevronCollapse: "rotate-180",
|
|
50
|
+
elementsTransformChevronDownPart: "part-[w-icon-chevron-down-16-part]:transform part-[w-icon-chevron-down-16-part]:transition-transform part-[w-icon-chevron-down-16-part]:transform-gpu part-[w-icon-chevron-down-16-part]:ease-in-out",
|
|
51
|
+
elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
|
|
52
|
+
elementsTransformChevronUpPart: "part-[w-icon-chevron-up-16-part]:transform part-[w-icon-chevron-up-16-part]:transition-transform part-[w-icon-chevron-up-16-part]:transform-gpu part-[w-icon-chevron-up-16-part]:ease-in-out",
|
|
53
|
+
elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
|
|
54
|
+
expansion: "overflow-hidden",
|
|
55
|
+
expansionNotExpanded: "h-0 invisible",
|
|
56
|
+
button: buttonReset + " hover:underline focus-visible:underline",
|
|
57
|
+
buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
|
|
58
|
+
paddingTop: "pt-0",
|
|
59
|
+
title: "flex w-full justify-between items-center",
|
|
60
|
+
titleType: "h4"
|
|
61
|
+
};
|
|
62
|
+
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
63
|
+
var buttonColors = {
|
|
64
|
+
primary: "i-text-$color-button-primary-text hover:i-text-$color-button-primary-text i-bg-$color-button-primary-background hover:i-bg-$color-button-primary-background-hover active:i-bg-$color-button-primary-background-active",
|
|
65
|
+
secondary: "i-text-$color-button-secondary-text hover:i-text-$color-button-secondary-text i-border-$color-button-secondary-border i-bg-$color-button-secondary-background hover:i-bg-$color-button-secondary-background-hover hover:i-border-$color-button-secondary-border-hover active:i-bg-$color-button-secondary-background-active",
|
|
66
|
+
utility: "i-text-$color-button-utility-text hover:i-text-$color-button-utility-text i-bg-$color-button-utility-background i-border-$color-button-utility-border hover:i-bg-$color-button-utility-background hover:i-border-$color-button-utility-border-hover active:i-border-$color-button-utility-border-active",
|
|
67
|
+
destructive: "i-bg-$color-button-negative-background i-text-$color-button-negative-text hover:i-text-$color-button-negative-text hover:i-bg-$color-button-negative-background-hover active:i-bg-$color-button-negative-background-active",
|
|
68
|
+
pill: "i-text-$color-button-pill-icon hover:i-text-$color-button-pill-icon-hover active:i-text-$color-button-pill-icon-active i-bg-$color-button-pill-background hover:i-bg-$color-button-pill-background-hover active:i-bg-$color-button-pill-background-active",
|
|
69
|
+
disabled: "i-text-$color-button-disabled-text i-bg-$color-button-disabled-background",
|
|
70
|
+
quiet: "i-bg-$color-button-quiet-background i-text-$color-button-quiet-text hover:i-bg-$color-button-quiet-background-hover active:i-bg-$color-button-quiet-background-active",
|
|
71
|
+
utilityQuiet: "i-text-$color-button-utility-quiet-text i-bg-$color-button-utility-quiet-background hover:i-bg-$color-button-utility-quiet-background-hover",
|
|
72
|
+
negativeQuiet: "i-bg-$color-button-negative-quiet-background i-text-$color-button-negative-quiet-text hover:i-bg-$color-button-negative-quiet-background-hover active:i-bg-$color-button-negative-quiet-background-active",
|
|
73
|
+
loading: "i-text-$color-button-loading-text i-bg-$color-button-loading-background",
|
|
74
|
+
link: "i-text-$color-button-link-text"
|
|
75
|
+
};
|
|
76
|
+
var buttonTypes = {
|
|
77
|
+
primary: `border-0 rounded-8 ${buttonDefaultStyling}`,
|
|
78
|
+
secondary: `border-2 rounded-8 ${buttonDefaultStyling}`,
|
|
79
|
+
utility: `border rounded-4 ${buttonDefaultStyling}`,
|
|
80
|
+
negative: `border-0 rounded-8 ${buttonDefaultStyling}`,
|
|
81
|
+
pill: `p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${buttonDefaultStyling}`,
|
|
82
|
+
link: `bg-transparent focusable ease-in-out inline active:underline hover:underline ${buttonColors.link}`
|
|
83
|
+
};
|
|
84
|
+
var buttonSizes = {
|
|
85
|
+
xsmall: "py-6 px-16",
|
|
86
|
+
small: "py-8 px-16",
|
|
87
|
+
medium: "py-10 px-14",
|
|
88
|
+
large: "py-12 px-16",
|
|
89
|
+
utility: "py-[11px] px-[15px]",
|
|
90
|
+
smallUtility: "py-[7px] px-[15px]",
|
|
91
|
+
pill: "min-h-[44px] min-w-[44px]",
|
|
92
|
+
pillSmall: "min-h-32 min-w-32",
|
|
93
|
+
link: "p-0"
|
|
94
|
+
};
|
|
95
|
+
var buttonTextSizes = {
|
|
96
|
+
medium: "text-m leading-[24]",
|
|
97
|
+
xsmall: "text-xs"
|
|
98
|
+
};
|
|
99
|
+
var buttonVariants = {
|
|
100
|
+
inProgress: `border-transparent animate-inprogress pointer-events-none ${buttonColors.loading}`,
|
|
101
|
+
// .button--in-progress, a.button--in-progress:visited
|
|
102
|
+
quiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
|
|
103
|
+
utilityQuiet: `border-0 rounded-4 ${buttonDefaultStyling}`,
|
|
104
|
+
negativeQuiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
|
|
105
|
+
isDisabled: `font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${buttonColors.disabled}`
|
|
106
|
+
// .button:disabled, .button--is-disabled
|
|
107
|
+
};
|
|
108
|
+
var button = {
|
|
109
|
+
// Buttontypes
|
|
110
|
+
secondary: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
|
|
111
|
+
// .button--secondary, .button--default, .button
|
|
112
|
+
secondaryHref: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
|
|
113
|
+
secondaryDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
|
|
114
|
+
secondarySmall: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonColors.secondary}`,
|
|
115
|
+
secondarySmallDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
|
|
116
|
+
secondaryQuiet: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
|
|
117
|
+
secondaryQuietDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
|
|
118
|
+
secondarySmallQuiet: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
|
|
119
|
+
secondarySmallQuietDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
|
|
120
|
+
secondaryLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
|
|
121
|
+
secondarySmallLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
|
|
122
|
+
secondarySmallQuietLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
|
|
123
|
+
secondaryQuietLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
|
|
124
|
+
primary: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.primary} ${buttonColors.primary}`,
|
|
125
|
+
// .button--primary, .button--cta
|
|
126
|
+
primaryDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.isDisabled} ${buttonTypes.primary}`,
|
|
127
|
+
primarySmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.primary} ${buttonColors.primary}`,
|
|
128
|
+
primarySmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.isDisabled} ${buttonTypes.primary} `,
|
|
129
|
+
primaryQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
|
|
130
|
+
primaryQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
|
|
131
|
+
primarySmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
|
|
132
|
+
primarySmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
|
|
133
|
+
primaryLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
|
|
134
|
+
primarySmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
|
|
135
|
+
primarySmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
|
|
136
|
+
primaryQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
|
|
137
|
+
utility: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonColors.utility}`,
|
|
138
|
+
// .button--utility
|
|
139
|
+
utilityDisabled: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
|
|
140
|
+
utilityQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
|
|
141
|
+
// .button--utility-flat
|
|
142
|
+
utilityQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
|
|
143
|
+
utilitySmall: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonColors.utility}`,
|
|
144
|
+
utilitySmallDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
|
|
145
|
+
utilitySmallQuiet: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
|
|
146
|
+
utilitySmallQuietDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
|
|
147
|
+
utilityLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
|
|
148
|
+
utilitySmallLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
|
|
149
|
+
utilityQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
|
|
150
|
+
utilitySmallQuietLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
|
|
151
|
+
negative: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonColors.destructive}`,
|
|
152
|
+
// .button--destructive
|
|
153
|
+
negativeDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
|
|
154
|
+
negativeQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
|
|
155
|
+
// .button--destructive-flat
|
|
156
|
+
negativeQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet}${buttonVariants.isDisabled}`,
|
|
157
|
+
negativeSmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonColors.destructive}`,
|
|
158
|
+
negativeSmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
|
|
159
|
+
negativeSmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
|
|
160
|
+
negativeSmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.isDisabled}`,
|
|
161
|
+
negativeLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
|
|
162
|
+
negativeSmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.negative}`,
|
|
163
|
+
negativeQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
|
|
164
|
+
negativeSmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.inProgress}`,
|
|
165
|
+
pill: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill}`,
|
|
166
|
+
// .button--pill
|
|
167
|
+
pillSmall: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonColors.pill}`,
|
|
168
|
+
pillLoading: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
|
|
169
|
+
pillSmallLoading: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
|
|
170
|
+
link: `${buttonSizes.link} ${buttonTextSizes.medium} ${buttonTypes.link}`,
|
|
171
|
+
linkSmall: `${buttonSizes.link} ${buttonTextSizes.xsmall} ${buttonTypes.link}`,
|
|
172
|
+
linkAsButton: "inline-block hover:no-underline text-center",
|
|
173
|
+
a11y: "sr-only",
|
|
174
|
+
fullWidth: "w-full max-w-full",
|
|
175
|
+
contentWidth: "max-w-max"
|
|
176
|
+
};
|
|
177
|
+
var modal = {
|
|
178
|
+
//TODO: this class can be removed when we have the solution for opacity and we can add rgba values to the background of the backdrop
|
|
179
|
+
transparentBg: `before:i-bg-$color-modal-backdrop-background before:content-[""] before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:opacity-25`,
|
|
180
|
+
backdrop: "fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-30 [--w-modal-max-height:80%] [--w-modal-width:640px]",
|
|
181
|
+
modal: "pb-safe-[32] i-shadow-$shadow-modal max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 i-bg-$color-modal-background flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",
|
|
182
|
+
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
183
|
+
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
184
|
+
transitionTitle: "transition-all duration-300",
|
|
185
|
+
transitionTitleCenter: "justify-self-center",
|
|
186
|
+
transitionTitleColSpan: "col-span-2",
|
|
187
|
+
title: "-mt-4 sm:-mt-8 h-40 sm:h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-center px-16 sm:px-32 border-b sm:border-b-0 shrink-0",
|
|
188
|
+
titleText: "mb-0 h4 sm:h3",
|
|
189
|
+
titleButton: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,
|
|
190
|
+
titleButtonLeft: "-ml-8 sm:-ml-12 justify-self-start",
|
|
191
|
+
titleButtonRight: "-mr-8 sm:-mr-12 justify-self-end",
|
|
192
|
+
titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
|
|
193
|
+
titleButtonIconRotated: "transform rotate-90"
|
|
194
|
+
};
|
|
195
|
+
var label = {
|
|
196
|
+
label: "antialiased block relative text-s font-bold pb-4 cursor-pointer i-text-$color-label-text",
|
|
197
|
+
labelInvalid: "i-text-$color-label-text-negative",
|
|
198
|
+
optional: "pl-8 font-normal text-s i-text-$color-label-optional-text"
|
|
199
|
+
};
|
|
200
|
+
var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
201
|
+
var suffix = {
|
|
202
|
+
wrapper: prefixSuffixWrapperBase + "right-0",
|
|
203
|
+
wrapperWithLabel: "w-max pr-12",
|
|
204
|
+
wrapperWithIcon: "w-40",
|
|
205
|
+
label: "antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"
|
|
206
|
+
};
|
|
207
|
+
var prefix = {
|
|
208
|
+
wrapper: prefixSuffixWrapperBase + "left-0",
|
|
209
|
+
wrapperWithLabel: "w-max pl-12",
|
|
210
|
+
wrapperWithIcon: "w-40",
|
|
211
|
+
label: "antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"
|
|
212
|
+
};
|
|
213
|
+
var clickable = {
|
|
214
|
+
toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
|
|
215
|
+
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
216
|
+
buttonOrLink: "bg-transparent focusable",
|
|
217
|
+
buttonOrLinkStretch: "inset-0 absolute"
|
|
218
|
+
};
|
|
219
|
+
var attention = {
|
|
220
|
+
base: "border-2 relative flex items-start",
|
|
221
|
+
tooltip: "i-bg-$color-tooltip-background i-border-$color-tooltip-background i-shadow-$shadow-tooltip i-text-$color-tooltip-text rounded-4 py-6 px-8",
|
|
222
|
+
callout: "i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8",
|
|
223
|
+
highlight: "i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8 drop-shadow-m",
|
|
224
|
+
popover: "i-bg-$color-popover-background i-border-$color-popover-background i-text-$color-popover-paragraph-text rounded-8 p-16 drop-shadow-m",
|
|
225
|
+
arrowBase: "absolute h-[14px] w-[14px] border-2 border-b-0 border-r-0 rounded-tl-4 transform",
|
|
226
|
+
arrowDirectionLeft: "-left-[8px]",
|
|
227
|
+
arrowDirectionRight: "-right-[8px]",
|
|
228
|
+
arrowDirectionBottom: "-bottom-[8px]",
|
|
229
|
+
arrowDirectionTop: "-top-[8px]",
|
|
230
|
+
arrowTooltip: "i-bg-$color-tooltip-background i-border-$color-tooltip-background",
|
|
231
|
+
arrowCallout: "i-bg-$color-callout-background i-border-$color-callout-border",
|
|
232
|
+
arrowPopover: "i-bg-$color-popover-background i-border-$color-popover-background",
|
|
233
|
+
arrowHighlight: "i-bg-$color-callout-background i-border-$color-callout-border",
|
|
234
|
+
content: "last-child:mb-0",
|
|
235
|
+
notCallout: "absolute z-50",
|
|
236
|
+
closeBtn: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} justify-self-end -mr-8 ml-8`
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// packages/utils/index.js
|
|
240
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
241
|
+
function fclasses(definition) {
|
|
242
|
+
const defn = {};
|
|
243
|
+
for (const [key, value] of Object.entries(definition)) {
|
|
244
|
+
for (const className of key.split(" ")) {
|
|
245
|
+
defn[className] = value;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return classMap(defn);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// packages/card/index.js
|
|
252
|
+
var keys = {
|
|
253
|
+
ENTER: "Enter",
|
|
254
|
+
SPACE: " "
|
|
255
|
+
};
|
|
256
|
+
var WarpCard = class extends WarpElement {
|
|
257
|
+
constructor() {
|
|
258
|
+
super();
|
|
259
|
+
this.selected = false;
|
|
260
|
+
this.flat = false;
|
|
261
|
+
this.clickable = false;
|
|
262
|
+
}
|
|
263
|
+
get _outerClasses() {
|
|
264
|
+
return fclasses({
|
|
265
|
+
[card.card]: true,
|
|
266
|
+
[card.cardShadow]: !this.flat,
|
|
267
|
+
[card.cardSelected]: this.selected,
|
|
268
|
+
[card.cardFlat]: this.flat,
|
|
269
|
+
[this.selected ? card.cardFlatSelected : card.cardFlatUnselected]: this.flat
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
get _innerClasses() {
|
|
273
|
+
return fclasses({
|
|
274
|
+
[card.cardOutline]: true,
|
|
275
|
+
[this.selected ? card.cardOutlineSelected : card.cardOutlineUnselected]: true
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
get uuButton() {
|
|
279
|
+
return html`<button
|
|
280
|
+
class="${card.a11y}"
|
|
3
281
|
aria-pressed="${this.selected}"
|
|
4
282
|
tabindex="-1"
|
|
5
283
|
>
|
|
6
284
|
Velg
|
|
7
|
-
</button
|
|
285
|
+
</button>`;
|
|
286
|
+
}
|
|
287
|
+
get uuSpan() {
|
|
288
|
+
return html`<span
|
|
8
289
|
role="checkbox"
|
|
9
290
|
aria-checked="true"
|
|
10
291
|
aria-disabled="true"
|
|
11
|
-
></span
|
|
292
|
+
></span>`;
|
|
293
|
+
}
|
|
294
|
+
keypressed(e) {
|
|
295
|
+
if (!this.clickable || e.altKey || e.ctrlKey)
|
|
296
|
+
return;
|
|
297
|
+
if (e.key === keys.ENTER || e.key === keys.SPACE) {
|
|
298
|
+
e.preventDefault();
|
|
299
|
+
this.click();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
render() {
|
|
303
|
+
return html`
|
|
12
304
|
<div
|
|
13
|
-
tabindex=${
|
|
305
|
+
tabindex=${ifDefined(this.clickable ? "0" : void 0)}
|
|
14
306
|
class="${this._outerClasses}"
|
|
15
307
|
@keydown=${this.keypressed}
|
|
16
308
|
>
|
|
17
|
-
${this.clickable?this.uuButton:""}
|
|
18
|
-
${!this.clickable&&this.selected?this.uuSpan:""}
|
|
309
|
+
${this.clickable ? this.uuButton : ""}
|
|
310
|
+
${!this.clickable && this.selected ? this.uuSpan : ""}
|
|
19
311
|
<div class="${this._innerClasses}"></div>
|
|
20
312
|
<slot></slot>
|
|
21
313
|
</div>
|
|
22
|
-
|
|
314
|
+
`;
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
__publicField(WarpCard, "styles", [
|
|
318
|
+
WarpElement.styles,
|
|
319
|
+
css`
|
|
23
320
|
a::after {
|
|
24
321
|
content: "";
|
|
25
322
|
position: absolute;
|
|
@@ -31,5 +328,17 @@ var f=Object.defineProperty;var k=(n,l,c)=>l in n?f(n,l,{enumerable:!0,configura
|
|
|
31
328
|
:host {
|
|
32
329
|
display: block;
|
|
33
330
|
}
|
|
34
|
-
`
|
|
331
|
+
`
|
|
332
|
+
]);
|
|
333
|
+
__publicField(WarpCard, "properties", {
|
|
334
|
+
selected: { type: Boolean, reflect: true },
|
|
335
|
+
flat: { type: Boolean },
|
|
336
|
+
clickable: { type: Boolean }
|
|
337
|
+
});
|
|
338
|
+
if (!customElements.get("w-card")) {
|
|
339
|
+
customElements.define("w-card", WarpCard);
|
|
340
|
+
}
|
|
341
|
+
export {
|
|
342
|
+
WarpCard
|
|
343
|
+
};
|
|
35
344
|
//# sourceMappingURL=index.js.map
|