@warp-ds/elements 2.10.1-next.1 → 2.11.0-next.1

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.
@@ -2401,7 +2401,7 @@
2401
2401
  "declarations": [
2402
2402
  {
2403
2403
  "kind": "class",
2404
- "description": "Card is a layout component used for separating content areas on a page.\n\n[Warp component reference](https://warp-ds.github.io/docs/components/card/frameworks/elements)",
2404
+ "description": "Card is a layout component used for grouping interactive content areas on a page.\n\n[Warp component reference](https://warp-ds.github.io/docs/components/card/frameworks/elements)",
2405
2405
  "name": "WarpCard",
2406
2406
  "members": [
2407
2407
  {
@@ -2435,6 +2435,14 @@
2435
2435
  "description": "Whether the whole card is interactive.\n\nWhen set, the card becomes keyboard focusable and Enter or Space triggers a click on the card. Use this only when the whole card has one action or represents one selectable choice.",
2436
2436
  "attribute": "clickable"
2437
2437
  },
2438
+ {
2439
+ "kind": "field",
2440
+ "name": "buttonText",
2441
+ "type": {
2442
+ "text": "string"
2443
+ },
2444
+ "privacy": "private"
2445
+ },
2438
2446
  {
2439
2447
  "kind": "method",
2440
2448
  "name": "keypressed",
@@ -2449,10 +2457,6 @@
2449
2457
  "type": {
2450
2458
  "text": "keypressed(e: KeyboardEvent) => void"
2451
2459
  }
2452
- },
2453
- {
2454
- "kind": "field",
2455
- "name": "buttonText"
2456
2460
  }
2457
2461
  ],
2458
2462
  "attributes": [
@@ -6,7 +6,6 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
6
6
 
7
7
  | Name | Type | Default | Summary |
8
8
  |-|-|-|-|
9
- | buttonText (JS only) | `unknown` | `-` | - |
10
9
  | clickable | `boolean` | `false` | Whether the whole card is interactive. |
11
10
  | flat | `boolean` | `false` | Whether the card uses the flat visual treatment. |
12
11
  | keypressed (JS only) | `keypressed(e: KeyboardEvent) => void` | `-` | - |
@@ -14,13 +13,6 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
14
13
 
15
14
  ### Property Details
16
15
 
17
- #### buttonText (JS only)
18
-
19
-
20
-
21
- - Type: `unknown`
22
- - Default: `-`
23
-
24
16
  #### clickable
25
17
 
26
18
  Whether the whole card is interactive.
@@ -2,15 +2,17 @@
2
2
 
3
3
  ## Description
4
4
 
5
- Card is a layout component used for separating content areas on a page.
5
+ Card is a layout component used for grouping interactive content areas on a page.
6
6
 
7
7
  [Warp component reference](https://warp-ds.github.io/docs/components/card/frameworks/elements)
8
8
 
9
9
  ## Usage
10
10
 
11
- Card is a layout component for visually grouping related content as one item.
11
+ Card is a layout component used for grouping interactive content areas on a page.
12
12
 
13
- Use `w-card` for listings, summaries, recommendations, or selectable choices where the grouped content should feel like a single object. The component does not add padding, headings, spacing between children, or semantic structure. Those must be provided by the content inside the card.
13
+ Use `w-card` for listings, summaries, recommendations, or selectable choices where the grouped content should feel like a single object.
14
+
15
+ The component does not add padding, headings, spacing between children, or semantic structure. Those must be provided by the content inside the card.
14
16
 
15
17
  ### Basic Card
16
18
 
@@ -239,6 +241,57 @@ Use a button for an action on the current page:
239
241
 
240
242
  ## Styling API
241
243
 
244
+ Card supports styling through **component tokens** (CSS custom properties with a `--w-c-` prefix) and **parts**.
245
+
246
+ ### Parts
247
+
248
+ Use `::part(part-name)` from outside the component.
249
+
250
+ - `base` - the root element of the card
251
+ - `border` - the inset border of the card
252
+
253
+ ```css
254
+ w-card::part(base) {
255
+ padding: 48px;
256
+ background: rebeccapurple;
257
+ color: cyan;
258
+ }
259
+ w-card::part(border) {
260
+ border-color: magenta;
261
+ border-width: 8px;
262
+ }
263
+ ```
264
+
265
+ ### Component tokens
266
+
267
+ Set these on `<w-card>` to override visuals.
268
+
269
+ ```css
270
+ w-card {
271
+ --w-c-card-border-radius: 0px;
272
+ }
273
+ ```
274
+
275
+ ##### Layout and typography
276
+
277
+ - `--w-c-card-border-radius`
278
+ - `--w-c-card-border-width`
279
+ - `--w-c-card-border-color`
280
+ - `--w-c-card-border-color-active`
281
+ - `--w-c-card-border-color-hover`
282
+
283
+ ##### Background
284
+
285
+ - `--w-c-card-bg`
286
+ - `--w-c-card-bg-active`
287
+ - `--w-c-card-bg-hover`
288
+
289
+ ##### Shadow
290
+
291
+ - `--w-c-card-box-shadow`
292
+ - `--w-c-card-box-shadow-active`
293
+ - `--w-c-card-box-shadow-hover`
294
+
242
295
  ## `<w-card>` API
243
296
 
244
297
  Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
@@ -247,7 +300,6 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
247
300
 
248
301
  | Name | Type | Default | Summary |
249
302
  |-|-|-|-|
250
- | buttonText (JS only) | `unknown` | `-` | - |
251
303
  | clickable | `boolean` | `false` | Whether the whole card is interactive. |
252
304
  | flat | `boolean` | `false` | Whether the card uses the flat visual treatment. |
253
305
  | keypressed (JS only) | `keypressed(e: KeyboardEvent) => void` | `-` | - |
@@ -255,13 +307,6 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
255
307
 
256
308
  ### Property Details
257
309
 
258
- #### buttonText (JS only)
259
-
260
-
261
-
262
- - Type: `unknown`
263
- - Default: `-`
264
-
265
310
  #### clickable
266
311
 
267
312
  Whether the whole card is interactive.
@@ -1 +1,52 @@
1
1
  ## Styling API
2
+
3
+ Card supports styling through **component tokens** (CSS custom properties with a `--w-c-` prefix) and **parts**.
4
+
5
+ ### Parts
6
+
7
+ Use `::part(part-name)` from outside the component.
8
+
9
+ - `base` - the root element of the card
10
+ - `border` - the inset border of the card
11
+
12
+ ```css
13
+ w-card::part(base) {
14
+ padding: 48px;
15
+ background: rebeccapurple;
16
+ color: cyan;
17
+ }
18
+ w-card::part(border) {
19
+ border-color: magenta;
20
+ border-width: 8px;
21
+ }
22
+ ```
23
+
24
+ ### Component tokens
25
+
26
+ Set these on `<w-card>` to override visuals.
27
+
28
+ ```css
29
+ w-card {
30
+ --w-c-card-border-radius: 0px;
31
+ }
32
+ ```
33
+
34
+ ##### Layout and typography
35
+
36
+ - `--w-c-card-border-radius`
37
+ - `--w-c-card-border-width`
38
+ - `--w-c-card-border-color`
39
+ - `--w-c-card-border-color-active`
40
+ - `--w-c-card-border-color-hover`
41
+
42
+ ##### Background
43
+
44
+ - `--w-c-card-bg`
45
+ - `--w-c-card-bg-active`
46
+ - `--w-c-card-bg-hover`
47
+
48
+ ##### Shadow
49
+
50
+ - `--w-c-card-box-shadow`
51
+ - `--w-c-card-box-shadow-active`
52
+ - `--w-c-card-box-shadow-hover`
@@ -1,8 +1,10 @@
1
1
  ## Usage
2
2
 
3
- Card is a layout component for visually grouping related content as one item.
3
+ Card is a layout component used for grouping interactive content areas on a page.
4
4
 
5
- Use `w-card` for listings, summaries, recommendations, or selectable choices where the grouped content should feel like a single object. The component does not add padding, headings, spacing between children, or semantic structure. Those must be provided by the content inside the card.
5
+ Use `w-card` for listings, summaries, recommendations, or selectable choices where the grouped content should feel like a single object.
6
+
7
+ The component does not add padding, headings, spacing between children, or semantic structure. Those must be provided by the content inside the card.
6
8
 
7
9
  ### Basic Card
8
10
 
@@ -17,7 +17,7 @@ Generated by `pnpm build:docs`. This file indexes the Markdown documentation shi
17
17
  | Breadcrumb Item | `<w-breadcrumb-item>` | `breadcrumb-item` | Represents one item in a `w-breadcrumbs` trail. Renders the slotted label as a link when `href` is set, or as text when it is not, and adds a separator after non-current items. Warp component reference | [breadcrumb-item.md](./breadcrumb-item/breadcrumb-item.md) |
18
18
  | Breadcrumbs | `<w-breadcrumbs>` | `breadcrumbs` | Shows the navigation structure for the current page. Renders direct child links and non-link elements as a breadcrumb trail, inserts separators between items, and exposes the trail as navigation. Warp component reference | [breadcrumbs.md](./breadcrumbs/breadcrumbs.md) |
19
19
  | Button | `<w-button>` | `button` | Performs an action or renders a link with button styling. Use button variants to match action priority, risk, and context. Warp component reference | [button.md](./button/button.md) |
20
- | Card | `<w-card>` | `card` | Card is a layout component used for separating content areas on a page. Warp component reference | [card.md](./card/card.md) |
20
+ | Card | `<w-card>` | `card` | Card is a layout component used for grouping interactive content areas on a page. Warp component reference | [card.md](./card/card.md) |
21
21
  | Checkbox | `<w-checkbox>` | `checkbox` | Checkboxes allow users to select one or more options from a number of choices. Wrap individual checkboxes in a checkbox group. Warp component reference | [checkbox.md](./checkbox/checkbox.md) |
22
22
  | Checkbox Group | `<w-checkbox-group>` | `checkbox-group` | Checkboxes allow users to select one or more options from a number of choices. Wrap individual checkboxes in a checkbox group. Warp component reference | [checkbox-group.md](./checkbox-group/checkbox-group.md) |
23
23
  | Combobox | `<w-combobox>` | `combobox` | A combobox element for text input with selectable options. Warp component reference | [combobox.md](./combobox/combobox.md) |
package/dist/index.d.ts CHANGED
@@ -903,8 +903,6 @@ Flat cards use a bordered surface instead of the default elevated surface. Use t
903
903
 
904
904
  When set, the card becomes keyboard focusable and Enter or Space triggers a click on the card. Use this only when the whole card has one action or represents one selectable choice. */
905
905
  clickable?: WarpCard["clickable"];
906
- /** */
907
- buttonText?: WarpCard["buttonText"];
908
906
  };
909
907
 
910
908
  export type WarpCardSolidJsProps = {
@@ -920,8 +918,6 @@ Flat cards use a bordered surface instead of the default elevated surface. Use t
920
918
 
921
919
  When set, the card becomes keyboard focusable and Enter or Space triggers a click on the card. Use this only when the whole card has one action or represents one selectable choice. */
922
920
  "prop:clickable"?: WarpCard["clickable"];
923
- /** */
924
- "prop:buttonText"?: WarpCard["buttonText"];
925
921
 
926
922
  /** Set the innerHTML of the element */
927
923
  innerHTML?: string;
@@ -2649,7 +2645,7 @@ export type CustomElements = {
2649
2645
  >;
2650
2646
 
2651
2647
  /**
2652
- * Card is a layout component used for separating content areas on a page.
2648
+ * Card is a layout component used for grouping interactive content areas on a page.
2653
2649
  *
2654
2650
  * [Warp component reference](https://warp-ds.github.io/docs/components/card/frameworks/elements)
2655
2651
  *
@@ -2666,7 +2662,6 @@ export type CustomElements = {
2666
2662
  * - `clickable`: Whether the whole card is interactive.
2667
2663
  *
2668
2664
  * When set, the card becomes keyboard focusable and Enter or Space triggers a click on the card. Use this only when the whole card has one action or represents one selectable choice.
2669
- * - `buttonText`: undefined (property only)
2670
2665
  *
2671
2666
  * ## Methods
2672
2667
  *
@@ -4039,7 +4034,7 @@ export type CustomElementsSolidJs = {
4039
4034
  >;
4040
4035
 
4041
4036
  /**
4042
- * Card is a layout component used for separating content areas on a page.
4037
+ * Card is a layout component used for grouping interactive content areas on a page.
4043
4038
  *
4044
4039
  * [Warp component reference](https://warp-ds.github.io/docs/components/card/frameworks/elements)
4045
4040
  *
@@ -4056,7 +4051,6 @@ export type CustomElementsSolidJs = {
4056
4051
  * - `clickable`: Whether the whole card is interactive.
4057
4052
  *
4058
4053
  * When set, the card becomes keyboard focusable and Enter or Space triggers a click on the card. Use this only when the whole card has one action or represents one selectable choice.
4059
- * - `buttonText`: undefined (property only)
4060
4054
  *
4061
4055
  * ## Methods
4062
4056
  *
@@ -1,6 +1,6 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * Card is a layout component used for separating content areas on a page.
3
+ * Card is a layout component used for grouping interactive content areas on a page.
4
4
  *
5
5
  * [Warp component reference](https://warp-ds.github.io/docs/components/card/frameworks/elements)
6
6
  */
@@ -24,15 +24,8 @@ declare class WarpCard extends LitElement {
24
24
  * When set, the card becomes keyboard focusable and Enter or Space triggers a click on the card. Use this only when the whole card has one action or represents one selectable choice.
25
25
  */
26
26
  clickable: boolean;
27
- /** @internal */
28
- buttonText: string;
27
+ private buttonText;
29
28
  constructor();
30
- /** @internal */
31
- get _containerClasses(): string;
32
- /** @internal */
33
- get _outlineClasses(): string;
34
- /** @internal */
35
- get _interactiveElement(): "" | import("lit").TemplateResult<1>;
36
29
  keypressed(e: KeyboardEvent): void;
37
30
  render(): import("lit").TemplateResult<1>;
38
31
  }
@@ -1,4 +1,4 @@
1
- var te=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var f=(t,e,r,o)=>{for(var a=o>1?void 0:o?ae(e,r):e,s=t.length-1,i;s>=0;s--)(i=t[s])&&(a=(o?i(e,r,a):i(a))||a);return o&&a&&te(e,r,a),a};var x=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?x.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var b=t=>typeof t=="string",ie=t=>typeof t=="function",A=new Map,$="en";function N(t){return[...Array.isArray(t)?t:[t],$]}function Y(t,e,r){let o=N(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return k(()=>y("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(b(e)?new Date(e):e)}function ne(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return Y(t,e,o)}function M(t,e,r){let o=N(t);return k(()=>y("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function P(t,e,r,{offset:o=0,...a}){let s=N(t),i=e?k(()=>y("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):k(()=>y("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return a[r]??a[i.select(r-o)]??a.other}function k(t,e){let r=t(),o=A.get(r);return o||(o=e(),A.set(r,o)),o}function y(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var T=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,X=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,o)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(o,16);return String.fromCharCode(a)}}),I="%__lingui_octothorpe__%",se=(t,e,r={})=>{let o=e||t,a=i=>typeof i=="object"?i:r[i],s=(i,n)=>{let c=Object.keys(r).length?a("number"):void 0,p=M(o,i,c);return n.replace(new RegExp(I,"g"),p)};return{plural:(i,n)=>{let{offset:c=0}=n,p=P(o,!1,i,n);return s(i-c,p)},selectordinal:(i,n)=>{let{offset:c=0}=n,p=P(o,!0,i,n);return s(i-c,p)},select:ce,number:(i,n)=>M(o,i,a(n)||{style:n}),date:(i,n)=>Y(o,i,a(n)||n),time:(i,n)=>ne(o,i,a(n)||n)}},ce=(t,e)=>e[t]??e.other;function le(t,e,r){return(o={},a)=>{let s=se(e,r,a),i=(c,p=!1)=>Array.isArray(c)?c.reduce((h,m)=>{if(m==="#"&&p)return h+I;if(b(m))return h+m;let[F,g,O]=m,E={};g==="plural"||g==="selectordinal"||g==="select"?Object.entries(O).forEach(([L,oe])=>{E[L]=i(oe,g==="plural"||g==="selectordinal")}):E=O;let w;if(g){let L=s[g];w=L(o[F],E)}else w=o[F];return w==null?h:h+w},""):c,n=i(t);return b(n)&&T.test(n)?X(n):b(n)?n:n?String(n):""}}var de=Object.defineProperty,be=(t,e,r)=>e in t?de(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pe=(t,e,r)=>(be(t,typeof e!="symbol"?e+"":e,r),r),S=class{constructor(){pe(this,"_events",{})}on(e,r){var o;return(o=this._events)[e]??(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},ge=Object.defineProperty,ue=(t,e,r)=>e in t?ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u=(t,e,r)=>(ue(t,typeof e!="symbol"?e+"":e,r),r),j=class extends S{constructor(e){super(),u(this,"_locale",""),u(this,"_locales"),u(this,"_localeData",{}),u(this,"_messages",{}),u(this,"_missing"),u(this,"_messageCompiler"),u(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??$,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o?.message;e||(e=""),b(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,n=this._missing;if(n&&i)return ie(n)?n(this._locale,e):n;i&&this.emit("missing",{id:e,locale:this._locale});let c=s||a||e;return b(c)&&(this._messageCompiler?c=this._messageCompiler(c):console.warn(`Uncompiled message detected! Message:
1
+ var re=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?oe(e,r):e,s=t.length-1,i;s>=0;s--)(i=t[s])&&(a=(o?i(e,r,a):i(a))||a);return o&&a&&re(e,r,a),a};var d=t=>typeof t=="string",te=t=>typeof t=="function",C=new Map,P="en";function M(t){return[...Array.isArray(t)?t:[t],P]}function Y(t,e,r){let o=M(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return f(()=>x("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(d(e)?new Date(e):e)}function ae(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return Y(t,e,o)}function z(t,e,r){let o=M(t);return f(()=>x("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function O(t,e,r,{offset:o=0,...a}){let s=M(t),i=e?f(()=>x("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):f(()=>x("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return a[r]??a[i.select(r-o)]??a.other}function f(t,e){let r=t(),o=C.get(r);return o||(o=e(),C.set(r,o)),o}function x(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,T=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,o)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(o,16);return String.fromCharCode(a)}}),X="%__lingui_octothorpe__%",ie=(t,e,r={})=>{let o=e||t,a=i=>typeof i=="object"?i:r[i],s=(i,n)=>{let c=Object.keys(r).length?a("number"):void 0,b=z(o,i,c);return n.replace(new RegExp(X,"g"),b)};return{plural:(i,n)=>{let{offset:c=0}=n,b=O(o,!1,i,n);return s(i-c,b)},selectordinal:(i,n)=>{let{offset:c=0}=n,b=O(o,!0,i,n);return s(i-c,b)},select:ne,number:(i,n)=>z(o,i,a(n)||{style:n}),date:(i,n)=>Y(o,i,a(n)||n),time:(i,n)=>ae(o,i,a(n)||n)}},ne=(t,e)=>e[t]??e.other;function se(t,e,r){return(o={},a)=>{let s=ie(e,r,a),i=(c,b=!1)=>Array.isArray(c)?c.reduce((h,v)=>{if(v==="#"&&b)return h+X;if(d(v))return h+v;let[D,p,F]=v,y={};p==="plural"||p==="selectordinal"||p==="select"?Object.entries(F).forEach(([_,ee])=>{y[_]=i(ee,p==="plural"||p==="selectordinal")}):y=F;let m;if(p){let _=s[p];m=_(o[D],y)}else m=o[D];return m==null?h:h+m},""):c,n=i(t);return d(n)&&A.test(n)?T(n):d(n)?n:n?String(n):""}}var ce=Object.defineProperty,le=(t,e,r)=>e in t?ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,de=(t,e,r)=>(le(t,typeof e!="symbol"?e+"":e,r),r),E=class{constructor(){de(this,"_events",{})}on(e,r){var o;return(o=this._events)[e]??(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},be=Object.defineProperty,pe=(t,e,r)=>e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,g=(t,e,r)=>(pe(t,typeof e!="symbol"?e+"":e,r),r),L=class extends E{constructor(e){super(),g(this,"_locale",""),g(this,"_locales"),g(this,"_localeData",{}),g(this,"_messages",{}),g(this,"_missing"),g(this,"_messageCompiler"),g(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??P,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o?.message;e||(e=""),d(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,n=this._missing;if(n&&i)return te(n)?n(this._locale,e):n;i&&this.emit("missing",{id:e,locale:this._locale});let c=s||a||e;return d(c)&&(this._messageCompiler?c=this._messageCompiler(c):console.warn(`Uncompiled message detected! Message:
2
2
 
3
3
  > ${c}
4
4
 
@@ -6,7 +6,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
6
6
  ICU features such as interpolation and plurals will not work properly for that message.
7
7
 
8
8
  Please compile your catalog first.
9
- `)),b(c)&&T.test(c)?X(c):b(c)?c:le(c,this._locale,this._locales)(r,o?.formats)}date(e,r){return Y(this._locales||this._locale,e,r)}number(e,r){return M(this._locales||this._locale,e,r)}};function ve(t={}){return new j(t)}var l=ve();import{css as ze,html as z,LitElement as Ee}from"lit";import{property as D}from"lit/decorators.js";import{ifDefined as Le}from"lit/directives/if-defined.js";var he=["en","nb","fi","da","sv"],C="en",_=t=>he.find(e=>t===e||t.toLowerCase().includes(e))||C;function U(){if(typeof window>"u"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return _(t)}try{let t=R(document);if(t)return _(t);let e=xe();if(e)return _(e);let r=R(J());return r?_(r):C}catch(t){return console.warn("could not detect locale, falling back to source locale",t),C}}var V=(t,e,r,o,a)=>{l.load("en",t),l.load("nb",e),l.load("fi",r),l.load("da",o),l.load("sv",a);let s=U();l.activate(s),H(),we()},me="warp-i18n-change";function H(){typeof window>"u"||window.dispatchEvent(new Event(me))}var Z=!1;function we(){if(Z||typeof window>"u"||!document?.documentElement)return;Z=!0;let t=()=>{let a=U();l.locale!==a&&(l.activate(a),H())},e=new MutationObserver(a=>{for(let s of a)if(s.type==="attributes"&&s.attributeName==="lang"){t();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=J();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let o=fe();o&&e.observe(o,{attributes:!0,attributeFilter:["lang"]})}function J(){try{return window.parent?.document??null}catch{return null}}function R(t){try{return t?.documentElement?.lang??""}catch{return""}}function fe(){try{return window.frameElement??null}catch{return null}}function xe(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{css as ke}from"lit";import{unsafeCSS as ye}from"lit";var K=ke`
9
+ `)),d(c)&&A.test(c)?T(c):d(c)?c:se(c,this._locale,this._locales)(r,o?.formats)}date(e,r){return Y(this._locales||this._locale,e,r)}number(e,r){return z(this._locales||this._locale,e,r)}};function ge(t={}){return new L(t)}var l=ge();import{css as ye,html as N,LitElement as _e,nothing as ze}from"lit";import{property as j}from"lit/decorators.js";import{ifDefined as Ee}from"lit/directives/if-defined.js";var ue=["en","nb","fi","da","sv"],S="en",k=t=>ue.find(e=>t===e||t.toLowerCase().includes(e))||S;function $(){if(typeof window>"u"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return k(t)}try{let t=Z(document);if(t)return k(t);let e=we();if(e)return k(e);let r=Z(H());return r?k(r):S}catch(t){return console.warn("could not detect locale, falling back to source locale",t),S}}var R=(t,e,r,o,a)=>{l.load("en",t),l.load("nb",e),l.load("fi",r),l.load("da",o),l.load("sv",a);let s=$();l.activate(s),V(),ve()},he="warp-i18n-change";function V(){typeof window>"u"||window.dispatchEvent(new Event(he))}var I=!1;function ve(){if(I||typeof window>"u"||!document?.documentElement)return;I=!0;let t=()=>{let a=$();l.locale!==a&&(l.activate(a),V())},e=new MutationObserver(a=>{for(let s of a)if(s.type==="attributes"&&s.attributeName==="lang"){t();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=H();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let o=me();o&&e.observe(o,{attributes:!0,attributeFilter:["lang"]})}function H(){try{return window.parent?.document??null}catch{return null}}function Z(t){try{return t?.documentElement?.lang??""}catch{return""}}function me(){try{return window.frameElement??null}catch{return null}}function we(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{css as fe}from"lit";import{unsafeCSS as xe}from"lit";var J=fe`
10
10
  *,
11
11
  :before,
12
12
  :after {
@@ -279,7 +279,7 @@ Please compile your catalog first.
279
279
  svg {
280
280
  pointer-events: none;
281
281
  }
282
- `,Oe=ye(`*, :before, :after {
282
+ `,Fe=xe(`*, :before, :after {
283
283
  --w-rotate: 0;
284
284
  --w-rotate-x: 0;
285
285
  --w-rotate-y: 0;
@@ -2445,27 +2445,158 @@ Please compile your catalog first.
2445
2445
  display: none
2446
2446
  }
2447
2447
  }
2448
- `);var B=JSON.parse('{"card.button.text":["V\xE6lg"]}');var G=JSON.parse('{"card.button.text":["Select"]}');var q=JSON.parse('{"card.button.text":["Valitse"]}');var Q=JSON.parse('{"card.button.text":["Velg"]}');var W=JSON.parse('{"card.button.text":["V\xE4lj"]}');import{unsafeCSS as _e}from"lit";var ee=_e("*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.border-2{border-width:2px}.border-transparent{border-color:#0000}.rounded-4{border-radius:4px}.rounded-8{border-radius:8px}.block{display:block}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.overflow-hidden{overflow:hidden}.outline{outline-style:solid}.inset-0{top:0;bottom:0;left:0;right:0}.absolute{position:absolute}.relative{position:relative}.static{position:static}.\\!s-bg-selected{background-color:var(--w-s-color-background-selected)!important}.s-bg{background-color:var(--w-s-color-background)}.s-bg-selected{background-color:var(--w-s-color-background-selected)}.\\!hover\\:s-bg-selected-hover:hover{background-color:var(--w-s-color-background-selected-hover)!important}.hover\\:s-bg-hover:hover{background-color:var(--w-s-color-background-hover)}.hover\\:s-bg-selected-hover:hover{background-color:var(--w-s-color-background-selected-hover)}.\\!active\\:s-bg-selected-active:active{background-color:var(--w-s-color-background-selected-active)!important}.active\\:s-bg-active:active{background-color:var(--w-s-color-background-active)}.active\\:s-bg-selected-active:active{background-color:var(--w-s-color-background-selected-active)}.s-border{border-color:var(--w-s-color-border)}.s-border-selected{border-color:var(--w-s-color-border-selected)}.group:hover .group-hover\\:s-border-selected-hover{border-color:var(--w-s-color-border-selected-hover)}.hover\\:s-border-hover:hover{border-color:var(--w-s-color-border-hover)}.hover\\:s-border-selected-hover:hover{border-color:var(--w-s-color-border-selected-hover)}.active\\:s-border-active:active{border-color:var(--w-s-color-border-active)}.active\\:s-border-selected-active:active{border-color:var(--w-s-color-border-selected-active)}.group:active .group-active\\:s-border-active{border-color:var(--w-s-color-border-active)}.group:active .group-active\\:s-border-selected-active{border-color:var(--w-s-color-border-selected-active)}.s-surface-elevated-200{background-color:var(--w-s-color-surface-elevated-200);box-shadow:var(--w-s-shadow-surface-elevated-200)}.hover\\:s-surface-elevated-200-hover:hover{background-color:var(--w-s-color-surface-elevated-200-hover);box-shadow:var(--w-s-shadow-surface-elevated-200-hover)}.active\\:s-surface-elevated-200-active:active{background-color:var(--w-s-color-surface-elevated-200-active);box-shadow:var(--w-s-shadow-surface-elevated-200-active)}.cursor-pointer{cursor:pointer}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}");var d={base:"cursor-pointer overflow-hidden relative transition-all",shadow:"group rounded-8 s-surface-elevated-200 hover:s-surface-elevated-200-hover active:s-surface-elevated-200-active",selected:"!s-bg-selected !hover:s-bg-selected-hover !active:s-bg-selected-active",outline:"absolute border-2 rounded-8 inset-0 transition-all",outlineUnselected:"border-transparent group-active:s-border-active",outlineSelected:"s-border-selected group-hover:s-border-selected-hover group-active:s-border-selected-active",flat:"border-2 rounded-4",flatUnselected:"s-bg hover:s-bg-hover active:s-bg-active s-border hover:s-border-hover active:s-border-active",flatSelected:"s-bg-selected hover:s-bg-selected-hover active:s-bg-selected-active s-border-selected hover:s-border-selected-hover active:s-border-selected-active",a11y:"sr-only"},re={ENTER:"Enter",SPACE:" "},v=class extends Ee{constructor(){super();this.selected=!1;this.flat=!1;this.clickable=!1;V(G,Q,q,B,W),this.buttonText=l._({id:"card.button.text",message:"Select",comment:"Screenreader message to indicate that the card is clickable"})}get _containerClasses(){return x([d.base,this.flat?d.flat:d.shadow,this.selected&&!this.flat&&d.selected,this.selected&&this.flat?d.flatSelected:d.flatUnselected])}get _outlineClasses(){return x([d.outline,this.selected?d.outlineSelected:d.outlineUnselected])}get _interactiveElement(){let r=()=>z`<button
2449
- class="${d.a11y}"
2450
- aria-pressed="${this.selected}"
2451
- tabindex="-1"
2452
- >
2453
- ${this.buttonText}
2454
- </button>`,o=()=>z`<span
2455
- role="checkbox"
2456
- aria-checked="true"
2457
- aria-disabled="true"
2458
- ></span>`;return this.clickable?r():this.selected?o():""}keypressed(r){!this.clickable||r.altKey||r.ctrlKey||(r.key===re.ENTER||r.key===re.SPACE)&&(r.preventDefault(),this.click())}render(){return z`
2448
+ `);var K=JSON.parse('{"card.button.text":["V\xE6lg"]}');var G=JSON.parse('{"card.button.text":["Select"]}');var U=JSON.parse('{"card.button.text":["Valitse"]}');var q=JSON.parse('{"card.button.text":["Velg"]}');var B=JSON.parse('{"card.button.text":["V\xE4lj"]}');import{css as ke}from"lit";var Q=ke`
2449
+ :host {
2450
+ --_background-color: var(
2451
+ --w-c-card-bg,
2452
+ var(--w-s-color-surface-elevated-200)
2453
+ );
2454
+ --_background-color-active: var(
2455
+ --w-c-card-bg-active,
2456
+ var(--w-s-color-background-active)
2457
+ );
2458
+ --_background-color-hover: var(
2459
+ --w-c-card-bg-hover,
2460
+ var(--w-s-color-background-hover)
2461
+ );
2462
+ --_border-color: var(--w-c-card-border-color, transparent);
2463
+ --_border-color-active: var(
2464
+ --w-c-card-border-color-active,
2465
+ var(--w-s-color-border-active)
2466
+ );
2467
+ --_border-color-hover: var(
2468
+ --w-c-card-border-color-hover,
2469
+ var(--w-s-color-border-hover)
2470
+ );
2471
+ --_border-radius: var(--w-c-card-border-radius, 8px);
2472
+ --_border-width: var(--w-c-card-border-width, 2px);
2473
+ --_box-shadow: var(
2474
+ --w-c-card-box-shadow,
2475
+ var(--w-s-shadow-surface-elevated-200)
2476
+ );
2477
+ --_box-shadow-active: var(
2478
+ --w-c-card-box-shadow-active,
2479
+ var(--w-s-shadow-surface-elevated-200-active)
2480
+ );
2481
+ --_box-shadow-hover: var(
2482
+ --w-c-card-box-shadow-hover,
2483
+ var(--w-s-shadow-surface-elevated-200-hover)
2484
+ );
2485
+ }
2486
+
2487
+ :host([flat]) {
2488
+ --_border-color: var(--w-c-card-border-color, var(--w-s-color-border));
2489
+ --_border-width: var(--w-c-card-border-width, 2px);
2490
+ --_border-radius: var(--w-c-card-border-radius, 4px);
2491
+ --_box-shadow: none;
2492
+ --_box-shadow-active: none;
2493
+ --_box-shadow-hover: none;
2494
+ }
2495
+
2496
+ :host([selected]) {
2497
+ --_background-color: var(
2498
+ --w-c-card-bg,
2499
+ var(--w-s-color-background-selected)
2500
+ );
2501
+ --_background-color-active: var(
2502
+ --w-c-card-bg-active,
2503
+ var(--w-s-color-background-selected-active)
2504
+ );
2505
+ --_background-color-hover: var(
2506
+ --w-c-card-bg-hover,
2507
+ var(--w-s-color-background-selected-hover)
2508
+ );
2509
+ --_border-color: var(
2510
+ --w-c-card-border-color,
2511
+ var(--w-s-color-border-selected)
2512
+ );
2513
+ --_border-color-active: var(
2514
+ --w-c-card-border-color-active,
2515
+ var(--w-s-color-border-selected-active)
2516
+ );
2517
+ --_border-color-hover: var(
2518
+ --w-c-card-border-color-hover,
2519
+ var(--w-s-color-border-selected-hover)
2520
+ );
2521
+ --_border-width: var(--w-c-card-border-width, 2px);
2522
+ }
2523
+
2524
+ [part="base"] {
2525
+ background-color: var(--_background-color);
2526
+ border-radius: var(--_border-radius);
2527
+ box-shadow: var(--_box-shadow);
2528
+ cursor: pointer;
2529
+ display: block;
2530
+ overflow: hidden;
2531
+ position: relative;
2532
+ transition-property: all;
2533
+ transition-duration: 0.15s;
2534
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2535
+ }
2536
+
2537
+ [part="base"]:hover {
2538
+ background-color: var(--_background-color-hover);
2539
+ box-shadow: var(--_box-shadow-hover);
2540
+ }
2541
+
2542
+ [part="base"]:active {
2543
+ background-color: var(--_background-color-active);
2544
+ box-shadow: var(--_box-shadow-active);
2545
+ }
2546
+
2547
+ [part="border"] {
2548
+ border-radius: var(--_border-radius);
2549
+ border-color: var(--_border-color);
2550
+ border-width: var(--_border-width);
2551
+ position: absolute;
2552
+ inset: 0px;
2553
+ transition-property: all;
2554
+ transition-duration: 0.15s;
2555
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2556
+ }
2557
+
2558
+ :host([flat]) [part="base"]:hover [part="border"],
2559
+ :host([selected]) [part="base"]:hover [part="border"] {
2560
+ border-color: var(--_border-color-hover);
2561
+ }
2562
+
2563
+ [part="base"]:active [part="border"] {
2564
+ border-color: var(--_border-color-active);
2565
+ }
2566
+
2567
+ .sr-only {
2568
+ position: absolute;
2569
+ width: 1px;
2570
+ height: 1px;
2571
+ padding: 0;
2572
+ margin: -1px;
2573
+ overflow: hidden;
2574
+ clip: rect(0, 0, 0, 0);
2575
+ white-space: nowrap;
2576
+ border-width: 0;
2577
+ }
2578
+ `;var W={ENTER:"Enter",SPACE:" "},u=class extends _e{constructor(){super();this.selected=!1;this.flat=!1;this.clickable=!1;R(G,q,U,K,B),this.buttonText=l._({id:"card.button.text",message:"Select",comment:"Screenreader message to indicate that the card is clickable"})}keypressed(r){!this.clickable||r.altKey||r.ctrlKey||(r.key===W.ENTER||r.key===W.SPACE)&&(r.preventDefault(),this.click())}render(){return N`
2459
2579
  <div
2460
- tabindex=${Le(this.clickable?"0":void 0)}
2461
- class="${this._containerClasses}"
2580
+ part="base"
2581
+ tabindex=${Ee(this.clickable?"0":void 0)}
2462
2582
  @keydown=${this.keypressed}
2463
2583
  >
2464
- ${this._interactiveElement}
2465
- ${this.flat?"":z`<div class="${this._outlineClasses}"></div>`}
2584
+ <div part="border"></div>
2585
+ ${this.clickable?N`<button
2586
+ class="sr-only"
2587
+ aria-pressed="${this.selected}"
2588
+ tabindex="-1"
2589
+ >
2590
+ ${this.buttonText}
2591
+ </button>`:this.selected?N`<span
2592
+ class="sr-only"
2593
+ role="checkbox"
2594
+ aria-checked="true"
2595
+ aria-disabled="true"
2596
+ ></span>`:ze}
2466
2597
  <slot></slot>
2467
2598
  </div>
2468
- `}};v.styles=[K,ee,ze`
2599
+ `}};u.styles=[J,Q,ye`
2469
2600
  a::after {
2470
2601
  content: "";
2471
2602
  position: absolute;
@@ -2477,5 +2608,5 @@ Please compile your catalog first.
2477
2608
  :host {
2478
2609
  display: block;
2479
2610
  }
2480
- `],f([D({type:Boolean,reflect:!0})],v.prototype,"selected",2),f([D({type:Boolean})],v.prototype,"flat",2),f([D({type:Boolean})],v.prototype,"clickable",2);customElements.get("w-card")||customElements.define("w-card",v);export{v as WarpCard};
2611
+ `],w([j({type:Boolean,reflect:!0})],u.prototype,"selected",2),w([j({type:Boolean})],u.prototype,"flat",2),w([j({type:Boolean})],u.prototype,"clickable",2);customElements.get("w-card")||customElements.define("w-card",u);export{u as WarpCard};
2481
2612
  //# sourceMappingURL=card.js.map