@iroco/ui 0.7.0 → 0.9.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) {
@@ -592,7 +623,7 @@ class Button extends SvelteComponent {
592
623
 
593
624
  /* src/TextInput.svelte generated by Svelte v3.38.2 */
594
625
 
595
- function create_if_block_1$1(ctx) {
626
+ function create_if_block_2(ctx) {
596
627
  let label_1;
597
628
  let t;
598
629
 
@@ -620,28 +651,91 @@ function create_if_block_1$1(ctx) {
620
651
  };
621
652
  }
622
653
 
623
- // (40:1) {#if error != null}
654
+ // (41:1) {#if error != null}
624
655
  function create_if_block$4(ctx) {
625
656
  let p;
626
- let t_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "";
627
- let t;
657
+
658
+ function select_block_type(ctx, dirty) {
659
+ if (/*htmlError*/ ctx[5]) return create_if_block_1$1;
660
+ return create_else_block$1;
661
+ }
662
+
663
+ let current_block_type = select_block_type(ctx);
664
+ let if_block = current_block_type(ctx);
628
665
 
629
666
  return {
630
667
  c() {
631
668
  p = element("p");
632
- t = text(t_value);
669
+ if_block.c();
633
670
  attr(p, "data-testid", "error");
634
671
  attr(p, "class", "error svelte-11iawkb");
635
672
  },
636
673
  m(target, anchor) {
637
674
  insert(target, p, anchor);
638
- append(p, t);
675
+ if_block.m(p, null);
639
676
  },
640
677
  p(ctx, dirty) {
641
- if (dirty & /*error*/ 16 && t_value !== (t_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "")) set_data(t, t_value);
678
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
679
+ if_block.p(ctx, dirty);
680
+ } else {
681
+ if_block.d(1);
682
+ if_block = current_block_type(ctx);
683
+
684
+ if (if_block) {
685
+ if_block.c();
686
+ if_block.m(p, null);
687
+ }
688
+ }
642
689
  },
643
690
  d(detaching) {
644
691
  if (detaching) detach(p);
692
+ if_block.d();
693
+ }
694
+ };
695
+ }
696
+
697
+ // (45:3) {:else}
698
+ function create_else_block$1(ctx) {
699
+ let t_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "";
700
+ let t;
701
+
702
+ return {
703
+ c() {
704
+ t = text(t_value);
705
+ },
706
+ m(target, anchor) {
707
+ insert(target, t, anchor);
708
+ },
709
+ p(ctx, dirty) {
710
+ if (dirty & /*error*/ 16 && t_value !== (t_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "")) set_data(t, t_value);
711
+ },
712
+ d(detaching) {
713
+ if (detaching) detach(t);
714
+ }
715
+ };
716
+ }
717
+
718
+ // (43:3) {#if htmlError}
719
+ function create_if_block_1$1(ctx) {
720
+ let html_tag;
721
+ let raw_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "";
722
+ let html_anchor;
723
+
724
+ return {
725
+ c() {
726
+ html_anchor = empty();
727
+ html_tag = new HtmlTag(html_anchor);
728
+ },
729
+ m(target, anchor) {
730
+ html_tag.m(raw_value, target, anchor);
731
+ insert(target, html_anchor, anchor);
732
+ },
733
+ p(ctx, dirty) {
734
+ if (dirty & /*error*/ 16 && raw_value !== (raw_value = (/*error*/ ctx[4] !== null ? /*error*/ ctx[4] : "") + "")) html_tag.p(raw_value);
735
+ },
736
+ d(detaching) {
737
+ if (detaching) detach(html_anchor);
738
+ if (detaching) html_tag.d();
645
739
  }
646
740
  };
647
741
  }
@@ -653,7 +747,7 @@ function create_fragment$f(ctx) {
653
747
  let t1;
654
748
  let mounted;
655
749
  let dispose;
656
- let if_block0 = /*label*/ ctx[2] && create_if_block_1$1(ctx);
750
+ let if_block0 = /*label*/ ctx[2] && create_if_block_2(ctx);
657
751
  let if_block1 = /*error*/ ctx[4] != null && create_if_block$4(ctx);
658
752
 
659
753
  return {
@@ -667,11 +761,11 @@ function create_fragment$f(ctx) {
667
761
  attr(input, "id", /*id*/ ctx[1]);
668
762
  attr(input, "type", "text");
669
763
  attr(input, "placeholder", /*placeholder*/ ctx[3]);
670
- input.readOnly = /*readonly*/ ctx[7];
764
+ input.readOnly = /*readonly*/ ctx[8];
671
765
  attr(input, "class", "svelte-11iawkb");
672
- toggle_class(input, "border", /*border*/ ctx[8]);
766
+ toggle_class(input, "border", /*border*/ ctx[9]);
673
767
  toggle_class(input, "error", /*error*/ ctx[4] !== null);
674
- toggle_class(input, "readonlyInput", /*readonly*/ ctx[7] == true);
768
+ toggle_class(input, "readonlyInput", /*readonly*/ ctx[8] == true);
675
769
  attr(div, "class", "iroco-ui-input svelte-11iawkb");
676
770
  },
677
771
  m(target, anchor) {
@@ -685,15 +779,15 @@ function create_fragment$f(ctx) {
685
779
 
686
780
  if (!mounted) {
687
781
  dispose = [
688
- listen(input, "input", /*input_handler*/ ctx[12]),
689
- listen(input, "input", /*input_input_handler*/ ctx[13]),
782
+ listen(input, "input", /*input_handler*/ ctx[13]),
783
+ listen(input, "input", /*input_input_handler*/ ctx[14]),
690
784
  listen(input, "focus", function () {
691
- if (is_function(/*onFocus*/ ctx[5])) /*onFocus*/ ctx[5].apply(this, arguments);
785
+ if (is_function(/*onFocus*/ ctx[6])) /*onFocus*/ ctx[6].apply(this, arguments);
692
786
  }),
693
787
  listen(input, "blur", function () {
694
- if (is_function(/*onBlur*/ ctx[6])) /*onBlur*/ ctx[6].apply(this, arguments);
788
+ if (is_function(/*onBlur*/ ctx[7])) /*onBlur*/ ctx[7].apply(this, arguments);
695
789
  }),
696
- action_destroyer(/*typeAction*/ ctx[9].call(null, input))
790
+ action_destroyer(/*typeAction*/ ctx[10].call(null, input))
697
791
  ];
698
792
 
699
793
  mounted = true;
@@ -706,7 +800,7 @@ function create_fragment$f(ctx) {
706
800
  if (if_block0) {
707
801
  if_block0.p(ctx, dirty);
708
802
  } else {
709
- if_block0 = create_if_block_1$1(ctx);
803
+ if_block0 = create_if_block_2(ctx);
710
804
  if_block0.c();
711
805
  if_block0.m(div, t0);
712
806
  }
@@ -723,24 +817,24 @@ function create_fragment$f(ctx) {
723
817
  attr(input, "placeholder", /*placeholder*/ ctx[3]);
724
818
  }
725
819
 
726
- if (dirty & /*readonly*/ 128) {
727
- input.readOnly = /*readonly*/ ctx[7];
820
+ if (dirty & /*readonly*/ 256) {
821
+ input.readOnly = /*readonly*/ ctx[8];
728
822
  }
729
823
 
730
824
  if (dirty & /*value*/ 1 && input.value !== /*value*/ ctx[0]) {
731
825
  set_input_value(input, /*value*/ ctx[0]);
732
826
  }
733
827
 
734
- if (dirty & /*border*/ 256) {
735
- toggle_class(input, "border", /*border*/ ctx[8]);
828
+ if (dirty & /*border*/ 512) {
829
+ toggle_class(input, "border", /*border*/ ctx[9]);
736
830
  }
737
831
 
738
832
  if (dirty & /*error*/ 16) {
739
833
  toggle_class(input, "error", /*error*/ ctx[4] !== null);
740
834
  }
741
835
 
742
- if (dirty & /*readonly*/ 128) {
743
- toggle_class(input, "readonlyInput", /*readonly*/ ctx[7] == true);
836
+ if (dirty & /*readonly*/ 256) {
837
+ toggle_class(input, "readonlyInput", /*readonly*/ ctx[8] == true);
744
838
  }
745
839
 
746
840
  if (/*error*/ ctx[4] != null) {
@@ -782,6 +876,7 @@ function instance$e($$self, $$props, $$invalidate) {
782
876
  let { label = null } = $$props;
783
877
  let { placeholder } = $$props;
784
878
  let { error = null } = $$props;
879
+ let { htmlError = false } = $$props;
785
880
  let { value = null } = $$props;
786
881
  let { onFocus } = $$props;
787
882
  let { onBlur } = $$props;
@@ -802,17 +897,18 @@ function instance$e($$self, $$props, $$invalidate) {
802
897
  }
803
898
 
804
899
  $$self.$$set = $$props => {
805
- if ("TextType" in $$props) $$invalidate(10, TextType = $$props.TextType);
900
+ if ("TextType" in $$props) $$invalidate(11, TextType = $$props.TextType);
806
901
  if ("id" in $$props) $$invalidate(1, id = $$props.id);
807
- if ("type" in $$props) $$invalidate(11, type = $$props.type);
902
+ if ("type" in $$props) $$invalidate(12, type = $$props.type);
808
903
  if ("label" in $$props) $$invalidate(2, label = $$props.label);
809
904
  if ("placeholder" in $$props) $$invalidate(3, placeholder = $$props.placeholder);
810
905
  if ("error" in $$props) $$invalidate(4, error = $$props.error);
906
+ if ("htmlError" in $$props) $$invalidate(5, htmlError = $$props.htmlError);
811
907
  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);
908
+ if ("onFocus" in $$props) $$invalidate(6, onFocus = $$props.onFocus);
909
+ if ("onBlur" in $$props) $$invalidate(7, onBlur = $$props.onBlur);
910
+ if ("readonly" in $$props) $$invalidate(8, readonly = $$props.readonly);
911
+ if ("border" in $$props) $$invalidate(9, border = $$props.border);
816
912
  };
817
913
 
818
914
  return [
@@ -821,6 +917,7 @@ function instance$e($$self, $$props, $$invalidate) {
821
917
  label,
822
918
  placeholder,
823
919
  error,
920
+ htmlError,
824
921
  onFocus,
825
922
  onBlur,
826
923
  readonly,
@@ -838,17 +935,18 @@ class TextInput extends SvelteComponent {
838
935
  super();
839
936
 
840
937
  init(this, options, instance$e, create_fragment$f, safe_not_equal, {
841
- TextType: 10,
938
+ TextType: 11,
842
939
  id: 1,
843
- type: 11,
940
+ type: 12,
844
941
  label: 2,
845
942
  placeholder: 3,
846
943
  error: 4,
944
+ htmlError: 5,
847
945
  value: 0,
848
- onFocus: 5,
849
- onBlur: 6,
850
- readonly: 7,
851
- border: 8
946
+ onFocus: 6,
947
+ onBlur: 7,
948
+ readonly: 8,
949
+ border: 9
852
950
  });
853
951
  }
854
952
  }
@@ -3996,16 +4094,15 @@ class IconClose extends SvelteComponent {
3996
4094
 
3997
4095
  function get_each_context$1(ctx, list, i) {
3998
4096
  const child_ctx = ctx.slice();
3999
- child_ctx[6] = list[i].destination;
4000
- child_ctx[7] = list[i].name;
4097
+ child_ctx[6] = list[i];
4001
4098
  return child_ctx;
4002
4099
  }
4003
4100
 
4004
- // (19:2) {#each navigationItems as { destination, name }}
4101
+ // (23:2) {#each navigationItems as item}
4005
4102
  function create_each_block$1(ctx) {
4006
4103
  let li;
4007
4104
  let a;
4008
- let t0_value = /*name*/ ctx[7] + "";
4105
+ let t0_value = /*item*/ ctx[6].name + "";
4009
4106
  let t0;
4010
4107
  let a_href_value;
4011
4108
  let t1;
@@ -4013,7 +4110,7 @@ function create_each_block$1(ctx) {
4013
4110
  let dispose;
4014
4111
 
4015
4112
  function click_handler_1() {
4016
- return /*click_handler_1*/ ctx[4](/*destination*/ ctx[6]);
4113
+ return /*click_handler_1*/ ctx[4](/*item*/ ctx[6]);
4017
4114
  }
4018
4115
 
4019
4116
  return {
@@ -4022,10 +4119,14 @@ function create_each_block$1(ctx) {
4022
4119
  a = element("a");
4023
4120
  t0 = text(t0_value);
4024
4121
  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]);
4122
+
4123
+ attr(a, "href", a_href_value = typeof /*item*/ ctx[6].hrefOrCallback === "string"
4124
+ ? /*item*/ ctx[6].hrefOrCallback
4125
+ : "#");
4126
+
4127
+ attr(a, "class", "svelte-jkys2k");
4128
+ attr(li, "class", "account__sidebar__item svelte-jkys2k");
4129
+ toggle_class(li, "active", /*active*/ ctx[1] === /*item*/ ctx[6].name);
4029
4130
  },
4030
4131
  m(target, anchor) {
4031
4132
  insert(target, li, anchor);
@@ -4040,14 +4141,16 @@ function create_each_block$1(ctx) {
4040
4141
  },
4041
4142
  p(new_ctx, dirty) {
4042
4143
  ctx = new_ctx;
4043
- if (dirty & /*navigationItems*/ 1 && t0_value !== (t0_value = /*name*/ ctx[7] + "")) set_data(t0, t0_value);
4144
+ if (dirty & /*navigationItems*/ 1 && t0_value !== (t0_value = /*item*/ ctx[6].name + "")) set_data(t0, t0_value);
4044
4145
 
4045
- if (dirty & /*navigationItems*/ 1 && a_href_value !== (a_href_value = /*destination*/ ctx[6])) {
4146
+ if (dirty & /*navigationItems*/ 1 && a_href_value !== (a_href_value = typeof /*item*/ ctx[6].hrefOrCallback === "string"
4147
+ ? /*item*/ ctx[6].hrefOrCallback
4148
+ : "#")) {
4046
4149
  attr(a, "href", a_href_value);
4047
4150
  }
4048
4151
 
4049
4152
  if (dirty & /*active, navigationItems*/ 3) {
4050
- toggle_class(li, "active", /*active*/ ctx[1] === /*destination*/ ctx[6]);
4153
+ toggle_class(li, "active", /*active*/ ctx[1] === /*item*/ ctx[6].name);
4051
4154
  }
4052
4155
  },
4053
4156
  d(detaching) {
@@ -4087,10 +4190,10 @@ function create_fragment$7(ctx) {
4087
4190
  each_blocks[i].c();
4088
4191
  }
4089
4192
 
4090
- attr(button, "class", "account__sidebar__close svelte-1rx212l");
4091
- attr(ul, "class", "account__sidebar__item_container svelte-1rx212l");
4193
+ attr(button, "class", "account__sidebar__close svelte-jkys2k");
4194
+ attr(ul, "class", "account__sidebar__item_container svelte-jkys2k");
4092
4195
  attr(nav, "data-testid", "sidebar");
4093
- attr(nav, "class", "account__sidebar svelte-1rx212l");
4196
+ attr(nav, "class", "account__sidebar svelte-jkys2k");
4094
4197
  },
4095
4198
  m(target, anchor) {
4096
4199
  insert(target, nav, anchor);
@@ -4159,8 +4262,14 @@ function instance$7($$self, $$props, $$invalidate) {
4159
4262
  let active;
4160
4263
  const dispatch = createEventDispatcher();
4161
4264
 
4162
- const handleClickLink = destination => {
4163
- $$invalidate(1, active = destination);
4265
+ const handleClickLink = menuItem => {
4266
+ $$invalidate(1, active = menuItem.name);
4267
+
4268
+ if (typeof menuItem.hrefOrCallback === "function") {
4269
+ menuItem.hrefOrCallback();
4270
+ return false; // to avoid calling href
4271
+ }
4272
+
4164
4273
  dispatch("click_link");
4165
4274
  };
4166
4275
 
@@ -4168,7 +4277,7 @@ function instance$7($$self, $$props, $$invalidate) {
4168
4277
  bubble($$self, event);
4169
4278
  }
4170
4279
 
4171
- const click_handler_1 = destination => handleClickLink(destination);
4280
+ const click_handler_1 = item => handleClickLink(item);
4172
4281
 
4173
4282
  $$self.$$set = $$props => {
4174
4283
  if ("navigationItems" in $$props) $$invalidate(0, navigationItems = $$props.navigationItems);
@@ -4344,13 +4453,13 @@ function create_fragment$5(ctx) {
4344
4453
  t6 = text(/*title*/ ctx[1]);
4345
4454
  t7 = space();
4346
4455
  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");
4456
+ attr(h10, "class", "svelte-1uu9ytm");
4457
+ attr(div0, "class", "account__navigation--mobile__title-container svelte-1uu9ytm");
4458
+ attr(button, "class", "account__navigation--mobile__button svelte-1uu9ytm");
4459
+ attr(div1, "class", "account__navigation--mobile svelte-1uu9ytm");
4460
+ attr(h11, "class", "svelte-1uu9ytm");
4461
+ attr(div2, "class", "account__navigation__title-container svelte-1uu9ytm");
4462
+ attr(div3, "class", "account__navigation svelte-1uu9ytm");
4354
4463
  },
4355
4464
  m(target, anchor) {
4356
4465
  insert(target, div1, anchor);
package/lib/index.mjs.css CHANGED
@@ -16,40 +16,6 @@ svg.svelte-1cuxg7m {
16
16
  to {
17
17
  transform: rotate(359deg); } }
18
18
 
19
- .data-table.svelte-1ju5y8t {
20
- border: 1px solid #464452;
21
- width: 100%; }
22
-
23
- .data-table__header.svelte-1ju5y8t {
24
- font-size: 1.5em;
25
- height: 4rem; }
26
-
27
- .data-table__header__cell.svelte-1ju5y8t {
28
- border-bottom: 1px solid #464452; }
29
-
30
- .data-table__body__cell.svelte-1ju5y8t {
31
- text-align: center;
32
- vertical-align: middle; }
33
-
34
- .alert.svelte-1oun6o6 {
35
- min-height: 2em;
36
- display: inline-flex;
37
- align-items: center;
38
- border-radius: 0.5em;
39
- padding: 0 1em 0 1em;
40
- font-size: 1.2em;
41
- justify-content: center;
42
- margin-bottom: 1em;
43
- cursor: pointer; }
44
-
45
- .alert--danger.svelte-1oun6o6 {
46
- background-color: rgba(255, 80, 77, 0.5);
47
- border: 1px solid #ff504d; }
48
-
49
- .alert--success.svelte-1oun6o6 {
50
- background-color: rgba(0, 214, 146, 0.5);
51
- border: 1px solid #00D692; }
52
-
53
19
  .iroco-ui-radio.svelte-156c82q.svelte-156c82q.svelte-156c82q {
54
20
  color: #f2ebe3;
55
21
  position: relative;
@@ -288,63 +254,63 @@ input.svelte-11iawkb.svelte-11iawkb:focus {
288
254
  .iroco-ui-button.rounded.svelte-hp8sdi {
289
255
  border-radius: 10px; }
290
256
 
291
- .account__navigation.svelte-1jgfrsf.svelte-1jgfrsf {
257
+ .account__navigation.svelte-1uu9ytm.svelte-1uu9ytm {
292
258
  display: block;
293
259
  width: 100%;
294
260
  border-bottom: 1px solid #464452; }
295
261
 
296
- .account__navigation--mobile.svelte-1jgfrsf.svelte-1jgfrsf {
262
+ .account__navigation--mobile.svelte-1uu9ytm.svelte-1uu9ytm {
297
263
  display: none; }
298
264
 
299
- .account__navigation__title-container.svelte-1jgfrsf.svelte-1jgfrsf {
265
+ .account__navigation__title-container.svelte-1uu9ytm.svelte-1uu9ytm {
300
266
  display: flex;
301
267
  align-items: center;
302
268
  padding-left: 1em; }
303
269
 
304
- .account__navigation__title-container.svelte-1jgfrsf h1.svelte-1jgfrsf {
270
+ .account__navigation__title-container.svelte-1uu9ytm h1.svelte-1uu9ytm {
305
271
  padding-left: 1em; }
306
272
 
307
273
  @media all and (max-width: 768px) {
308
- .account__navigation.svelte-1jgfrsf.svelte-1jgfrsf {
274
+ .account__navigation.svelte-1uu9ytm.svelte-1uu9ytm {
309
275
  display: none;
310
276
  color: #f2ebe3; }
311
- .account__navigation--mobile.svelte-1jgfrsf.svelte-1jgfrsf {
277
+ .account__navigation--mobile.svelte-1uu9ytm.svelte-1uu9ytm {
312
278
  display: flex;
313
279
  padding: 0 1em;
314
280
  justify-content: space-between;
315
281
  position: fixed;
316
282
  top: 0;
283
+ z-index: 1;
317
284
  width: 100%;
318
285
  border-bottom: 1px solid #464452; }
319
- .account__navigation--mobile.svelte-1jgfrsf h1.svelte-1jgfrsf {
286
+ .account__navigation--mobile.svelte-1uu9ytm h1.svelte-1uu9ytm {
320
287
  font: bold;
321
288
  font-size: 2em; }
322
- .account__navigation--mobile__button.svelte-1jgfrsf.svelte-1jgfrsf {
289
+ .account__navigation--mobile__button.svelte-1uu9ytm.svelte-1uu9ytm {
323
290
  background-color: transparent;
324
291
  border: none;
325
292
  color: #464452; }
326
- .account__navigation--mobile__title-container.svelte-1jgfrsf.svelte-1jgfrsf {
293
+ .account__navigation--mobile__title-container.svelte-1uu9ytm.svelte-1uu9ytm {
327
294
  display: flex;
328
295
  align-items: center; }
329
- .account__navigation--mobile__title-container.svelte-1jgfrsf h1.svelte-1jgfrsf {
296
+ .account__navigation--mobile__title-container.svelte-1uu9ytm h1.svelte-1uu9ytm {
330
297
  padding-left: 0.5em; } }
331
298
 
332
- .account__sidebar.svelte-1rx212l.svelte-1rx212l {
299
+ .account__sidebar.svelte-jkys2k.svelte-jkys2k {
333
300
  height: 100%;
334
301
  width: 300px;
335
302
  position: absolute;
336
303
  top: 70px;
337
- z-index: 1;
338
304
  overflow-x: hidden;
339
305
  border-right: 1px solid #464452; }
340
306
 
341
- .account__sidebar__item_container.svelte-1rx212l.svelte-1rx212l {
307
+ .account__sidebar__item_container.svelte-jkys2k.svelte-jkys2k {
342
308
  margin: 0;
343
309
  padding: 0;
344
310
  width: 100%;
345
311
  height: 100%; }
346
312
 
347
- .account__sidebar__item.svelte-1rx212l.svelte-1rx212l {
313
+ .account__sidebar__item.svelte-jkys2k.svelte-jkys2k {
348
314
  padding: 2em 2em;
349
315
  text-decoration: none;
350
316
  font-size: 0.75em;
@@ -353,19 +319,19 @@ input.svelte-11iawkb.svelte-11iawkb:focus {
353
319
  border-bottom: 1px solid #464452 a;
354
320
  border-bottom-padding-left: 1em; }
355
321
 
356
- .account__sidebar__item.svelte-1rx212l a.svelte-1rx212l {
322
+ .account__sidebar__item.svelte-jkys2k a.svelte-jkys2k {
357
323
  color: #f2ebe3;
358
324
  font-size: 2em; }
359
325
 
360
- .account__sidebar__close.svelte-1rx212l.svelte-1rx212l {
326
+ .account__sidebar__close.svelte-jkys2k.svelte-jkys2k {
361
327
  display: none; }
362
328
 
363
- .account__sidebar.svelte-1rx212l .active.svelte-1rx212l {
329
+ .account__sidebar.svelte-jkys2k .active.svelte-jkys2k {
364
330
  border-top: 1px solid #00D692;
365
331
  border-bottom: 1px solid #00D692; }
366
332
 
367
333
  @media all and (max-width: 768px) {
368
- .account__sidebar.svelte-1rx212l.svelte-1rx212l {
334
+ .account__sidebar.svelte-jkys2k.svelte-jkys2k {
369
335
  position: fixed;
370
336
  background-color: #211D28;
371
337
  top: 0;
@@ -375,10 +341,10 @@ input.svelte-11iawkb.svelte-11iawkb:focus {
375
341
  padding-top: 2em;
376
342
  margin: 0;
377
343
  border-right: none; }
378
- .account__sidebar__item_container.svelte-1rx212l.svelte-1rx212l {
344
+ .account__sidebar__item_container.svelte-jkys2k.svelte-jkys2k {
379
345
  padding: 0em;
380
346
  margin-top: 2rem; }
381
- .account__sidebar__close.svelte-1rx212l.svelte-1rx212l {
347
+ .account__sidebar__close.svelte-jkys2k.svelte-jkys2k {
382
348
  display: block;
383
349
  position: absolute;
384
350
  right: 0;
@@ -392,3 +358,36 @@ input.svelte-11iawkb.svelte-11iawkb:focus {
392
358
  @use "fonts";
393
359
  @use "forms";
394
360
  @use "layouts";
361
+ .data-table.svelte-1ju5y8t {
362
+ border: 1px solid #464452;
363
+ width: 100%; }
364
+
365
+ .data-table__header.svelte-1ju5y8t {
366
+ font-size: 1.5em;
367
+ height: 4rem; }
368
+
369
+ .data-table__header__cell.svelte-1ju5y8t {
370
+ border-bottom: 1px solid #464452; }
371
+
372
+ .data-table__body__cell.svelte-1ju5y8t {
373
+ text-align: center;
374
+ vertical-align: middle; }
375
+
376
+ .alert.svelte-1oun6o6 {
377
+ min-height: 2em;
378
+ display: inline-flex;
379
+ align-items: center;
380
+ border-radius: 0.5em;
381
+ padding: 0 1em 0 1em;
382
+ font-size: 1.2em;
383
+ justify-content: center;
384
+ margin-bottom: 1em;
385
+ cursor: pointer; }
386
+
387
+ .alert--danger.svelte-1oun6o6 {
388
+ background-color: rgba(255, 80, 77, 0.5);
389
+ border: 1px solid #ff504d; }
390
+
391
+ .alert--success.svelte-1oun6o6 {
392
+ background-color: rgba(0, 214, 146, 0.5);
393
+ border: 1px solid #00D692; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iroco/ui",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Iroco design system based on Svelte",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
@@ -68,6 +68,7 @@
68
68
  justify-content: space-between;
69
69
  position: fixed;
70
70
  top: 0;
71
+ z-index: 1;
71
72
  width: 100%;
72
73
  border-bottom: 1px solid colors.$mediumGrey;
73
74
 
@@ -1,16 +1,19 @@
1
1
  <script lang="ts">
2
2
  import IconClose from './IconClose.svelte';
3
3
  import type { NavigationItem } from 'definition';
4
+ import { createEventDispatcher } from 'svelte';
4
5
 
5
6
  export let navigationItems: Array<NavigationItem>;
6
- import { createEventDispatcher } from 'svelte';
7
7
 
8
8
  let active: string;
9
-
10
9
  const dispatch = createEventDispatcher();
11
10
 
12
- const handleClickLink = (destination: string) => {
13
- active = destination;
11
+ const handleClickLink = (menuItem: NavigationItem) => {
12
+ active = menuItem.name;
13
+ if (typeof menuItem.hrefOrCallback === "function") {
14
+ menuItem.hrefOrCallback()
15
+ return false // to avoid calling href
16
+ }
14
17
  dispatch('click_link');
15
18
  };
16
19
  </script>
@@ -21,9 +24,9 @@
21
24
  </button>
22
25
 
23
26
  <ul class="account__sidebar__item_container">
24
- {#each navigationItems as { destination, name }}
25
- <li class="account__sidebar__item" class:active={active === destination}>
26
- <a on:click={() => handleClickLink(destination)} href={destination}> {name}</a>
27
+ {#each navigationItems as item}
28
+ <li class="account__sidebar__item" class:active={active === item.name}>
29
+ <a on:click={() => handleClickLink(item)} href={typeof item.hrefOrCallback === 'string' ? item.hrefOrCallback: '#'}> {item.name}</a>
27
30
  </li>
28
31
  {/each}
29
32
  </ul>
@@ -38,7 +41,6 @@
38
41
  width: 300px;
39
42
  position: absolute;
40
43
  top: 70px;
41
- z-index: 1;
42
44
  overflow-x: hidden;
43
45
  border-right: 1px solid colors.$mediumGrey;
44
46
  &__item_container {