@nocoo/basalt 3.0.0 → 3.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","names":["React","Table","props","cn","BASALT_UI_CLASS","className","TableHeader","TableBody","TableFooter","TableRow","variant","TableHead","TableCell","TableCaption"],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\n\nexport type TableProps = {\n\t/**\n\t * Additional classes for the table.\n\t */\n\tclassName?: string;\n};\n\nexport const Table = React.forwardRef<\n\tHTMLTableElement,\n\tTableProps & React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n\t<table\n\t\tref={ref}\n\t\tdata-basalt-table=\"\"\n\t\tclassName={cn(\n\t\t\tBASALT_UI_CLASS,\n\t\t\t\"w-full border-separate border-spacing-0 caption-bottom text-left text-basalt-code leading-[var(--basalt-line-body)] text-basalt-foreground\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTable.displayName = \"Table\";\n\nexport interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableHeader = (props: TableHeaderProps) => <thead {...props} />;\n\nexport interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableBody = (props: TableBodyProps) => <tbody {...props} />;\n\nexport interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableFooter = (props: TableFooterProps) => <tfoot {...props} />;\n\nexport type TableRowVariant = \"default\" | \"selected\";\n\nexport type TableRowProps = {\n\t/**\n\t * Highlight the row as selected.\n\t * @default \"default\"\n\t */\n\tvariant?: TableRowVariant;\n\t/**\n\t * Additional classes for the row.\n\t */\n\tclassName?: string;\n};\n\nexport const TableRow = ({\n\tclassName,\n\tvariant = \"default\",\n\t...props\n}: TableRowProps & React.HTMLAttributes<HTMLTableRowElement>) => (\n\t<tr\n\t\t{...props}\n\t\taria-selected={variant === \"selected\" ? true : props[\"aria-selected\"]}\n\t\tclassName={className}\n\t/>\n);\n\nexport type TableHeadProps = {\n\t/**\n\t * Additional classes for the header cell.\n\t */\n\tclassName?: string;\n};\n\nexport const TableHead = ({\n\tclassName,\n\t...props\n}: TableHeadProps & React.ThHTMLAttributes<HTMLTableCellElement>) => (\n\t<th\n\t\tclassName={cn(\n\t\t\t\"relative h-basalt-table-row whitespace-nowrap border-b border-basalt-border px-basalt-table-x py-basalt-table-y text-left align-middle text-basalt-sm font-medium text-basalt-muted-foreground\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport type TableCellProps = {\n\t/**\n\t * Additional classes for the cell.\n\t */\n\tclassName?: string;\n};\n\nexport const TableCell = ({\n\tclassName,\n\t...props\n}: TableCellProps & React.TdHTMLAttributes<HTMLTableCellElement>) => (\n\t<td\n\t\tclassName={cn(\n\t\t\t\"relative h-basalt-table-row px-basalt-table-x py-basalt-table-y align-middle\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport type TableCaptionProps = {\n\t/**\n\t * Additional classes for the caption.\n\t */\n\tclassName?: string;\n};\n\nexport function TableCaption({\n\tclassName,\n\t...props\n}: TableCaptionProps & React.HTMLAttributes<HTMLTableCaptionElement>) {\n\treturn (\n\t\t<caption\n\t\t\tclassName={cn(\"mt-basalt-space-lg text-basalt-base text-basalt-muted-foreground\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAWA,IAAaC,IAAQD,EAAM,YAGxB,EAAE,cAAW,GAAGE,KAAS,MAC3B,kBAAC,SAAD;CACM;CACL,qBAAkB;CAClB,WAAWC,EACVC,GACA,8IACAC,CACD;CACA,GAAIH;AACJ,CAAA,CACD;AACD,EAAM,cAAc;AAIpB,IAAaI,KAAe,MAA4B,kBAAC,SAAD,EAAO,GAAIJ,EAAQ,CAAA,GAI9DK,KAAa,MAA0B,kBAAC,SAAD,EAAO,GAAIL,EAAQ,CAAA,GAI1DM,KAAe,MAA4B,kBAAC,SAAD,EAAO,GAAIN,EAAQ,CAAA,GAgB9DO,KAAY,EACxB,cACA,aAAU,WACV,GAAGP,QAEH,kBAAC,MAAD;CACC,GAAIA;CACJ,iBAAeQ,MAAY,cAAoBR,EAAM;CAC1C;AACX,CAAA,GAUWS,KAAa,EACzB,cACA,GAAGT,QAEH,kBAAC,MAAD;CACC,WAAWC,EACV,kMACAE,CACD;CACA,GAAIH;AACJ,CAAA,GAUWU,KAAa,EACzB,cACA,GAAGV,QAEH,kBAAC,MAAD;CACC,WAAWC,EACV,gFACAE,CACD;CACA,GAAIH;AACJ,CAAA;AAUF,SAAgBW,EAAa,EAC5B,cACA,GAAGX,KACkE;CACrE,OACC,kBAAC,WAAD;EACC,WAAWC,EAAG,oEAAoEE,CAAS;EAC3F,GAAIH;CACJ,CAAA;AAEH"}
1
+ {"version":3,"file":"table.js","names":["_Fragment","React","Fragment$1","Table","props","cn","BASALT_UI_CLASS","className","TableHeader","TableBody","TableFooter","TableRow","variant","textAlignClass","textAlign","TableHead","align","TableCell","TableCaption","SortIcon","sorted","ArrowUp","ArrowDown","ArrowUpDown","trailing","TableSortableHeader","label","icon"],"sources":["../../src/components/table.tsx"],"sourcesContent":["import { ArrowDown, ArrowUp, ArrowUpDown } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\n\n/** Logical inline alignment. Maps to CSS `text-align: start | end`. */\nexport type TableTextAlign = \"start\" | \"end\";\nexport type TableSortDirection = \"asc\" | \"desc\";\n\nexport type TableProps = {\n\t/**\n\t * Additional classes for the table.\n\t */\n\tclassName?: string;\n};\n\nexport const Table = React.forwardRef<\n\tHTMLTableElement,\n\tTableProps & React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n\t<table\n\t\tref={ref}\n\t\tdata-basalt-table=\"\"\n\t\tclassName={cn(\n\t\t\tBASALT_UI_CLASS,\n\t\t\t\"w-full border-separate border-spacing-0 caption-bottom text-start text-basalt-code leading-[var(--basalt-line-body)] text-basalt-foreground\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTable.displayName = \"Table\";\n\nexport interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableHeader = (props: TableHeaderProps) => <thead {...props} />;\n\nexport interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableBody = (props: TableBodyProps) => <tbody {...props} />;\n\nexport interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableFooter = (props: TableFooterProps) => <tfoot {...props} />;\n\nexport type TableRowVariant = \"default\" | \"selected\";\n\nexport type TableRowProps = {\n\t/**\n\t * Highlight the row as selected.\n\t * @default \"default\"\n\t */\n\tvariant?: TableRowVariant;\n\t/**\n\t * Additional classes for the row.\n\t */\n\tclassName?: string;\n};\n\nexport const TableRow = ({\n\tclassName,\n\tvariant = \"default\",\n\t...props\n}: TableRowProps & React.HTMLAttributes<HTMLTableRowElement>) => (\n\t<tr\n\t\t{...props}\n\t\taria-selected={variant === \"selected\" ? true : props[\"aria-selected\"]}\n\t\tclassName={className}\n\t/>\n);\n\nfunction textAlignClass(textAlign?: TableTextAlign) {\n\tif (textAlign === \"end\") return \"text-end tabular-nums\";\n\tif (textAlign === \"start\") return \"text-start\";\n}\n\nexport type TableHeadProps = {\n\t/**\n\t * Additional classes for the header cell.\n\t */\n\tclassName?: string;\n\t/**\n\t * Logical inline alignment. Omitted headers keep `text-start` unless native `align` is set.\n\t */\n\ttextAlign?: TableTextAlign;\n};\n\nexport const TableHead = ({\n\tclassName,\n\ttextAlign,\n\talign,\n\t...props\n}: TableHeadProps & React.ThHTMLAttributes<HTMLTableCellElement>) => (\n\t<th\n\t\tclassName={cn(\n\t\t\t\"relative h-basalt-table-row whitespace-nowrap border-b border-basalt-border ps-basalt-table-x pe-basalt-table-x py-basalt-table-y align-middle text-basalt-sm font-medium text-basalt-muted-foreground\",\n\t\t\ttextAlignClass(textAlign) ?? (align == null ? \"text-start\" : undefined),\n\t\t\tclassName,\n\t\t)}\n\t\talign={align}\n\t\t{...props}\n\t/>\n);\n\nexport type TableCellProps = {\n\t/**\n\t * Additional classes for the cell.\n\t */\n\tclassName?: string;\n\t/**\n\t * Logical inline alignment. Omitted cells inherit from the table or row. Native HTML `align` is unchanged.\n\t */\n\ttextAlign?: TableTextAlign;\n};\n\nexport const TableCell = ({\n\tclassName,\n\ttextAlign,\n\t...props\n}: TableCellProps & React.TdHTMLAttributes<HTMLTableCellElement>) => (\n\t<td\n\t\tclassName={cn(\n\t\t\t\"relative h-basalt-table-row ps-basalt-table-x pe-basalt-table-x py-basalt-table-y align-middle\",\n\t\t\ttextAlignClass(textAlign),\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport type TableCaptionProps = {\n\t/**\n\t * Additional classes for the caption.\n\t */\n\tclassName?: string;\n};\n\nexport function TableCaption({\n\tclassName,\n\t...props\n}: TableCaptionProps & React.HTMLAttributes<HTMLTableCaptionElement>) {\n\treturn (\n\t\t<caption\n\t\t\tclassName={cn(\n\t\t\t\t\"px-basalt-panel-x py-basalt-panel-y text-basalt-base text-basalt-muted-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type TableSortableHeaderProps = {\n\tchildren: React.ReactNode;\n\t/**\n\t * Logical control layout. `end` places the sort icon inward of the label.\n\t * @default \"start\"\n\t */\n\ttextAlign?: TableTextAlign;\n\t/**\n\t * Current sort direction when this column is sorted.\n\t */\n\tsorted?: TableSortDirection;\n\tclassName?: string;\n} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"type\" | \"children\" | \"className\">;\n\nfunction SortIcon({ sorted, trailing }: { sorted?: TableSortDirection; trailing: boolean }) {\n\tconst Icon = sorted === \"asc\" ? ArrowUp : sorted === \"desc\" ? ArrowDown : ArrowUpDown;\n\treturn (\n\t\t<Icon\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(\n\t\t\t\t\"size-basalt-icon-sm shrink-0\",\n\t\t\t\ttrailing && \"ms-auto\",\n\t\t\t\t!sorted &&\n\t\t\t\t\t\"opacity-0 transition-opacity basalt-motion group-hover:opacity-60 group-focus-visible:opacity-60 motion-reduce:transition-none\",\n\t\t\t)}\n\t\t\tstrokeWidth={1.5}\n\t\t/>\n\t);\n}\n\nexport const TableSortableHeader = React.forwardRef<HTMLButtonElement, TableSortableHeaderProps>(\n\t({ children, textAlign = \"start\", sorted, className, ...props }, ref) => {\n\t\tconst label = (\n\t\t\t<span className=\"flex min-w-0 items-center gap-basalt-control-gap truncate\">{children}</span>\n\t\t);\n\t\tconst icon = <SortIcon sorted={sorted} trailing={textAlign !== \"end\"} />;\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"group flex w-full cursor-pointer items-center gap-basalt-control-gap rounded-basalt-sm border-0 bg-transparent p-0 font-inherit text-inherit font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-basalt-primary\",\n\t\t\t\t\ttextAlign === \"end\" ? \"justify-end text-end\" : \"text-start\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{textAlign === \"end\" ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{icon}\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t\t{icon}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t},\n);\nTableSortableHeader.displayName = \"TableSortableHeader\";\n"],"mappings":";;;;;;;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H;AAEA,IAAaK,IAAsBxB,EAAM,YACvC,EAAE,aAAU,eAAY,SAAS,WAAQ,cAAW,GAAGG,KAAS,MAAQ;CACxE,IAAMsB,IACL,kBAAC,QAAD;EAAM,WAAU;EAA6D;CAAe,CAAA,GAEvFC,IAAO,kBAACR,GAAD;EAAkB;EAAQ,UAAUL,MAAc;CAAQ,CAAA;CACvE,OACC,kBAAC,UAAD;EACC,MAAK;EACA;EACL,WAAWT,EACV,wPACAS,MAAc,QAAQ,yBAAyB,cAC/CP,CACD;EACA,GAAIH;EAEH,UAAAU,MAAc,QACd,kBAAAd,GAAA,EAAA,UAAA,CACE2B,GACAD,CACA,EAAA,CAAA,IAEF,kBAAA1B,GAAA,EAAA,UAAA,CACE0B,GACAC,CACA,EAAA,CAAA;CAEI,CAAA;AAEV,CACD;AACA,EAAoB,cAAc"}
@@ -132,6 +132,7 @@
132
132
  --basalt-space-overlay: var(--basalt-space-lg);
