@kopexa/card 3.0.0 → 4.0.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/card.d.mts CHANGED
@@ -18,5 +18,9 @@ type CardFooterProps = ComponentProps<"div"> & {
18
18
  asChild?: boolean;
19
19
  };
20
20
  declare function CardFooter(props: CardFooterProps): react_jsx_runtime.JSX.Element;
21
+ type CardHeadingProps = ComponentProps<"div">;
22
+ declare function CardHeading({ className, ...props }: CardHeadingProps): react_jsx_runtime.JSX.Element;
23
+ type CardToolbarProps = ComponentProps<"div">;
24
+ declare function CardToolbar({ className, ...props }: CardToolbarProps): react_jsx_runtime.JSX.Element;
21
25
 
22
- export { CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardRoot, type CardRootProps };
26
+ export { CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardHeading, type CardHeadingProps, CardRoot, type CardRootProps, CardToolbar, type CardToolbarProps };
package/dist/card.d.ts CHANGED
@@ -18,5 +18,9 @@ type CardFooterProps = ComponentProps<"div"> & {
18
18
  asChild?: boolean;
19
19
  };
20
20
  declare function CardFooter(props: CardFooterProps): react_jsx_runtime.JSX.Element;
21
+ type CardHeadingProps = ComponentProps<"div">;
22
+ declare function CardHeading({ className, ...props }: CardHeadingProps): react_jsx_runtime.JSX.Element;
23
+ type CardToolbarProps = ComponentProps<"div">;
24
+ declare function CardToolbar({ className, ...props }: CardToolbarProps): react_jsx_runtime.JSX.Element;
21
25
 
22
- export { CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardRoot, type CardRootProps };
26
+ export { CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardHeading, type CardHeadingProps, CardRoot, type CardRootProps, CardToolbar, type CardToolbarProps };
package/dist/card.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  "use strict";
3
+ "use client";
3
4
  var __create = Object.create;
4
5
  var __defProp = Object.defineProperty;
5
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -34,7 +35,9 @@ __export(card_exports, {
34
35
  CardBody: () => CardBody,
35
36
  CardFooter: () => CardFooter,
36
37
  CardHeader: () => CardHeader,
37
- CardRoot: () => CardRoot
38
+ CardHeading: () => CardHeading,
39
+ CardRoot: () => CardRoot,
40
+ CardToolbar: () => CardToolbar
38
41
  });
39
42
  module.exports = __toCommonJS(card_exports);
40
43
  var import_react_utils = require("@kopexa/react-utils");
@@ -82,6 +85,7 @@ var CardRoot = (props) => {
82
85
  tabIndex: isPressable ? 0 : -1,
83
86
  "data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
84
87
  role: isPressable ? "button" : void 0,
88
+ "data-slot": "card",
85
89
  ...rest,
86
90
  children
87
91
  }
@@ -91,13 +95,29 @@ function CardHeader(props) {
91
95
  const { className, children, asChild, ...rest } = props;
92
96
  const Component = asChild ? Slot.Root : "div";
93
97
  const { styles } = useCardContext();
94
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.header({ className }), ...rest, children });
98
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
+ Component,
100
+ {
101
+ "data-slot": "card-header",
102
+ className: styles.header({ className }),
103
+ ...rest,
104
+ children
105
+ }
106
+ );
95
107
  }
96
108
  function CardBody(props) {
97
109
  const { className, children, asChild, ...rest } = props;
98
110
  const Component = asChild ? Slot.Root : "div";
99
111
  const { styles } = useCardContext();
100
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.body({ className }), ...rest, children });
112
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
113
+ Component,
114
+ {
115
+ className: styles.body({ className }),
116
+ "data-slot": "card-body",
117
+ ...rest,
118
+ children
119
+ }
120
+ );
101
121
  }
102
122
  function CardFooter(props) {
103
123
  const { className, children, asChild, ...rest } = props;
@@ -105,10 +125,34 @@ function CardFooter(props) {
105
125
  const { styles } = useCardContext();
106
126
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.footer({ className }), ...rest, children });
107
127
  }
