@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.
Files changed (37) hide show
  1. package/README.md +27 -4
  2. package/dist/api.js +52 -1
  3. package/dist/api.js.map +2 -2
  4. package/dist/index.js +3353 -3813
  5. package/dist/index.js.map +7 -0
  6. package/dist/packages/affix/index.js +1748 -8
  7. package/dist/packages/affix/index.js.map +4 -4
  8. package/dist/packages/alert/index.js +1881 -9
  9. package/dist/packages/alert/index.js.map +4 -4
  10. package/dist/packages/attention/index.js +2364 -17
  11. package/dist/packages/attention/index.js.map +4 -4
  12. package/dist/packages/badge/index.js +289 -2
  13. package/dist/packages/badge/index.js.map +4 -4
  14. package/dist/packages/box/index.js +279 -3
  15. package/dist/packages/box/index.js.map +4 -4
  16. package/dist/packages/breadcrumbs/index.js +1703 -10
  17. package/dist/packages/breadcrumbs/index.js.map +4 -4
  18. package/dist/packages/broadcast/index.js +93 -8
  19. package/dist/packages/broadcast/index.js.map +2 -2
  20. package/dist/packages/button/index.js +1778 -8
  21. package/dist/packages/button/index.js.map +4 -4
  22. package/dist/packages/card/index.js +318 -9
  23. package/dist/packages/card/index.js.map +4 -4
  24. package/dist/packages/expandable/index.d.ts +0 -2
  25. package/dist/packages/expandable/index.js +1822 -55
  26. package/dist/packages/expandable/index.js.map +4 -4
  27. package/dist/packages/select/index.js +1841 -19
  28. package/dist/packages/select/index.js.map +4 -4
  29. package/dist/packages/textfield/index.js +378 -17
  30. package/dist/packages/textfield/index.js.map +4 -4
  31. package/dist/packages/toast/index.js +2165 -23
  32. package/dist/packages/toast/index.js.map +4 -4
  33. package/package.json +23 -19
  34. package/dist/elements.min.js +0 -5
  35. package/dist/packages/expandable/locales/en/messages.d.mts +0 -1
  36. package/dist/packages/expandable/locales/fi/messages.d.mts +0 -1
  37. package/dist/packages/expandable/locales/nb/messages.d.mts +0 -1