133
133
  --basalt-space-panel-x: var(--basalt-space-card);
134
134
  --basalt-space-panel-y: var(--basalt-space-card-sm);
135
+ --basalt-space-table-edge: var(--basalt-space-panel-x);
135
136
  --basalt-space-content-gap: var(--basalt-space-lg);
136
137
  --basalt-space-row-x: var(--basalt-space-lg);
137
138
  --basalt-space-row-y: var(--basalt-space-md);
@@ -623,6 +624,7 @@
623
624
  border-radius: var(--basalt-radius-md);
624
625
  background: linear-gradient(90deg, var(--basalt-hover), var(--basalt-hover-end));
625
626
  opacity: 0;
627
+ transition: none;
626
628
  }
627
629
  .basalt-hover-list[data-hover-visible="true"]::before {
628
630
  opacity: 1;
@@ -1369,12 +1371,18 @@
1369
1371
  .my-basalt-layout-xl {
1370
1372
  margin-block: var(--basalt-space-layout-xl);
1371
1373
  }
1374
+ .ms-auto {
1375
+ margin-inline-start: auto;
1376
+ }
1372
1377
  .mt-auto {
1373
1378
  margin-top: auto;
1374
1379
  }
1375
1380
  .mt-basalt-content-gap {
1376
1381
  margin-top: var(--basalt-space-content-gap);
1377
1382
  }
1383
+ .mt-basalt-layout {
1384
+ margin-top: var(--basalt-space-layout);
1385
+ }
1378
1386
  .mt-basalt-space-lg {
1379
1387
  margin-top: var(--basalt-space-lg);
1380
1388
  }
@@ -1609,6 +1617,9 @@
1609
1617
  .min-h-\[calc\(1lh\+var\(--basalt-space-2\)\)\] {
1610
1618
  min-height: calc(1lh + var(--basalt-space-2));
1611
1619
  }
1620
+ .min-h-\[calc\(var\(--basalt-line-row\)\+2\*var\(--basalt-space-lg\)\)\] {
1621
+ min-height: calc(var(--basalt-line-row) + 2 * var(--basalt-space-lg));
1622
+ }
1612
1623
  .min-h-basalt-action {
1613
1624
  min-height: var(--basalt-size-action);
1614
1625
  }
@@ -2609,9 +2620,6 @@
2609
2620
  .px-basalt-space-sm {
2610
2621
  padding-inline: var(--basalt-space-sm);
2611
2622
  }
2612
- .px-basalt-table-x {
2613
- padding-inline: var(--basalt-space-table-x);
2614
- }
2615
2623
  .py-basalt-card {
2616
2624
  padding-block: var(--basalt-space-card);
2617
2625
  }
@@ -2669,6 +2677,18 @@
2669
2677
  .py-basalt-table-y {
2670
2678
  padding-block: var(--basalt-space-table-y);
2671
2679
  }
2680
+ .ps-basalt-table-edge {
2681
+ padding-inline-start: var(--basalt-space-table-edge);
2682
+ }
2683
+ .ps-basalt-table-x {
2684
+ padding-inline-start: var(--basalt-space-table-x);
2685
+ }
2686
+ .pe-basalt-table-edge {
2687
+ padding-inline-end: var(--basalt-space-table-edge);
2688
+ }
2689
+ .pe-basalt-table-x {
2690
+ padding-inline-end: var(--basalt-space-table-x);
2691
+ }
2672
2692
  .pt-basalt-layout {
2673
2693
  padding-top: var(--basalt-space-layout);
2674
2694
  }
@@ -2717,12 +2737,18 @@
2717
2737
  .text-center {
2718
2738
  text-align: center;
2719
2739
  }
2740
+ .text-end {
2741
+ text-align: end;
2742
+ }
2720
2743
  .text-left {
2721
2744
  text-align: left;
2722
2745
  }
2723
2746
  .text-right {
2724
2747
  text-align: right;
2725
2748
  }
2749
+ .text-start {
2750
+ text-align: start;
2751
+ }
2726
2752
  .align-middle {
2727
2753
  vertical-align: middle;
2728
2754
  }
@@ -2768,10 +2794,6 @@
2768
2794
  font-size: var(--basalt-text-xs);
2769
2795
  line-height: var(--tw-leading, var(--basalt-leading-body));
2770
2796
  }
