@iroco/ui 0.16.0 → 0.17.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.js CHANGED
@@ -4217,8 +4217,9 @@
4217
4217
  ? /*item*/ ctx[7].hrefOrCallback
4218
4218
  : "#");
4219
4219
 
4220
- attr(a, "class", "svelte-1c8sozl");
4221
- attr(li, "class", li_class_value = "nav__" + /*type*/ ctx[1] + "__item" + " svelte-1c8sozl");
4220
+ attr(a, "class", "svelte-v0jihd");
4221
+ toggle_class(a, "iroco-ui-button", /*item*/ ctx[7].isButton());
4222
+ attr(li, "class", li_class_value = "nav__" + /*type*/ ctx[1] + "__item" + " svelte-v0jihd");
4222
4223
  toggle_class(li, "active", /*active*/ ctx[2] === /*item*/ ctx[7].name);
4223
4224
  },
4224
4225
  m(target, anchor) {
@@ -4242,7 +4243,11 @@
4242
4243
  attr(a, "href", a_href_value);
4243
4244
  }
4244
4245
 
4245
- if (dirty & /*type*/ 2 && li_class_value !== (li_class_value = "nav__" + /*type*/ ctx[1] + "__item" + " svelte-1c8sozl")) {
4246
+ if (dirty & /*navigationItems*/ 1) {
4247
+ toggle_class(a, "iroco-ui-button", /*item*/ ctx[7].isButton());
4248
+ }
4249
+
4250
+ if (dirty & /*type*/ 2 && li_class_value !== (li_class_value = "nav__" + /*type*/ ctx[1] + "__item" + " svelte-v0jihd")) {
4246
4251
  attr(li, "class", li_class_value);
4247
4252
  }
4248
4253
 
@@ -4290,10 +4295,10 @@
4290
4295
  each_blocks[i].c();
4291
4296
  }
4292
4297
 
4293
- attr(button, "class", button_class_value = "nav__" + /*type*/ ctx[1] + "__close" + " svelte-1c8sozl");
4294
- attr(ul, "class", ul_class_value = "nav__" + /*type*/ ctx[1] + "__item-container" + " svelte-1c8sozl");
4298
+ attr(button, "class", button_class_value = "nav__" + /*type*/ ctx[1] + "__close" + " svelte-v0jihd");
4299
+ attr(ul, "class", ul_class_value = "nav__" + /*type*/ ctx[1] + "__item-container" + " svelte-v0jihd");
4295
4300
  attr(nav, "data-testid", /*type*/ ctx[1]);
4296
- attr(nav, "class", nav_class_value = "nav__" + /*type*/ ctx[1] + " svelte-1c8sozl");
4301
+ attr(nav, "class", nav_class_value = "nav__" + /*type*/ ctx[1] + " svelte-v0jihd");
4297
4302
  },
4298
4303
  m(target, anchor) {
4299
4304
  insert(target, nav, anchor);
@@ -4314,7 +4319,7 @@
4314
4319
  }
4315
4320
  },
4316
4321
  p(ctx, [dirty]) {
4317
- if (!current || dirty & /*type*/ 2 && button_class_value !== (button_class_value = "nav__" + /*type*/ ctx[1] + "__close" + " svelte-1c8sozl")) {
4322
+ if (!current || dirty & /*type*/ 2 && button_class_value !== (button_class_value = "nav__" + /*type*/ ctx[1] + "__close" + " svelte-v0jihd")) {
4318
4323
  attr(button, "class", button_class_value);
4319
4324
  }
4320
4325
 
@@ -4341,7 +4346,7 @@
4341
4346
  each_blocks.length = each_value.length;
4342
4347
  }
4343
4348
 
4344
- if (!current || dirty & /*type*/ 2 && ul_class_value !== (ul_class_value = "nav__" + /*type*/ ctx[1] + "__item-container" + " svelte-1c8sozl")) {
4349
+ if (!current || dirty & /*type*/ 2 && ul_class_value !== (ul_class_value = "nav__" + /*type*/ ctx[1] + "__item-container" + " svelte-v0jihd")) {
4345
4350
  attr(ul, "class", ul_class_value);
4346
4351
  }
4347
4352
 
@@ -4349,7 +4354,7 @@
4349
4354
  attr(nav, "data-testid", /*type*/ ctx[1]);
4350
4355
  }
4351
4356
 
4352
- if (!current || dirty & /*type*/ 2 && nav_class_value !== (nav_class_value = "nav__" + /*type*/ ctx[1] + " svelte-1c8sozl")) {
4357
+ if (!current || dirty & /*type*/ 2 && nav_class_value !== (nav_class_value = "nav__" + /*type*/ ctx[1] + " svelte-v0jihd")) {
4353
4358
  attr(nav, "class", nav_class_value);
4354
4359
  }
4355
4360
  },
@@ -5738,6 +5743,21 @@
5738
5743
  }
5739
5744
  }
5740
5745
 
5746
+ class NavigationItem {
5747
+ constructor(name, hrefOrCallback) {
5748
+ this.hrefOrCallback = hrefOrCallback;
5749
+ this.name = name;
5750
+ }
5751
+ isButton() {
5752
+ return typeof this.hrefOrCallback === 'function';
5753
+ }
5754
+ }
5755
+ exports.ButtonKind = void 0;
5756
+ (function (ButtonKind) {
5757
+ ButtonKind["REGULAR"] = "regular";
5758
+ ButtonKind["DANGER"] = "danger";
5759
+ })(exports.ButtonKind || (exports.ButtonKind = {}));
5760
+
5741
5761
  exports.Alert = Alert;
5742
5762
  exports.Button = Button;
5743
5763
  exports.DataTable = DataTable;
@@ -5752,6 +5772,7 @@
5752
5772
  exports.Loader = Loader;
5753
5773
  exports.NavBar = NavBar;
5754
5774
  exports.Navigation = Navigation;
5775
+ exports.NavigationItem = NavigationItem;
5755
5776
  exports.NumberInput = NumberInput;
5756
5777
  exports.RadioButton = RadioButton;
5757
5778
  exports.TextInput = TextInput;