@eqtylab/equality 5.5.3 → 5.6.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,27 @@
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
+ ## 5.6.0 - 2026-11-18
6
+
7
+ ### Added
8
+
9
+ - `Card` takes `selected`, which makes it a choice in a set, such as a radio card. With `onClick`, a
10
+ choice takes the grey list hover in place of the brand border and gradient; while `selected` is
11
+ `true` it takes the current-item fill, a primary border and, in forced colours, an outline. Pass
12
+ `false` for the unchosen cards so they hover the same way.
13
+ - `Card` takes `variant`, `success`, `warning` or `danger`, which tints its border and background
14
+ with that badge colour. It defaults to `default`, untinted, and isn't combined with `selected`.
15
+ Both tints sit over the elevation's background rather than replacing it.
16
+ - `Textarea` takes `variant="bare"`, for a textarea inside a frame that draws its own edge, such as
17
+ an editor with a toolbar: no border, background, radius or focus ring, so the frame must show
18
+ focus. `variant` defaults to `default`.
19
+ - `Button` takes `variant="field"`, for a button that opens a picker in a form. It draws as
20
+ `Select`'s trigger does, with the input's border, background and hover, full width, spreading its
21
+ content across it and clipping what overflows. Wrap the label in a `flex-1 truncate` span, so a
22
+ long value cuts off rather than pushing a `suffix` out.
23
+ - `IconButton` takes `size="xs"`: 24px, the WCAG 2.2 AA minimum target size, with a 14px icon, for
24
+ an action inside a picker field such as a clear button.
25
+
5
26
  ## 5.5.3 - 2026-11-18
6
27
 
7
28
  ### Changed
@@ -233,6 +233,44 @@
233
233
  }
234
234
  }
235
235
  }
236
+ .button--field {
237
+ --mix-color: var(--color-border);
238
+ --hover-darken: 12%;
239
+ --hover-lighten: 12%;
240
+ border-style: var(--tw-border-style);
241
+ border-width: 1px;
242
+ border-color: var(--color-border, color(display-p3 0.7432 0.7432 0.7432));
243
+ background-color: var(--color-background, color(display-p3 1 1 1));
244
+ color: var(--color-text-primary, color(display-p3 0 0 0));
245
+ width: 100%;
246
+ justify-content: space-between;
247
+ overflow: hidden;
248
+ text-align: left;
249
+ --tw-font-weight: 400;
250
+ font-weight: 400;
251
+ &:hover {
252
+ @media (hover: hover) {
253
+ &:not(*:disabled) {
254
+ border-color: var(--mix-color);
255
+ @supports (color: color-mix(in lab, red, red)) {
256
+ border-color: color-mix(in oklch, var(--mix-color), black var(--hover-darken, 20%));
257
+ }
258
+ }
259
+ }
260
+ }
261
+ &:where(html[data-equality-theme=dark], html[data-equality-theme=dark] *, [data-equality-theme=dark] .root, [data-equality-theme=dark] .root *) {
262
+ &:hover {
263
+ @media (hover: hover) {
264
+ &:not(*:disabled) {
265
+ border-color: var(--mix-color);
266
+ @supports (color: color-mix(in lab, red, red)) {
267
+ border-color: color-mix(in oklch, var(--mix-color), white var(--hover-lighten, 20%));
268
+ }
269
+ }
270
+ }
271
+ }
272
+ }
273
+ }
236
274
  .button--link {
237
275
  --mix-color: var(--color-text-link);
238
276
  color: var(--mix-color);
@@ -1,4 +1,9 @@
1
1
  /*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */
2
+ @property --card-tint {
3
+ syntax: '<color>';
4
+ inherits: false;
5
+ initial-value: transparent;
6
+ }
2
7
  .card {
3
8
  container-type: inline-size;
4
9
  container-name: card;
@@ -111,6 +116,65 @@
111
116
  --tw-shadow-color: color-mix(in oklab, rgba(0, 0, 0, 0.1) var(--tw-shadow-alpha), transparent);
112
117
  }
113
118
  }