@@ -1,13 +1,289 @@
1
- var m=Object.defineProperty;var h=(n,l,c)=>l in n?m(n,l,{enumerable:!0,configurable:!0,writable:!0,value:c}):n[l]=c;var s=(n,l,c)=>(h(n,typeof l!="symbol"?l+"":l,c),c);import{css as y,html as w,nothing as D}from"lit";import p from"@warp-ds/elements-core";import{classMap as v}from"lit/directives/class-map.js";function u(n){let l={};for(let[c,$]of Object.entries(n))for(let x of c.split(" "))l[x]=$;return v(l)}var a={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 f="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 "+a.box,expandableBleed:a.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:f+" hover:underline focus:underline",buttonBox:"w-full text-left relative inline-flex items-center "+a.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 k={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 g="absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ",P={wrapper:g+"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"},C={wrapper:g+"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 ${k.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`};var b=class extends p{get _class(){return u({[a.box]:!0,[a.bleed]:this.bleed,[a.info]:this.info,[a.neutral]:this.neutral,[a.bordered]:this.bordered})}get _optOutRoleWithDefault(){var l;return this.role===""?D:(l=this.role)!=null?l:"region"}render(){return w`
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/box/index.js
9
+ import { css, html, nothing } from "lit";
10
+ import WarpElement from "@warp-ds/elements-core";
11
+
12
+ // packages/utils/index.js
13
+ import { classMap } from "lit/directives/class-map.js";
14
+ function fclasses(definition) {
15
+ const defn = {};
16
+ for (const [key, value] of Object.entries(definition)) {
17
+ for (const className of key.split(" ")) {
18
+ defn[className] = value;
19
+ }
20
+ }
21
+ return classMap(defn);
22
+ }
23
+
24
+ // node_modules/.pnpm/@warp-ds+css@1.4.2/node_modules/@warp-ds/css/component-classes/index.js
25
+ var box = {
26
+ box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
27
+ // Relative here enables w-clickable
28
+ bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
29
+ // We target L and R to override the default rounded-8
30
+ info: "i-bg-$color-box-info-background i-text-$color-box-info-text",
31
+ neutral: "i-bg-$color-box-neutral-background i-text-$color-box-neutral-text",
32
+ bordered: "border-2 i-border-$color-box-bordered-border i-bg-$color-box-bordered-background i-text-$color-box-bordered-text",
33
+ infoClickable: "hover:i-bg-$color-box-info-background-hover active:i-bg-$color-box-info-background-hover",
34
+ neutralClickable: "hover:i-bg-$color-box-neutral-background-hover active:i-bg-$color-box-neutral-background-hover",
35
+ 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"
36
+ };
37
+ var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
38
+ var expandable = {
39
+ expandable: "will-change-height",
40
+ expandableTitle: "font-bold i-text-$color-expandable-title-text",
41
+ expandableBox: "i-bg-$color-expandable-background hover:i-bg-$color-expandable-background-hover py-0 px-0 " + box.box,
42
+ expandableBleed: box.bleed,
43
+ chevron: "inline-block align-middle i-text-$color-expandable-icon",
44
+ chevronNonBox: "ml-8",
45
+ chevronBox: "",
46
+ chevronTransform: "transform transition-transform transform-gpu ease-in-out",
47
+ chevronExpand: "-rotate-180",
48
+ chevronCollapse: "rotate-180",
49
+ 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",
50
+ elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
51
+ 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",
52
+ elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
53
+ expansion: "overflow-hidden",
54
+ expansionNotExpanded: "h-0 invisible",
55
+ button: buttonReset + " hover:underline focus-visible:underline",
56
+ buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
57
+ paddingTop: "pt-0",
58
+ title: "flex w-full justify-between items-center",
59
+ titleType: "h4"
60
+ };
61
+ var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
62
+ var buttonColors = {
63
+ 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",
64
+ 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",
65
+ 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",
66
+ 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",
67
+ 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",
68
+ disabled: "i-text-$color-button-disabled-text i-bg-$color-button-disabled-background",
69
+ 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",
70
+ utilityQuiet: "i-text-$color-button-utility-quiet-text i-bg-$color-button-utility-quiet-background hover:i-bg-$color-button-utility-quiet-background-hover",
71
+ 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",
72
+ loading: "i-text-$color-button-loading-text i-bg-$color-button-loading-background",
73
+ link: "i-text-$color-button-link-text"
74
+ };
75
+ var buttonTypes = {
76
+ primary: `border-0 rounded-8 ${buttonDefaultStyling}`,
77
+ secondary: `border-2 rounded-8 ${buttonDefaultStyling}`,
78
+ utility: `border rounded-4 ${buttonDefaultStyling}`,
79
+ negative: `border-0 rounded-8 ${buttonDefaultStyling}`,
80
+ pill: `p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${buttonDefaultStyling}`,
81
+ link: `bg-transparent focusable ease-in-out inline active:underline hover:underline ${buttonColors.link}`
82
+ };
83
+ var buttonSizes = {
84
+ xsmall: "py-6 px-16",
85
+ small: "py-8 px-16",
86
+ medium: "py-10 px-14",
87
+ large: "py-12 px-16",
88
+ utility: "py-[11px] px-[15px]",
89
+ smallUtility: "py-[7px] px-[15px]",
90
+ pill: "min-h-[44px] min-w-[44px]",
91
+ pillSmall: "min-h-32 min-w-32",
92
+ link: "p-0"
93
+ };
94
+ var buttonTextSizes = {
95
+ medium: "text-m leading-[24]",
96
+ xsmall: "text-xs"
97
+ };
98
+ var buttonVariants = {
99
+ inProgress: `border-transparent animate-inprogress pointer-events-none ${buttonColors.loading}`,
100
+ // .button--in-progress, a.button--in-progress:visited
101
+ quiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
102
+ utilityQuiet: `border-0 rounded-4 ${buttonDefaultStyling}`,
103
+ negativeQuiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
104
+ isDisabled: `font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${buttonColors.disabled}`
105
+ // .button:disabled, .button--is-disabled
106
+ };
107
+ var button = {
108
+ // Buttontypes
109
+ secondary: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
110
+ // .button--secondary, .button--default, .button
111
+ secondaryHref: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
112
+ secondaryDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
113
+ secondarySmall: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonColors.secondary}`,
114
+ secondarySmallDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
115
+ secondaryQuiet: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
116
+ secondaryQuietDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
117
+ secondarySmallQuiet: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
118
+ secondarySmallQuietDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
119
+ secondaryLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
120
+ secondarySmallLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
121
+ secondarySmallQuietLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
122
+ secondaryQuietLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
123
+ primary: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.primary} ${buttonColors.primary}`,
124
+ // .button--primary, .button--cta
125
+ primaryDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.isDisabled} ${buttonTypes.primary}`,
126
+ primarySmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.primary} ${buttonColors.primary}`,
127
+ primarySmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.isDisabled} ${buttonTypes.primary} `,
128
+ primaryQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
129
+ primaryQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
130
+ primarySmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
131
+ primarySmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
132
+ primaryLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
133
+ primarySmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
134
+ primarySmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
135
+ primaryQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
136
+ utility: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonColors.utility}`,
137
+ // .button--utility
138
+ utilityDisabled: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
139
+ utilityQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
140
+ // .button--utility-flat
141
+ utilityQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
142
+ utilitySmall: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonColors.utility}`,
143
+ utilitySmallDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
144
+ utilitySmallQuiet: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
145
+ utilitySmallQuietDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
146
+ utilityLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
147
+ utilitySmallLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
148
+ utilityQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
149
+ utilitySmallQuietLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
150
+ negative: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonColors.destructive}`,
151
+ // .button--destructive
152
+ negativeDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
153
+ negativeQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
154
+ // .button--destructive-flat
155
+ negativeQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet}${buttonVariants.isDisabled}`,
156
+ negativeSmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonColors.destructive}`,
157
+ negativeSmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
158
+ negativeSmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
159
+ negativeSmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.isDisabled}`,
160
+ negativeLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
161
+ negativeSmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.negative}`,
162
+ negativeQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
163
+ negativeSmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.inProgress}`,
164
+ pill: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill}`,
165
+ // .button--pill
166
+ pillSmall: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonColors.pill}`,
167
+ pillLoading: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
168
+ pillSmallLoading: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
169
+ link: `${buttonSizes.link} ${buttonTextSizes.medium} ${buttonTypes.link}`,
170
+ linkSmall: `${buttonSizes.link} ${buttonTextSizes.xsmall} ${buttonTypes.link}`,
171
+ linkAsButton: "inline-block hover:no-underline text-center",
172
+ a11y: "sr-only",
173
+ fullWidth: "w-full max-w-full",
174
+ contentWidth: "max-w-max"
175
+ };
176
+ var modal = {
177
+ //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
178
+ 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`,
179
+ 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]",
180
+ 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",
181
+ content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
182
+ footer: "flex justify-end shrink-0 px-16 sm:px-32",
183
+ transitionTitle: "transition-all duration-300",
184
+ transitionTitleCenter: "justify-self-center",
185
+ transitionTitleColSpan: "col-span-2",
186
+ 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",
187
+ titleText: "mb-0 h4 sm:h3",
188
+ titleButton: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,
189
+ titleButtonLeft: "-ml-8 sm:-ml-12 justify-self-start",
190
+ titleButtonRight: "-mr-8 sm:-mr-12 justify-self-end",
191
+ titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
192
+ titleButtonIconRotated: "transform rotate-90"
193
+ };
194
+ var label = {
195
+ label: "antialiased block relative text-s font-bold pb-4 cursor-pointer i-text-$color-label-text",
196
+ labelInvalid: "i-text-$color-label-text-negative",
197
+ optional: "pl-8 font-normal text-s i-text-$color-label-optional-text"
198
+ };
199
+ var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ";
200
+ var suffix = {
201
+ wrapper: prefixSuffixWrapperBase + "right-0",
202
+ wrapperWithLabel: "w-max pr-12",
203
+ wrapperWithIcon: "w-40",
204
+ label: "antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"
205
+ };
206
+ var prefix = {
207
+ wrapper: prefixSuffixWrapperBase + "left-0",
208
+ wrapperWithLabel: "w-max pl-12",
209
+ wrapperWithIcon: "w-40",
210
+ label: "antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"
211
+ };
212
+ var clickable = {
213
+ toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
214
+ label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
215
+ buttonOrLink: "bg-transparent focusable",
216
+ buttonOrLinkStretch: "inset-0 absolute"
217
+ };
218
+ var attention = {
219
+ base: "border-2 relative flex items-start",
220
+ 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",
221
+ callout: "i-bg-$color-callout-background i-border-$color-callout-border i-text-$color-callout-text py-8 px-16 rounded-8",
222
+ 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",
223
+ popover: "i-bg-$color-popover-background i-border-$color-popover-background i-text-$color-popover-paragraph-text rounded-8 p-16 drop-shadow-m",
224
+ arrowBase: "absolute h-[14px] w-[14px] border-2 border-b-0 border-r-0 rounded-tl-4 transform",
225
+ arrowDirectionLeft: "-left-[8px]",
226
+ arrowDirectionRight: "-right-[8px]",
227
+ arrowDirectionBottom: "-bottom-[8px]",
228
+ arrowDirectionTop: "-top-[8px]",
229
+ arrowTooltip: "i-bg-$color-tooltip-background i-border-$color-tooltip-background",
230
+ arrowCallout: "i-bg-$color-callout-background i-border-$color-callout-border",
231
+ arrowPopover: "i-bg-$color-popover-background i-border-$color-popover-background",
232
+ arrowHighlight: "i-bg-$color-callout-background i-border-$color-callout-border",
233
+ content: "last-child:mb-0",
234
+ notCallout: "absolute z-50",
235
+ closeBtn: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} justify-self-end -mr-8 ml-8`
236
+ };
237
+
238
+ // packages/box/index.js
239
+ var WarpBox = class extends WarpElement {
240
+ get _class() {
241
+ return fclasses({
242
+ [box.box]: true,
243
+ [box.bleed]: this.bleed,
244
+ [box.info]: this.info,
245
+ [box.neutral]: this.neutral,
246
+ [box.bordered]: this.bordered
247
+ });
248
+ }
249
+ get _optOutRoleWithDefault() {
250
+ var _a;
251
+ return this.role === "" ? nothing : (_a = this.role) != null ? _a : "region";
252
+ }
253
+ render() {
254
+ return html`
2
255
  <div role="${this._optOutRoleWithDefault}" class="${this._class}">
