@caratlogic/design-system 0.1.27 → 0.1.28
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/SegmentedControl.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO,CAE7F;
|
|
1
|
+
{"version":3,"file":"SegmentedControl.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SegmentedControl/SegmentedControl.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO,CAE7F;AAMD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAS5F;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,uBAAuB,EAChC,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,OAAO,EACnB,QAAQ,UAAQ,GACf,MAAM,CAqBR;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAQ7E;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,4BAA4B,GAAG,MAAM,CAIhF;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAEjE"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -38304,23 +38304,30 @@ const NumberedStepCard = ({ step, title, description, className, }) => {
|
|
|
38304
38304
|
function hasDetails(variant, hasDescription) {
|
|
38305
38305
|
return variant === 'default' && hasDescription;
|
|
38306
38306
|
}
|
|
38307
|
+
/** Dark mode: `--primary` is too dim on near-black, so the detailed active state uses the design's lighter green. */
|
|
38308
|
+
const DARK_ACTIVE_GREEN = 'dark:border-[#6FB98A]';
|
|
38309
|
+
const DARK_ACTIVE_GREEN_TEXT = 'dark:text-[#6FB98A]';
|
|
38307
38310
|
function getListClassName(variant, detailed) {
|
|
38308
|
-
|
|
38311
|
+
if (detailed) {
|
|
38312
|
+
// Light: a faint primary tint. Dark: `--muted` is a light overlay that would outshine the active segment.
|
|
38313
|
+
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';
|
|
38314
|
+
}
|
|
38315
|
+
return cn('inline-flex w-full items-center gap-1 bg-muted p-1', variant === 'bordered' ? 'rounded-lg' : 'rounded-md');
|
|
38309
38316
|
}
|
|
38310
38317
|
function getSegmentClassName(variant, isActive, isDisabled, detailed = false) {
|
|
38311
|
-
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',
|
|
38318
|
+
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',
|
|
38312
38319
|
// Bordered tabs size to their content (Figma "Advance Tabs"); the others stretch to equal width.
|
|
38313
38320
|
variant === 'bordered' ? 'shrink-0' : 'flex-1',
|
|
38314
38321
|
// Every segment carries a border so the active one's primary border doesn't shift the layout.
|
|
38315
38322
|
isActive
|
|
38316
|
-
? cn('border-primary bg-card shadow-xs', detailed ? 'text-primary dark:text-foreground' : 'text-primary')
|
|
38317
|
-
: cn('border-transparent', variant === 'bordered' ? 'text-foreground' : 'text-muted-foreground', 'hover:text-foreground'), isDisabled && 'cursor-not-allowed opacity-50');
|
|
38323
|
+
? 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')
|
|
38324
|
+
: 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');
|
|
38318
38325
|
}
|
|
38319
38326
|
function getIconClassName(detailed, isActive) {
|
|
38320
38327
|
if (!detailed) {
|
|
38321
38328
|
return 'inline-flex shrink-0 items-center [&_svg]:h-4 [&_svg]:w-4';
|
|
38322
38329
|
}
|
|
38323
|
-
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');
|
|
38330
|
+
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');
|
|
38324
38331
|
}
|
|
38325
38332
|
function getContentClassName(layout) {
|
|
38326
38333
|
return layout === 'inline'
|
|
@@ -38328,7 +38335,7 @@ function getContentClassName(layout) {
|
|
|
38328
38335
|
: 'flex min-w-0 flex-col items-center gap-0.5';
|
|
38329
38336
|
}
|
|
38330
38337
|
function getDescriptionClassName(isActive) {
|
|
38331
|
-
return cn('truncate text-xs font-normal', isActive ? 'text-primary' : 'text-muted-foreground');
|
|
38338
|
+
return cn('truncate text-xs font-normal', isActive ? cn('text-primary', DARK_ACTIVE_GREEN_TEXT) : 'text-muted-foreground');
|
|
38332
38339
|
}
|
|
38333
38340
|
|
|
38334
38341
|
/**
|