128
+ function CardHeading({ className, ...props }) {
129
+ const { styles } = useCardContext();
130
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
+ "div",
132
+ {
133
+ "data-slot": "card-heading",
134
+ className: (0, import_shared_utils.cn)(styles.heading(), className),
135
+ ...props
136
+ }
137
+ );
138
+ }
139
+ function CardToolbar({ className, ...props }) {
140
+ const { styles } = useCardContext();
141
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
142
+ "div",
143
+ {
144
+ "data-slot": "card-toolbar",
145
+ className: (0, import_shared_utils.cn)(styles.toolbar(), className),
146
+ ...props
147
+ }
148
+ );
149
+ }
108
150
  // Annotate the CommonJS export names for ESM import in node:
109
151
  0 && (module.exports = {
110
152
  CardBody,
111
153
  CardFooter,
112
154
  CardHeader,
113
- CardRoot
155
+ CardHeading,
156
+ CardRoot,
157
+ CardToolbar
114
158
  });
package/dist/card.mjs CHANGED
@@ -1,13 +1,18 @@
1
1
  "use client";
2
+ "use client";
2
3
  import {
3
4
  CardBody,
4
5
  CardFooter,
5
6
  CardHeader,
6
- CardRoot
7
- } from "./chunk-QJLYPGLR.mjs";
7
+ CardHeading,
8
+ CardRoot,
9
+ CardToolbar
10
+ } from "./chunk-4TZ4CO7Q.mjs";
8
11
  export {
9
12
  CardBody,
10
13
  CardFooter,
11
14
  CardHeader,
12
- CardRoot
15
+ CardHeading,
16
+ CardRoot,
17
+ CardToolbar
13
18
  };
