@salemcobalt/ui 0.2.0-rc.17 → 0.2.0-rc.18

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
@@ -2974,6 +2974,7 @@ interface WordDiffPart {
2974
2974
  }
2975
2975
  type WordDiffElement = 'p' | 'div' | 'span';
2976
2976
  type WordDiffSize = 'sm' | 'md';
2977
+ type WordDiffFamily = 'sans' | 'mono';
2977
2978
  interface WordDiffProps extends Omit<ComponentPropsWithRef<'p'>, 'children'> {
2978
2979
  /** Runs of unchanged, removed and added text, in reading order, whitespace included. Rendered exactly: joining every `text` gives the visible string. */
2979
2980
  parts: readonly WordDiffPart[];
@@ -2981,6 +2982,11 @@ interface WordDiffProps extends Omit<ComponentPropsWithRef<'p'>, 'children'> {
2981
2982
  as?: WordDiffElement | undefined;
2982
2983
  /** `sm` 14px UI text (default) or `md` body copy. */
2983
2984
  size?: WordDiffSize | undefined;
2985
+ /**
2986
+ * `sans` prose (default), or `mono` for code and structured text (YAML, JSON, Markdown source): the mono face, no
2987
+ * reading-measure cap, and marks without side padding so columns stay aligned.
2988
+ */
2989
+ family?: WordDiffFamily | undefined;
2984
2990
  /** Screen reader word around added text: "[added: …]". Default "added". */
2985
2991
  addedLabel?: string | undefined;
2986
2992
  /** Screen reader word around removed text: "[removed: …]". Default "removed". */
@@ -2991,7 +2997,7 @@ interface WordDiffProps extends Omit<ComponentPropsWithRef<'p'>, 'children'> {
2991
2997
  * `<del>` and `<ins>` with "[removed: …]" / "[added: …]" for screen readers. The line, not the colour, carries the
2992
2998
  * meaning. Whitespace is preserved exactly (`white-space: pre-wrap`).
2993
2999
  */
2994
- declare function WordDiff({ parts, as, size, addedLabel, removedLabel, className, ...rest }: WordDiffProps): react.DetailedReactHTMLElement<{
3000
+ declare function WordDiff({ parts, as, size, family, addedLabel, removedLabel, className, ...rest }: WordDiffProps): react.DetailedReactHTMLElement<{
2995
3001
  slot?: string | undefined | undefined;
2996
3002
  style?: react.CSSProperties | undefined;
2997
3003
  title?: string | undefined | undefined;
@@ -3272,6 +3278,7 @@ declare function WordDiff({ parts, as, size, addedLabel, removedLabel, className
3272
3278
  onTransitionRunCapture?: react.TransitionEventHandler<HTMLParagraphElement> | undefined;
3273
3279
  onTransitionStart?: react.TransitionEventHandler<HTMLParagraphElement> | undefined;
3274
3280
  onTransitionStartCapture?: react.TransitionEventHandler<HTMLParagraphElement> | undefined;
3281
+ 'data-family'?: string;
3275
3282
  className: string;
3276
3283
  'data-size': WordDiffSize;
3277
3284
  }, HTMLParagraphElement>;
package/dist/index.js CHANGED
@@ -3585,6 +3585,7 @@ function WordDiff({
3585
3585
  parts,
3586
3586
  as = "p",
3587
3587
  size = "sm",
3588
+ family = "sans",
3588
3589
  addedLabel = "added",
3589
3590
  removedLabel = "removed",
3590
3591
  className,
@@ -3603,7 +3604,12 @@ function WordDiff({
3603
3604
  );
3604
3605
  return createElement7(
3605
3606
  as,
3606
- { className: cx("sc-word-diff", className), "data-size": size, ...rest },
3607
+ {
3608
+ className: cx("sc-word-diff", className),
3609
+ "data-size": size,
3610
+ ...family === "mono" ? { "data-family": "mono" } : {},
3611
+ ...rest
3612
+ },
3607
3613
  children
3608
3614
  );
3609
3615
  }