2771
- .leading-\[calc\(var\(--basalt-size-control\)-2\*var\(--basalt-space-lg\)\)\] {
2772
- --tw-leading: calc(var(--basalt-size-control) - 2 * var(--basalt-space-lg));
2773
- line-height: calc(var(--basalt-size-control) - 2 * var(--basalt-space-lg));
2774
- }
2775
2797
  .leading-\[var\(--basalt-leading-banner\)\] {
2776
2798
  --tw-leading: var(--basalt-leading-banner);
2777
2799
  line-height: var(--basalt-leading-banner);
@@ -146,6 +146,7 @@
146
146
  --spacing-basalt-field-gap: var(--basalt-space-field-gap);
147
147
  --spacing-basalt-table-x: var(--basalt-space-table-x);
148
148
  --spacing-basalt-table-y: var(--basalt-space-table-y);
149
+ --spacing-basalt-table-edge: var(--basalt-space-table-edge);
149
150
  --spacing-basalt-overlay: var(--basalt-space-overlay);
150
151
  --spacing-basalt-panel-x: var(--basalt-space-panel-x);
151
152
  --spacing-basalt-panel-y: var(--basalt-space-panel-y);
@@ -110,6 +110,7 @@
110
110
  --basalt-space-overlay: var(--basalt-space-lg);
111
111
  --basalt-space-panel-x: var(--basalt-space-card);
112
112
  --basalt-space-panel-y: var(--basalt-space-card-sm);
113
+ --basalt-space-table-edge: var(--basalt-space-panel-x);
113
114
  --basalt-space-content-gap: var(--basalt-space-lg);
114
115
  --basalt-space-row-x: var(--basalt-space-lg);
115
116
  --basalt-space-row-y: var(--basalt-space-md);
@@ -616,6 +617,7 @@
616
617
  border-radius: var(--basalt-radius-md);
617
618
  background: linear-gradient(90deg, var(--basalt-hover), var(--basalt-hover-end));
618
619
  opacity: 0;
620
+ transition: none;
619
621
  }
