@nucleux/card 0.1.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/LICENSE +21 -0
- package/dist/index.cjs +99 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +35 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nucleux
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var utils = require('@nucleux/utils');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
// src/index.tsx
|
|
29
|
+
var CardContainer = React__namespace.forwardRef(
|
|
30
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
ref,
|
|
34
|
+
className: utils.cn(
|
|
35
|
+
"rounded-xl border border-border bg-background text-foreground shadow-sm",
|
|
36
|
+
className
|
|
37
|
+
),
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
CardContainer.displayName = "CardContainer";
|
|
43
|
+
var CardHeader = React__namespace.forwardRef(
|
|
44
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
ref,
|
|
48
|
+
className: utils.cn("flex items-start justify-between gap-4 px-6 py-4", className),
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
CardHeader.displayName = "CardHeader";
|
|
54
|
+
var CardTitle = React__namespace.forwardRef(
|
|
55
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
+
"h3",
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
className: utils.cn("text-base font-semibold leading-6 text-foreground", className),
|
|
60
|
+
...props
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
CardTitle.displayName = "CardTitle";
|
|
65
|
+
var CardDescription = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("p", { ref, className: utils.cn("text-sm text-muted-foreground", className), ...props }));
|
|
66
|
+
CardDescription.displayName = "CardDescription";
|
|
67
|
+
var CardAction = React__namespace.forwardRef(
|
|
68
|
+
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
ref,
|
|
72
|
+
type,
|
|
73
|
+
className: utils.cn(
|
|
74
|
+
"shrink-0 text-sm font-medium text-info transition-colors hover:text-info/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
CardAction.displayName = "CardAction";
|
|
82
|
+
var CardContent = React__namespace.forwardRef(
|
|
83
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn("px-6 py-4", className), ...props })
|
|
84
|
+
);
|
|
85
|
+
CardContent.displayName = "CardContent";
|
|
86
|
+
var CardDivider = React__namespace.forwardRef(
|
|
87
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, role: "separator", className: utils.cn("h-px w-full bg-border", className), ...props })
|
|
88
|
+
);
|
|
89
|
+
CardDivider.displayName = "CardDivider";
|
|
90
|
+
|
|
91
|
+
exports.CardAction = CardAction;
|
|
92
|
+
exports.CardContainer = CardContainer;
|
|
93
|
+
exports.CardContent = CardContent;
|
|
94
|
+
exports.CardDescription = CardDescription;
|
|
95
|
+
exports.CardDivider = CardDivider;
|
|
96
|
+
exports.CardHeader = CardHeader;
|
|
97
|
+
exports.CardTitle = CardTitle;
|
|
98
|
+
//# sourceMappingURL=index.cjs.map
|
|
99
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":["React","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,IAAM,aAAA,GAAsBA,gBAAA,CAAA,UAAA;AAAA,EACjC,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxBC,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAWC,QAAA;AAAA,QACT,yEAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA;AAGV;AACA,aAAA,CAAc,WAAA,GAAc,eAAA;AAGrB,IAAM,UAAA,GAAmBF,gBAAA,CAAA,UAAA;AAAA,EAC9B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxBC,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAWC,QAAA,CAAG,kDAAA,EAAoD,SAAS,CAAA;AAAA,MAC1E,GAAG;AAAA;AAAA;AAGV;AACA,UAAA,CAAW,WAAA,GAAc,YAAA;AAElB,IAAM,SAAA,GAAkBF,gBAAA,CAAA,UAAA;AAAA,EAC7B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxBC,cAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAWC,QAAA,CAAG,mDAAA,EAAqD,SAAS,CAAA;AAAA,MAC3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";\nimport { cn } from \"@nucleux/utils\";\n\n/**\n * Composable card surface. Compose the parts to match the design:\n *\n * ```tsx\n * <CardContainer>\n * <CardHeader>\n * <div>\n * <CardTitle>Recent meeting</CardTitle>\n * <CardDescription>1 in your library</CardDescription>\n * </div>\n * <CardAction>View all</CardAction>\n * </CardHeader>\n * <CardDivider />\n * <CardContent>…</CardContent>\n * </CardContainer>\n * ```\n *\n * Named `CardContainer` to mirror the canonical Figma component.\n */\nexport interface CardContainerProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const CardContainer = React.forwardRef<HTMLDivElement, CardContainerProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-xl border border-border bg-background text-foreground shadow-sm\",\n className,\n )}\n {...props}\n />\n ),\n);\nCardContainer.displayName = \"CardContainer\";\n\n/** Card header. Lays children out in a row with space-between by default. */\nexport const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-start justify-between gap-4 px-6 py-4\", className)}\n {...props}\n />\n ),\n);\nCardHeader.displayName = \"CardHeader\";\n\nexport const CardTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-base font-semibold leading-6 text-foreground\", className)}\n {...props}\n />\n ),\n);\nCardTitle.displayName = \"CardTitle\";\n\nexport const CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n));\nCardDescription.displayName = \"CardDescription\";\n\n/** Trailing action in a card header, e.g. a \"View all\" link. Renders a button by default. */\nexport const CardAction = React.forwardRef<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>>(\n ({ className, type = \"button\", ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n className={cn(\n \"shrink-0 text-sm font-medium text-info transition-colors hover:text-info/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n {...props}\n />\n ),\n);\nCardAction.displayName = \"CardAction\";\n\nexport const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"px-6 py-4\", className)} {...props} />\n ),\n);\nCardContent.displayName = \"CardContent\";\n\n/** Full-bleed hairline divider between card sections. */\nexport const CardDivider = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} role=\"separator\" className={cn(\"h-px w-full bg-border\", className)} {...props} />\n ),\n);\nCardDivider.displayName = \"CardDivider\";\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Composable card surface. Compose the parts to match the design:
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <CardContainer>
|
|
8
|
+
* <CardHeader>
|
|
9
|
+
* <div>
|
|
10
|
+
* <CardTitle>Recent meeting</CardTitle>
|
|
11
|
+
* <CardDescription>1 in your library</CardDescription>
|
|
12
|
+
* </div>
|
|
13
|
+
* <CardAction>View all</CardAction>
|
|
14
|
+
* </CardHeader>
|
|
15
|
+
* <CardDivider />
|
|
16
|
+
* <CardContent>…</CardContent>
|
|
17
|
+
* </CardContainer>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Named `CardContainer` to mirror the canonical Figma component.
|
|
21
|
+
*/
|
|
22
|
+
interface CardContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
}
|
|
24
|
+
declare const CardContainer: React.ForwardRefExoticComponent<CardContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
/** Card header. Lays children out in a row with space-between by default. */
|
|
26
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
28
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
29
|
+
/** Trailing action in a card header, e.g. a "View all" link. Renders a button by default. */
|
|
30
|
+
declare const CardAction: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
/** Full-bleed hairline divider between card sections. */
|
|
33
|
+
declare const CardDivider: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
|
|
35
|
+
export { CardAction, CardContainer, type CardContainerProps, CardContent, CardDescription, CardDivider, CardHeader, CardTitle };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Composable card surface. Compose the parts to match the design:
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <CardContainer>
|
|
8
|
+
* <CardHeader>
|
|
9
|
+
* <div>
|
|
10
|
+
* <CardTitle>Recent meeting</CardTitle>
|
|
11
|
+
* <CardDescription>1 in your library</CardDescription>
|
|
12
|
+
* </div>
|
|
13
|
+
* <CardAction>View all</CardAction>
|
|
14
|
+
* </CardHeader>
|
|
15
|
+
* <CardDivider />
|
|
16
|
+
* <CardContent>…</CardContent>
|
|
17
|
+
* </CardContainer>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Named `CardContainer` to mirror the canonical Figma component.
|
|
21
|
+
*/
|
|
22
|
+
interface CardContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
}
|
|
24
|
+
declare const CardContainer: React.ForwardRefExoticComponent<CardContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
/** Card header. Lays children out in a row with space-between by default. */
|
|
26
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
28
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
29
|
+
/** Trailing action in a card header, e.g. a "View all" link. Renders a button by default. */
|
|
30
|
+
declare const CardAction: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
/** Full-bleed hairline divider between card sections. */
|
|
33
|
+
declare const CardDivider: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
|
|
35
|
+
export { CardAction, CardContainer, type CardContainerProps, CardContent, CardDescription, CardDivider, CardHeader, CardTitle };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '@nucleux/utils';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/index.tsx
|
|
7
|
+
var CardContainer = React.forwardRef(
|
|
8
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
className: cn(
|
|
13
|
+
"rounded-xl border border-border bg-background text-foreground shadow-sm",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
CardContainer.displayName = "CardContainer";
|
|
21
|
+
var CardHeader = React.forwardRef(
|
|
22
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
className: cn("flex items-start justify-between gap-4 px-6 py-4", className),
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
CardHeader.displayName = "CardHeader";
|
|
32
|
+
var CardTitle = React.forwardRef(
|
|
33
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
34
|
+
"h3",
|
|
35
|
+
{
|
|
36
|
+
ref,
|
|
37
|
+
className: cn("text-base font-semibold leading-6 text-foreground", className),
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
CardTitle.displayName = "CardTitle";
|
|
43
|
+
var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
44
|
+
CardDescription.displayName = "CardDescription";
|
|
45
|
+
var CardAction = React.forwardRef(
|
|
46
|
+
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
type,
|
|
51
|
+
className: cn(
|
|
52
|
+
"shrink-0 text-sm font-medium text-info transition-colors hover:text-info/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
53
|
+
className
|
|
54
|
+
),
|
|
55
|
+
...props
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
CardAction.displayName = "CardAction";
|
|
60
|
+
var CardContent = React.forwardRef(
|
|
61
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("px-6 py-4", className), ...props })
|
|
62
|
+
);
|
|
63
|
+
CardContent.displayName = "CardContent";
|
|
64
|
+
var CardDivider = React.forwardRef(
|
|
65
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", className: cn("h-px w-full bg-border", className), ...props })
|
|
66
|
+
);
|
|
67
|
+
CardDivider.displayName = "CardDivider";
|
|
68
|
+
|
|
69
|
+
export { CardAction, CardContainer, CardContent, CardDescription, CardDivider, CardHeader, CardTitle };
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;AAwBO,IAAM,aAAA,GAAsB,KAAA,CAAA,UAAA;AAAA,EACjC,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxB,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,EAAA;AAAA,QACT,yEAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA;AAGV;AACA,aAAA,CAAc,WAAA,GAAc,eAAA;AAGrB,IAAM,UAAA,GAAmB,KAAA,CAAA,UAAA;AAAA,EAC9B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxB,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,kDAAA,EAAoD,SAAS,CAAA;AAAA,MAC1E,GAAG;AAAA;AAAA;AAGV;AACA,UAAA,CAAW,WAAA,GAAc,YAAA;AAElB,IAAM,SAAA,GAAkB,KAAA,CAA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,EAAA,EAAI,GAAA,EAAU,IAAA,EAAK,aAAY,SAAA,EAAW,EAAA,CAAG,yBAAyB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAElG;AACA,WAAA,CAAY,WAAA,GAAc,aAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@nucleux/utils\";\n\n/**\n * Composable card surface. Compose the parts to match the design:\n *\n * ```tsx\n * <CardContainer>\n * <CardHeader>\n * <div>\n * <CardTitle>Recent meeting</CardTitle>\n * <CardDescription>1 in your library</CardDescription>\n * </div>\n * <CardAction>View all</CardAction>\n * </CardHeader>\n * <CardDivider />\n * <CardContent>…</CardContent>\n * </CardContainer>\n * ```\n *\n * Named `CardContainer` to mirror the canonical Figma component.\n */\nexport interface CardContainerProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const CardContainer = React.forwardRef<HTMLDivElement, CardContainerProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-xl border border-border bg-background text-foreground shadow-sm\",\n className,\n )}\n {...props}\n />\n ),\n);\nCardContainer.displayName = \"CardContainer\";\n\n/** Card header. Lays children out in a row with space-between by default. */\nexport const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-start justify-between gap-4 px-6 py-4\", className)}\n {...props}\n />\n ),\n);\nCardHeader.displayName = \"CardHeader\";\n\nexport const CardTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-base font-semibold leading-6 text-foreground\", className)}\n {...props}\n />\n ),\n);\nCardTitle.displayName = \"CardTitle\";\n\nexport const CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n));\nCardDescription.displayName = \"CardDescription\";\n\n/** Trailing action in a card header, e.g. a \"View all\" link. Renders a button by default. */\nexport const CardAction = React.forwardRef<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>>(\n ({ className, type = \"button\", ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n className={cn(\n \"shrink-0 text-sm font-medium text-info transition-colors hover:text-info/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n {...props}\n />\n ),\n);\nCardAction.displayName = \"CardAction\";\n\nexport const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"px-6 py-4\", className)} {...props} />\n ),\n);\nCardContent.displayName = \"CardContent\";\n\n/** Full-bleed hairline divider between card sections. */\nexport const CardDivider = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} role=\"separator\" className={cn(\"h-px w-full bg-border\", className)} {...props} />\n ),\n);\nCardDivider.displayName = \"CardDivider\";\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nucleux/card",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": ">=18",
|
|
21
|
+
"react-dom": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@nucleux/utils": "0.1.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"tsup": "^8.3.5",
|
|
28
|
+
"typescript": "^5.7.2",
|
|
29
|
+
"@types/react": "^18.3.18",
|
|
30
|
+
"react": "^18.3.1",
|
|
31
|
+
"lucide-react": "^0.469.0"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/intelligaia-open-labs/nucleux.git",
|
|
40
|
+
"directory": "packages/card"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/intelligaia-open-labs/nucleux#readme",
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup"
|
|
45
|
+
}
|
|
46
|
+
}
|