@aircall/ds 0.41.0 → 0.42.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/dist/index.d.ts CHANGED
@@ -645,7 +645,7 @@ declare namespace AlertDialogCancel {
645
645
  * the icon level with the first line when the title wraps.
646
646
  */
647
647
  declare const alertVariants: (props?: ({
648
- variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
648
+ variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
649
649
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
650
650
  /**
651
651
  * Callout that draws attention to an important, contextual message.
@@ -970,8 +970,8 @@ declare namespace CounterBadge {
970
970
  /** `cva` recipe for the Badge/Chip container — drives the `size`, `color`, and `tone` classes. */
971
971
  declare const badgeVariants: (props?: ({
972
972
  size?: "default" | "lg" | null | undefined;
973
- color?: "blue" | "green" | "pink" | "purple" | "red" | "yellow" | "charcoal" | null | undefined;
974
- tone?: "dark" | "light" | "medium-dark" | "medium-light" | null | undefined;
973
+ color?: "charcoal" | "red" | "green" | "blue" | "purple" | "yellow" | "pink" | null | undefined;
974
+ tone?: "dark" | "medium-dark" | "medium-light" | "light" | null | undefined;
975
975
  overflowMode?: "none" | "truncate" | null | undefined;
976
976
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
977
977
  type BadgeVariants = VariantProps<typeof badgeVariants>;
@@ -1049,7 +1049,7 @@ declare namespace BadgeGroupCount {
1049
1049
  * edge gets the accent border.
1050
1050
  */
1051
1051
  declare const bannerVariants: (props?: ({
1052
- variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
1052
+ variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
1053
1053
  borderDirection?: "bottom" | "top" | null | undefined;
1054
1054
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1055
1055
  /**
@@ -5463,8 +5463,18 @@ interface TagOption {
5463
5463
  * Forwarded to the {@link Badge} `legacyColor` prop, which resolves it to a DS `color` + `tone`
5464
5464
  * (unknown hexes fall back to `charcoal`). Takes precedence over `color`/`tone` - use it to
5465
5465
  * render existing tags without migrating their stored colors.
5466
+ *
5467
+ * @deprecated Prefer `customColor` - `legacyColor` resolves only a closed set of predefined
5468
+ * hexes and falls back to `charcoal` for anything else. Kept working for existing callers.
5466
5469
  */
5467
5470
  legacyColor?: Badge.Props['legacyColor'];
5471
+ /**
5472
+ * An arbitrary fill hex (e.g. one a user picked with `ColorPicker`'s free-form mode).
5473
+ * Forwarded to the {@link Badge} `customColor` prop, which paints it directly and picks a
5474
+ * black or white foreground by WCAG contrast. Takes precedence over `color` / `tone` /
5475
+ * `legacyColor` - the general replacement for `legacyColor`'s closed palette.
5476
+ */
5477
+ customColor?: Badge.Props['customColor'];
5468
5478
  }
5469
5479
  /**
5470
5480
  * Async-search + pagination config for {@link RichTextarea} `@mention` / `#tag`
package/dist/index.js CHANGED
@@ -12362,7 +12362,7 @@ function TagElement(props) {
12362
12362
  const readOnly = useReadOnly();
12363
12363
  const stored = element;
12364
12364
  const option = (_tags$find = tags.find((t) => t.id === stored.key)) !== null && _tags$find !== void 0 ? _tags$find : tags.find((t) => t.label === element.value);
12365
- const appearance = stored.color != null || stored.tone != null || stored.legacyColor != null ? stored : option;
12365
+ const appearance = stored.color != null || stored.tone != null || stored.legacyColor != null || stored.customColor != null ? stored : option;
12366
12366
  return /* @__PURE__ */ jsxs(PlateElement, _objectSpread2(_objectSpread2({}, props), {}, {
12367
12367
  as: "span",
12368
12368
  attributes: _objectSpread2(_objectSpread2({}, props.attributes), {}, {
@@ -12373,6 +12373,7 @@ function TagElement(props) {
12373
12373
  color: appearance === null || appearance === void 0 ? void 0 : appearance.color,
12374
12374
  tone: appearance === null || appearance === void 0 ? void 0 : appearance.tone,
12375
12375
  legacyColor: appearance === null || appearance === void 0 ? void 0 : appearance.legacyColor,
12376
+ customColor: appearance === null || appearance === void 0 ? void 0 : appearance.customColor,
12376
12377
  className: cn("align-middle", !readOnly && "cursor-pointer", selected && focused && "ring-2 ring-ring"),
12377
12378
  children: `#${element.value}`
12378
12379
  }), props.children]
@@ -12402,12 +12403,12 @@ function TagInputElement(props) {
12402
12403
  const noMatch = !!tagsAsync && !(loadingState === "loading" || loadingState === "filtering" || loadingState === "loadingMore") && search.length > 0 && tags.length === 0;
12403
12404
  const insertTag = (tag) => {
12404
12405
  var _editor$api$block2;
12405
- editor.tf.insertNodes(_objectSpread2(_objectSpread2(_objectSpread2({
12406
+ editor.tf.insertNodes(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
12406
12407
  children: [{ text: "" }],
12407
12408
  type: "tag",
12408
12409
  value: tag.label,
12409
12410
  key: tag.id
12410
- }, tag.color ? { color: tag.color } : {}), tag.tone ? { tone: tag.tone } : {}), tag.legacyColor ? { legacyColor: tag.legacyColor } : {}));
12411
+ }, tag.color ? { color: tag.color } : {}), tag.tone ? { tone: tag.tone } : {}), tag.legacyColor ? { legacyColor: tag.legacyColor } : {}), tag.customColor ? { customColor: tag.customColor } : {}));
12411
12412
  editor.tf.move({ unit: "offset" });
12412
12413
  const path = (_editor$api$block2 = editor.api.block()) === null || _editor$api$block2 === void 0 ? void 0 : _editor$api$block2[1];
12413
12414
  if (editor.selection && path && editor.api.isEnd(editor.selection.anchor, path)) editor.tf.insertText(" ");
@@ -12436,6 +12437,7 @@ function TagInputElement(props) {
12436
12437
  color: tag.color,
12437
12438
  tone: tag.tone,
12438
12439
  legacyColor: tag.legacyColor,
12440
+ customColor: tag.customColor,
12439
12441
  children: tag.label
12440
12442
  })
12441
12443
  }, tag.id)) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aircall/ds",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "sideEffects": [