119
+ .card--choice,
120
+ .card--selected,
121
+ .card--success,
122
+ .card--warning,
123
+ .card--danger {
124
+ background-image: linear-gradient(var(--card-tint), var(--card-tint));
125
+ }
126
+ .card--choice {
127
+ cursor: pointer;
128
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
129
+ transition-timing-function: var(--tw-ease, cubic-bezier(0.4, 0, 0.2, 1));
130
+ transition-duration: var(--tw-duration, 150ms);
131
+ transition-property: color, background-color, border-color, --card-tint;
132
+ &:hover {
133
+ @media (hover: hover) {
134
+ --card-tint: var(--color-list-item-hover);
135
+ }
136
+ }
137
+ &:active {
138
+ --card-tint: var(--color-list-item-hover);
139
+ }
140
+ }
141
+ .card--selected,
142
+ .card--selected:hover,
143
+ .card--selected:active {
144
+ --card-tint: var(--color-list-item-current);
145
+ border-color: var(--color-text-primary, color(display-p3 0 0 0));
146
+ @media (forced-colors: active) {
147
+ outline-style: var(--tw-outline-style);
148
+ outline-width: 2px;
149
+ }
150
+ @media (forced-colors: active) {
151
+ outline-offset: calc(2px * -1);
152
+ }
153
+ @media (forced-colors: active) {
154
+ outline-color: Highlight;
155
+ }
156
+ }
157
+ .card--success {
158
+ --card-tint: color-mix(in srgb, color(display-p3 0.7403 0.8486 0.7417) 20%, transparent);
159
+ @supports (color: color-mix(in lab, red, red)) {
160
+ --card-tint: color-mix(in oklab, var(--color-badge-background-success) 20%, transparent);
161
+ }
162
+ border-color: var(--color-badge-background-success, color(display-p3 0.7403 0.8486 0.7417));
163
+ }
164
+ .card--warning {
165
+ --card-tint: color-mix(in srgb, color(display-p3 0.9327 0.8528 0.7204) 20%, transparent);
166
+ @supports (color: color-mix(in lab, red, red)) {
167
+ --card-tint: color-mix(in oklab, var(--color-badge-background-warning) 20%, transparent);
168
+ }
169
+ border-color: var(--color-badge-background-warning, color(display-p3 0.9327 0.8528 0.7204));
170
+ }
171
+ .card--danger {
172
+ --card-tint: color-mix(in srgb, color(display-p3 0.9358 0.751 0.7228) 20%, transparent);
173
+ @supports (color: color-mix(in lab, red, red)) {
174
+ --card-tint: color-mix(in oklab, var(--color-badge-background-danger) 20%, transparent);
175
+ }
176
+ border-color: var(--color-badge-background-danger, color(display-p3 0.9358 0.751 0.7228));
177
+ }
114
178
  @property --tw-border-style {
115
179
  syntax: "*";
116
180
  inherits: false;
@@ -236,3 +300,8 @@
236
300
  syntax: "*";
237
301
  inherits: false;
238
302
  }
303
+ @property --tw-outline-style {
304
+ syntax: "*";
305
+ inherits: false;
306
+ initial-value: solid;
307
+ }
@@ -36,6 +36,11 @@
36
36
  }
37
37
  display: flex;
38
38
  }
