@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/components/molecules/CustomTable/CustomTable.d.ts.map +1 -1
- package/dist/components/molecules/CustomTable/CustomTable.utils.d.ts +4 -1
- package/dist/components/molecules/CustomTable/CustomTable.utils.d.ts.map +1 -1
- package/dist/components/molecules/SegmentedControl/SegmentedControl.utils.d.ts.map +1 -1
- package/dist/index.cjs.js +19 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -9
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomTable.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomTable/CustomTable.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC7B,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAA+C,EAC/C,SAAc,EACd,YAAiB,EACjB,eAAuB,EACvB,WAAmB,EACnB,iBAAyB,EACzB,UAAU,EACV,eAAuB,EACvB,cAAc,EACd,iBAAiB,GAClB,EAAE,gBAAgB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"CustomTable.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomTable/CustomTable.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC7B,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAA+C,EAC/C,SAAc,EACd,YAAiB,EACjB,eAAuB,EACvB,WAAmB,EACnB,iBAAyB,EACzB,UAAU,EACV,eAAuB,EACvB,cAAc,EACd,iBAAiB,GAClB,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CAuKrB"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { Column } from './CustomTable.types';
|
|
3
3
|
export declare function alignClass(align?: 'left' | 'right' | 'center'): string;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Sticky right-pinned header cell for an `actions` column. Being sticky itself it no longer
|
|
6
|
+
* rides the sticky <thead>, so it needs its own `top-0` or it scrolls away with the rows.
|
|
7
|
+
*/
|
|
5
8
|
export declare function stickyActionsHeaderClass(): string;
|
|
6
9
|
/** Sticky right-pinned body cell for an `actions` column (opaque per alternating row). */
|
|
7
10
|
export declare function stickyActionsCellClass(isEven: boolean): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomTable.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomTable/CustomTable.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAMtE;AAKD
|
|
1
|
+
{"version":3,"file":"CustomTable.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomTable/CustomTable.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAMtE;AAKD;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,0FAA0F;AAC1F,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAM9D;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAItE"}
|
|
@@ -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
|
@@ -21316,9 +21316,12 @@ function alignClass(align) {
|
|
|
21316
21316
|
: '';
|
|
21317
21317
|
}
|
|
21318
21318
|
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]';
|
|
21319
|
-
/**
|
|
21319
|
+
/**
|
|
21320
|
+
* Sticky right-pinned header cell for an `actions` column. Being sticky itself it no longer
|
|
21321
|
+
* rides the sticky <thead>, so it needs its own `top-0` or it scrolls away with the rows.
|
|
21322
|
+
*/
|
|
21320
21323
|
function stickyActionsHeaderClass() {
|
|
21321
|
-
return cn(STICKY_ACTIONS_BASE, 'z-40 bg-table-header');
|
|
21324
|
+
return cn(STICKY_ACTIONS_BASE, 'top-0 z-40 bg-table-header');
|
|
21322
21325
|
}
|
|
21323
21326
|
/** Sticky right-pinned body cell for an `actions` column (opaque per alternating row). */
|
|
21324
21327
|
function stickyActionsCellClass(isEven) {
|
|
@@ -21346,7 +21349,7 @@ function CustomTable({ data, columns, expandable, rowKey = (row) => row.id, clas
|
|
|
21346
21349
|
? selectedIds.filter((id) => id !== key)
|
|
21347
21350
|
: [...selectedIds, key]);
|
|
21348
21351
|
};
|
|
21349
|
-
return (jsxRuntime.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: [jsxRuntime.jsx("div", { className: "overflow-auto flex-1 isolate", children: jsxRuntime.jsxs("table", { "data-slot": "table", className: "min-w-full w-full text-left text-sm", children: [jsxRuntime.jsx("thead", { className: "sticky top-0 z-
|
|
21352
|
+
return (jsxRuntime.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: [jsxRuntime.jsx("div", { className: "overflow-auto flex-1 isolate", children: jsxRuntime.jsxs("table", { "data-slot": "table", className: "min-w-full w-full text-left text-sm", children: [jsxRuntime.jsx("thead", { className: "sticky top-0 z-40 border-b border-border !bg-table-header", children: jsxRuntime.jsxs("tr", { children: [expandable && (jsxRuntime.jsx("th", { className: "h-12 w-[52px] min-w-[52px] whitespace-nowrap px-3 text-left align-middle text-secondary-foreground" })), enableSelection && (jsxRuntime.jsx("th", { className: "h-12 w-[52px] min-w-[52px] whitespace-nowrap px-3 text-left align-middle", children: jsxRuntime.jsx(Checkbox, { checked: allSelected
|
|
21350
21353
|
? true
|
|
21351
21354
|
: someSelected
|
|
21352
21355
|
? 'indeterminate'
|
|
@@ -38304,23 +38307,30 @@ const NumberedStepCard = ({ step, title, description, className, }) => {
|
|
|
38304
38307
|
function hasDetails(variant, hasDescription) {
|
|
38305
38308
|
return variant === 'default' && hasDescription;
|
|
38306
38309
|
}
|
|
38310
|
+
/** Dark mode: `--primary` is too dim on near-black, so the detailed active state uses the design's lighter green. */
|
|
38311
|
+
const DARK_ACTIVE_GREEN = 'dark:border-[#6FB98A]';
|
|
38312
|
+
const DARK_ACTIVE_GREEN_TEXT = 'dark:text-[#6FB98A]';
|
|
38307
38313
|
function getListClassName(variant, detailed) {
|
|
38308
|
-
|
|
38314
|
+
if (detailed) {
|
|
38315
|
+
// Light: a faint primary tint. Dark: `--muted` is a light overlay that would outshine the active segment.
|
|
38316
|
+
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';
|
|
38317
|
+
}
|
|
38318
|
+
return cn('inline-flex w-full items-center gap-1 bg-muted p-1', variant === 'bordered' ? 'rounded-lg' : 'rounded-md');
|
|
38309
38319
|
}
|
|
38310
38320
|
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',
|
|
38321
|
+
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
38322
|
// Bordered tabs size to their content (Figma "Advance Tabs"); the others stretch to equal width.
|
|
38313
38323
|
variant === 'bordered' ? 'shrink-0' : 'flex-1',
|
|
38314
38324
|
// Every segment carries a border so the active one's primary border doesn't shift the layout.
|
|
38315
38325
|
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');
|
|
38326
|
+
? 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')
|
|
38327
|
+
: 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
38328
|
}
|
|
38319
38329
|
function getIconClassName(detailed, isActive) {
|
|
38320
38330
|
if (!detailed) {
|
|
38321
38331
|
return 'inline-flex shrink-0 items-center [&_svg]:h-4 [&_svg]:w-4';
|
|
38322
38332
|
}
|
|
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');
|
|
38333
|
+
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
38334
|
}
|
|
38325
38335
|
function getContentClassName(layout) {
|
|
38326
38336
|
return layout === 'inline'
|
|
@@ -38328,7 +38338,7 @@ function getContentClassName(layout) {
|
|
|
38328
38338
|
: 'flex min-w-0 flex-col items-center gap-0.5';
|
|
38329
38339
|
}
|
|
38330
38340
|
function getDescriptionClassName(isActive) {
|
|
38331
|
-
return cn('truncate text-xs font-normal', isActive ? 'text-primary' : 'text-muted-foreground');
|
|
38341
|
+
return cn('truncate text-xs font-normal', isActive ? cn('text-primary', DARK_ACTIVE_GREEN_TEXT) : 'text-muted-foreground');
|
|
38332
38342
|
}
|
|
38333
38343
|
|
|
38334
38344
|
/**
|