@eqtylab/equality 4.12.0 → 4.13.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  Notable changes to Equality are recorded here, following [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
4
4
 
5
+ ## 4.13.1 - 2026-10-15
6
+
7
+ ### Fixed
8
+
9
+ - A long `SelectItem` lines up with the others. Its check column used to shrink when the text was
10
+ too wide, by up to 14px, so an unselected long option sat left of the rest. Long text wraps
11
+ inside the row, and an unbreakable string such as a hash breaks onto more lines instead of
12
+ running past the list's edge. Content that can't shrink, such as an `inline-block` with a fixed
13
+ width, still overflows; give it `block truncate` to cut it to one line instead.
14
+
15
+ ## 4.13.0 - 2026-10-13
16
+
17
+ `Tabs` can be controlled with a `value` prop, so the indicator from 4.12.0 slides when the active
18
+ tab comes from outside, such as the URL. Existing code keeps working, but code that remounts
19
+ `Tabs` with `key` to change the tab has to pass `value` instead to get the slide.
20
+
21
+ ### Added
22
+
23
+ - A `value` prop on `Tabs`, so the active tab can be controlled. Code that remounts `Tabs` with
24
+ `key` to change the tab can pass `value` instead. The indicator then slides to the new tab
25
+ rather than jumping partway through.
26
+
27
+ ### Fixed
28
+
29
+ - A click on a controlled tab calls `onValueChange` once. Radix requests the tab on both mousedown
30
+ and focus, so a parent that commits the new value later, as React Router does, was called twice.
31
+
5
32
  ## 4.12.0 - 2026-10-12
6
33
 
7
34
  `Tabs` respond to hover, and filled `Tabs` match `SegmentedControls`. Two `SegmentedControls`
package/dist/index.cjs CHANGED
@@ -3196,7 +3196,7 @@ var SelectItem = React15__namespace.forwardRef(({ className, children, textValue
3196
3196
  hidden: hidden || !matches || void 0,
3197
3197
  children: [
3198
3198
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles37__default.default["select-item-indicator"], children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon3, { className: styles37__default.default["select-icon"] }) }) }),
3199
- /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
3199
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles37__default.default["select-item-text"], children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }) })
3200
3200
  ]
3201
3201
  }
3202
3202
  );
@@ -4297,11 +4297,13 @@ var Tabs = ({
4297
4297
  items,
4298
4298
  className,
4299
4299
  tabsListBackground = "transparent",
4300
+ value,
4300
4301
  defaultValue,
4301
4302
  onValueChange,
4302
4303
  staticRender = false
4303
4304
  }) => {
4304
- const [activeTab, setActiveTab] = React15.useState(defaultValue ?? items[0].value);
4305
+ const [uncontrolledTab, setUncontrolledTab] = React15.useState(defaultValue ?? items[0].value);
4306
+ const activeTab = value ?? uncontrolledTab;
4305
4307
  const isFilled = tabsListBackground === "filled";
4306
4308
  const listRef = React15.useRef(null);
4307
4309
  const triggerRefs = React15.useRef({});
@@ -4340,8 +4342,14 @@ var Tabs = ({
4340
4342
  }
4341
4343
  return () => observer.disconnect();
4342
4344
  }, [updateIndicator, itemValues, staticRender]);
4345
+ const requestedTab = React15.useRef(null);
4343
4346
  const handleValueChange = (newTab) => {
4344
- setActiveTab(newTab);
4347
+ if (newTab === requestedTab.current) return;
4348
+ requestedTab.current = newTab;
4349
+ setTimeout(() => {
4350
+ requestedTab.current = null;
4351
+ });
4352
+ if (value === void 0) setUncontrolledTab(newTab);
4345
4353
  onValueChange?.(newTab);
4346
4354
  };
4347
4355
  const renderIcon = (icon) => {
@@ -4354,7 +4362,7 @@ var Tabs = ({
4354
4362
  styles58__default.default["active-tab-indicator"],
4355
4363
  isFilled ? styles58__default.default["active-tab-indicator--filled"] : styles58__default.default["active-tab-indicator--transparent"]
4356
4364
  );
4357
- const renderTriggerIndicator = (value) => {
4365
+ const renderTriggerIndicator = (value2) => {
4358
4366
  if (staticRender) {
4359
4367
  return /* @__PURE__ */ jsxRuntime.jsx(
4360
4368
  "span",
@@ -4365,7 +4373,7 @@ var Tabs = ({
4365
4373
  }
4366
4374
  );
4367
4375
  }
4368
- if (!indicator && value === activeTab) {
4376
+ if (!indicator && value2 === activeTab) {
4369
4377
  return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, "data-slot": "tabs-indicator", className: indicatorClass });
4370
4378
  }
4371
4379
  return null;
@@ -4386,16 +4394,16 @@ var Tabs = ({
4386
4394
  isFilled ? styles58__default.default["tabs-list--filled"] : styles58__default.default["tabs-list--transparent"]
4387
4395
  ),
4388
4396
  children: [
4389
- items.map(({ label, value, icon, suffix, triggerProps }) => {
4397
+ items.map(({ label, value: value2, icon, suffix, triggerProps }) => {
4390
4398
  return /* @__PURE__ */ React15.createElement(
4391
4399
  TabsTrigger,
4392
4400
  {
4393
4401
  ...triggerProps,
4394
- key: value,
4402
+ key: value2,
4395
4403
  ref: (el) => {
4396
- triggerRefs.current[value] = el;
4404
+ triggerRefs.current[value2] = el;
4397
4405
  },
4398
- value,
4406
+ value: value2,
4399
4407
  className: cn(
4400
4408
  styles58__default.default["tabs-trigger"],
4401
4409
  isFilled ? styles58__default.default["tabs-trigger--filled"] : styles58__default.default["tabs-trigger--transparent"],
@@ -4405,7 +4413,7 @@ var Tabs = ({
4405
4413
  renderIcon(icon),
4406
4414
  label,
4407
4415
  suffix,
4408
- renderTriggerIndicator(value)
4416
+ renderTriggerIndicator(value2)
4409
4417
  );
4410
4418
  }),
4411
4419
  !staticRender && indicator && /* @__PURE__ */ jsxRuntime.jsx(
@@ -4428,15 +4436,15 @@ var Tabs = ({
4428
4436
  ]
4429
4437
  }
4430
4438
  ),
4431
- items.map(({ value, content }) => /* @__PURE__ */ jsxRuntime.jsx(
4439
+ items.map(({ value: value2, content }) => /* @__PURE__ */ jsxRuntime.jsx(
4432
4440
  TabsContent,
4433
4441
  {
4434
- value,
4442
+ value: value2,
4435
4443
  className: styles58__default.default["content"],
4436
4444
  forceMount: staticRender || void 0,
4437
4445
  children: content
4438
4446
  },
4439
- value
4447
+ value2
4440
4448
  ))
4441
4449
  ]
4442
4450
  }