@@ -7,7 +7,7 @@ var __export = (target, all) => {
7
7
 
8
8
  // src/card.tsx
9
9
  import { createContext } from "@kopexa/react-utils";
10
- import { dataAttr } from "@kopexa/shared-utils";
10
+ import { cn, dataAttr } from "@kopexa/shared-utils";
11
11
  import { card } from "@kopexa/theme";
12
12
  import * as Slot from "@radix-ui/react-slot";
13
13
  import { jsx } from "react/jsx-runtime";
@@ -51,6 +51,7 @@ var CardRoot = (props) => {
51
51
  tabIndex: isPressable ? 0 : -1,
52
52
  "data-disabled": dataAttr(isDisabled),
53
53
  role: isPressable ? "button" : void 0,
54
+ "data-slot": "card",
54
55
  ...rest,
55
56
  children
56
57
  }
@@ -60,13 +61,29 @@ function CardHeader(props) {
60
61
  const { className, children, asChild, ...rest } = props;
61
62
  const Component = asChild ? Slot.Root : "div";
62
63
  const { styles } = useCardContext();
63
- return /* @__PURE__ */ jsx(Component, { className: styles.header({ className }), ...rest, children });
64
+ return /* @__PURE__ */ jsx(
65
+ Component,
66
+ {
67
+ "data-slot": "card-header",
68
+ className: styles.header({ className }),
69
+ ...rest,
70
+ children
71
+ }
72
+ );
64
73
  }
65
74
  function CardBody(props) {
66
75
  const { className, children, asChild, ...rest } = props;
67
76
  const Component = asChild ? Slot.Root : "div";
68
77
  const { styles } = useCardContext();
69
- return /* @__PURE__ */ jsx(Component, { className: styles.body({ className }), ...rest, children });
78
+ return /* @__PURE__ */ jsx(
79
+ Component,
80
+ {
81
+ className: styles.body({ className }),
82
+ "data-slot": "card-body",
83
+ ...rest,
84
+ children
85
+ }
86
+ );
70
87
  }
71
88
  function CardFooter(props) {
72
89
  const { className, children, asChild, ...rest } = props;
@@ -74,11 +91,35 @@ function CardFooter(props) {
74
91
  const { styles } = useCardContext();
75
92
  return /* @__PURE__ */ jsx(Component, { className: styles.footer({ className }), ...rest, children });
76
93
  }
94
+ function CardHeading({ className, ...props }) {
95
+ const { styles } = useCardContext();
96
+ return /* @__PURE__ */ jsx(
97
+ "div",
98
+ {
99
+ "data-slot": "card-heading",
100
+ className: cn(styles.heading(), className),
101
+ ...props
102
+ }
103
+ );
104
+ }
105
+ function CardToolbar({ className, ...props }) {
106
+ const { styles } = useCardContext();
107
+ return /* @__PURE__ */ jsx(
108
+ "div",
109
+ {
110
+ "data-slot": "card-toolbar",
111
+ className: cn(styles.toolbar(), className),
112
+ ...props
113
+ }
114
+ );
115
+ }
77
116
 
78
117
  export {
79
118
  __export,
80
119
  CardRoot,
81
120
  CardHeader,
82
121
  CardBody,
83
- CardFooter
122
+ CardFooter,
123
+ CardHeading,
124
+ CardToolbar
84
125
  };
@@ -3,9 +3,11 @@ import {
3
3
  CardBody,
4
4
  CardFooter,
5
5
  CardHeader,
6
+ CardHeading,
6
7
  CardRoot,
8
+ CardToolbar,
7
9
  __export
8
- } from "./chunk-QJLYPGLR.mjs";
10
+ } from "./chunk-4TZ4CO7Q.mjs";
9
11
 
10
12
  // src/namespace.ts
11
13
  var namespace_exports = {};
@@ -13,7 +15,9 @@ __export(namespace_exports, {
13
15
  Body: () => CardBody,
14
16
  Footer: () => CardFooter,
15
17
  Header: () => CardHeader,
16
- Root: () => CardRoot
18
+ Heading: () => CardHeading,
19
+ Root: () => CardRoot,
20
+ Toolbar: () => CardToolbar
17
21
  });
18
22
 
19
23
  export {
package/dist/index.js CHANGED
@@ -41,7 +41,9 @@ __export(namespace_exports, {
41
41
  Body: () => CardBody,
42
42
  Footer: () => CardFooter,
43
43
  Header: () => CardHeader,
44
- Root: () => CardRoot
44
+ Heading: () => CardHeading,
45
+ Root: () => CardRoot,
46
+ Toolbar: () => CardToolbar
45
47
  });
46
48
 
47
49
  // src/card.tsx
@@ -90,6 +92,7 @@ var CardRoot = (props) => {
90
92
  tabIndex: isPressable ? 0 : -1,
91
93
  "data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
92
94
  role: isPressable ? "button" : void 0,
95
+ "data-slot": "card",
93
96
  ...rest,
94
97
  children
95
98
  }
@@ -99,13 +102,29 @@ function CardHeader(props) {
99
102
  const { className, children, asChild, ...rest } = props;
100
103
  const Component = asChild ? Slot.Root : "div";
101
104
  const { styles } = useCardContext();
102
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.header({ className }), ...rest, children });
105
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ Component,
107
+ {
108
+ "data-slot": "card-header",
109
+ className: styles.header({ className }),
110
+ ...rest,
111
+ children
112
+ }
113
+ );
103
114
  }
104
115
  function CardBody(props) {
105
116
  const { className, children, asChild, ...rest } = props;
106
117
  const Component = asChild ? Slot.Root : "div";
107
118
  const { styles } = useCardContext();
108
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.body({ className }), ...rest, children });
119
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ Component,
121
+ {
122
+ className: styles.body({ className }),
123
+ "data-slot": "card-body",
124
+ ...rest,
125
+ children
126
+ }
127
+ );
109
128
  }
110
129
  function CardFooter(props) {
111
130
  const { className, children, asChild, ...rest } = props;
@@ -113,6 +132,28 @@ function CardFooter(props) {
113
132
  const { styles } = useCardContext();
114
133
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.footer({ className }), ...rest, children });
115
134
  }
135
+ function CardHeading({ className, ...props }) {
136
+ const { styles } = useCardContext();
137
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
138
+ "div",
139
+ {
140
+ "data-slot": "card-heading",
141
+ className: (0, import_shared_utils.cn)(styles.heading(), className),
142
+ ...props
143
+ }
144
+ );
145
+ }
146
+ function CardToolbar({ className, ...props }) {
147
+ const { styles } = useCardContext();
148
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ "div",
150
+ {
151
+ "data-slot": "card-toolbar",
152
+ className: (0, import_shared_utils.cn)(styles.toolbar(), className),
153
+ ...props
154
+ }
155
+ );
156
+ }
116
157
  // Annotate the CommonJS export names for ESM import in node:
