@eqtylab/equality 4.5.1 → 4.7.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
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.7.0 - 2026-09-28
6
+
7
+ ### Added
8
+
9
+ - `SegmentedControls` accepts `aria-label` and `aria-labelledby`, and renders as a `group`, so a
10
+ screen reader announces what the segments choose between. Consumers had to wrap it in their
11
+ own labelled `div` to get this.
12
+
13
+ ## 4.6.0 - 2026-09-25
14
+
15
+ ### Added
16
+
17
+ - Segmented control options can now display `primary` (default), `neutral`, `success`, `warning`, and `danger` variants that change the selection color based on the state.
18
+
5
19
  ## 4.5.1 - 2026-09-25
6
20
 
7
21
  ### Fixed
@@ -73,12 +73,18 @@
73
73
  --color-button-danger-border: color(display-p3 0.5698 0.1873 0.1674);
74
74
  --color-button-danger-fill: color(display-p3 0.7365 0.2216 0.2026);
75
75
  --color-button-danger-text: color(display-p3 1 1 1);
76
+ --color-button-neutral-border: color(display-p3 0.3886 0.3886 0.3886);
77
+ --color-button-neutral-fill: color(display-p3 0.3886 0.3886 0.3886);
78
+ --color-button-neutral-text: color(display-p3 1 1 1);
76
79
  --color-button-primary-border: color(display-p3 0.5242 0.2903 0.7705);
77
80
  --color-button-primary-fill: color(display-p3 0.5242 0.2903 0.7705);
78
81
  --color-button-primary-text: color(display-p3 1 1 1);
79
82
  --color-button-secondary-border: color(display-p3 0.0861 0.0861 0.0861);
80
83
  --color-button-secondary-fill: color(display-p3 0.0861 0.0861 0.0861);
81
84
  --color-button-secondary-text: color(display-p3 1 1 1);
85
+ --color-button-success-border: color(display-p3 0.2946 0.5328 0.2433);
86
+ --color-button-success-fill: color(display-p3 0.2946 0.5328 0.2433);
87
+ --color-button-success-text: color(display-p3 1 1 1);
82
88
  --color-button-tertiary-border: color(display-p3 0.7432 0.7432 0.7432);
83
89
  --color-button-tertiary-fill: color(display-p3 1 1 1);
84
90
  --color-button-tertiary-text: color(display-p3 0 0 0);
@@ -324,11 +330,15 @@
324
330
  --dark-color-border: color(display-p3 0.1792 0.1792 0.1792);
325
331
  --dark-color-button-danger-border: color(display-p3 0.7365 0.2216 0.2026);
326
332
  --dark-color-button-danger-fill: color(display-p3 0.7365 0.2216 0.2026);
333
+ --dark-color-button-neutral-border: color(display-p3 0.3886 0.3886 0.3886);
334
+ --dark-color-button-neutral-fill: color(display-p3 0.3886 0.3886 0.3886);
327
335
  --dark-color-button-primary-border: color(display-p3 0.5242 0.2903 0.7705);
328
336
  --dark-color-button-primary-fill: color(display-p3 0.5242 0.2903 0.7705);
329
337
  --dark-color-button-secondary-border: color(display-p3 1 1 1);
330
338
  --dark-color-button-secondary-fill: color(display-p3 1 1 1);
331
339
  --dark-color-button-secondary-text: color(display-p3 0 0 0);
340
+ --dark-color-button-success-border: color(display-p3 0.2946 0.5328 0.2433);
341
+ --dark-color-button-success-fill: color(display-p3 0.2946 0.5328 0.2433);
332
342
  --dark-color-button-tertiary-border: color(display-p3 0.2806 0.2806 0.2806);
333
343
  --dark-color-button-tertiary-fill: color(display-p3 0 0 0);
334
344
  --dark-color-button-tertiary-text: color(display-p3 1 1 1);
@@ -48,11 +48,15 @@
48
48
  --color-border: color(display-p3 0.1792 0.1792 0.1792);
49
49
  --color-button-danger-border: color(display-p3 0.7365 0.2216 0.2026);
50
50
  --color-button-danger-fill: color(display-p3 0.7365 0.2216 0.2026);
51
+ --color-button-neutral-border: color(display-p3 0.3886 0.3886 0.3886);
52
+ --color-button-neutral-fill: color(display-p3 0.3886 0.3886 0.3886);
51
53
  --color-button-primary-border: color(display-p3 0.5242 0.2903 0.7705);
