@iris-ui-kit/vue 0.2.1 → 0.2.3

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/dist/index.cjs CHANGED
@@ -9289,6 +9289,7 @@ var IrisTable = vue.defineComponent({
9289
9289
  "update:sort": (_value) => true,
9290
9290
  "update:columnWidths": (_value) => true,
9291
9291
  rowClick: (_row, _index) => true,
9292
+ rowDblclick: (_row, _index) => true,
9292
9293
  cellEdit: (_payload) => true,
9293
9294
  expandedRowsChange: (_keys) => true
9294
9295
  },
@@ -9695,6 +9696,8 @@ var IrisTable = vue.defineComponent({
9695
9696
  const isLeaf = !col.children || col.children.length === 0;
9696
9697
  const sortable = isLeaf && col.sortable;
9697
9698
  const align = col.align ?? "left";
9699
+ const headerSlot = slots[`header.${col.key}`];
9700
+ const title = headerSlot?.({ column: col }) ?? col.title;
9698
9701
  cells.push(
9699
9702
  vue.h(
9700
9703
  "div",
@@ -9725,7 +9728,7 @@ var IrisTable = vue.defineComponent({
9725
9728
  textOverflow: "ellipsis"
9726
9729
  }
9727
9730
  },
9728
- [col.title, sortable ? sortIndicator(col) : null]
9731
+ [title, sortable ? sortIndicator(col) : null]
9729
9732
  )
9730
9733
  );
9731
9734
  }
@@ -9795,6 +9798,8 @@ var IrisTable = vue.defineComponent({
9795
9798
  const col = props.columns[ci];
9796
9799
  if (visibleColSet.value && !visibleColSet.value.has(ci)) continue;
9797
9800
  const align = col.align ?? "left";
9801
+ const headerSlot = slots[`header.${col.key}`];
9802
+ const title = headerSlot?.({ column: col }) ?? col.title;
9798
9803
  wireResize(col);
9799
9804
  const handle = props.resizableColumns ? vue.h("span", {
9800
9805
  ref: (el) => {
@@ -9862,7 +9867,7 @@ var IrisTable = vue.defineComponent({
9862
9867
  },
9863
9868
  "aria-sort": internalSort.value?.key === col.key ? internalSort.value.direction === "asc" ? "ascending" : "descending" : col.sortable ? "none" : void 0
9864
9869
  },
9865
- [col.title, sortIndicator(col), handle]
9870
+ [title, sortIndicator(col), handle]
9866
9871
  )
9867
9872
  );
9868
9873
  }
@@ -10138,6 +10143,7 @@ var IrisTable = vue.defineComponent({
10138
10143
  "data-iris-table-row": "",
10139
10144
  "data-state": selected ? "selected" : void 0,
10140
10145
  onClick: () => emit("rowClick", row, index),
10146
+ onDblclick: () => emit("rowDblclick", row, index),
10141
10147
  style: {
10142
10148
  display: "grid",
10143
10149
  gridTemplateColumns: gridTemplate.value,
@@ -10456,10 +10462,82 @@ var IrisTabs = vue.defineComponent({
10456
10462
  return () => slots.default?.();
10457
10463
  }
10458
10464
  });
10465
+
10466
+ // src/primitives/tabs/styles.ts
10467
+ var STYLE_ID2 = "iris-tabs-styles";
10468
+ var CSS6 = `
10469
+ :where(.iris-tabs-list) {
10470
+ display: flex;
10471
+ gap: 2px;
10472
+ }
10473
+ :where(.iris-tabs-list[data-orientation="horizontal"]) {
10474
+ flex-direction: row;
10475
+ border-bottom: 1px solid var(--iris-border);
10476
+ }
10477
+ :where(.iris-tabs-list[data-orientation="vertical"]) {
10478
+ flex-direction: column;
10479
+ border-inline-end: 1px solid var(--iris-border);
10480
+ }
10481
+ :where(.iris-tabs-trigger) {
10482
+ padding: 8px var(--iris-padding-md);
10483
+ font-size: 14px;
10484
+ font-weight: 500;
10485
+ font-family: inherit;
10486
+ cursor: pointer;
10487
+ opacity: 1;
10488
+ border: none;
10489
+ outline: none;
10490
+ background: transparent;
10491
+ color: var(--iris-muted);
10492
+ transition: color 120ms ease, border-color 120ms ease;
10493
+ }
10494
+ :where(.iris-tabs-trigger[data-orientation="horizontal"]) {
10495
+ margin-bottom: -1px;
10496
+ border-bottom: 2px solid transparent;
10497
+ }
10498
+ :where(.iris-tabs-trigger[data-orientation="vertical"]) {
10499
+ margin-inline-end: -1px;
10500
+ border-inline-end: 2px solid transparent;
10501
+ }
10502
+ :where(.iris-tabs-trigger[data-state="active"]) {
10503
+ color: var(--iris-primary);
10504
+ }
10505
+ :where(.iris-tabs-trigger[data-state="active"][data-orientation="horizontal"]) {
10506
+ border-bottom-color: var(--iris-primary);
10507
+ }
10508
+ :where(.iris-tabs-trigger[data-state="active"][data-orientation="vertical"]) {
10509
+ border-inline-end-color: var(--iris-primary);
10510
+ }
10511
+ :where(.iris-tabs-trigger[data-disabled]) {
10512
+ cursor: not-allowed;
10513
+ opacity: 0.5;
10514
+ }
10515
+ :where(.iris-tabs-trigger:focus-visible) {
10516
+ outline: 2px solid var(--iris-focus-ring, var(--iris-primary));
10517
+ outline-offset: 2px;
10518
+ }
10519
+ `.trim();
10520
+ var installed6 = false;
10521
+ function installTabsStyles() {
10522
+ if (installed6) return;
10523
+ if (typeof document === "undefined") return;
10524
+ if (document.getElementById(STYLE_ID2)) {
10525
+ installed6 = true;
10526
+ return;
10527
+ }
10528
+ const style = document.createElement("style");
10529
+ style.id = STYLE_ID2;
10530
+ style.textContent = CSS6;
10531
+ document.head.appendChild(style);
10532
+ installed6 = true;
10533
+ }
10534
+
10535
+ // src/primitives/tabs/TabsList.ts
10459
10536
  var IrisTabsList = vue.defineComponent({
10460
10537
  name: "IrisTabsList",
10461
10538
  inheritAttrs: false,
10462
10539
  setup(_, { slots, attrs }) {
10540
+ installTabsStyles();
10463
10541
  const ctx = vue.inject(TabsContextKey);
10464
10542
  if (!ctx) {
10465
10543
  throw new Error("[iris-ui] IrisTabsList must be inside an IrisTabs");
@@ -10475,14 +10553,8 @@ var IrisTabsList = vue.defineComponent({
10475
10553
  "aria-orientation": ctx.orientation.value,
10476
10554
  "data-iris-tabs-list": "",
10477
10555
  "data-orientation": ctx.orientation.value,
10478
- style: {
10479
- display: "flex",
10480
- flexDirection: ctx.orientation.value === "horizontal" ? "row" : "column",
10481
- gap: "2px",
10482
- borderBottom: ctx.orientation.value === "horizontal" ? "1px solid var(--iris-border)" : "none",
10483
- borderInlineEnd: ctx.orientation.value === "vertical" ? "1px solid var(--iris-border)" : "none",
10484
- ...attrs.style ?? {}
10485
- }
10556
+ class: ["iris-tabs-list", attrs.class],
10557
+ style: attrs.style
10486
10558
  },
10487
10559
  slots.default?.()
10488
10560
  );
@@ -10497,6 +10569,7 @@ var IrisTabsTrigger = vue.defineComponent({
10497
10569
  asChild: { type: Boolean, default: false }
10498
10570
  },
10499
10571
  setup(props, { slots, attrs }) {
10572
+ installTabsStyles();
10500
10573
  const ctx = vue.inject(TabsContextKey);
10501
10574
  if (!ctx) {
10502
10575
  throw new Error("[iris-ui] IrisTabsTrigger must be inside an IrisTabs");
@@ -10545,7 +10618,9 @@ var IrisTabsTrigger = vue.defineComponent({
10545
10618
  "data-disabled": isDisabled.value ? "" : void 0,
10546
10619
  disabled: isDisabled.value ? true : void 0,
10547
10620
  onClick,
10548
- onKeydown: onKeyDown
10621
+ onKeydown: onKeyDown,
10622
+ class: ["iris-tabs-trigger", attrs.class],
10623
+ style: attrs.style
10549
10624
  };
10550
10625
  if (props.asChild) {
10551
10626
  const root = findFirstElement(slots.default?.());
@@ -10556,37 +10631,17 @@ var IrisTabsTrigger = vue.defineComponent({
10556
10631
  return null;
10557
10632
  }
10558
10633
  const merged = mergeSlotProps(
10559
- { ...triggerProps, ...attrs },
10634
+ { ...attrs, ...triggerProps },
10560
10635
  root.props ?? {}
10561
10636
  );
10562
10637
  return vue.h(root.type, merged, root.children);
10563
10638
  }
10564
- const colors = isActive.value ? { background: "transparent", color: "var(--iris-primary)" } : { background: "transparent", color: "var(--iris-muted)" };
10565
- const borderActive = ctx.orientation.value === "horizontal" ? { borderBottom: `2px solid ${isActive.value ? "var(--iris-primary)" : "transparent"}` } : {
10566
- borderInlineEnd: `2px solid ${isActive.value ? "var(--iris-primary)" : "transparent"}`
10567
- };
10568
10639
  return vue.h(
10569
10640
  "button",
10570
10641
  {
10571
10642
  type: "button",
10572
10643
  ...attrs,
10573
- ...triggerProps,
10574
- style: {
10575
- padding: "8px var(--iris-padding-md)",
10576
- fontSize: "14px",
10577
- fontWeight: "500",
10578
- fontFamily: "inherit",
10579
- cursor: isDisabled.value ? "not-allowed" : "pointer",
10580
- opacity: isDisabled.value ? "0.5" : "1",
10581
- border: "none",
10582
- outline: "none",
10583
- marginBottom: ctx.orientation.value === "horizontal" ? "-1px" : void 0,
10584
- marginInlineEnd: ctx.orientation.value === "vertical" ? "-1px" : void 0,
10585
- transition: "color 120ms ease, border-color 120ms ease",
10586
- ...colors,
10587
- ...borderActive,
10588
- ...attrs.style ?? {}
10589
- }
10644
+ ...triggerProps
10590
10645
  },
10591
10646
  slots.default?.()
10592
10647
  );