@iroco/ui 0.10.0 → 0.12.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/lib/index.mjs CHANGED
@@ -169,6 +169,37 @@ function custom_event(type, detail) {
169
169
  e.initCustomEvent(type, false, false, detail);
170
170
  return e;
171
171
  }
172
+ class HtmlTag {
173
+ constructor(anchor = null) {
174
+ this.a = anchor;
175
+ this.e = this.n = null;
176
+ }
177
+ m(html, target, anchor = null) {
178
+ if (!this.e) {
179
+ this.e = element(target.nodeName);
180
+ this.t = target;
181
+ this.h(html);
182
+ }
183
+ this.i(anchor);
184
+ }
185
+ h(html) {
186
+ this.e.innerHTML = html;
187
+ this.n = Array.from(this.e.childNodes);
188
+ }
189
+ i(anchor) {
190
+ for (let i = 0; i < this.n.length; i += 1) {
191
+ insert(this.t, this.n[i], anchor);
192
+ }
193
+ }
194
+ p(html) {
195
+ this.d();
196
+ this.h(html);
197
+ this.i(this.a);
198
+ }
199
+ d() {
200
+ this.n.forEach(detach);
201
+ }
202
+ }
172
203
 
173
204
  let current_component;
174
205
  function set_current_component(component) {
@@ -466,25 +497,25 @@ class SvelteComponent {
466
497
 
467
498
  /* src/Button.svelte generated by Svelte v3.38.2 */
468
499
 
469
- function create_fragment$g(ctx) {
500
+ function create_fragment$h(ctx) {
470
501
  let button;
471
502
  let button_class_value;
472
503
  let current;
473
504
  let mounted;
474
505
  let dispose;
475
- const default_slot_template = /*#slots*/ ctx[7].default;
476
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[6], null);
506
+ const default_slot_template = /*#slots*/ ctx[8].default;
507
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[7], null);
477
508
 
478
509
  return {
479
510
  c() {
480
511
  button = element("button");
481
512
  if (default_slot) default_slot.c();
482
- attr(button, "id", /*id*/ ctx[5]);
483
- attr(button, "class", button_class_value = "" + (null_to_empty(`iroco-ui-button iroco-ui-button--${/*size*/ ctx[3]} iroco-ui-button--${/*kind*/ ctx[2]}`) + " svelte-hp8sdi"));
484
- attr(button, "type", /*type*/ ctx[0]);
485
- button.disabled = /*disabled*/ ctx[1];
486
- toggle_class(button, "disabled", /*disabled*/ ctx[1]);
487
- toggle_class(button, "rounded", /*rounded*/ ctx[4]);
513
+ attr(button, "id", /*id*/ ctx[6]);
514
+ attr(button, "class", button_class_value = "" + (null_to_empty(`iroco-ui-button iroco-ui-button--${/*size*/ ctx[4]} iroco-ui-button--${/*kind*/ ctx[3]}`) + " svelte-cdmkz4"));
515
+ attr(button, "type", /*type*/ ctx[1]);
516
+ button.disabled = /*disabled*/ ctx[2];
517
+ toggle_class(button, "disabled", /*disabled*/ ctx[2]);
518
+ toggle_class(button, "rounded", /*rounded*/ ctx[5]);
488
519
  },
489
520
  m(target, anchor) {
490
521
  insert(target, button, anchor);
@@ -493,42 +524,43 @@ function create_fragment$g(ctx) {
493
524
  default_slot.m(button, null);
494
525
  }
495
526
 
527
+ /*button_binding*/ ctx[10](button);
496
528
  current = true;
497
529
 
498
530
  if (!mounted) {
499
- dispose = listen(button, "click", /*click_handler*/ ctx[8]);
531
+ dispose = listen(button, "click", /*click_handler*/ ctx[9]);
500
532
  mounted = true;
501
533
  }
502
534
  },
503
535
  p(ctx, [dirty]) {
504
536
  if (default_slot) {
505
- if (default_slot.p && (!current || dirty & /*$$scope*/ 64)) {
506
- update_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[6], dirty, null, null);
537
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 128)) {
538
+ update_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[7], dirty, null, null);
507
539
  }
508
540
  }
509
541
 
510
- if (!current || dirty & /*id*/ 32) {
511
- attr(button, "id", /*id*/ ctx[5]);
542
+ if (!current || dirty & /*id*/ 64) {
543
+ attr(button, "id", /*id*/ ctx[6]);
512
544
  }
513
545
 
514
- if (!current || dirty & /*size, kind*/ 12 && button_class_value !== (button_class_value = "" + (null_to_empty(`iroco-ui-button iroco-ui-button--${/*size*/ ctx[3]} iroco-ui-button--${/*kind*/ ctx[2]}`) + " svelte-hp8sdi"))) {
546
+ if (!current || dirty & /*size, kind*/ 24 && button_class_value !== (button_class_value = "" + (null_to_empty(`iroco-ui-button iroco-ui-button--${/*size*/ ctx[4]} iroco-ui-button--${/*kind*/ ctx[3]}`) + " svelte-cdmkz4"))) {
515
547
  attr(button, "class", button_class_value);
516
548
  }
517
549
 
518
- if (!current || dirty & /*type*/ 1) {
519
- attr(button, "type", /*type*/ ctx[0]);
550
+ if (!current || dirty & /*type*/ 2) {
551
+ attr(button, "type", /*type*/ ctx[1]);
520
552
  }
521
553
 
522
- if (!current || dirty & /*disabled*/ 2) {
523
- button.disabled = /*disabled*/ ctx[1];
554
+ if (!current || dirty & /*disabled*/ 4) {
555
+ button.disabled = /*disabled*/ ctx[2];
524
556
  }
525
557
 
526
- if (dirty & /*size, kind, disabled*/ 14) {
527
- toggle_class(button, "disabled", /*disabled*/ ctx[1]);
558
+ if (dirty & /*size, kind, disabled*/ 28) {
559
+ toggle_class(button, "disabled", /*disabled*/ ctx[2]);
528
560
  }
529
561
 
530
- if (dirty & /*size, kind, rounded*/ 28) {
531
- toggle_class(button, "rounded", /*rounded*/ ctx[4]);
562
+ if (dirty & /*size, kind, rounded*/ 56) {
563
+ toggle_class(button, "rounded", /*rounded*/ ctx[5]);
532
564
  }
533
565
  },
534
566
  i(local) {
@@ -543,13 +575,14 @@ function create_fragment$g(ctx) {
543
575
  d(detaching) {
544
576
  if (detaching) detach(button);
545
577
  if (default_slot) default_slot.d(detaching);
578
+ /*button_binding*/ ctx[10](null);
546
579
  mounted = false;
547
580
  dispose();
548
581
  }
549
582
  };
550
583
  }
551
584
 
552
- function instance$f($$self, $$props, $$invalidate) {
585
+ function instance$g($$self, $$props, $$invalidate) {
553
586
  let { $$slots: slots = {}, $$scope } = $$props;
554
587
  let { type = "button" } = $$props;
555
588
  let { disabled = false } = $$props;
@@ -557,42 +590,64 @@ function instance$f($$self, $$props, $$invalidate) {
557
590
  let { size = "regular" } = $$props;
558
591
  let { rounded = false } = $$props;
559
592
  let { id } = $$props;
593
+ let { node } = $$props;
560
594
 
561
595
  function click_handler(event) {
562
596
  bubble($$self, event);
563
597
  }
564
598
 
599
+ function button_binding($$value) {
600
+ binding_callbacks[$$value ? "unshift" : "push"](() => {
601
+ node = $$value;
602
+ $$invalidate(0, node);
603
+ });
604
+ }
605
+
565
606
  $$self.$$set = $$props => {
566
- if ("type" in $$props) $$invalidate(0, type = $$props.type);
567
- if ("disabled" in $$props) $$invalidate(1, disabled = $$props.disabled);
568
- if ("kind" in $$props) $$invalidate(2, kind = $$props.kind);
569
- if ("size" in $$props) $$invalidate(3, size = $$props.size);
570
- if ("rounded" in $$props) $$invalidate(4, rounded = $$props.rounded);
571
- if ("id" in $$props) $$invalidate(5, id = $$props.id);
572
- if ("$$scope" in $$props) $$invalidate(6, $$scope = $$props.$$scope);
607
+ if ("type" in $$props) $$invalidate(1, type = $$props.type);
608
+ if ("disabled" in $$props) $$invalidate(2, disabled = $$props.disabled);
609
+ if ("kind" in $$props) $$invalidate(3, kind = $$props.kind);
610
+ if ("size" in $$props) $$invalidate(4, size = $$props.size);
611
+ if ("rounded" in $$props) $$invalidate(5, rounded = $$props.rounded);
612
+ if ("id" in $$props) $$invalidate(6, id = $$props.id);
613
+ if ("node" in $$props) $$invalidate(0, node = $$props.node);
614
+ if ("$$scope" in $$props) $$invalidate(7, $$scope = $$props.$$scope);
573
615
  };
574
616
 
575
- return [type, disabled, kind, size, rounded, id, $$scope, slots, click_handler];
617
+ return [
618
+ node,
619
+ type,
620
+ disabled,
621
+ kind,
622
+ size,
623
+ rounded,
624
+ id,
625
+ $$scope,
626
+ slots,
627
+ click_handler,
628
+ button_binding
629
+ ];
576
630
  }
577
631
 
578
632
  class Button extends SvelteComponent {
579
633
  constructor(options) {
580
634
  super();
581
635
 
582
- init(this, options, instance$f, create_fragment$g, safe_not_equal, {
583
- type: 0,
584
- disabled: 1,
585
- kind: 2,
586
- size: 3,
587
- rounded: 4,
588
- id: 5
636
+ init(this, options, instance$g, create_fragment$h, safe_not_equal, {
637
+ type: 1,
638
+ disabled: 2,
639
+ kind: 3,
640
+ size: 4,
641
+ rounded: 5,
642
+ id: 6,
643
+ node: 0
589
644
  });
590
645
  }
591
646
  }
592
647
 
593
648
  /* src/TextInput.svelte generated by Svelte v3.38.2 */
594
649
 
595
- function create_if_block_1$1(ctx) {
650
+ function create_if_block_2(ctx) {
596
651
  let label_1;
597
652
  let t;
598
653
 
@@ -620,40 +675,103 @@ function create_if_block_1$1(ctx) {
620
675
  };
621
676
  }
622
677
 
623
- // (40:1) {#if error != null}
678
+ // (41:1) {#if error != null}
624
679
  function create_if_block$4(ctx) {
625
680
  let p;
626
- let t_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "";
627
- let t;
681
+
682
+ function select_block_type(ctx, dirty) {
683
+ if (/*htmlError*/ ctx[5]) return create_if_block_1$1;
684
+ return create_else_block$1;
685
+ }
686
+
687
+ let current_block_type = select_block_type(ctx);
688
+ let if_block = current_block_type(ctx);
628
689
 
629
690
  return {
630
691
  c() {
631
692
  p = element("p");
632
- t = text(t_value);
693
+ if_block.c();
633
694
  attr(p, "data-testid", "error");
634
695
  attr(p, "class", "error svelte-11iawkb");
635
696
  },
636
697
  m(target, anchor) {
637
698
  insert(target, p, anchor);
638
- append(p, t);
699
+ if_block.m(p, null);
639
700
  },
640
701
  p(ctx, dirty) {
641
- if (dirty & /*error*/ 16 && t_value !== (t_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "")) set_data(t, t_value);
702
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
703
+ if_block.p(ctx, dirty);
704
+ } else {
705
+ if_block.d(1);
706
+ if_block = current_block_type(ctx);
707
+
708
+ if (if_block) {
709
+ if_block.c();
710
+ if_block.m(p, null);
711
+ }
712
+ }
642
713
  },
643
714
  d(detaching) {
644
715
  if (detaching) detach(p);
716
+ if_block.d();
645
717
  }
646
718
  };
647
719
  }
648
720
 
649
- function create_fragment$f(ctx) {
721
+ // (45:3) {:else}
722
+ function create_else_block$1(ctx) {
723
+ let t_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "";
724
+ let t;
725
+
726
+ return {
727
+ c() {
728
+ t = text(t_value);
729
+ },
730
+ m(target, anchor) {
731
+ insert(target, t, anchor);
732
+ },
733
+ p(ctx, dirty) {
734
+ if (dirty & /*error*/ 16 && t_value !== (t_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "")) set_data(t, t_value);
735
+ },
736
+ d(detaching) {
737
+ if (detaching) detach(t);
738
+ }
739
+ };
740
+ }
741
+
742
+ // (43:3) {#if htmlError}
743
+ function create_if_block_1$1(ctx) {
744
+ let html_tag;
745
+ let raw_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "";
746
+ let html_anchor;
747
+
748
+ return {
749
+ c() {
750
+ html_anchor = empty();
751
+ html_tag = new HtmlTag(html_anchor);
752
+ },
753
+ m(target, anchor) {
754
+ html_tag.m(raw_value, target, anchor);
755
+ insert(target, html_anchor, anchor);
756
+ },
757
+ p(ctx, dirty) {
758
+ if (dirty & /*error*/ 16 && raw_value !== (raw_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "")) html_tag.p(raw_value);
759
+ },
760
+ d(detaching) {
761
+ if (detaching) detach(html_anchor);
762
+ if (detaching) html_tag.d();
763
+ }
764
+ };
765
+ }
766
+
767
+ function create_fragment$g(ctx) {
650
768
  let div;
651
769
  let t0;
652
770
  let input;
653
771
  let t1;
654
772
  let mounted;
655
773
  let dispose;
656
- let if_block0 = /*label*/ ctx[2] && create_if_block_1$1(ctx);
774
+ let if_block0 = /*label*/ ctx[2] && create_if_block_2(ctx);
657
775
  let if_block1 = /*error*/ ctx[4] != null && create_if_block$4(ctx);
658
776
 
659
777
  return {
@@ -667,11 +785,11 @@ function create_fragment$f(ctx) {
667
785
  attr(input, "id", /*id*/ ctx[1]);
668
786
  attr(input, "type", "text");
669
787
  attr(input, "placeholder", /*placeholder*/ ctx[3]);
670
- input.readOnly = /*readonly*/ ctx[7];
788
+ input.readOnly = /*readonly*/ ctx[8];
671
789
  attr(input, "class", "svelte-11iawkb");
672
- toggle_class(input, "border", /*border*/ ctx[8]);
790
+ toggle_class(input, "border", /*border*/ ctx[9]);
673
791
  toggle_class(input, "error", /*error*/ ctx[4] !== null);
674
- toggle_class(input, "readonlyInput", /*readonly*/ ctx[7] == true);
792
+ toggle_class(input, "readonlyInput", /*readonly*/ ctx[8] == true);
675
793
  attr(div, "class", "iroco-ui-input svelte-11iawkb");
676
794
  },
677
795
  m(target, anchor) {
@@ -685,15 +803,15 @@ function create_fragment$f(ctx) {
685
803
 
686
804
  if (!mounted) {
687
805
  dispose = [
688
- listen(input, "input", /*input_handler*/ ctx[12]),
689
- listen(input, "input", /*input_input_handler*/ ctx[13]),
806
+ listen(input, "input", /*input_handler*/ ctx[13]),
807
+ listen(input, "input", /*input_input_handler*/ ctx[14]),
690
808
  listen(input, "focus", function () {
691
- if (is_function(/*onFocus*/ ctx[5])) /*onFocus*/ ctx[5].apply(this, arguments);
809
+ if (is_function(/*onFocus*/ ctx[6])) /*onFocus*/ ctx[6].apply(this, arguments);
692
810
  }),
693
811
  listen(input, "blur", function () {
694
- if (is_function(/*onBlur*/ ctx[6])) /*onBlur*/ ctx[6].apply(this, arguments);
812
+ if (is_function(/*onBlur*/ ctx[7])) /*onBlur*/ ctx[7].apply(this, arguments);
695
813
  }),
696
- action_destroyer(/*typeAction*/ ctx[9].call(null, input))
814
+ action_destroyer(/*typeAction*/ ctx[10].call(null, input))
697
815
  ];
698
816
 
699
817
  mounted = true;
@@ -706,7 +824,7 @@ function create_fragment$f(ctx) {
706
824
  if (if_block0) {
707
825
  if_block0.p(ctx, dirty);
708
826
  } else {
709
- if_block0 = create_if_block_1$1(ctx);
827
+ if_block0 = create_if_block_2(ctx);
710
828
  if_block0.c();
711
829
  if_block0.m(div, t0);
712
830
  }
@@ -723,24 +841,24 @@ function create_fragment$f(ctx) {
723
841
  attr(input, "placeholder", /*placeholder*/ ctx[3]);
724
842
  }
725
843
 
726
- if (dirty & /*readonly*/ 128) {
727
- input.readOnly = /*readonly*/ ctx[7];
844
+ if (dirty & /*readonly*/ 256) {
845
+ input.readOnly = /*readonly*/ ctx[8];
728
846
  }
729
847
 
730
848
  if (dirty & /*value*/ 1 && input.value !== /*value*/ ctx[0]) {
731
849
  set_input_value(input, /*value*/ ctx[0]);
732
850
  }
733
851
 
734
- if (dirty & /*border*/ 256) {
735
- toggle_class(input, "border", /*border*/ ctx[8]);
852
+ if (dirty & /*border*/ 512) {
853
+ toggle_class(input, "border", /*border*/ ctx[9]);
736
854
  }
737
855
 
738
856
  if (dirty & /*error*/ 16) {
739
857
  toggle_class(input, "error", /*error*/ ctx[4] !== null);
740
858
  }
741
859
 
742
- if (dirty & /*readonly*/ 128) {
743
- toggle_class(input, "readonlyInput", /*readonly*/ ctx[7] == true);
860
+ if (dirty & /*readonly*/ 256) {
861
+ toggle_class(input, "readonlyInput", /*readonly*/ ctx[8] == true);
744
862
  }
745
863
 
746
864
  if (/*error*/ ctx[4] != null) {
@@ -768,7 +886,7 @@ function create_fragment$f(ctx) {
768
886
  };
769
887
  }
770
888
 
771
- function instance$e($$self, $$props, $$invalidate) {
889
+ function instance$f($$self, $$props, $$invalidate) {
772
890
  var { TextType } = $$props;
773
891
 
774
892
  (function (TextType) {
@@ -782,6 +900,7 @@ function instance$e($$self, $$props, $$invalidate) {
782
900
  let { label = null } = $$props;
783
901
  let { placeholder } = $$props;
784
902
  let { error = null } = $$props;
903
+ let { htmlError = false } = $$props;
785
904
  let { value = null } = $$props;
786
905
  let { onFocus } = $$props;
787
906
  let { onBlur } = $$props;
@@ -802,17 +921,18 @@ function instance$e($$self, $$props, $$invalidate) {
802
921
  }
803
922
 
804
923
  $$self.$$set = $$props => {
805
- if ("TextType" in $$props) $$invalidate(10, TextType = $$props.TextType);
924
+ if ("TextType" in $$props) $$invalidate(11, TextType = $$props.TextType);
806
925
  if ("id" in $$props) $$invalidate(1, id = $$props.id);
807
- if ("type" in $$props) $$invalidate(11, type = $$props.type);
926
+ if ("type" in $$props) $$invalidate(12, type = $$props.type);
808
927
  if ("label" in $$props) $$invalidate(2, label = $$props.label);
809
928
  if ("placeholder" in $$props) $$invalidate(3, placeholder = $$props.placeholder);
810
929
  if ("error" in $$props) $$invalidate(4, error = $$props.error);
930
+ if ("htmlError" in $$props) $$invalidate(5, htmlError = $$props.htmlError);
811
931
  if ("value" in $$props) $$invalidate(0, value = $$props.value);
812
- if ("onFocus" in $$props) $$invalidate(5, onFocus = $$props.onFocus);
813
- if ("onBlur" in $$props) $$invalidate(6, onBlur = $$props.onBlur);
814
- if ("readonly" in $$props) $$invalidate(7, readonly = $$props.readonly);
815
- if ("border" in $$props) $$invalidate(8, border = $$props.border);
932
+ if ("onFocus" in $$props) $$invalidate(6, onFocus = $$props.onFocus);
933
+ if ("onBlur" in $$props) $$invalidate(7, onBlur = $$props.onBlur);
934
+ if ("readonly" in $$props) $$invalidate(8, readonly = $$props.readonly);
935
+ if ("border" in $$props) $$invalidate(9, border = $$props.border);
816
936
  };
817
937
 
818
938
  return [
@@ -821,6 +941,7 @@ function instance$e($$self, $$props, $$invalidate) {
821
941
  label,
822
942
  placeholder,
823
943
  error,
944
+ htmlError,
824
945
  onFocus,
825
946
  onBlur,
826
947
  readonly,
@@ -837,25 +958,26 @@ class TextInput extends SvelteComponent {
837
958
  constructor(options) {
838
959
  super();
839
960
 
840
- init(this, options, instance$e, create_fragment$f, safe_not_equal, {
841
- TextType: 10,
961
+ init(this, options, instance$f, create_fragment$g, safe_not_equal, {
962
+ TextType: 11,
842
963
  id: 1,
843
- type: 11,
964
+ type: 12,
844
965
  label: 2,
845
966
  placeholder: 3,
846
967
  error: 4,
968
+ htmlError: 5,
847
969
  value: 0,
848
- onFocus: 5,
849
- onBlur: 6,
850
- readonly: 7,
851
- border: 8
970
+ onFocus: 6,
971
+ onBlur: 7,
972
+ readonly: 8,
973
+ border: 9
852
974
  });
853
975
  }
854
976
  }
855
977
 
856
978
  /* src/RadioButton.svelte generated by Svelte v3.38.2 */
857
979
 
858
- function create_fragment$e(ctx) {
980
+ function create_fragment$f(ctx) {
859
981
  let label_1;
860
982
  let input;
861
983
  let t0;
@@ -951,7 +1073,7 @@ function create_fragment$e(ctx) {
951
1073
  };
952
1074
  }
953
1075
 
954
- function instance$d($$self, $$props, $$invalidate) {
1076
+ function instance$e($$self, $$props, $$invalidate) {
955
1077
  let { $$slots: slots = {}, $$scope } = $$props;
956
1078
  const label = "";
957
1079
  let { value } = $$props;
@@ -1002,7 +1124,7 @@ class RadioButton extends SvelteComponent {
1002
1124
  constructor(options) {
1003
1125
  super();
1004
1126
 
1005
- init(this, options, instance$d, create_fragment$e, safe_not_equal, {
1127
+ init(this, options, instance$e, create_fragment$f, safe_not_equal, {
1006
1128
  label: 5,
1007
1129
  value: 2,
1008
1130
  group: 0,
@@ -1071,7 +1193,7 @@ function create_if_block$3(ctx) {
1071
1193
  };
1072
1194
  }
1073
1195
 
1074
- function create_fragment$d(ctx) {
1196
+ function create_fragment$e(ctx) {
1075
1197
  let div;
1076
1198
  let t0;
1077
1199
  let input;
@@ -1178,7 +1300,7 @@ function create_fragment$d(ctx) {
1178
1300
  };
1179
1301
  }
1180
1302
 
1181
- function instance$c($$self, $$props, $$invalidate) {
1303
+ function instance$d($$self, $$props, $$invalidate) {
1182
1304
  const omit_props_names = ["id","label","placeholder","error","value","min","max"];
1183
1305
  let $$restProps = compute_rest_props($$props, omit_props_names);
1184
1306
  let { id } = $$props;
@@ -1228,7 +1350,7 @@ class NumberInput extends SvelteComponent {
1228
1350
  constructor(options) {
1229
1351
  super();
1230
1352
 
1231
- init(this, options, instance$c, create_fragment$d, safe_not_equal, {
1353
+ init(this, options, instance$d, create_fragment$e, safe_not_equal, {
1232
1354
  id: 1,
1233
1355
  label: 2,
1234
1356
  placeholder: 3,
@@ -3682,7 +3804,7 @@ function create_if_block$2(ctx) {
3682
3804
  };
3683
3805
  }
3684
3806
 
3685
- function create_fragment$c(ctx) {
3807
+ function create_fragment$d(ctx) {
3686
3808
  let if_block_anchor;
3687
3809
  let if_block = /*icon*/ ctx[3] && create_if_block$2(ctx);
3688
3810
 
@@ -3718,7 +3840,7 @@ function create_fragment$c(ctx) {
3718
3840
  };
3719
3841
  }
3720
3842
 
3721
- function instance$b($$self, $$props, $$invalidate) {
3843
+ function instance$c($$self, $$props, $$invalidate) {
3722
3844
  let { name } = $$props;
3723
3845
  let { stroke } = $$props;
3724
3846
  let { strokeWidth } = $$props;
@@ -3752,7 +3874,7 @@ class Icon extends SvelteComponent {
3752
3874
  constructor(options) {
3753
3875
  super();
3754
3876
 
3755
- init(this, options, instance$b, create_fragment$c, safe_not_equal, {
3877
+ init(this, options, instance$c, create_fragment$d, safe_not_equal, {
3756
3878
  name: 4,
3757
3879
  stroke: 5,
3758
3880
  strokeWidth: 6,
@@ -3765,7 +3887,7 @@ class Icon extends SvelteComponent {
3765
3887
 
3766
3888
  /* src/IconIrocoLogo.svelte generated by Svelte v3.38.2 */
3767
3889
 
3768
- function create_fragment$b(ctx) {
3890
+ function create_fragment$c(ctx) {
3769
3891
  let svg;
3770
3892
  let path0;
3771
3893
  let path1;
@@ -3807,7 +3929,7 @@ function create_fragment$b(ctx) {
3807
3929
  };
3808
3930
  }
3809
3931
 
3810
- function instance$a($$self, $$props, $$invalidate) {
3932
+ function instance$b($$self, $$props, $$invalidate) {
3811
3933
  let { width = "5rem" } = $$props;
3812
3934
  let { height = "5rem" } = $$props;
3813
3935
 
@@ -3822,13 +3944,13 @@ function instance$a($$self, $$props, $$invalidate) {
3822
3944
  class IconIrocoLogo extends SvelteComponent {
3823
3945
  constructor(options) {
3824
3946
  super();
3825
- init(this, options, instance$a, create_fragment$b, safe_not_equal, { width: 0, height: 1 });
3947
+ init(this, options, instance$b, create_fragment$c, safe_not_equal, { width: 0, height: 1 });
3826
3948
  }
3827
3949
  }
3828
3950
 
3829
3951
  /* src/Loader.svelte generated by Svelte v3.38.2 */
3830
3952
 
3831
- function create_fragment$a(ctx) {
3953
+ function create_fragment$b(ctx) {
3832
3954
  let div;
3833
3955
  let iconirocologo;
3834
3956
  let current;
@@ -3865,13 +3987,13 @@ function create_fragment$a(ctx) {
3865
3987
  class Loader extends SvelteComponent {
3866
3988
  constructor(options) {
3867
3989
  super();
3868
- init(this, options, null, create_fragment$a, safe_not_equal, {});
3990
+ init(this, options, null, create_fragment$b, safe_not_equal, {});
3869
3991
  }
3870
3992
  }
3871
3993
 
3872
3994
  /* src/IconInfo.svelte generated by Svelte v3.38.2 */
3873
3995
 
3874
- function create_fragment$9(ctx) {
3996
+ function create_fragment$a(ctx) {
3875
3997
  let svg;
3876
3998
  let path;
3877
3999
 
@@ -3912,7 +4034,7 @@ function create_fragment$9(ctx) {
3912
4034
  };
3913
4035
  }
3914
4036
 
3915
- function instance$9($$self, $$props, $$invalidate) {
4037
+ function instance$a($$self, $$props, $$invalidate) {
3916
4038
  let { width = "5rem" } = $$props;
3917
4039
  let { height = "5rem" } = $$props;
3918
4040
 
@@ -3927,7 +4049,78 @@ function instance$9($$self, $$props, $$invalidate) {
3927
4049
  class IconInfo extends SvelteComponent {
3928
4050
  constructor(options) {
3929
4051
  super();
3930
- init(this, options, instance$9, create_fragment$9, safe_not_equal, { width: 0, height: 1 });
4052
+ init(this, options, instance$a, create_fragment$a, safe_not_equal, { width: 0, height: 1 });
4053
+ }
4054
+ }
4055
+
4056
+ /* src/IconMastodon.svelte generated by Svelte v3.38.2 */
4057
+
4058
+ function create_fragment$9(ctx) {
4059
+ let svg;
4060
+ let title;
4061
+ let t;
4062
+ let path;
4063
+
4064
+ return {
4065
+ c() {
4066
+ svg = svg_element("svg");
4067
+ title = svg_element("title");
4068
+ t = text("Mastodon");
4069
+ path = svg_element("path");
4070
+ attr(path, "d", "M23.193 7.88c0-5.207-3.411-6.733-3.411-6.733C18.062.357 15.108.025 12.041 0h-.076c-3.069.025-6.02.357-7.74 1.147 0 0-3.412 1.526-3.412 6.732 0 1.193-.023 2.619.015 4.13.124 5.092.934 10.11 5.641 11.355 2.17.574 4.034.695 5.536.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.13.54c-2.165-.075-4.449-.234-4.799-2.892a5.5 5.5 0 0 1-.048-.745s2.125.52 4.818.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.508.475-6.508zm-4.024 6.709h-2.497v-6.12c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.313v3.349h-2.484v-3.35c0-1.537-.602-2.313-1.802-2.313-1.085 0-1.628.655-1.628 1.945v6.119H4.831V8.285c0-1.29.328-2.314.987-3.07.68-.759 1.57-1.147 2.674-1.147 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.305z");
4071
+ attr(path, "fill", /*fill*/ ctx[2]);
4072
+ attr(svg, "width", /*width*/ ctx[0]);
4073
+ attr(svg, "height", /*height*/ ctx[1]);
4074
+ attr(svg, "role", "img");
4075
+ attr(svg, "viewBox", "0 0 24 24");
4076
+ attr(svg, "class", "icon-mastodon");
4077
+ attr(svg, "xmlns", "http://www.w3.org/2000/svg");
4078
+ },
4079
+ m(target, anchor) {
4080
+ insert(target, svg, anchor);
4081
+ append(svg, title);
4082
+ append(title, t);
4083
+ append(svg, path);
4084
+ },
4085
+ p(ctx, [dirty]) {
4086
+ if (dirty & /*fill*/ 4) {
4087
+ attr(path, "fill", /*fill*/ ctx[2]);
4088
+ }
4089
+
4090
+ if (dirty & /*width*/ 1) {
4091
+ attr(svg, "width", /*width*/ ctx[0]);
4092
+ }
4093
+
4094
+ if (dirty & /*height*/ 2) {
4095
+ attr(svg, "height", /*height*/ ctx[1]);
4096
+ }
4097
+ },
4098
+ i: noop,
4099
+ o: noop,
4100
+ d(detaching) {
4101
+ if (detaching) detach(svg);
4102
+ }
4103
+ };
4104
+ }
4105
+
4106
+ function instance$9($$self, $$props, $$invalidate) {
4107
+ let { width = "5em" } = $$props;
4108
+ let { height = "5em" } = $$props;
4109
+ let { fill = "currentColor" } = $$props;
4110
+
4111
+ $$self.$$set = $$props => {
4112
+ if ("width" in $$props) $$invalidate(0, width = $$props.width);
4113
+ if ("height" in $$props) $$invalidate(1, height = $$props.height);
4114
+ if ("fill" in $$props) $$invalidate(2, fill = $$props.fill);
4115
+ };
4116
+
4117
+ return [width, height, fill];
4118
+ }
4119
+
4120
+ class IconMastodon extends SvelteComponent {
4121
+ constructor(options) {
4122
+ super();
4123
+ init(this, options, instance$9, create_fragment$9, safe_not_equal, { width: 0, height: 1, fill: 2 });
3931
4124
  }
3932
4125
  }
3933
4126
 
@@ -3996,16 +4189,15 @@ class IconClose extends SvelteComponent {
3996
4189
 
3997
4190
  function get_each_context$1(ctx, list, i) {
3998
4191
  const child_ctx = ctx.slice();
3999
- child_ctx[6] = list[i].destination;
4000
- child_ctx[7] = list[i].name;
4192
+ child_ctx[6] = list[i];
4001
4193
  return child_ctx;
4002
4194
  }
4003
4195
 
4004
- // (19:2) {#each navigationItems as { destination, name }}
4196
+ // (23:2) {#each navigationItems as item}
4005
4197
  function create_each_block$1(ctx) {
4006
4198
  let li;
4007
4199
  let a;
4008
- let t0_value = /*name*/ ctx[7] + "";
4200
+ let t0_value = /*item*/ ctx[6].name + "";
4009
4201
  let t0;
4010
4202
  let a_href_value;
4011
4203
  let t1;
@@ -4013,7 +4205,7 @@ function create_each_block$1(ctx) {
4013
4205
  let dispose;
4014
4206
 
4015
4207
  function click_handler_1() {
4016
- return /*click_handler_1*/ ctx[4](/*destination*/ ctx[6]);
4208
+ return /*click_handler_1*/ ctx[4](/*item*/ ctx[6]);
4017
4209
  }
4018
4210
 
4019
4211
  return {
@@ -4022,10 +4214,14 @@ function create_each_block$1(ctx) {
4022
4214
  a = element("a");
4023
4215
  t0 = text(t0_value);
4024
4216
  t1 = space();
4025
- attr(a, "href", a_href_value = /*destination*/ ctx[6]);
4026
- attr(a, "class", "svelte-1rx212l");
4027
- attr(li, "class", "account__sidebar__item svelte-1rx212l");
4028
- toggle_class(li, "active", /*active*/ ctx[1] === /*destination*/ ctx[6]);
4217
+
4218
+ attr(a, "href", a_href_value = typeof /*item*/ ctx[6].hrefOrCallback === "string"
4219
+ ? /*item*/ ctx[6].hrefOrCallback
4220
+ : "#");
4221
+
4222
+ attr(a, "class", "svelte-12quws1");
4223
+ attr(li, "class", "account__sidebar__item svelte-12quws1");
4224
+ toggle_class(li, "active", /*active*/ ctx[1] === /*item*/ ctx[6].name);
4029
4225
  },
4030
4226
  m(target, anchor) {
4031
4227
  insert(target, li, anchor);
@@ -4040,14 +4236,16 @@ function create_each_block$1(ctx) {
4040
4236
  },
4041
4237
  p(new_ctx, dirty) {
4042
4238
  ctx = new_ctx;
4043
- if (dirty & /*navigationItems*/ 1 && t0_value !== (t0_value = /*name*/ ctx[7] + "")) set_data(t0, t0_value);
4239
+ if (dirty & /*navigationItems*/ 1 && t0_value !== (t0_value = /*item*/ ctx[6].name + "")) set_data(t0, t0_value);
4044
4240
 
4045
- if (dirty & /*navigationItems*/ 1 && a_href_value !== (a_href_value = /*destination*/ ctx[6])) {
4241
+ if (dirty & /*navigationItems*/ 1 && a_href_value !== (a_href_value = typeof /*item*/ ctx[6].hrefOrCallback === "string"
4242
+ ? /*item*/ ctx[6].hrefOrCallback
4243
+ : "#")) {
4046
4244
  attr(a, "href", a_href_value);
4047
4245
  }
4048
4246
 
4049
4247
  if (dirty & /*active, navigationItems*/ 3) {
4050
- toggle_class(li, "active", /*active*/ ctx[1] === /*destination*/ ctx[6]);
4248
+ toggle_class(li, "active", /*active*/ ctx[1] === /*item*/ ctx[6].name);
4051
4249
  }
4052
4250
  },
4053
4251
  d(detaching) {
@@ -4087,10 +4285,10 @@ function create_fragment$7(ctx) {
4087
4285
  each_blocks[i].c();
4088
4286
  }
4089
4287
 
4090
- attr(button, "class", "account__sidebar__close svelte-1rx212l");
4091
- attr(ul, "class", "account__sidebar__item_container svelte-1rx212l");
4288
+ attr(button, "class", "account__sidebar__close svelte-12quws1");
4289
+ attr(ul, "class", "account__sidebar__item_container svelte-12quws1");
4092
4290
  attr(nav, "data-testid", "sidebar");
4093
- attr(nav, "class", "account__sidebar svelte-1rx212l");
4291
+ attr(nav, "class", "account__sidebar svelte-12quws1");
4094
4292
  },
4095
4293
  m(target, anchor) {
4096
4294
  insert(target, nav, anchor);
@@ -4159,8 +4357,14 @@ function instance$7($$self, $$props, $$invalidate) {
4159
4357
  let active;
4160
4358
  const dispatch = createEventDispatcher();
4161
4359
 
4162
- const handleClickLink = destination => {
4163
- $$invalidate(1, active = destination);
4360
+ const handleClickLink = menuItem => {
4361
+ $$invalidate(1, active = menuItem.name);
4362
+
4363
+ if (typeof menuItem.hrefOrCallback === "function") {
4364
+ menuItem.hrefOrCallback();
4365
+ return false; // to avoid calling href
4366
+ }
4367
+
4164
4368
  dispatch("click_link");
4165
4369
  };
4166
4370
 
@@ -4168,7 +4372,7 @@ function instance$7($$self, $$props, $$invalidate) {
4168
4372
  bubble($$self, event);
4169
4373
  }
4170
4374
 
4171
- const click_handler_1 = destination => handleClickLink(destination);
4375
+ const click_handler_1 = item => handleClickLink(item);
4172
4376
 
4173
4377
  $$self.$$set = $$props => {
4174
4378
  if ("navigationItems" in $$props) $$invalidate(0, navigationItems = $$props.navigationItems);
@@ -4344,13 +4548,13 @@ function create_fragment$5(ctx) {
4344
4548
  t6 = text(/*title*/ ctx[1]);
4345
4549
  t7 = space();
4346
4550
  create_component(sidebar.$$.fragment);
4347
- attr(h10, "class", "svelte-1jgfrsf");
4348
- attr(div0, "class", "account__navigation--mobile__title-container svelte-1jgfrsf");
4349
- attr(button, "class", "account__navigation--mobile__button svelte-1jgfrsf");
4350
- attr(div1, "class", "account__navigation--mobile svelte-1jgfrsf");
4351
- attr(h11, "class", "svelte-1jgfrsf");
4352
- attr(div2, "class", "account__navigation__title-container svelte-1jgfrsf");
4353
- attr(div3, "class", "account__navigation svelte-1jgfrsf");
4551
+ attr(h10, "class", "svelte-1uu9ytm");
4552
+ attr(div0, "class", "account__navigation--mobile__title-container svelte-1uu9ytm");
4553
+ attr(button, "class", "account__navigation--mobile__button svelte-1uu9ytm");
4554
+ attr(div1, "class", "account__navigation--mobile svelte-1uu9ytm");
4555
+ attr(h11, "class", "svelte-1uu9ytm");
4556
+ attr(div2, "class", "account__navigation__title-container svelte-1uu9ytm");
4557
+ attr(div3, "class", "account__navigation svelte-1uu9ytm");
4354
4558
  },
4355
4559
  m(target, anchor) {
4356
4560
  insert(target, div1, anchor);
@@ -5203,4 +5407,4 @@ class Alert extends SvelteComponent {
5203
5407
  }
5204
5408
  }
5205
5409
 
5206
- export { Alert, Button, DataTable, Icon, IconFloppyDisk, IconInfo, IconMoreSign as IconMore, IconTrashCan, Loader, Navigation, NumberInput, RadioButton, SideBar, TextInput };
5410
+ export { Alert, Button, DataTable, Icon, IconFloppyDisk, IconInfo, IconMastodon, IconMoreSign as IconMore, IconTrashCan, Loader, Navigation, NumberInput, RadioButton, SideBar, TextInput };