52
54
  --color-button-primary-fill: color(display-p3 0.5242 0.2903 0.7705);
53
55
  --color-button-secondary-border: color(display-p3 1 1 1);
54
56
  --color-button-secondary-fill: color(display-p3 1 1 1);
55
57
  --color-button-secondary-text: color(display-p3 0 0 0);
58
+ --color-button-success-border: color(display-p3 0.2946 0.5328 0.2433);
59
+ --color-button-success-fill: color(display-p3 0.2946 0.5328 0.2433);
56
60
  --color-button-tertiary-border: color(display-p3 0.2806 0.2806 0.2806);
57
61
  --color-button-tertiary-fill: color(display-p3 0 0 0);
58
62
  --color-button-tertiary-text: color(display-p3 1 1 1);
@@ -48,11 +48,15 @@ html[data-equality-theme='dark'] {
48
48
  --color-border: color(display-p3 0.1792 0.1792 0.1792);
49
49
  --color-button-danger-border: color(display-p3 0.7365 0.2216 0.2026);
50
50
  --color-button-danger-fill: color(display-p3 0.7365 0.2216 0.2026);
51
+ --color-button-neutral-border: color(display-p3 0.3886 0.3886 0.3886);
52
+ --color-button-neutral-fill: color(display-p3 0.3886 0.3886 0.3886);
51
53
  --color-button-primary-border: color(display-p3 0.5242 0.2903 0.7705);
52
54
  --color-button-primary-fill: color(display-p3 0.5242 0.2903 0.7705);
53
55
  --color-button-secondary-border: color(display-p3 1 1 1);
54
56
  --color-button-secondary-fill: color(display-p3 1 1 1);
55
57
  --color-button-secondary-text: color(display-p3 0 0 0);
58
+ --color-button-success-border: color(display-p3 0.2946 0.5328 0.2433);
59
+ --color-button-success-fill: color(display-p3 0.2946 0.5328 0.2433);
56
60
  --color-button-tertiary-border: color(display-p3 0.2806 0.2806 0.2806);
57
61
  --color-button-tertiary-fill: color(display-p3 0 0 0);
58
62
  --color-button-tertiary-text: color(display-p3 1 1 1);
@@ -77,12 +77,18 @@ html {
77
77
  --color-button-danger-border: color(display-p3 0.5698 0.1873 0.1674);
78
78
  --color-button-danger-fill: color(display-p3 0.7365 0.2216 0.2026);
79
79
  --color-button-danger-text: color(display-p3 1 1 1);
80
+ --color-button-neutral-border: color(display-p3 0.3886 0.3886 0.3886);
81
+ --color-button-neutral-fill: color(display-p3 0.3886 0.3886 0.3886);
82
+ --color-button-neutral-text: color(display-p3 1 1 1);
80
83
  --color-button-primary-border: color(display-p3 0.5242 0.2903 0.7705);
81
84
  --color-button-primary-fill: color(display-p3 0.5242 0.2903 0.7705);
82
85
  --color-button-primary-text: color(display-p3 1 1 1);
83
86
  --color-button-secondary-border: color(display-p3 0.0861 0.0861 0.0861);
84
87
  --color-button-secondary-fill: color(display-p3 0.0861 0.0861 0.0861);
85
88
  --color-button-secondary-text: color(display-p3 1 1 1);
89
+ --color-button-success-border: color(display-p3 0.2946 0.5328 0.2433);
90
+ --color-button-success-fill: color(display-p3 0.2946 0.5328 0.2433);
91
+ --color-button-success-text: color(display-p3 1 1 1);
86
92
  --color-button-tertiary-border: color(display-p3 0.7432 0.7432 0.7432);
87
93
  --color-button-tertiary-fill: color(display-p3 1 1 1);
88
94
  --color-button-tertiary-text: color(display-p3 0 0 0);
@@ -77,12 +77,18 @@
77
77
  --color-button-danger-border: color(display-p3 0.5698 0.1873 0.1674);
78
78
  --color-button-danger-fill: color(display-p3 0.7365 0.2216 0.2026);
79
79
  --color-button-danger-text: color(display-p3 1 1 1);
80
+ --color-button-neutral-border: color(display-p3 0.3886 0.3886 0.3886);
81
+ --color-button-neutral-fill: color(display-p3 0.3886 0.3886 0.3886);
82
+ --color-button-neutral-text: color(display-p3 1 1 1);
80
83
  --color-button-primary-border: color(display-p3 0.5242 0.2903 0.7705);
81
84
  --color-button-primary-fill: color(display-p3 0.5242 0.2903 0.7705);
82
85
  --color-button-primary-text: color(display-p3 1 1 1);
83
86
  --color-button-secondary-border: color(display-p3 0.0861 0.0861 0.0861);
84
87
  --color-button-secondary-fill: color(display-p3 0.0861 0.0861 0.0861);
85
88
  --color-button-secondary-text: color(display-p3 1 1 1);
89
+ --color-button-success-border: color(display-p3 0.2946 0.5328 0.2433);
90
+ --color-button-success-fill: color(display-p3 0.2946 0.5328 0.2433);
91
+ --color-button-success-text: color(display-p3 1 1 1);
86
92
  --color-button-tertiary-border: color(display-p3 0.7432 0.7432 0.7432);
87
93
  --color-button-tertiary-fill: color(display-p3 1 1 1);
88
94
  --color-button-tertiary-text: color(display-p3 0 0 0);
@@ -77,12 +77,18 @@
77
77
  --color-button-danger-border: color(display-p3 0.5698 0.1873 0.1674);
78
78
  --color-button-danger-fill: color(display-p3 0.7365 0.2216 0.2026);
79
79
  --color-button-danger-text: color(display-p3 1 1 1);
80
+ --color-button-neutral-border: color(display-p3 0.3886 0.3886 0.3886);
81
+ --color-button-neutral-fill: color(display-p3 0.3886 0.3886 0.3886);
82
+ --color-button-neutral-text: color(display-p3 1 1 1);
80
83
  --color-button-primary-border: color(display-p3 0.5242 0.2903 0.7705);
81
84
  --color-button-primary-fill: color(display-p3 0.5242 0.2903 0.7705);
82
85
  --color-button-primary-text: color(display-p3 1 1 1);
83
86
  --color-button-secondary-border: color(display-p3 0.0861 0.0861 0.0861);
84
87
  --color-button-secondary-fill: color(display-p3 0.0861 0.0861 0.0861);
85
88
  --color-button-secondary-text: color(display-p3 1 1 1);
89
+ --color-button-success-border: color(display-p3 0.2946 0.5328 0.2433);
90
+ --color-button-success-fill: color(display-p3 0.2946 0.5328 0.2433);
91
+ --color-button-success-text: color(display-p3 1 1 1);
86
92
  --color-button-tertiary-border: color(display-p3 0.7432 0.7432 0.7432);
87
93
  --color-button-tertiary-fill: color(display-p3 1 1 1);
88
94
  --color-button-tertiary-text: color(display-p3 0 0 0);
package/dist/index.cjs CHANGED
@@ -3938,11 +3938,14 @@ var SegmentedControls = ({
3938
3938
  onValueChange,
3939
3939
  display = "both",
3940
3940
  size = "md",
3941
+ "aria-label": ariaLabel,
3942
+ "aria-labelledby": ariaLabelledBy,
3941
3943
  className
3942
3944
  }) => {
3943
3945
  const allHaveIcons = options.every((option) => option.icon != null);
3944
3946
  const effectiveDisplay = display === "icon-only" && !allHaveIcons ? "both" : display;
3945
3947
  const isIconOnly = effectiveDisplay === "icon-only";
3948
+ const activeVariant = options.find((option) => option.value === value)?.variant ?? "primary";
3946
3949
  const containerRef = React15.useRef(null);
3947
3950
  const segmentRefs = React15.useRef({});
3948
3951
  const [indicator, setIndicator] = React15.useState({
@@ -3974,7 +3977,15 @@ var SegmentedControls = ({
3974
3977
  "div",
3975
3978
  {
3976
3979
  ref: containerRef,
3977
- className: cn(styles49__default.default["segmented-controls"], styles49__default.default[`size--${size}`], className),
3980
+ role: "group",
3981
+ "aria-label": ariaLabel,
3982
+ "aria-labelledby": ariaLabelledBy,
3983
+ className: cn(
3984
+ styles49__default.default["segmented-controls"],
3985
+ styles49__default.default[`size--${size}`],
3986
+ styles49__default.default[`variant--${activeVariant}`],
3987
+ className
3988
+ ),
3978
3989
  children: [
3979
3990
  options.map((option) => {
3980
3991
  const currentlyActive = option.value === value;