117
158
  0 && (module.exports = {
118
159
  Card
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  namespace_exports
4
- } from "./chunk-6LOHEW6B.mjs";
5
- import "./chunk-QJLYPGLR.mjs";
4
+ } from "./chunk-BZFCKMXJ.mjs";
5
+ import "./chunk-4TZ4CO7Q.mjs";
6
6
  export {
7
7
  namespace_exports as Card
8
8
  };
@@ -1,10 +1,10 @@
1
- import { CardBody, CardBodyProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardRoot, CardRootProps } from './card.mjs';
1
+ import { CardBody, CardBodyProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardHeading, CardHeadingProps, CardRoot, CardRootProps, CardToolbar, CardToolbarProps } from './card.mjs';
2
2
  import 'react/jsx-runtime';
3
3
  import '@kopexa/theme';
4
4
  import 'react';
5
5
 
6
6
  declare namespace namespace {
7
- export { CardBody as Body, CardBodyProps as BodyProps, CardFooter as Footer, CardFooterProps as FooterProps, CardHeader as Header, CardHeaderProps as HeaderProps, CardRoot as Root, CardRootProps as RootProps };
7
+ export { CardBody as Body, CardBodyProps as BodyProps, CardFooter as Footer, CardFooterProps as FooterProps, CardHeader as Header, CardHeaderProps as HeaderProps, CardHeading as Heading, CardHeadingProps as HeadingProps, CardRoot as Root, CardRootProps as RootProps, CardToolbar as Toolbar, CardToolbarProps as ToolbarProps };
8
8
  }
9
9
 
10
- export { CardBody as Body, CardBodyProps as BodyProps, CardFooter as Footer, CardFooterProps as FooterProps, CardHeader as Header, CardHeaderProps as HeaderProps, CardRoot as Root, CardRootProps as RootProps, namespace as n };
10
+ export { CardBody as Body, CardBodyProps as BodyProps, CardFooter as Footer, CardFooterProps as FooterProps, CardHeader as Header, CardHeaderProps as HeaderProps, CardHeading as Heading, CardHeadingProps as HeadingProps, CardRoot as Root, CardRootProps as RootProps, CardToolbar as Toolbar, CardToolbarProps as ToolbarProps, namespace as n };
@@ -1,10 +1,10 @@
1
- import { CardBody, CardBodyProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardRoot, CardRootProps } from './card.js';
1
+ import { CardBody, CardBodyProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardHeading, CardHeadingProps, CardRoot, CardRootProps, CardToolbar, CardToolbarProps } from './card.js';
2
2
  import 'react/jsx-runtime';
3
3
  import '@kopexa/theme';
4
4
  import 'react';
5
5
 
6
6
  declare namespace namespace {
7
- export { CardBody as Body, CardBodyProps as BodyProps, CardFooter as Footer, CardFooterProps as FooterProps, CardHeader as Header, CardHeaderProps as HeaderProps, CardRoot as Root, CardRootProps as RootProps };
7
+ export { CardBody as Body, CardBodyProps as BodyProps, CardFooter as Footer, CardFooterProps as FooterProps, CardHeader as Header, CardHeaderProps as HeaderProps, CardHeading as Heading, CardHeadingProps as HeadingProps, CardRoot as Root, CardRootProps as RootProps, CardToolbar as Toolbar, CardToolbarProps as ToolbarProps };
8
8
  }
9
9
 
10
- export { CardBody as Body, CardBodyProps as BodyProps, CardFooter as Footer, CardFooterProps as FooterProps, CardHeader as Header, CardHeaderProps as HeaderProps, CardRoot as Root, CardRootProps as RootProps, namespace as n };
10
+ export { CardBody as Body, CardBodyProps as BodyProps, CardFooter as Footer, CardFooterProps as FooterProps, CardHeader as Header, CardHeaderProps as HeaderProps, CardHeading as Heading, CardHeadingProps as HeadingProps, CardRoot as Root, CardRootProps as RootProps, CardToolbar as Toolbar, CardToolbarProps as ToolbarProps, namespace as n };
package/dist/namespace.js CHANGED
@@ -34,7 +34,9 @@ __export(namespace_exports, {
34
34
  Body: () => CardBody,
35
35
  Footer: () => CardFooter,
36
36
  Header: () => CardHeader,
37
- Root: () => CardRoot
37
+ Heading: () => CardHeading,
38
+ Root: () => CardRoot,
39
+ Toolbar: () => CardToolbar
38
40
  });
