@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.d.cts CHANGED
@@ -4248,7 +4248,8 @@ type IrisTableColumnWidths = Record<string, number>;
4248
4248
  * are wired explicitly for screen readers.
4249
4249
  *
4250
4250
  * **Features**:
4251
- * - Column-driven rendering with optional `#cell.<key>` slots
4251
+ * - Column-driven rendering with optional `#header.<key>` and `#cell.<key>` slots
4252
+ * - Row activation via `rowClick` and `rowDblclick` events
4252
4253
  * - Sorting (controlled or uncontrolled, cycles `none → asc → desc → none`)
4253
4254
  * - Row selection (single / multi) with master checkbox + indeterminate
4254
4255
  * - **Column resize** (`resizable-columns`) — draggable handle on each
@@ -4397,6 +4398,7 @@ declare const IrisTable: vue.DefineComponent<vue.ExtractPropTypes<{
4397
4398
  'update:sort': (_value: IrisTableSortState | null) => true;
4398
4399
  'update:columnWidths': (_value: IrisTableColumnWidths) => true;
4399
4400
  rowClick: (_row: Record<string, unknown>, _index: number) => true;
4401
+ rowDblclick: (_row: Record<string, unknown>, _index: number) => true;
4400
4402
  cellEdit: (_payload: IrisTableCellEditEvent<Record<string, unknown>>) => true;
4401
4403
  expandedRowsChange: (_keys: Array<string | number>) => true;
4402
4404
  }, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
