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