39
41
  module.exports = __toCommonJS(namespace_exports);
40
42
 
@@ -84,6 +86,7 @@ var CardRoot = (props) => {
84
86
  tabIndex: isPressable ? 0 : -1,
85
87
  "data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
86
88
  role: isPressable ? "button" : void 0,
89
+ "data-slot": "card",
87
90
  ...rest,
88
91
  children
89
92
  }
@@ -93,13 +96,29 @@ function CardHeader(props) {
93
96
  const { className, children, asChild, ...rest } = props;
94
97
  const Component = asChild ? Slot.Root : "div";
95
98
  const { styles } = useCardContext();
96
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.header({ className }), ...rest, children });
99
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
+ Component,
101
+ {
102
+ "data-slot": "card-header",
103
+ className: styles.header({ className }),
104
+ ...rest,
105
+ children
106
+ }
107
+ );
97
108
  }
98
109
  function CardBody(props) {
99
110
  const { className, children, asChild, ...rest } = props;
100
111
  const Component = asChild ? Slot.Root : "div";
101
112
  const { styles } = useCardContext();
102
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.body({ className }), ...rest, children });
113
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
114
+ Component,
115
+ {
116
+ className: styles.body({ className }),
117
+ "data-slot": "card-body",
118
+ ...rest,
119
+ children
120
+ }
121
+ );
103
122
  }
104
123
  function CardFooter(props) {
105
124
  const { className, children, asChild, ...rest } = props;
@@ -107,10 +126,34 @@ function CardFooter(props) {
107
126
  const { styles } = useCardContext();
108
127
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { className: styles.footer({ className }), ...rest, children });
109
128
  }
129
+ function CardHeading({ className, ...props }) {
130
+ const { styles } = useCardContext();
131
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
132
+ "div",
133
+ {
134
+ "data-slot": "card-heading",
135
+ className: (0, import_shared_utils.cn)(styles.heading(), className),
136
+ ...props
137
+ }
138
+ );
139
+ }
140
+ function CardToolbar({ className, ...props }) {
141
+ const { styles } = useCardContext();
142
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
143
+ "div",
144
+ {
145
+ "data-slot": "card-toolbar",
146
+ className: (0, import_shared_utils.cn)(styles.toolbar(), className),
147
+ ...props
148
+ }
149
+ );
150
+ }
110
151
  // Annotate the CommonJS export names for ESM import in node:
111
152
  0 && (module.exports = {
112
153
  Body,
113
154
  Footer,
114
155
  Header,
115
- Root
156
+ Heading,
157
+ Root,
158
+ Toolbar
116
159
  });
@@ -1,14 +1,18 @@
1
1
  "use client";
2
- import "./chunk-6LOHEW6B.mjs";
2
+ import "./chunk-BZFCKMXJ.mjs";
3
3
  import {
4
4
  CardBody,
5
5
  CardFooter,
6
6
  CardHeader,
7
- CardRoot
8
- } from "./chunk-QJLYPGLR.mjs";
7
+ CardHeading,
8
+ CardRoot,
9
+ CardToolbar
10
+ } from "./chunk-4TZ4CO7Q.mjs";
9
11
  export {
10
12
  CardBody as Body,
11
13
  CardFooter as Footer,
12
14
  CardHeader as Header,
13
- CardRoot as Root
15
+ CardHeading as Heading,
16
+ CardRoot as Root,
17
+ CardToolbar as Toolbar
14
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kopexa/card",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "A card to be used as container",
5
5
  "keywords": [
6
6
  "card"
@@ -28,7 +28,7 @@
28
28
  "motion": ">=12.23.6",
29
29
  "react": ">=19.0.0-rc.0",
30
30
  "react-dom": ">=19.0.0-rc.0",
31
- "@kopexa/theme": "2.0.0"
31
+ "@kopexa/theme": "2.1.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "@radix-ui/react-slot": "^1.2.3",