3
256
  <slot></slot>
4
257
  </div>
5
- `}};s(b,"properties",{bleed:{type:Boolean},bordered:{type:Boolean},info:{type:Boolean},neutral:{type:Boolean},role:{type:String}}),s(b,"styles",[p.styles,y`
258
+ `;
259
+ }
260
+ };
261
+ __publicField(WarpBox, "properties", {
262
+ bleed: { type: Boolean },
263
+ bordered: { type: Boolean },
264
+ info: { type: Boolean },
265
+ neutral: { type: Boolean },
266
+ role: { type: String }
267
+ });
268
+ // Slotted elements remain in lightDOM which allows for control of their style outside of shadowDOM.
269
+ // ::slotted([Simple Selector]) confirms to Specificity rules, but (being simple) does not add weight to lightDOM skin selectors,
270
+ // so never gets higher Specificity. Thus in order to overwrite style linked within shadowDOM, we need to use !important.
271
+ // https://stackoverflow.com/a/61631668
272
+ __publicField(WarpBox, "styles", [
273
+ WarpElement.styles,
274
+ css`
6
275
  :host {
7
276
  display: block;
8
277
  }
9
278
  ::slotted(:last-child) {
10
279
  margin-bottom: 0 !important;
11
280
  }
12
- `]);customElements.get("w-box")||customElements.define("w-box",b);export{b as WarpBox};
281
+ `
282
+ ]);
283
+ if (!customElements.get("w-box")) {
284
+ customElements.define("w-box", WarpBox);
285
+ }
286
+ export {
287
+ WarpBox
288
+ };
13
289
  //# sourceMappingURL=index.js.map