@caratlogic/design-system 0.1.27 → 0.1.29

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.esm.js CHANGED
@@ -21286,9 +21286,12 @@ function alignClass(align) {
21286
21286
  : '';
21287
21287
  }
21288
21288
  const STICKY_ACTIONS_BASE = 'sticky !right-0 w-[92px] min-w-[92px] max-w-[92px] px-2 text-center before:pointer-events-none before:absolute before:left-0 before:top-0 before:h-full before:w-px before:bg-border before:content-[""] shadow-[-3px_0_6px_-3px_#00000014]';
21289
- /** Sticky right-pinned header cell for an `actions` column. */
21289
+ /**
21290
+ * Sticky right-pinned header cell for an `actions` column. Being sticky itself it no longer
21291
+ * rides the sticky <thead>, so it needs its own `top-0` or it scrolls away with the rows.
21292
+ */
21290
21293
  function stickyActionsHeaderClass() {
21291
- return cn(STICKY_ACTIONS_BASE, 'z-40 bg-table-header');
21294
+ return cn(STICKY_ACTIONS_BASE, 'top-0 z-40 bg-table-header');
21292
21295
  }
21293
21296
  /** Sticky right-pinned body cell for an `actions` column (opaque per alternating row). */
21294
21297
  function stickyActionsCellClass(isEven) {
@@ -21316,7 +21319,7 @@ function CustomTable({ data, columns, expandable, rowKey = (row) => row.id, clas
21316
21319
  ? selectedIds.filter((id) => id !== key)
21317
21320
  : [...selectedIds, key]);
21318
21321
  };
21319
- return (jsxs("div", { className: `h-full w-full flex flex-col overflow-hidden rounded-lg border border-border bg-card ${className}`, "data-slot": "table-container", children: [jsx("div", { className: "overflow-auto flex-1 isolate", children: jsxs("table", { "data-slot": "table", className: "min-w-full w-full text-left text-sm", children: [jsx("thead", { className: "sticky top-0 z-10 border-b border-border !bg-table-header", children: jsxs("tr", { children: [expandable && (jsx("th", { className: "h-12 w-[52px] min-w-[52px] whitespace-nowrap px-3 text-left align-middle text-secondary-foreground" })), enableSelection && (jsx("th", { className: "h-12 w-[52px] min-w-[52px] whitespace-nowrap px-3 text-left align-middle", children: jsx(Checkbox, { checked: allSelected
21322
+ return (jsxs("div", { className: `h-full w-full flex flex-col overflow-hidden rounded-lg border border-border bg-card ${className}`, "data-slot": "table-container", children: [jsx("div", { className: "overflow-auto flex-1 isolate", children: jsxs("table", { "data-slot": "table", className: "min-w-full w-full text-left text-sm", children: [jsx("thead", { className: "sticky top-0 z-40 border-b border-border !bg-table-header", children: jsxs("tr", { children: [expandable && (jsx("th", { className: "h-12 w-[52px] min-w-[52px] whitespace-nowrap px-3 text-left align-middle text-secondary-foreground" })), enableSelection && (jsx("th", { className: "h-12 w-[52px] min-w-[52px] whitespace-nowrap px-3 text-left align-middle", children: jsx(Checkbox, { checked: allSelected
21320
21323
  ? true
21321
21324
  : someSelected
21322
21325
  ? 'indeterminate'
@@ -38274,23 +38277,30 @@ const NumberedStepCard = ({ step, title, description, className, }) => {
38274
38277
  function hasDetails(variant, hasDescription) {
38275
38278
  return variant === 'default' && hasDescription;
38276
38279
  }
38280
+ /** Dark mode: `--primary` is too dim on near-black, so the detailed active state uses the design's lighter green. */
38281
+ const DARK_ACTIVE_GREEN = 'dark:border-[#6FB98A]';
38282
+ const DARK_ACTIVE_GREEN_TEXT = 'dark:text-[#6FB98A]';
38277
38283
  function getListClassName(variant, detailed) {
38278
- return cn('inline-flex w-full items-center gap-1 bg-muted p-1', detailed ? 'rounded-xl' : variant === 'bordered' ? 'rounded-lg' : 'rounded-md');
38284
+ if (detailed) {
38285
+ // Light: a faint primary tint. Dark: `--muted` is a light overlay that would outshine the active segment.
38286
+ return 'inline-flex w-full items-center gap-1 rounded-xl border border-transparent bg-primary/5 p-1 dark:border-border dark:bg-black/25';
38287
+ }
38288
+ return cn('inline-flex w-full items-center gap-1 bg-muted p-1', variant === 'bordered' ? 'rounded-lg' : 'rounded-md');
38279
38289
  }
38280
38290
  function getSegmentClassName(variant, isActive, isDisabled, detailed = false) {
38281
- return cn('inline-flex cursor-pointer items-center justify-center gap-2 border px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed', 'outline-none focus-visible:ring-2 focus-visible:ring-primary/30', detailed ? 'min-h-11 rounded-lg py-2 font-semibold' : 'h-7 rounded-md',
38291
+ return cn('inline-flex cursor-pointer items-center justify-center gap-2 border px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed', 'outline-none focus-visible:ring-2 focus-visible:ring-primary/30', detailed ? 'min-h-11 rounded-lg border-2 py-2 font-semibold' : 'h-7 rounded-md',
38282
38292
  // Bordered tabs size to their content (Figma "Advance Tabs"); the others stretch to equal width.
38283
38293
  variant === 'bordered' ? 'shrink-0' : 'flex-1',
38284
38294
  // Every segment carries a border so the active one's primary border doesn't shift the layout.
38285
38295
  isActive
38286
- ? cn('border-primary bg-card shadow-xs', detailed ? 'text-primary dark:text-foreground' : 'text-primary')
38287
- : cn('border-transparent', variant === 'bordered' ? 'text-foreground' : 'text-muted-foreground', 'hover:text-foreground'), isDisabled && 'cursor-not-allowed opacity-50');
38296
+ ? cn('border-primary bg-card shadow-xs', detailed ? cn('text-primary dark:bg-muted dark:text-foreground dark:shadow-none', DARK_ACTIVE_GREEN) : 'text-primary')
38297
+ : cn('border-transparent', variant === 'bordered' || detailed ? 'text-secondary-foreground' : 'text-muted-foreground', variant === 'bordered' && 'text-foreground', 'hover:text-foreground'), isDisabled && 'cursor-not-allowed opacity-50');
38288
38298
  }
38289
38299
  function getIconClassName(detailed, isActive) {
38290
38300
  if (!detailed) {
38291
38301
  return 'inline-flex shrink-0 items-center [&_svg]:h-4 [&_svg]:w-4';
38292
38302
  }
38293
- return cn('inline-flex size-7 shrink-0 items-center justify-center rounded-full text-sm font-semibold [&_svg]:size-4', isActive ? 'bg-primary/10 text-primary' : 'bg-foreground/5 text-muted-foreground');
38303
+ return cn('inline-flex size-7 shrink-0 items-center justify-center rounded-full text-sm font-semibold [&_svg]:size-4', isActive ? cn('bg-primary/10 text-primary dark:bg-primary/25', DARK_ACTIVE_GREEN_TEXT) : 'bg-foreground/5 text-muted-foreground');
38294
38304
  }
38295
38305
  function getContentClassName(layout) {
38296
38306
  return layout === 'inline'
@@ -38298,7 +38308,7 @@ function getContentClassName(layout) {
38298
38308
  : 'flex min-w-0 flex-col items-center gap-0.5';
38299
38309
  }
38300
38310
  function getDescriptionClassName(isActive) {
38301
- return cn('truncate text-xs font-normal', isActive ? 'text-primary' : 'text-muted-foreground');
38311
+ return cn('truncate text-xs font-normal', isActive ? cn('text-primary', DARK_ACTIVE_GREEN_TEXT) : 'text-muted-foreground');
38302
38312
  }
38303
38313
 
38304
38314
  /**