@crispy-seed/data-table 0.2.0 → 0.2.2

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
@@ -9110,7 +9110,6 @@ const fromDatePickerDate = (d)=>new Date(d.year, d.month - 1, d.day);
9110
9110
  children: /*#__PURE__*/ jsxRuntime.jsxs(ActionButton, {
9111
9111
  variant: "neutralOutline",
9112
9112
  size: "xsmall",
9113
- "aria-label": label,
9114
9113
  "data-active": toolbarSorts.length > 0 ? "" : undefined,
9115
9114
  children: [
9116
9115
  /*#__PURE__*/ jsxRuntime.jsx(IconArrowUpArrowDownLine_default, {
@@ -9513,7 +9512,6 @@ const formatFilterDate = (iso)=>{
9513
9512
  children: /*#__PURE__*/ jsxRuntime.jsxs(ActionButton, {
9514
9513
  variant: "neutralOutline",
9515
9514
  size: "xsmall",
9516
- "aria-label": label,
9517
9515
  "data-active": toolbarFilters.length > 0 ? "" : undefined,
9518
9516
  children: [
9519
9517
  /*#__PURE__*/ jsxRuntime.jsx(IconSlider2HorizontalLine_default, {
@@ -9530,17 +9528,55 @@ const formatFilterDate = (iso)=>{
9530
9528
  minWidth: 260
9531
9529
  },
9532
9530
  children: /*#__PURE__*/ jsxRuntime.jsx(MenuScrollArea, {
9533
- children: pickingField ? /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
9534
- children: columns.map((c)=>/*#__PURE__*/ jsxRuntime.jsx(MenuItem, {
9535
- onClick: ()=>{
9536
- const id = addToolbarFilter(c.key);
9537
- setExpandedId(id);
9538
- setPickingField(false);
9531
+ children: pickingField ? // Plain buttons, NOT `MenuItem` -- `MenuItem`'s own `getItemProps`
9532
+ // (`useMenu.ts`: `setOpen(false, { reason: "itemClick" })`) closes the
9533
+ // WHOLE popover unconditionally on click, which is correct for a normal
9534
+ // command menu but exactly wrong here: picking a field must stay inside
9535
+ // THIS SAME popover and land on the new condition's own expanded editor,
9536
+ // not close it. Same reasoning as `SortControl`'s "+ Add sort" button and
9537
+ // crisp's own historic note on this file's old per-column picker.
9538
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
9539
+ style: {
9540
+ display: "flex",
9541
+ flexDirection: "column",
9542
+ gap: 2,
9543
+ padding: "4px 8px"
9544
+ },
9545
+ children: [
9546
+ /*#__PURE__*/ jsxRuntime.jsx("button", {
9547
+ type: "button",
9548
+ "aria-label": "Back to filters",
9549
+ onClick: ()=>setPickingField(false),
9550
+ style: {
9551
+ alignSelf: "flex-start",
9552
+ fontSize: 12,
9553
+ color: "var(--seed-color-fg-neutral-subtle)",
9554
+ border: "none",
9555
+ background: "transparent",
9556
+ cursor: "pointer",
9557
+ padding: "4px 4px 6px"
9539
9558
  },
9540
- children: /*#__PURE__*/ jsxRuntime.jsx(MenuItemLabel, {
9559
+ children: "‹ Back"
9560
+ }),
9561
+ columns.map((c)=>/*#__PURE__*/ jsxRuntime.jsx("button", {
9562
+ type: "button",
9563
+ onClick: ()=>{
9564
+ const id = addToolbarFilter(c.key);
9565
+ setExpandedId(id);
9566
+ setPickingField(false);
9567
+ },
9568
+ style: {
9569
+ textAlign: "left",
9570
+ padding: "6px 8px",
9571
+ borderRadius: 6,
9572
+ border: "none",
9573
+ cursor: "pointer",
9574
+ background: "transparent",
9575
+ fontSize: 13
9576
+ },
9541
9577
  children: columnLabel(c)
9542
- })
9543
- }, c.key))
9578
+ }, c.key))
9579
+ ]
9544
9580
  }) : /*#__PURE__*/ jsxRuntime.jsxs("div", {
9545
9581
  style: {
9546
9582
  display: "flex",
package/dist/index.js CHANGED
@@ -9091,7 +9091,6 @@ const fromDatePickerDate = (d)=>new Date(d.year, d.month - 1, d.day);
9091
9091
  children: /*#__PURE__*/ jsxs(ActionButton, {
9092
9092
  variant: "neutralOutline",
9093
9093
  size: "xsmall",
9094
- "aria-label": label,
9095
9094
  "data-active": toolbarSorts.length > 0 ? "" : undefined,
9096
9095
  children: [
9097
9096
  /*#__PURE__*/ jsx(IconArrowUpArrowDownLine_default, {
@@ -9494,7 +9493,6 @@ const formatFilterDate = (iso)=>{
9494
9493
  children: /*#__PURE__*/ jsxs(ActionButton, {
9495
9494
  variant: "neutralOutline",
9496
9495
  size: "xsmall",
9497
- "aria-label": label,
9498
9496
  "data-active": toolbarFilters.length > 0 ? "" : undefined,
9499
9497
  children: [
9500
9498
  /*#__PURE__*/ jsx(IconSlider2HorizontalLine_default, {
@@ -9511,17 +9509,55 @@ const formatFilterDate = (iso)=>{
9511
9509
  minWidth: 260
9512
9510
  },
9513
9511
  children: /*#__PURE__*/ jsx(MenuScrollArea, {
9514
- children: pickingField ? /*#__PURE__*/ jsx(Fragment, {
9515
- children: columns.map((c)=>/*#__PURE__*/ jsx(MenuItem, {
9516
- onClick: ()=>{
9517
- const id = addToolbarFilter(c.key);
9518
- setExpandedId(id);
9519
- setPickingField(false);
9512
+ children: pickingField ? // Plain buttons, NOT `MenuItem` -- `MenuItem`'s own `getItemProps`
9513
+ // (`useMenu.ts`: `setOpen(false, { reason: "itemClick" })`) closes the
9514
+ // WHOLE popover unconditionally on click, which is correct for a normal
9515
+ // command menu but exactly wrong here: picking a field must stay inside
9516
+ // THIS SAME popover and land on the new condition's own expanded editor,
9517
+ // not close it. Same reasoning as `SortControl`'s "+ Add sort" button and
9518
+ // crisp's own historic note on this file's old per-column picker.
9519
+ /*#__PURE__*/ jsxs("div", {
9520
+ style: {
9521
+ display: "flex",
9522
+ flexDirection: "column",
9523
+ gap: 2,
9524
+ padding: "4px 8px"
9525
+ },
9526
+ children: [
9527
+ /*#__PURE__*/ jsx("button", {
9528
+ type: "button",
9529
+ "aria-label": "Back to filters",
9530
+ onClick: ()=>setPickingField(false),
9531
+ style: {
9532
+ alignSelf: "flex-start",
9533
+ fontSize: 12,
9534
+ color: "var(--seed-color-fg-neutral-subtle)",
9535
+ border: "none",
9536
+ background: "transparent",
9537
+ cursor: "pointer",
9538
+ padding: "4px 4px 6px"
9520
9539
  },
9521
- children: /*#__PURE__*/ jsx(MenuItemLabel, {
9540
+ children: "‹ Back"
9541
+ }),
9542
+ columns.map((c)=>/*#__PURE__*/ jsx("button", {
9543
+ type: "button",
9544
+ onClick: ()=>{
9545
+ const id = addToolbarFilter(c.key);
9546
+ setExpandedId(id);
9547
+ setPickingField(false);
9548
+ },
9549
+ style: {
9550
+ textAlign: "left",
9551
+ padding: "6px 8px",
9552
+ borderRadius: 6,
9553
+ border: "none",
9554
+ cursor: "pointer",
9555
+ background: "transparent",
9556
+ fontSize: 13
9557
+ },
9522
9558
  children: columnLabel(c)
9523
- })
9524
- }, c.key))
9559
+ }, c.key))
9560
+ ]
9525
9561
  }) : /*#__PURE__*/ jsxs("div", {
9526
9562
  style: {
9527
9563
  display: "flex",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crispy-seed/data-table",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Self-contained, publishable build of seed-design's Attio-measured DataTable — one install, one CSS import.",
5
5
  "repository": {
6
6
  "type": "git",