@@ -4530,6 +4532,7 @@ declare const IrisTable: vue.DefineComponent<vue.ExtractPropTypes<{
4530
4532
  onCellEdit?: ((_payload: IrisTableCellEditEvent<Record<string, unknown>>) => any) | undefined;
4531
4533
  "onUpdate:columnWidths"?: ((_value: IrisTableColumnWidths) => any) | undefined;
4532
4534
  onRowClick?: ((_row: Record<string, unknown>, _index: number) => any) | undefined;
4535
+ onRowDblclick?: ((_row: Record<string, unknown>, _index: number) => any) | undefined;
4533
4536
  }>, {
4534
4537
  sort: IrisTableSortState | null;
4535
4538
  error: boolean;
package/dist/index.d.ts CHANGED
@@ -4248,7 +4248,8 @@ type IrisTableColumnWidths = Record<string, number>;
4248
4248
  * are wired explicitly for screen readers.
4249
4249
  *
4250
4250
  * **Features**:
4251
- * - Column-driven rendering with optional `#cell.<key>` slots
4251
+ * - Column-driven rendering with optional `#header.<key>` and `#cell.<key>` slots
4252
+ * - Row activation via `rowClick` and `rowDblclick` events
4252
4253
  * - Sorting (controlled or uncontrolled, cycles `none → asc → desc → none`)
4253
4254
  * - Row selection (single / multi) with master checkbox + indeterminate
4254
4255
  * - **Column resize** (`resizable-columns`) — draggable handle on each
@@ -4397,6 +4398,7 @@ declare const IrisTable: vue.DefineComponent<vue.ExtractPropTypes<{
4397
4398
  'update:sort': (_value: IrisTableSortState | null) => true;
4398
4399
  'update:columnWidths': (_value: IrisTableColumnWidths) => true;
4399
4400
  rowClick: (_row: Record<string, unknown>, _index: number) => true;
4401
+ rowDblclick: (_row: Record<string, unknown>, _index: number) => true;
4400
4402
  cellEdit: (_payload: IrisTableCellEditEvent<Record<string, unknown>>) => true;
4401
4403
  expandedRowsChange: (_keys: Array<string | number>) => true;
4402
4404
  }, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
@@ -4530,6 +4532,7 @@ declare const IrisTable: vue.DefineComponent<vue.ExtractPropTypes<{
4530
4532
  onCellEdit?: ((_payload: IrisTableCellEditEvent<Record<string, unknown>>) => any) | undefined;
4531
4533
  "onUpdate:columnWidths"?: ((_value: IrisTableColumnWidths) => any) | undefined;
4532
4534
  onRowClick?: ((_row: Record<string, unknown>, _index: number) => any) | undefined;
4535
+ onRowDblclick?: ((_row: Record<string, unknown>, _index: number) => any) | undefined;
4533
4536
  }>, {
4534
4537
  sort: IrisTableSortState | null;
4535
4538
  error: boolean;
package/dist/index.js CHANGED
@@ -5423,6 +5423,7 @@ var IrisTable = defineComponent({
5423
5423
  "update:sort": (_value) => true,
5424
5424
  "update:columnWidths": (_value) => true,
5425
5425
  rowClick: (_row, _index) => true,
5426
+ rowDblclick: (_row, _index) => true,
5426
5427
  cellEdit: (_payload) => true,
5427
5428
  expandedRowsChange: (_keys) => true
5428
5429
  },
@@ -5829,6 +5830,8 @@ var IrisTable = defineComponent({
5829
5830
  const isLeaf = !col.children || col.children.length === 0;
5830
5831
  const sortable = isLeaf && col.sortable;
5831
5832
  const align = col.align ?? "left";
5833
+ const headerSlot = slots[`header.${col.key}`];
5834
+ const title = headerSlot?.({ column: col }) ?? col.title;
5832
5835
  cells.push(
5833
5836
  h(
5834
5837
  "div",
@@ -5859,7 +5862,7 @@ var IrisTable = defineComponent({
5859
5862
  textOverflow: "ellipsis"
5860
5863
  }
5861
5864
  },
5862
- [col.title, sortable ? sortIndicator(col) : null]
5865
+ [title, sortable ? sortIndicator(col) : null]
5863
5866
  )
5864
5867
  );
5865
5868
  }
@@ -5929,6 +5932,8 @@ var IrisTable = defineComponent({
5929
5932
  const col = props.columns[ci];
5930
5933
  if (visibleColSet.value && !visibleColSet.value.has(ci)) continue;
5931
5934
  const align = col.align ?? "left";
5935
+ const headerSlot = slots[`header.${col.key}`];
5936
+ const title = headerSlot?.({ column: col }) ?? col.title;
5932
5937
  wireResize(col);
5933
5938
  const handle = props.resizableColumns ? h("span", {
5934
5939
  ref: (el) => {
@@ -5996,7 +6001,7 @@ var IrisTable = defineComponent({
5996
6001
  },
5997
6002
  "aria-sort": internalSort.value?.key === col.key ? internalSort.value.direction === "asc" ? "ascending" : "descending" : col.sortable ? "none" : void 0
5998
6003
  },
5999
- [col.title, sortIndicator(col), handle]
6004
+ [title, sortIndicator(col), handle]
6000
6005
  )
6001
6006
  );
6002
6007
  }
@@ -6272,6 +6277,7 @@ var IrisTable = defineComponent({
6272
6277
  "data-iris-table-row": "",
6273
6278
  "data-state": selected ? "selected" : void 0,
6274
6279
  onClick: () => emit("rowClick", row, index),
6280
+ onDblclick: () => emit("rowDblclick", row, index),
6275
6281
  style: {
6276
6282
  display: "grid",
6277
6283
  gridTemplateColumns: gridTemplate.value,
@@ -6590,10 +6596,82 @@ var IrisTabs = defineComponent({
6590
6596
  return () => slots.default?.();
6591
6597
  }
6592
6598
  });
6599
+
6600
+ // src/primitives/tabs/styles.ts
6601
+ var STYLE_ID = "iris-tabs-styles";
6602
+ var CSS4 = `
6603
+ :where(.iris-tabs-list) {
6604
+ display: flex;
6605
+ gap: 2px;
6606
+ }
6607
+ :where(.iris-tabs-list[data-orientation="horizontal"]) {
6608
+ flex-direction: row;
6609
+ border-bottom: 1px solid var(--iris-border);
6610
+ }
6611
+ :where(.iris-tabs-list[data-orientation="vertical"]) {
6612
+ flex-direction: column;
6613
+ border-inline-end: 1px solid var(--iris-border);
6614
+ }
6615
+ :where(.iris-tabs-trigger) {
6616
+ padding: 8px var(--iris-padding-md);
6617
+ font-size: 14px;
6618
+ font-weight: 500;
6619
+ font-family: inherit;
6620
+ cursor: pointer;
6621
+ opacity: 1;
6622
+ border: none;
6623
+ outline: none;
6624
+ background: transparent;
6625
+ color: var(--iris-muted);
6626
+ transition: color 120ms ease, border-color 120ms ease;
6627
+ }
6628
+ :where(.iris-tabs-trigger[data-orientation="horizontal"]) {
6629
+ margin-bottom: -1px;
6630
+ border-bottom: 2px solid transparent;
6631
+ }
6632
+ :where(.iris-tabs-trigger[data-orientation="vertical"]) {
6633
+ margin-inline-end: -1px;
6634
+ border-inline-end: 2px solid transparent;
6635
+ }
6636
+ :where(.iris-tabs-trigger[data-state="active"]) {
6637
+ color: var(--iris-primary);
6638
+ }
6639
+ :where(.iris-tabs-trigger[data-state="active"][data-orientation="horizontal"]) {
6640
+ border-bottom-color: var(--iris-primary);
6641
+ }
6642
+ :where(.iris-tabs-trigger[data-state="active"][data-orientation="vertical"]) {
6643
+ border-inline-end-color: var(--iris-primary);
6644
+ }
6645
+ :where(.iris-tabs-trigger[data-disabled]) {
6646
+ cursor: not-allowed;
6647
+ opacity: 0.5;
6648
+ }
6649
+ :where(.iris-tabs-trigger:focus-visible) {
6650
+ outline: 2px solid var(--iris-focus-ring, var(--iris-primary));
6651
+ outline-offset: 2px;
6652
+ }
6653
+ `.trim();
6654
+ var installed4 = false;
6655
+ function installTabsStyles() {
6656
+ if (installed4) return;
6657
+ if (typeof document === "undefined") return;
6658
+ if (document.getElementById(STYLE_ID)) {
6659
+ installed4 = true;
6660
+ return;
6661
+ }
6662
+ const style = document.createElement("style");
6663
+ style.id = STYLE_ID;
6664
+ style.textContent = CSS4;
6665
+ document.head.appendChild(style);
6666
+ installed4 = true;
6667
+ }
6668
+
6669
+ // src/primitives/tabs/TabsList.ts
6593
6670
  var IrisTabsList = defineComponent({
6594
6671
  name: "IrisTabsList",
6595
6672
  inheritAttrs: false,
6596
6673
  setup(_, { slots, attrs }) {
6674
+ installTabsStyles();
6597
6675
  const ctx = inject(TabsContextKey);
6598
6676
  if (!ctx) {
6599
6677
  throw new Error("[iris-ui] IrisTabsList must be inside an IrisTabs");
@@ -6609,14 +6687,8 @@ var IrisTabsList = defineComponent({
6609
6687
  "aria-orientation": ctx.orientation.value,
6610
6688
  "data-iris-tabs-list": "",
6611
6689
  "data-orientation": ctx.orientation.value,
6612
- style: {
6613
- display: "flex",
6614
- flexDirection: ctx.orientation.value === "horizontal" ? "row" : "column",
6615
- gap: "2px",
6616
- borderBottom: ctx.orientation.value === "horizontal" ? "1px solid var(--iris-border)" : "none",
6617
- borderInlineEnd: ctx.orientation.value === "vertical" ? "1px solid var(--iris-border)" : "none",
6618
- ...attrs.style ?? {}
6619
- }
6690
+ class: ["iris-tabs-list", attrs.class],
6691
+ style: attrs.style
6620
6692
  },
6621
6693
  slots.default?.()
6622
6694
  );
@@ -6631,6 +6703,7 @@ var IrisTabsTrigger = defineComponent({
6631
6703
  asChild: { type: Boolean, default: false }
6632
6704
  },
6633
6705
  setup(props, { slots, attrs }) {
6706
+ installTabsStyles();
6634
6707
  const ctx = inject(TabsContextKey);
6635
6708
  if (!ctx) {
6636
6709
  throw new Error("[iris-ui] IrisTabsTrigger must be inside an IrisTabs");
@@ -6679,7 +6752,9 @@ var IrisTabsTrigger = defineComponent({
6679
6752
  "data-disabled": isDisabled.value ? "" : void 0,
6680
6753
  disabled: isDisabled.value ? true : void 0,
6681
6754
  onClick,
6682
- onKeydown: onKeyDown
6755
+ onKeydown: onKeyDown,
6756
+ class: ["iris-tabs-trigger", attrs.class],
6757
+ style: attrs.style
6683
6758
  };
6684
6759
  if (props.asChild) {
6685
6760
  const root = findFirstElement(slots.default?.());
@@ -6690,37 +6765,17 @@ var IrisTabsTrigger = defineComponent({
6690
6765
  return null;
6691
6766
  }
6692
6767
  const merged = mergeSlotProps(
6693
- { ...triggerProps, ...attrs },
6768
+ { ...attrs, ...triggerProps },
6694
6769
  root.props ?? {}
6695
6770
  );
6696
6771
  return h(root.type, merged, root.children);
6697
6772
  }
6698
- const colors = isActive.value ? { background: "transparent", color: "var(--iris-primary)" } : { background: "transparent", color: "var(--iris-muted)" };
6699
- const borderActive = ctx.orientation.value === "horizontal" ? { borderBottom: `2px solid ${isActive.value ? "var(--iris-primary)" : "transparent"}` } : {
6700
- borderInlineEnd: `2px solid ${isActive.value ? "var(--iris-primary)" : "transparent"}`
6701
- };
6702
6773
  return h(
6703
6774
  "button",
6704
6775
  {
6705
6776
  type: "button",
6706
6777
  ...attrs,
6707
- ...triggerProps,
6708
- style: {
6709
- padding: "8px var(--iris-padding-md)",
6710
- fontSize: "14px",
6711
- fontWeight: "500",
6712
- fontFamily: "inherit",
6713
- cursor: isDisabled.value ? "not-allowed" : "pointer",
6714
- opacity: isDisabled.value ? "0.5" : "1",
6715
- border: "none",
6716
- outline: "none",
6717
- marginBottom: ctx.orientation.value === "horizontal" ? "-1px" : void 0,
6718
- marginInlineEnd: ctx.orientation.value === "vertical" ? "-1px" : void 0,
6719
- transition: "color 120ms ease, border-color 120ms ease",
6720
- ...colors,
6721
- ...borderActive,
6722
- ...attrs.style ?? {}
6723
- }
6778
+ ...triggerProps
6724
6779
  },
6725
6780
  slots.default?.()
6726
6781
  );