39
+ .size--xs {
40
+ width: calc(0.25rem * 6);
41
+ height: calc(0.25rem * 6);
42
+ border-radius: var(--radius-md, 0.375rem);
43
+ }
39
44
  .size--sm {
40
45
  width: calc(0.25rem * 7);
41
46
  height: calc(0.25rem * 7);
package/dist/index.cjs CHANGED
@@ -221,6 +221,7 @@ var buttonVariants = classVarianceAuthority.cva(styles__default.default["button"
221
221
  warning: [styles__default.default["button--filled"], styles__default.default["button--warning"]],
222
222
  secondary: [styles__default.default["button--filled"], styles__default.default["button--secondary"]],
223
223
  tertiary: styles__default.default["button--tertiary"],
224
+ field: styles__default.default["button--field"],
224
225
  link: styles__default.default["button--link"],
225
226
  navigation: styles__default.default["button--navigation"]
226
227
  },
@@ -947,26 +948,40 @@ var CardContentHeader = React16.forwardRef(
947
948
  );
948
949
  CardContentHeader.displayName = "CardContentHeader";
949
950
  var cardElevationVariants = generateElevationVariants(styles12__default.default, "card", ELEVATION.RAISED);
950
- var Card = React16__namespace.forwardRef(({ className, hoverGradientClassName, elevation = ELEVATION.RAISED, ...props }, ref) => {
951
- const shouldHaveHoverStyle = props.onClick !== void 0;
952
- return /* @__PURE__ */ jsxRuntime.jsxs(
953
- "div",
954
- {
955
- ref,
956
- className: cn(
957
- styles12__default.default.card,
958
- shouldHaveHoverStyle && styles12__default.default["card--hover"],
959
- cardElevationVariants({ elevation }),
960
- className
961
- ),
962
- ...props,
963
- children: [
964
- shouldHaveHoverStyle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(styles12__default.default["card-hover-gradient"], hoverGradientClassName) }),
965
- props.children
966
- ]
967
- }
968
- );
969
- });
951
+ var Card = React16__namespace.forwardRef(
952
+ ({
953
+ className,
954
+ hoverGradientClassName,
955
+ elevation = ELEVATION.RAISED,
956
+ selected,
957
+ variant = "default",
958
+ ...props
959
+ }, ref) => {
960
+ const isClickable = props.onClick !== void 0;
961
+ const isChoice = selected !== void 0;
962
+ const shouldHaveHoverStyle = isClickable && !isChoice;
963
+ return /* @__PURE__ */ jsxRuntime.jsxs(
964
+ "div",
965
+ {
966
+ ref,
967
+ className: cn(
968
+ styles12__default.default.card,
969
+ shouldHaveHoverStyle && styles12__default.default["card--hover"],
970
+ cardElevationVariants({ elevation }),
971
+ isChoice && isClickable && styles12__default.default["card--choice"],
972
+ selected && styles12__default.default["card--selected"],
973
+ variant !== "default" && styles12__default.default[`card--${variant}`],
974
+ className
975
+ ),
976
+ ...props,
977
+ children: [
978
+ shouldHaveHoverStyle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(styles12__default.default["card-hover-gradient"], hoverGradientClassName) }),
979
+ props.children
980
+ ]
981
+ }
982
+ );
983
+ }
984
+ );
970
985
  Card.displayName = "Card";
971
986
  var CardHeader = React16__namespace.forwardRef(
972
987
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(styles12__default.default["card-header"], className), ...props })
@@ -1004,6 +1019,7 @@ Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
1004
1019
  var iconButtonVariants = classVarianceAuthority.cva(styles14__default.default["icon-btn"], {
1005
1020
  variants: {
1006
1021
  size: {
1022
+ xs: styles14__default.default["size--xs"],
1007
1023
  sm: styles14__default.default["size--sm"],
1008
1024
  md: styles14__default.default["size--md"],
1009
1025
  lg: styles14__default.default["size--lg"]
@@ -1019,6 +1035,7 @@ var iconButtonVariants = classVarianceAuthority.cva(styles14__default.default["i
1019
1035
  }
1020
1036
  });
1021
1037
  var iconSizeMap = {
1038
+ xs: 14,
1022
1039
  sm: 16,
1023
1040
  md: 22,
1024
1041
  lg: 26
@@ -5188,8 +5205,19 @@ var Tabs = ({
5188
5205
  );
5189
5206
  };
5190
5207
  var Textarea = React16__namespace.forwardRef(
5191
- ({ className, ...props }, ref) => {
5192
- return /* @__PURE__ */ jsxRuntime.jsx("textarea", { className: cn(styles62__default.default["textarea"], className), ref, ...props });
5208
+ ({ className, variant = "default", ...props }, ref) => {
5209
+ return /* @__PURE__ */ jsxRuntime.jsx(
5210
+ "textarea",
5211
+ {
5212
+ className: cn(
5213
+ styles62__default.default["textarea"],
5214
+ variant === "bare" && styles62__default.default["textarea--bare"],
5215
+ className
5216
+ ),
5217
+ ref,
5218
+ ...props
5219
+ }
5220
+ );
5193
5221
  }
5194
5222
  );
5195
5223
  Textarea.displayName = "Textarea";