@chayns-ui/core 0.11.2 → 0.12.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/badge.css CHANGED
@@ -52,7 +52,7 @@
52
52
  }
53
53
 
54
54
  @media (hover: hover) {
55
- .chayns-badge:hover {
55
+ .chayns-badge:not(.chayns-badge--hover-disabled):hover {
56
56
  transform: translateY(-2px);
57
57
  filter: saturate(1.18);
58
58
  box-shadow: 0 5px 12px -5px rgb(16 40 46 / 30%);
@@ -64,7 +64,7 @@
64
64
  transition: none;
65
65
  }
66
66
 
67
- .chayns-badge:hover {
67
+ .chayns-badge:not(.chayns-badge--hover-disabled):hover {
68
68
  transform: none;
69
69
  }
70
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,QAAA,MAAM,KAAK,qHAwBT,CAAC;AAIH,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,QAAA,MAAM,KAAK,qHAiCT,CAAC;AAIH,eAAe,KAAK,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { forwardRef } from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  //#region src/components/badge/Badge.tsx
4
- var Badge = forwardRef(function Badge({ "aria-label": ariaLabel, children, className, size = "sm", tone = "neutral", ...spanProps }, ref) {
4
+ var Badge = forwardRef(function Badge({ "aria-label": ariaLabel, children, className, disableHover = false, size = "sm", tone = "neutral", ...spanProps }, ref) {
5
5
  const resolvedClassName = [
6
6
  "chayns-badge",
7
+ disableHover && "chayns-badge--hover-disabled",
7
8
  `chayns-badge--${tone}`,
8
9
  `chayns-badge--${size}`,
9
10
  className
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","names":[],"sources":["../../../src/components/badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport type { BadgeProps } from './Badge.types.js';\n\nconst Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { 'aria-label': ariaLabel, children, className, size = 'sm', tone = 'neutral', ...spanProps },\n ref,\n) {\n const resolvedClassName = [\n 'chayns-badge',\n `chayns-badge--${tone}`,\n `chayns-badge--${size}`,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <span\n {...spanProps}\n aria-label={ariaLabel}\n className={resolvedClassName}\n ref={ref}\n role={ariaLabel === undefined ? undefined : 'status'}\n >\n <span className=\"chayns-badge__content\">{children}</span>\n </span>\n );\n});\n\nBadge.displayName = 'Badge';\n\nexport default Badge;\n"],"mappings":";;;AAIA,IAAM,QAAQ,WAAwC,SAAS,MAC7D,EAAE,cAAc,WAAW,UAAU,WAAW,OAAO,MAAM,OAAO,WAAW,GAAG,aAClF,KACA;CACA,MAAM,oBAAoB;EACxB;EACA,iBAAiB;EACjB,iBAAiB;EACjB;CACF,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,cAAY;EACZ,WAAW;EACN;EACL,MAAM,cAAc,KAAA,IAAY,KAAA,IAAY;EAE5C,UAAA,oBAAC,QAAD;GAAM,WAAU;GAAyB;EAAe,CAAA;CACpD,CAAA;AAEV,CAAC;AAED,MAAM,cAAc"}
1
+ {"version":3,"file":"Badge.js","names":[],"sources":["../../../src/components/badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport type { BadgeProps } from './Badge.types.js';\n\nconst Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n {\n 'aria-label': ariaLabel,\n children,\n className,\n disableHover = false,\n size = 'sm',\n tone = 'neutral',\n ...spanProps\n },\n ref,\n) {\n const resolvedClassName = [\n 'chayns-badge',\n disableHover && 'chayns-badge--hover-disabled',\n `chayns-badge--${tone}`,\n `chayns-badge--${size}`,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <span\n {...spanProps}\n aria-label={ariaLabel}\n className={resolvedClassName}\n ref={ref}\n role={ariaLabel === undefined ? undefined : 'status'}\n >\n <span className=\"chayns-badge__content\">{children}</span>\n </span>\n );\n});\n\nBadge.displayName = 'Badge';\n\nexport default Badge;\n"],"mappings":";;;AAIA,IAAM,QAAQ,WAAwC,SAAS,MAC7D,EACE,cAAc,WACd,UACA,WACA,eAAe,OACf,OAAO,MACP,OAAO,WACP,GAAG,aAEL,KACA;CACA,MAAM,oBAAoB;EACxB;EACA,gBAAgB;EAChB,iBAAiB;EACjB,iBAAiB;EACjB;CACF,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,cAAY;EACZ,WAAW;EACN;EACL,MAAM,cAAc,KAAA,IAAY,KAAA,IAAY;EAE5C,UAAA,oBAAC,QAAD;GAAM,WAAU;GAAyB;EAAe,CAAA;CACpD,CAAA;AAEV,CAAC;AAED,MAAM,cAAc"}
@@ -18,6 +18,11 @@ export declare const BADGE_SIZES: readonly ["sm", "md"];
18
18
  export type BadgeSize = (typeof BADGE_SIZES)[number];
19
19
  export interface BadgeProps extends Omit<ComponentPropsWithRef<'span'>, 'children' | 'role'> {
20
20
  children: Exclude<ReactNode, boolean | null | undefined>;
21
+ /**
22
+ * @description Suppresses the decorative Badge hover treatment while
23
+ * preserving its non-interactive status semantics.
24
+ */
25
+ disableHover?: boolean;
21
26
  tone?: BadgeTone;
22
27
  size?: BadgeSize;
23
28
  'aria-label'?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.types.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SA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,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,WAAW,uBAAwB,CAAC;AACjD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC1F,QAAQ,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACzD;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,KAAK,CAAC;CACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.types.js","names":[],"sources":["../../../src/components/badge/Badge.types.ts"],"sourcesContent":["import type { ComponentPropsWithRef, ReactNode } from 'react';\n\n/** Named configuration values; existing literal props and value lists remain supported. */\nexport enum BadgeSizes {\n Small = 'sm',\n Medium = 'md',\n}\n\n/** Named configuration values; existing literal props and value lists remain supported. */\nexport enum BadgeTones {\n Neutral = 'neutral',\n Accent = 'accent',\n Success = 'success',\n Warning = 'warning',\n Danger = 'danger',\n}\n\nexport const BADGE_TONES = ['neutral', 'accent', 'success', 'warning', 'danger'] as const;\nexport type BadgeTone = (typeof BADGE_TONES)[number];\n\nexport const BADGE_SIZES = ['sm', 'md'] as const;\nexport type BadgeSize = (typeof BADGE_SIZES)[number];\n\nexport interface BadgeProps extends Omit<ComponentPropsWithRef<'span'>, 'children' | 'role'> {\n children: Exclude<ReactNode, boolean | null | undefined>;\n tone?: BadgeTone;\n size?: BadgeSize;\n 'aria-label'?: string;\n role?: never;\n}\n"],"mappings":";;AAGA,IAAY,aAAL,yBAAA,YAAA;CACL,WAAA,WAAA;CACA,WAAA,YAAA;;AACF,EAAA,CAAA,CAAA;;AAGA,IAAY,aAAL,yBAAA,YAAA;CACL,WAAA,aAAA;CACA,WAAA,YAAA;CACA,WAAA,aAAA;CACA,WAAA,aAAA;CACA,WAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAa,cAAc;CAAC;CAAW;CAAU;CAAW;CAAW;AAAQ;AAG/E,IAAa,cAAc,CAAC,MAAM,IAAI"}
1
+ {"version":3,"file":"Badge.types.js","names":[],"sources":["../../../src/components/badge/Badge.types.ts"],"sourcesContent":["import type { ComponentPropsWithRef, ReactNode } from 'react';\n\n/** Named configuration values; existing literal props and value lists remain supported. */\nexport enum BadgeSizes {\n Small = 'sm',\n Medium = 'md',\n}\n\n/** Named configuration values; existing literal props and value lists remain supported. */\nexport enum BadgeTones {\n Neutral = 'neutral',\n Accent = 'accent',\n Success = 'success',\n Warning = 'warning',\n Danger = 'danger',\n}\n\nexport const BADGE_TONES = ['neutral', 'accent', 'success', 'warning', 'danger'] as const;\nexport type BadgeTone = (typeof BADGE_TONES)[number];\n\nexport const BADGE_SIZES = ['sm', 'md'] as const;\nexport type BadgeSize = (typeof BADGE_SIZES)[number];\n\nexport interface BadgeProps extends Omit<ComponentPropsWithRef<'span'>, 'children' | 'role'> {\n children: Exclude<ReactNode, boolean | null | undefined>;\n /**\n * @description Suppresses the decorative Badge hover treatment while\n * preserving its non-interactive status semantics.\n */\n disableHover?: boolean;\n tone?: BadgeTone;\n size?: BadgeSize;\n 'aria-label'?: string;\n role?: never;\n}\n"],"mappings":";;AAGA,IAAY,aAAL,yBAAA,YAAA;CACL,WAAA,WAAA;CACA,WAAA,YAAA;;AACF,EAAA,CAAA,CAAA;;AAGA,IAAY,aAAL,yBAAA,YAAA;CACL,WAAA,aAAA;CACA,WAAA,YAAA;CACA,WAAA,aAAA;CACA,WAAA,aAAA;CACA,WAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAa,cAAc;CAAC;CAAW;CAAU;CAAW;CAAW;AAAQ;AAG/E,IAAa,cAAc,CAAC,MAAM,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-ui/core",
3
- "version": "0.11.2",
3
+ "version": "0.12.0",
4
4
  "description": "Accessible React core components for chayns UI",
5
5
  "license": "MIT",
6
6
  "type": "module",