@sb1/indeks-web 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @sb1/indeks-web
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 129ee83: Ikon: `name` bruker nå Material Design-navn direkte, norsk-alias-mappingen er fjernet
8
+
9
+ Ikoner identifiseres nå med Material Design-navnet (= SVG-filnavnet) direkte, både i `<Icon>` (React) og `<ix-icon>` (web component). Den norske alias-mappingen (`ICON_NAMES`) er fjernet.
10
+
11
+ **Migrering — bytt norsk alias til Material Design-navn:**
12
+
13
+ | Før (`name`) | Etter (`name`) |
14
+ | --------------- | --------------------- |
15
+ | `hjem` | `home` |
16
+ | `meny` | `menu` |
17
+ | `sparing` | `savings` |
18
+ | `lukk` | `close` |
19
+ | `pil-hoyre` | `chevron_right` |
20
+ | `pil-venstre` | `chevron_left` |
21
+ | `pil-ned` | `keyboard_arrow_down` |
22
+ | `legg-til` | `add` |
23
+ | `hake` | `check` |
24
+ | `apne-ekstern` | `open_in_new` |
25
+ | `bankkonto` | `account_balance` |
26
+ | `rediger` | `edit` |
27
+ | `betalingskort` | `credit_card` |
28
+ | `slett` | `delete` |
29
+ | `last-ned` | `download` |
30
+ | `e-post` | `mail` |
31
+ | `betaling` | `payments` |
32
+ | `info` | `info_i` |
33
+ | `sok` | `search` |
34
+ | `innstillinger` | `settings` |
35
+ | `bil` | `directions_car` |
36
+ | `feil` | `error` |
37
+ | `utropstegn` | `priority_high` |
38
+
39
+ **Andre breaking changes:**
40
+
41
+ - **`materialDesignName`-propen (React) og `materialdesignname`-attributtet (web) er fjernet.** Bruk `name` — det tar nå det samme Material Design-navnet. Erstatt `materialDesignName="foo"` med `name="foo"`.
42
+ - **`ICON_NAMES` og typen `IconValue` er fjernet.** For autocomplete på de vanligste ikonene, bruk den nye `COMMON_ICON_NAMES` / `CommonIconName`. `name` godtar fortsatt hvilken som helst Material Design-streng.
43
+ - **`availableMaterialDesignIconNames` (runtime-array) er fjernet** fra `@sb1/indeks-react` (fjerner ~100 kB fra bundelen). Typen `MaterialDesignIconName` beholdes.
44
+
45
+ Typen `IconName` er nå `CommonIconName | (string & {})`: de mest brukte SB1-ikonene autofullføres, mens alle andre Material Design-navn godtas uten typefeil.
46
+
3
47
  ## 0.14.0
4
48
 
5
49
  ## 0.13.0
@@ -4,8 +4,8 @@ import { IxRadioGroup } from './lib/components/radio-group/IxRadioGroup.js';
4
4
  export { IxField };
5
5
  export { IxIcon };
6
6
  export { IxRadioGroup };