620
622
  .basalt-hover-list[data-hover-visible="true"]::before {
621
623
  opacity: 1;
@@ -6,53 +6,55 @@ var n = "[data-basalt-hover-item]", r = "[data-highlighted], [data-hover-active=
6
6
  function i(i, { restoreOnPointerLeave: a = !0 } = {}) {
7
7
  return t((t) => {
8
8
  if (e(i, t), !t) return;
9
- let o = null, s = !1, c = null, l = null, u = null, d = null, f = !0, p = 0, m = "", h = !0, g = (e) => e && t.contains(e) && e.matches(n) && e.closest(".basalt-hover-list") === t && !e.closest("[hidden], [disabled], [aria-disabled=\"true\"], [data-disabled=\"\"], [data-disabled=\"true\"]") ? e : null, _ = (e) => g(e instanceof Element ? e.closest(n) : null), v = new ResizeObserver(() => {
10
- h = !0, b();
11
- }), y = () => {
12
- if (p = 0, f) {
13
- d = null, u = null;
14
- for (let e of t.querySelectorAll(`${n}:is(${r})`)) if (g(e) && (u ||= e, e.matches("[data-highlighted], [data-hover-active=\"true\"]"))) {
15
- d = e;
9
+ let o = null, s = !1, c = !1, l = null, u = null, d = null, f = null, p = !0, m = 0, h = "", g = !0, _ = (e) => e && t.contains(e) && e.matches(n) && e.closest(".basalt-hover-list") === t && !e.closest("[hidden], [disabled], [aria-disabled=\"true\"], [data-disabled=\"\"], [data-disabled=\"true\"]") ? e : null, v = (e) => _(e instanceof Element ? e.closest(n) : null), y = new ResizeObserver(() => {
10
+ g = !0, x();
11
+ }), b = () => {
12
+ if (m = 0, p) {
13
+ f = null, d = null;
14
+ for (let e of t.querySelectorAll(`${n}:is(${r})`)) if (_(e) && (d ||= e, e.matches("[data-highlighted], [data-hover-active=\"true\"]"))) {
15
+ f = e;
16
16
  break;
17
17
  }
18
- f = !1;
18
+ p = !1;
19
19
  }
20
- let e = s ? null : g(d) ?? g(o) ?? g(c) ?? g(u);
21
- if (e === l && !h) return;
22
- e !== l && (l && v.unobserve(l), e && v.observe(e));
23
- let i = e?.offsetWidth ?? 0, a = e?.offsetHeight ?? 0;
24
- if (!e || !i || !a) {
25
- s && (t.dataset.hoverAnimated = "true"), t.dataset.hoverVisible = "false", l = null, m = "", h = !1;
20
+ let e = c;
21
+ c = !1, e && (t.dataset.hoverAnimated = "false");
22
+ let i = s ? null : a ? _(f) ?? _(o) ?? _(l) ?? _(d) : _(o);
23
+ if (i === u && !g) return;
24
+ i !== u && (u && y.unobserve(u), i && y.observe(i));
25
+ let v = i?.offsetWidth ?? 0, b = i?.offsetHeight ?? 0;
26
+ if (!i || !v || !b) {
27
+ a || (t.dataset.hoverAnimated = "false"), t.dataset.hoverVisible = "false", u = null, h = "", g = !1;
26
28
  return;
27
29
  }
28
- let _ = 0, y = 0;
29
- for (let n = e; n && n !== t; n = n.offsetParent) _ += n.offsetLeft, y += n.offsetTop;
30
- for (let n = e.parentElement; n && n !== t; n = n.parentElement) _ -= n.scrollLeft, y -= n.scrollTop;
31
- let b = `${_},${y},${i},${a}`;
32
- b !== m && (t.dataset.hoverAnimated = l && l !== e && !h ? "true" : "false", t.style.setProperty("--basalt-hover-x", `${_}px`), t.style.setProperty("--basalt-hover-y", `${y}px`), t.style.setProperty("--basalt-hover-width", `${i}px`), t.style.setProperty("--basalt-hover-height", `${a}px`), m = b), t.dataset.hoverVisible = "true", l = e, h = !1;
30
+ let x = 0, S = 0;
31
+ for (let e = i; e && e !== t; e = e.offsetParent) x += e.offsetLeft, S += e.offsetTop;
32
+ for (let e = i.parentElement; e && e !== t; e = e.parentElement) x -= e.scrollLeft, S -= e.scrollTop;
33
+ let C = `${x},${S},${v},${b}`;
34
+ C !== h && (t.dataset.hoverAnimated = u && u !== i && !g && !e ? "true" : "false", t.style.setProperty("--basalt-hover-x", `${x}px`), t.style.setProperty("--basalt-hover-y", `${S}px`), t.style.setProperty("--basalt-hover-width", `${v}px`), t.style.setProperty("--basalt-hover-height", `${b}px`), h = C), t.dataset.hoverVisible = "true", u = i, g = !1;
33
35
  };
34
- function b() {
35
- p ||= requestAnimationFrame(y);
36
+ function x() {
37
+ m ||= requestAnimationFrame(b);
36
38
  }
37
- let x = (e) => {
39
+ let S = (e) => {
38
40
  if (e.pointerType === "touch") return;
39
41
  s = !1;
40
- let t = _(e.target);
41
- t !== o && (o = t, b());
42
- }, S = () => {
43
- o = null, s = !a, b();
44
- }, C = (e) => {
45
- s = !1, c = _(e.target), o = null, b();
42
+ let t = v(e.target);
43
+ t !== o && (!a && (!t || !o) && (c = !0), o = t, x());
44
+ }, C = () => {
45
+ o = null, s = !a, a || (c = !0), x();
46
46
  }, w = (e) => {
47
- c = _(e.relatedTarget), b();
47
+ l = v(e.target), a && (s = !1, o = null, x());
48
48
  }, T = (e) => {
49
- e.target instanceof Element && (t.contains(e.target) || t.id && e.target.getAttribute("aria-controls") === t.id) && (o = null, s = !1, b());
49
+ l = v(e.relatedTarget), a && x();
50
50
  }, E = (e) => {
51
- (e.target !== t || e.type === "scroll") && (h = !0, b());
52
- }, D = new MutationObserver((e) => {
53
- f = !0, e.some((e) => e.type === "childList" || e.attributeName === "hidden") && (h = !0), b();
51
+ e.target instanceof Element && (t.contains(e.target) || t.id && e.target.getAttribute("aria-controls") === t.id) && a && (o = null, s = !1, x());
52
+ }, D = (e) => {
53
+ (e.target !== t || e.type === "scroll") && (g = !0, x());
54
+ }, O = new MutationObserver((e) => {
55
+ p = !0, e.some((e) => e.type === "childList" || e.attributeName === "hidden") && (g = !0), x();
54
56
  });
55
- return D.observe(t, {
57
+ return O.observe(t, {
56
58
  subtree: !0,
57
59
  childList: !0,
58
60
  attributes: !0,
@@ -69,8 +71,8 @@ function i(i, { restoreOnPointerLeave: a = !0 } = {}) {
69
71
  "data-disabled",
70
72
  "hidden"
71
73
  ]
72
- }), v.observe(t), t.addEventListener("pointerover", x), t.addEventListener("pointerleave", S), t.addEventListener("focusin", C), t.addEventListener("focusout", w), t.ownerDocument.addEventListener("keydown", T), t.addEventListener("scroll", E, !0), t.addEventListener("animationend", E), t.addEventListener("transitionend", E), b(), () => {
73
- cancelAnimationFrame(p), v.disconnect(), D.disconnect(), t.removeEventListener("pointerover", x), t.removeEventListener("pointerleave", S), t.removeEventListener("focusin", C), t.removeEventListener("focusout", w), t.ownerDocument.removeEventListener("keydown", T), t.removeEventListener("scroll", E, !0), t.removeEventListener("animationend", E), t.removeEventListener("transitionend", E), e(i, null);
74
+ }), y.observe(t), t.addEventListener("pointerover", S), t.addEventListener("pointerleave", C), t.addEventListener("focusin", w), t.addEventListener("focusout", T), t.ownerDocument.addEventListener("keydown", E), t.addEventListener("scroll", D, !0), t.addEventListener("animationend", D), t.addEventListener("transitionend", D), x(), () => {
75
+ cancelAnimationFrame(m), y.disconnect(), O.disconnect(), t.removeEventListener("pointerover", S), t.removeEventListener("pointerleave", C), t.removeEventListener("focusin", w), t.removeEventListener("focusout", T), t.ownerDocument.removeEventListener("keydown", E), t.removeEventListener("scroll", D, !0), t.removeEventListener("animationend", D), t.removeEventListener("transitionend", D), e(i, null);
74
76
  };
75
77
  }, [i, a]);
76
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-hover-highlight.js","names":["ROW","ACTIVE","useHoverHighlight","useCallback","assignRef","ref","root","hovered","pointerExited","focused","previous","selected","active","selectionDirty","frame","geometry","layoutChanged","eligible","node","row","target","resize","schedule","update","item","width","height","x","next","over","event","leave","restoreOnPointerLeave","focus","blur","keyboard","layout","mutations","records","record"],"sources":["../../src/utils/use-hover-highlight.ts"],"sourcesContent":["import { type Ref, useCallback } from \"react\";\nimport { assignRef } from \"./selection-indicator\";\n\nconst ROW = \"[data-basalt-hover-item]\";\nconst ACTIVE =\n\t'[data-highlighted], [data-hover-active=\"true\"], [aria-selected=\"true\"], [data-state=\"checked\"], [data-hover-selected=\"true\"], [data-selected=\"true\"]';\n\nexport function useHoverHighlight(\n\tref?: Ref<HTMLElement | null>,\n\t{ restoreOnPointerLeave = true }: { restoreOnPointerLeave?: boolean } = {},\n) {\n\treturn useCallback(\n\t\t(root: HTMLElement | null) => {\n\t\t\tassignRef(ref, root);\n\t\t\tif (!root) return;\n\t\t\tlet hovered: HTMLElement | null = null;\n\t\t\tlet pointerExited = false;\n\t\t\tlet focused: HTMLElement | null = null;\n\t\t\tlet previous: HTMLElement | null = null;\n\t\t\tlet selected: HTMLElement | null = null;\n\t\t\tlet active: HTMLElement | null = null;\n\t\t\tlet selectionDirty = true;\n\t\t\tlet frame = 0;\n\t\t\tlet geometry = \"\";\n\t\t\tlet layoutChanged = true;\n\t\t\tconst eligible = (node: HTMLElement | null) =>\n\t\t\t\tnode &&\n\t\t\t\troot.contains(node) &&\n\t\t\t\tnode.matches(ROW) &&\n\t\t\t\tnode.closest(\".basalt-hover-list\") === root &&\n\t\t\t\t!node.closest(\n\t\t\t\t\t'[hidden], [disabled], [aria-disabled=\"true\"], [data-disabled=\"\"], [data-disabled=\"true\"]',\n\t\t\t\t)\n\t\t\t\t\t? node\n\t\t\t\t\t: null;\n\t\t\tconst row = (target: EventTarget | null) =>\n\t\t\t\teligible(target instanceof Element ? target.closest<HTMLElement>(ROW) : null);\n\t\t\tconst resize = new ResizeObserver(() => {\n\t\t\t\tlayoutChanged = true;\n\t\t\t\tschedule();\n\t\t\t});\n\t\t\tconst update = () => {\n\t\t\t\tframe = 0;\n\t\t\t\tif (selectionDirty) {\n\t\t\t\t\tactive = null;\n\t\t\t\t\tselected = null;\n\t\t\t\t\tfor (const node of root.querySelectorAll<HTMLElement>(`${ROW}:is(${ACTIVE})`)) {\n\t\t\t\t\t\tif (!eligible(node)) continue;\n\t\t\t\t\t\tif (!selected) selected = node;\n\t\t\t\t\t\tif (node.matches('[data-highlighted], [data-hover-active=\"true\"]')) {\n\t\t\t\t\t\t\tactive = node;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tselectionDirty = false;\n\t\t\t\t}\n\t\t\t\tconst item = pointerExited\n\t\t\t\t\t? null\n\t\t\t\t\t: (eligible(active) ?? eligible(hovered) ?? eligible(focused) ?? eligible(selected));\n\t\t\t\tif (item === previous && !layoutChanged) return;\n\t\t\t\tif (item !== previous) {\n\t\t\t\t\tif (previous) resize.unobserve(previous);\n\t\t\t\t\tif (item) resize.observe(item);\n\t\t\t\t}\n\t\t\t\tconst width = item?.offsetWidth ?? 0;\n\t\t\t\tconst height = item?.offsetHeight ?? 0;\n\t\t\t\tif (!item || !width || !height) {\n\t\t\t\t\tif (pointerExited) root.dataset.hoverAnimated = \"true\";\n\t\t\t\t\troot.dataset.hoverVisible = \"false\";\n\t\t\t\t\tprevious = null;\n\t\t\t\t\tgeometry = \"\";\n\t\t\t\t\tlayoutChanged = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet x = 0,\n\t\t\t\t\ty = 0;\n\t\t\t\tfor (\n\t\t\t\t\tlet node: HTMLElement | null = item;\n\t\t\t\t\tnode && node !== root;\n\t\t\t\t\tnode = node.offsetParent as HTMLElement | null\n\t\t\t\t) {\n\t\t\t\t\tx += node.offsetLeft;\n\t\t\t\t\ty += node.offsetTop;\n\t\t\t\t}\n\t\t\t\tfor (let node = item.parentElement; node && node !== root; node = node.parentElement) {\n\t\t\t\t\tx -= node.scrollLeft;\n\t\t\t\t\ty -= node.scrollTop;\n\t\t\t\t}\n\t\t\t\tconst next = `${x},${y},${width},${height}`;\n\t\t\t\tif (next !== geometry) {\n\t\t\t\t\troot.dataset.hoverAnimated =\n\t\t\t\t\t\tprevious && previous !== item && !layoutChanged ? \"true\" : \"false\";\n\t\t\t\t\troot.style.setProperty(\"--basalt-hover-x\", `${x}px`);\n\t\t\t\t\troot.style.setProperty(\"--basalt-hover-y\", `${y}px`);\n\t\t\t\t\troot.style.setProperty(\"--basalt-hover-width\", `${width}px`);\n\t\t\t\t\troot.style.setProperty(\"--basalt-hover-height\", `${height}px`);\n\t\t\t\t\tgeometry = next;\n\t\t\t\t}\n\t\t\t\troot.dataset.hoverVisible = \"true\";\n\t\t\t\tprevious = item;\n\t\t\t\tlayoutChanged = false;\n\t\t\t};\n\t\t\tfunction schedule() {\n\t\t\t\tif (!frame) frame = requestAnimationFrame(update);\n\t\t\t}\n\t\t\tconst over = (event: PointerEvent) => {\n\t\t\t\tif (event.pointerType === \"touch\") return;\n\t\t\t\tpointerExited = false;\n\t\t\t\tconst next = row(event.target);\n\t\t\t\tif (next !== hovered) {\n\t\t\t\t\thovered = next;\n\t\t\t\t\tschedule();\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst leave = () => {\n\t\t\t\thovered = null;\n\t\t\t\tpointerExited = !restoreOnPointerLeave;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst focus = (event: FocusEvent) => {\n\t\t\t\tpointerExited = false;\n\t\t\t\tfocused = row(event.target);\n\t\t\t\thovered = null;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst blur = (event: FocusEvent) => {\n\t\t\t\tfocused = row(event.relatedTarget);\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst keyboard = (event: KeyboardEvent) => {\n\t\t\t\tif (\n\t\t\t\t\t!(event.target instanceof Element) ||\n\t\t\t\t\t(!root.contains(event.target) &&\n\t\t\t\t\t\t(!root.id || event.target.getAttribute(\"aria-controls\") !== root.id))\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\thovered = null;\n\t\t\t\tpointerExited = false;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst layout = (event: Event) => {\n\t\t\t\t// Our pseudo-element transition cannot change row geometry.\n\t\t\t\tif (event.target === root && event.type !== \"scroll\") return;\n\t\t\t\tlayoutChanged = true;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst mutations = new MutationObserver((records) => {\n\t\t\t\tselectionDirty = true;\n\t\t\t\tif (\n\t\t\t\t\trecords.some((record) => record.type === \"childList\" || record.attributeName === \"hidden\")\n\t\t\t\t)\n\t\t\t\t\tlayoutChanged = true;\n\t\t\t\tschedule();\n\t\t\t});\n\t\t\tmutations.observe(root, {\n\t\t\t\tsubtree: true,\n\t\t\t\tchildList: true,\n\t\t\t\tattributes: true,\n\t\t\t\tattributeFilter: [\n\t\t\t\t\t\"data-basalt-hover-item\",\n\t\t\t\t\t\"data-highlighted\",\n\t\t\t\t\t\"data-state\",\n\t\t\t\t\t\"aria-selected\",\n\t\t\t\t\t\"data-selected\",\n\t\t\t\t\t\"data-hover-active\",\n\t\t\t\t\t\"data-hover-selected\",\n\t\t\t\t\t\"disabled\",\n\t\t\t\t\t\"aria-disabled\",\n\t\t\t\t\t\"data-disabled\",\n\t\t\t\t\t\"hidden\",\n\t\t\t\t],\n\t\t\t});\n\t\t\tresize.observe(root);\n\t\t\troot.addEventListener(\"pointerover\", over);\n\t\t\troot.addEventListener(\"pointerleave\", leave);\n\t\t\troot.addEventListener(\"focusin\", focus);\n\t\t\troot.addEventListener(\"focusout\", blur);\n\t\t\troot.ownerDocument.addEventListener(\"keydown\", keyboard);\n\t\t\troot.addEventListener(\"scroll\", layout, true);\n\t\t\troot.addEventListener(\"animationend\", layout);\n\t\t\troot.addEventListener(\"transitionend\", layout);\n\t\t\tschedule();\n\t\t\treturn () => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tresize.disconnect();\n\t\t\t\tmutations.disconnect();\n\t\t\t\troot.removeEventListener(\"pointerover\", over);\n\t\t\t\troot.removeEventListener(\"pointerleave\", leave);\n\t\t\t\troot.removeEventListener(\"focusin\", focus);\n\t\t\t\troot.removeEventListener(\"focusout\", blur);\n\t\t\t\troot.ownerDocument.removeEventListener(\"keydown\", keyboard);\n\t\t\t\troot.removeEventListener(\"scroll\", layout, true);\n\t\t\t\troot.removeEventListener(\"animationend\", layout);\n\t\t\t\troot.removeEventListener(\"transitionend\", layout);\n\t\t\t\tassignRef(ref, null);\n\t\t\t};\n\t\t},\n\t\t[ref, restoreOnPointerLeave],\n\t);\n}\n"],"mappings":";;;;AAGA,IAAMA,IAAM,4BACNC,IACL;AAED,SAAgBC,EACf,GACA,EAAE,2BAAwB,OAA8C,CAAC,GACxE;CACD,OAAOC,GACL,MAA6B;EAE7B,IADAC,EAAUC,GAAKC,CAAI,GACf,CAACA,GAAM;EACX,IAAIC,IAA8B,MAC9BC,IAAgB,IAChBC,IAA8B,MAC9BC,IAA+B,MAC/BC,IAA+B,MAC/BC,I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ACD"}
1
+ {"version":3,"file":"use-hover-highlight.js","names":["ROW","ACTIVE","useHoverHighlight","useCallback","assignRef","ref","root","hovered","pointerExited","sequenceBroken","focused","previous","selected","active","selectionDirty","frame","geometry","layoutChanged","eligible","node","row","target","resize","schedule","update","broken","item","restoreOnPointerLeave","width","height","y","next","over","event","leave","focus","blur","keyboard","layout","mutations","records","record"],"sources":["../../src/utils/use-hover-highlight.ts"],"sourcesContent":["import { type Ref, useCallback } from \"react\";\nimport { assignRef } from \"./selection-indicator\";\n\nconst ROW = \"[data-basalt-hover-item]\";\nconst ACTIVE =\n\t'[data-highlighted], [data-hover-active=\"true\"], [aria-selected=\"true\"], [data-state=\"checked\"], [data-hover-selected=\"true\"], [data-selected=\"true\"]';\n\nexport function useHoverHighlight(\n\tref?: Ref<HTMLElement | null>,\n\t{ restoreOnPointerLeave = true }: { restoreOnPointerLeave?: boolean } = {},\n) {\n\treturn useCallback(\n\t\t(root: HTMLElement | null) => {\n\t\t\tassignRef(ref, root);\n\t\t\tif (!root) return;\n\t\t\tlet hovered: HTMLElement | null = null;\n\t\t\tlet pointerExited = false;\n\t\t\tlet sequenceBroken = false;\n\t\t\tlet focused: HTMLElement | null = null;\n\t\t\tlet previous: HTMLElement | null = null;\n\t\t\tlet selected: HTMLElement | null = null;\n\t\t\tlet active: HTMLElement | null = null;\n\t\t\tlet selectionDirty = true;\n\t\t\tlet frame = 0;\n\t\t\tlet geometry = \"\";\n\t\t\tlet layoutChanged = true;\n\t\t\tconst eligible = (node: HTMLElement | null) =>\n\t\t\t\tnode &&\n\t\t\t\troot.contains(node) &&\n\t\t\t\tnode.matches(ROW) &&\n\t\t\t\tnode.closest(\".basalt-hover-list\") === root &&\n\t\t\t\t!node.closest(\n\t\t\t\t\t'[hidden], [disabled], [aria-disabled=\"true\"], [data-disabled=\"\"], [data-disabled=\"true\"]',\n\t\t\t\t)\n\t\t\t\t\t? node\n\t\t\t\t\t: null;\n\t\t\tconst row = (target: EventTarget | null) =>\n\t\t\t\teligible(target instanceof Element ? target.closest<HTMLElement>(ROW) : null);\n\t\t\tconst resize = new ResizeObserver(() => {\n\t\t\t\tlayoutChanged = true;\n\t\t\t\tschedule();\n\t\t\t});\n\t\t\tconst update = () => {\n\t\t\t\tframe = 0;\n\t\t\t\tif (selectionDirty) {\n\t\t\t\t\tactive = null;\n\t\t\t\t\tselected = null;\n\t\t\t\t\tfor (const node of root.querySelectorAll<HTMLElement>(`${ROW}:is(${ACTIVE})`)) {\n\t\t\t\t\t\tif (!eligible(node)) continue;\n\t\t\t\t\t\tif (!selected) selected = node;\n\t\t\t\t\t\tif (node.matches('[data-highlighted], [data-hover-active=\"true\"]')) {\n\t\t\t\t\t\t\tactive = node;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tselectionDirty = false;\n\t\t\t\t}\n\t\t\t\tconst broken = sequenceBroken;\n\t\t\t\tsequenceBroken = false;\n\t\t\t\tif (broken) root.dataset.hoverAnimated = \"false\";\n\t\t\t\tconst item = pointerExited\n\t\t\t\t\t? null\n\t\t\t\t\t: restoreOnPointerLeave\n\t\t\t\t\t\t? (eligible(active) ?? eligible(hovered) ?? eligible(focused) ?? eligible(selected))\n\t\t\t\t\t\t: eligible(hovered);\n\t\t\t\tif (item === previous && !layoutChanged) return;\n\t\t\t\tif (item !== previous) {\n\t\t\t\t\tif (previous) resize.unobserve(previous);\n\t\t\t\t\tif (item) resize.observe(item);\n\t\t\t\t}\n\t\t\t\tconst width = item?.offsetWidth ?? 0;\n\t\t\t\tconst height = item?.offsetHeight ?? 0;\n\t\t\t\tif (!item || !width || !height) {\n\t\t\t\t\tif (!restoreOnPointerLeave) root.dataset.hoverAnimated = \"false\";\n\t\t\t\t\troot.dataset.hoverVisible = \"false\";\n\t\t\t\t\tprevious = null;\n\t\t\t\t\tgeometry = \"\";\n\t\t\t\t\tlayoutChanged = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet x = 0,\n\t\t\t\t\ty = 0;\n\t\t\t\tfor (\n\t\t\t\t\tlet node: HTMLElement | null = item;\n\t\t\t\t\tnode && node !== root;\n\t\t\t\t\tnode = node.offsetParent as HTMLElement | null\n\t\t\t\t) {\n\t\t\t\t\tx += node.offsetLeft;\n\t\t\t\t\ty += node.offsetTop;\n\t\t\t\t}\n\t\t\t\tfor (let node = item.parentElement; node && node !== root; node = node.parentElement) {\n\t\t\t\t\tx -= node.scrollLeft;\n\t\t\t\t\ty -= node.scrollTop;\n\t\t\t\t}\n\t\t\t\tconst next = `${x},${y},${width},${height}`;\n\t\t\t\tif (next !== geometry) {\n\t\t\t\t\troot.dataset.hoverAnimated =\n\t\t\t\t\t\tprevious && previous !== item && !layoutChanged && !broken ? \"true\" : \"false\";\n\t\t\t\t\troot.style.setProperty(\"--basalt-hover-x\", `${x}px`);\n\t\t\t\t\troot.style.setProperty(\"--basalt-hover-y\", `${y}px`);\n\t\t\t\t\troot.style.setProperty(\"--basalt-hover-width\", `${width}px`);\n\t\t\t\t\troot.style.setProperty(\"--basalt-hover-height\", `${height}px`);\n\t\t\t\t\tgeometry = next;\n\t\t\t\t}\n\t\t\t\troot.dataset.hoverVisible = \"true\";\n\t\t\t\tprevious = item;\n\t\t\t\tlayoutChanged = false;\n\t\t\t};\n\t\t\tfunction schedule() {\n\t\t\t\tif (!frame) frame = requestAnimationFrame(update);\n\t\t\t}\n\t\t\tconst over = (event: PointerEvent) => {\n\t\t\t\tif (event.pointerType === \"touch\") return;\n\t\t\t\tpointerExited = false;\n\t\t\t\tconst next = row(event.target);\n\t\t\t\tif (next !== hovered) {\n\t\t\t\t\tif (!restoreOnPointerLeave && (!next || !hovered)) sequenceBroken = true;\n\t\t\t\t\thovered = next;\n\t\t\t\t\tschedule();\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst leave = () => {\n\t\t\t\thovered = null;\n\t\t\t\tpointerExited = !restoreOnPointerLeave;\n\t\t\t\tif (!restoreOnPointerLeave) sequenceBroken = true;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst focus = (event: FocusEvent) => {\n\t\t\t\tfocused = row(event.target);\n\t\t\t\tif (!restoreOnPointerLeave) return;\n\t\t\t\tpointerExited = false;\n\t\t\t\thovered = null;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst blur = (event: FocusEvent) => {\n\t\t\t\tfocused = row(event.relatedTarget);\n\t\t\t\tif (!restoreOnPointerLeave) return;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst keyboard = (event: KeyboardEvent) => {\n\t\t\t\tif (\n\t\t\t\t\t!(event.target instanceof Element) ||\n\t\t\t\t\t(!root.contains(event.target) &&\n\t\t\t\t\t\t(!root.id || event.target.getAttribute(\"aria-controls\") !== root.id))\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\tif (!restoreOnPointerLeave) return;\n\t\t\t\thovered = null;\n\t\t\t\tpointerExited = false;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst layout = (event: Event) => {\n\t\t\t\t// Our pseudo-element transition cannot change row geometry.\n\t\t\t\tif (event.target === root && event.type !== \"scroll\") return;\n\t\t\t\tlayoutChanged = true;\n\t\t\t\tschedule();\n\t\t\t};\n\t\t\tconst mutations = new MutationObserver((records) => {\n\t\t\t\tselectionDirty = true;\n\t\t\t\tif (\n\t\t\t\t\trecords.some((record) => record.type === \"childList\" || record.attributeName === \"hidden\")\n\t\t\t\t)\n\t\t\t\t\tlayoutChanged = true;\n\t\t\t\tschedule();\n\t\t\t});\n\t\t\tmutations.observe(root, {\n\t\t\t\tsubtree: true,\n\t\t\t\tchildList: true,\n\t\t\t\tattributes: true,\n\t\t\t\tattributeFilter: [\n\t\t\t\t\t\"data-basalt-hover-item\",\n\t\t\t\t\t\"data-highlighted\",\n\t\t\t\t\t\"data-state\",\n\t\t\t\t\t\"aria-selected\",\n\t\t\t\t\t\"data-selected\",\n\t\t\t\t\t\"data-hover-active\",\n\t\t\t\t\t\"data-hover-selected\",\n\t\t\t\t\t\"disabled\",\n\t\t\t\t\t\"aria-disabled\",\n\t\t\t\t\t\"data-disabled\",\n\t\t\t\t\t\"hidden\",\n\t\t\t\t],\n\t\t\t});\n\t\t\tresize.observe(root);\n\t\t\troot.addEventListener(\"pointerover\", over);\n\t\t\troot.addEventListener(\"pointerleave\", leave);\n\t\t\troot.addEventListener(\"focusin\", focus);\n\t\t\troot.addEventListener(\"focusout\", blur);\n\t\t\troot.ownerDocument.addEventListener(\"keydown\", keyboard);\n\t\t\troot.addEventListener(\"scroll\", layout, true);\n\t\t\troot.addEventListener(\"animationend\", layout);\n\t\t\troot.addEventListener(\"transitionend\", layout);\n\t\t\tschedule();\n\t\t\treturn () => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tresize.disconnect();\n\t\t\t\tmutations.disconnect();\n\t\t\t\troot.removeEventListener(\"pointerover\", over);\n\t\t\t\troot.removeEventListener(\"pointerleave\", leave);\n\t\t\t\troot.removeEventListener(\"focusin\", focus);\n\t\t\t\troot.removeEventListener(\"focusout\", blur);\n\t\t\t\troot.ownerDocument.removeEventListener(\"keydown\", keyboard);\n\t\t\t\troot.removeEventListener(\"scroll\", layout, true);\n\t\t\t\troot.removeEventListener(\"animationend\", layout);\n\t\t\t\troot.removeEventListener(\"transitionend\", layout);\n\t\t\t\tassignRef(ref, null);\n\t\t\t};\n\t\t},\n\t\t[ref, restoreOnPointerLeave],\n\t);\n}\n"],"mappings":";;;;AAGA,IAAMA,IAAM,4BACNC,IACL;AAED,SAAgBC,EACf,GACA,EAAE,2BAAwB,OAA8C,CAAC,GACxE;CACD,OAAOC,GACL,MAA6B;EAE7B,IADAC,EAAUC,GAAKC,CAAI,GACf,CAACA,GAAM;EACX,IAAIC,IAA8B,MAC9BC,IAAgB,IAChBC,IAAiB,IACjBC,IAA8B,MAC9BC,IAA+B,MAC/BC,IAA+B,MAC/BC,IAA6B,MAC7BC,IAAiB,IACjBC,IAAQ,GACRC,IAAW,IACXC,IAAgB,IACdC,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AAK,oBAAoB,gBAAgBgC,CAAM,GAC/ChC,EAAK,oBAAoB,iBAAiBgC,CAAM,GAChDlC,EAAUC,GAAK,IAAI;EACpB;CACD,GACA,CAACA,GAAKsB,CAAqB,CAC5B;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocoo/basalt",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -52,36 +52,36 @@
52
52
  "./styles/standalone": "./dist/styles/standalone.css"
53
53
  },
54
54
  "dependencies": {
55
- "@radix-ui/react-accordion": "1.2.20",
56
- "@radix-ui/react-alert-dialog": "1.1.23",
57
- "@radix-ui/react-avatar": "1.2.6",
58
- "@radix-ui/react-checkbox": "1.3.11",
59
- "@radix-ui/react-collapsible": "1.1.20",
60
- "@radix-ui/react-context-menu": "2.3.7",
61
- "@radix-ui/react-dialog": "1.1.23",
62
- "@radix-ui/react-dropdown-menu": "2.1.24",
63
- "@radix-ui/react-hover-card": "1.1.23",
64
- "@radix-ui/react-label": "2.1.15",
65
- "@radix-ui/react-menubar": "1.1.24",
66
- "@radix-ui/react-navigation-menu": "1.2.22",
67
- "@radix-ui/react-popover": "1.1.23",
68
- "@radix-ui/react-progress": "1.1.16",
69
- "@radix-ui/react-radio-group": "1.4.7",
70
- "@radix-ui/react-scroll-area": "1.2.18",
71
- "@radix-ui/react-select": "2.3.7",
72
- "@radix-ui/react-separator": "1.1.15",
73
- "@radix-ui/react-slider": "1.4.7",
74
- "@radix-ui/react-slot": "1.3.3",
75
- "@radix-ui/react-switch": "1.3.7",
76
- "@radix-ui/react-tabs": "1.1.21",
77
- "@radix-ui/react-toggle": "1.1.18",
78
- "@radix-ui/react-toggle-group": "1.1.19",
79
- "@radix-ui/react-tooltip": "1.2.16",
55
+ "@radix-ui/react-accordion": "1.3.1",
56
+ "@radix-ui/react-alert-dialog": "1.2.1",
57
+ "@radix-ui/react-avatar": "1.3.1",
58
+ "@radix-ui/react-checkbox": "1.4.1",
59
+ "@radix-ui/react-collapsible": "1.2.1",
60
+ "@radix-ui/react-context-menu": "2.4.1",
61
+ "@radix-ui/react-dialog": "1.3.1",
62
+ "@radix-ui/react-dropdown-menu": "2.2.1",
63
+ "@radix-ui/react-hover-card": "1.2.1",
64
+ "@radix-ui/react-label": "2.1.17",
65
+ "@radix-ui/react-menubar": "1.2.1",
66
+ "@radix-ui/react-navigation-menu": "1.4.1",
67
+ "@radix-ui/react-popover": "1.3.1",
68
+ "@radix-ui/react-progress": "1.2.1",
69
+ "@radix-ui/react-radio-group": "1.5.1",
70
+ "@radix-ui/react-scroll-area": "1.4.0",
71
+ "@radix-ui/react-select": "2.4.1",
72
+ "@radix-ui/react-separator": "1.2.0",
73
+ "@radix-ui/react-slider": "1.6.1",
74
+ "@radix-ui/react-slot": "1.5.0",
75
+ "@radix-ui/react-switch": "1.4.1",
76
+ "@radix-ui/react-tabs": "1.2.1",
77
+ "@radix-ui/react-toggle": "1.2.1",
78
+ "@radix-ui/react-toggle-group": "1.2.1",
79
+ "@radix-ui/react-tooltip": "1.4.1",
80
80
  "class-variance-authority": "^0.7.1",
81
81
  "clsx": "^2.1.1",
82
82
  "cmdk": "^1.1.1",
83
- "entities": "8.0.0",
84
- "marked": "18.0.14",
83
+ "entities": "8.1.0",
84
+ "marked": "18.1.1",
85
85
  "sonner": "2.0.8",
86
86
  "tailwind-merge": "3.7.0"
87
87
  },