7
- export { ICON_NAMES } from './lib/components/icon/IxIcon.js';
8
- export type { IconName, IconValue } from './lib/components/icon/IxIcon.js';
7
+ export { COMMON_ICON_NAMES } from './lib/components/icon/IxIcon.js';
8
+ export type { IconName, CommonIconName } from './lib/components/icon/IxIcon.js';
9
9
  declare global {
10
10
  interface HTMLElementTagNameMap {
11
11
  'ix-field': IxField;
@@ -31,7 +31,6 @@ declare global {
31
31
  };
32
32
  'ix-icon': {
33
33
  name?: IconName;
34
- materialdesignname?: string;
35
34
  'data-size'?: 'sm' | 'md' | 'lg' | 'xl';
36
35
  'aria-label'?: string;
37
36
  'aria-labelledby'?: string;
package/dist/npm/index.js CHANGED
@@ -222,37 +222,164 @@ var IxField = class extends HTMLElement {
222
222
  //#endregion
223
223
  //#region lib/components/icon/IxIcon.ts
224
224
  var ICON_CDN_BASE = "https://cdn.sparebank1.no/icons";
225
- var ICON_NAMES = {
226
- hjem: "home",
227
- meny: "menu",
228
- sparing: "savings",
229
- lukk: "close",
230
- "pil-hoyre": "chevron_right",
231
- "legg-til": "add",
232
- hake: "check",
233
- "apne-ekstern": "open_in_new",
234
- bankkonto: "account_balance",
235
- rediger: "edit",
236
- betalingskort: "credit_card",
237
- slett: "delete",
238
- "last-ned": "download",
239
- person: "person",
240
- "pil-ned": "keyboard_arrow_down",
241
- "e-post": "mail",
242
- betaling: "payments",
243
- info: "info_i",
244
- sok: "search",
245
- innstillinger: "settings",
246
- bil: "directions_car",
247
- "pil-venstre": "chevron_left",
248
- feil: "error",
249
- utropstegn: "priority_high"
250
- };
225
+ var COMMON_ICON_NAMES = [
226
+ "close",
227
+ "chevron_right",
228
+ "add",
229
+ "check",
230
+ "open_in_new",
231
+ "account_balance",
232
+ "edit",
233
+ "credit_card",
234
+ "delete",
235
+ "savings",
236
+ "download",
237
+ "person",
238
+ "keyboard_arrow_down",
239
+ "mail",
240
+ "payments",
241
+ "info",
242
+ "search",
243
+ "settings",
244
+ "directions_car",
245
+ "chevron_left",
246
+ "error",
247
+ "check_circle",
248
+ "content_copy",
249
+ "expand_more",
250
+ "face",
251
+ "add_circle",
252
+ "cancel",
253
+ "celebration",
254
+ "description",
255
+ "school",
256
+ "shopping_cart",
257
+ "arrow_downward",
258
+ "arrow_upward",
259
+ "healing",
260
+ "local_gas_station",
261
+ "account_balance_wallet",
262
+ "calendar_month",
263
+ "exclamation",
264
+ "group",
265
+ "nutrition",
266
+ "potted_plant",
267
+ "thumb_down",
268
+ "thumb_up",
269
+ "tune",
270
+ "wallet",
271
+ "apparel",
272
+ "bolt",
273
+ "book_2",
274
+ "call",
275
+ "chair",
276
+ "check_circle_filled",
277
+ "coffee",
278
+ "cottage",
279
+ "diversity_2",
280
+ "eyeglasses",
281
+ "favorite",
282
+ "flights_and_hotels",
283
+ "flightsmode",
284
+ "garage",
285
+ "groups",
286
+ "handyman",
287
+ "health_and_beauty",
288
+ "hotel",
289
+ "laptop_chromebook",
290
+ "live_tv",
291
+ "local_bar",
292
+ "local_taxi",
293
+ "luggage",
294
+ "medication",
295
+ "oven_gen",
296
+ "palette",
297
+ "pedal_bike",
298
+ "person_play",
299
+ "pets",
300
+ "phone_iphone",
301
+ "playing_cards",
302
+ "restaurant",
303
+ "shopping_bag",
304
+ "spa",
305
+ "sports_tennis",
306
+ "steps",
307
+ "stethoscope",
308
+ "stroller",
309
+ "support_agent",
310
+ "theater_comedy",
311
+ "train",
312
+ "tv",
313
+ "arrow_back",
314
+ "autorenew",
315
+ "blender",
316
+ "build",
317
+ "cabin",
318
+ "car_repair",
319
+ "currency_bitcoin",
320
+ "dentistry",
321
+ "detector_alarm",
322
+ "devices",
323
+ "diamond",
324
+ "exercise",
325
+ "fastfood",
326
+ "featured_seasonal_and_gifts",
327
+ "house",
328
+ "icecream",
329
+ "import_contacts",
330
+ "local_car_wash",
331
+ "local_pizza",
332
+ "menu_book",
333
+ "monitoring",
334
+ "photo_camera",
335
+ "priority_high",
336
+ "question_mark",
337
+ "redeem",
338
+ "restaurant_menu",
339
+ "sports_and_outdoors",
340
+ "stadia_controller",
341
+ "swap_horiz",
342
+ "things_to_do",
343
+ "tools_power_drill",
344
+ "toys",
345
+ "add_card",
346
+ "apartment",
347
+ "arrow_right",
348
+ "article",
349
+ "contract",
350
+ "handshake",
351
+ "home",
352
+ "info_i",
353
+ "logout",
354
+ "money_bag",
355
+ "motorcycle",
356
+ "notifications",
357
+ "phone",
358
+ "print",
359
+ "real_estate_agent",
360
+ "receipt",
361
+ "remove",
362
+ "agriculture",
363
+ "arrow_right_alt",
364
+ "bookmark",
365
+ "calculate",
366
+ "circle",
367
+ "event",
368
+ "exit_to_app",
369
+ "help",
370
+ "keyboard_arrow_right",
371
+ "keyboard_arrow_up",
372
+ "lock",
373
+ "more_vert",
374
+ "people",
375
+ "schedule",
376
+ "sync_alt",
377
+ "warning"
378
+ ];
251
379
  var IxIcon = class extends HTMLElement {
252
380
  static get observedAttributes() {
253
381
  return [
254
382
  "name",
255
- "materialdesignname",
256
383
  "aria-label",
257
384
  "aria-labelledby"
258
385
  ];
@@ -265,11 +392,9 @@ var IxIcon = class extends HTMLElement {
265
392
  this._update();
266
393
  }
267
394
  _update() {
268
- const nameAttr = this.getAttribute("name");
269
- const materialDesignName = this.getAttribute("materialdesignname");
395
+ const iconFileName = this.getAttribute("name");
270
396
  const ariaLabel = this.getAttribute("aria-label");
271
397
  const ariaLabelledBy = this.getAttribute("aria-labelledby");
272
- const iconFileName = nameAttr ? ICON_NAMES[nameAttr] ?? nameAttr : materialDesignName;
273
398
  if (iconFileName) this.style.setProperty("--ii-icon-url", `url(${ICON_CDN_BASE}/${iconFileName}.svg)`);
274
399
  else this.style.removeProperty("--ii-icon-url");
275
400
  if (ariaLabel || ariaLabelledBy) {
@@ -610,4 +735,4 @@ customElements.define("ix-field", IxField);
610
735
  customElements.define("ix-icon", IxIcon);
611
736
  customElements.define("ix-radio-group", IxRadioGroup);
612
737
  //#endregion
613
- export { ICON_NAMES, IxField, IxIcon, IxRadioGroup };
738
+ export { COMMON_ICON_NAMES, IxField, IxIcon, IxRadioGroup };
@@ -1,31 +1,6 @@
1
- export declare const ICON_NAMES: {
2
- readonly hjem: "home";
3
- readonly meny: "menu";
4
- readonly sparing: "savings";
5
- readonly lukk: "close";
6
- readonly 'pil-hoyre': "chevron_right";
7
- readonly 'legg-til': "add";
8
- readonly hake: "check";
9
- readonly 'apne-ekstern': "open_in_new";
10
- readonly bankkonto: "account_balance";
11
- readonly rediger: "edit";
12
- readonly betalingskort: "credit_card";
13
- readonly slett: "delete";
14
- readonly 'last-ned': "download";
15
- readonly person: "person";
16
- readonly 'pil-ned': "keyboard_arrow_down";
17
- readonly 'e-post': "mail";
18
- readonly betaling: "payments";
19
- readonly info: "info_i";
20
- readonly sok: "search";
21
- readonly innstillinger: "settings";
22
- readonly bil: "directions_car";
23
- readonly 'pil-venstre': "chevron_left";
24
- readonly feil: "error";
25
- readonly utropstegn: "priority_high";
26
- };
27
- export type IconValue = (typeof ICON_NAMES)[keyof typeof ICON_NAMES];
28
- export type IconName = keyof typeof ICON_NAMES;
1
+ export declare const COMMON_ICON_NAMES: readonly ["close", "chevron_right", "add", "check", "open_in_new", "account_balance", "edit", "credit_card", "delete", "savings", "download", "person", "keyboard_arrow_down", "mail", "payments", "info", "search", "settings", "directions_car", "chevron_left", "error", "check_circle", "content_copy", "expand_more", "face", "add_circle", "cancel", "celebration", "description", "school", "shopping_cart", "arrow_downward", "arrow_upward", "healing", "local_gas_station", "account_balance_wallet", "calendar_month", "exclamation", "group", "nutrition", "potted_plant", "thumb_down", "thumb_up", "tune", "wallet", "apparel", "bolt", "book_2", "call", "chair", "check_circle_filled", "coffee", "cottage", "diversity_2", "eyeglasses", "favorite", "flights_and_hotels", "flightsmode", "garage", "groups", "handyman", "health_and_beauty", "hotel", "laptop_chromebook", "live_tv", "local_bar", "local_taxi", "luggage", "medication", "oven_gen", "palette", "pedal_bike", "person_play", "pets", "phone_iphone", "playing_cards", "restaurant", "shopping_bag", "spa", "sports_tennis", "steps", "stethoscope", "stroller", "support_agent", "theater_comedy", "train", "tv", "arrow_back", "autorenew", "blender", "build", "cabin", "car_repair", "currency_bitcoin", "dentistry", "detector_alarm", "devices", "diamond", "exercise", "fastfood", "featured_seasonal_and_gifts", "house", "icecream", "import_contacts", "local_car_wash", "local_pizza", "menu_book", "monitoring", "photo_camera", "priority_high", "question_mark", "redeem", "restaurant_menu", "sports_and_outdoors", "stadia_controller", "swap_horiz", "things_to_do", "tools_power_drill", "toys", "add_card", "apartment", "arrow_right", "article", "contract", "handshake", "home", "info_i", "logout", "money_bag", "motorcycle", "notifications", "phone", "print", "real_estate_agent", "receipt", "remove", "agriculture", "arrow_right_alt", "bookmark", "calculate", "circle", "event", "exit_to_app", "help", "keyboard_arrow_right", "keyboard_arrow_up", "lock", "more_vert", "people", "schedule", "sync_alt", "warning"];
2
+ export type CommonIconName = (typeof COMMON_ICON_NAMES)[number];
3
+ export type IconName = CommonIconName | (string & {});
29
4
  export declare class IxIcon extends HTMLElement {
30
5
  static get observedAttributes(): string[];
31
6
  connectedCallback(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/indeks-web",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "description": "Web components for Indeks design system",
6
6
  "homepage": "https://design.sparebank1.no",