@jamsrui/card 0.0.12 → 0.0.14

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,26 +1,15 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Text } from '@jamsrui/text';
3
- import { PropGetter, UIProps, SlotsToClassNames } from '@jamsrui/utils';
2
+ import { PropGetter, UIProps } from '@jamsrui/utils';
4
3
  import { CardContent } from './card-content.mjs';
5
4
  import { CardDescription } from './card-description.mjs';
6
5
  import { CardFooter } from './card-footer.mjs';
7
6
  import { CardHeader } from './card-header.mjs';
8
- import { CardHeaderContent } from './card-header-content.mjs';
9
7
  import { CardTitle } from './card-title.mjs';
10
- import { CardVariants, CardSlots } from './styles.mjs';
8
+ import { CardVariants } from './styles.mjs';
11
9
 
12
10
  declare const useCard: (props: useCard.Props) => {
13
- slotProps: {
14
- header?: CardHeader.Props;
15
- headerContent?: CardHeader.Props;
16
- title?: Text.Props;
17
- description?: Text.Props;
18
- content?: CardContent.Props;
19
- footer?: CardFooter.Props;
20
- } | undefined;
21
11
  getRootProps: PropGetter<Card.Props>;
22
12
  getHeaderProps: PropGetter<CardHeader.Props>;
23
- getHeaderContentProps: PropGetter<CardHeaderContent.Props>;
24
13
  getTitleProps: PropGetter<CardTitle.Props>;
25
14
  getDescriptionProps: PropGetter<CardDescription.Props>;
26
15
  getContentProps: PropGetter<CardContent.Props>;
@@ -28,15 +17,6 @@ declare const useCard: (props: useCard.Props) => {
28
17
  };
29
18
  declare namespace useCard {
30
19
  interface Props extends UIProps<"div">, CardVariants {
31
- classNames?: SlotsToClassNames<CardSlots>;
32
- slotProps?: {
33
- header?: CardHeader.Props;
34
- headerContent?: CardHeader.Props;
35
- title?: Text.Props;
36
- description?: Text.Props;
37
- content?: CardContent.Props;
38
- footer?: CardFooter.Props;
39
- };
40
20
  }
41
21
  }
42
22
 
@@ -1,15 +1,14 @@
1
- import { C as Card } from './card-B-x30v8R.mjs';
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { GlobalConfigProps } from '@jamsrui/core';
3
+ import { C as Card } from './card-c7opxkqe.mjs';
4
+ import '@jamsrui/utils';
4
5
  import './card-content.mjs';
6
+ import 'react';
5
7
  import './card-description.mjs';
8
+ import '@jamsrui/text';
6
9
  import './card-footer.mjs';
7
10
  import './card-header.mjs';
8
11
  import './card-title.mjs';
9
- import '@jamsrui/text';
10
- import '@jamsrui/utils';
11
- import './card-header-content.mjs';
12
- import 'react';
13
12
  import './styles.mjs';
14
13
 
15
14
  declare const useCardConfig: () => CardConfig.Props;
@@ -1 +1 @@
1
- import{a,b}from"./chunk-HPZIIMR4.mjs";export{a as CardConfig,b as useCardConfig};
1
+ "use client";import{createConfigContext as o}from"@jamsrui/utils";const[e,a]=o({displayName:"CardConfigContext"});export{e as CardConfig,a as useCardConfig};
@@ -1 +1 @@
1
- import{a}from"./chunk-YUKB7KCD.mjs";import"./chunk-PRVJXBBM.mjs";export{a as CardContent};
1
+ "use client";import{useRenderElement as r}from"@jamsrui/hooks";import{useCardContext as n}from"./card-context.mjs";const m=e=>{const{getContentProps:t}=n();return r("div",{props:t(e)})};export{m as CardContent};
@@ -1,13 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { u as useCard } from './card-B-x30v8R.mjs';
3
- import '@jamsrui/text';
2
+ import { u as useCard } from './card-c7opxkqe.mjs';
4
3
  import '@jamsrui/utils';
5
4
  import './card-content.mjs';
6
5
  import 'react';
7
6
  import './card-description.mjs';
7
+ import '@jamsrui/text';
8
8
  import './card-footer.mjs';
9
9
  import './card-header.mjs';
10
- import './card-header-content.mjs';
11
10
  import './card-title.mjs';
12
11
  import './styles.mjs';
13
12
 
@@ -1 +1 @@
1
- import{a,b}from"./chunk-PRVJXBBM.mjs";export{a as CardContextProvider,b as useCardContext};
1
+ "use client";import{jsx as C}from"react/jsx-runtime";import{createContext as n,use as a}from"react";const t=n(null),c=e=>{const{children:r,ctx:o}=e;return C(t,{value:o,children:r})},s=()=>{const e=a(t);if(!e)throw new Error("useCardContext must be used within a CardProvider");return e};export{c as CardContextProvider,s as useCardContext};
@@ -1 +1 @@
1
- import{a}from"./chunk-RHOMM74N.mjs";import"./chunk-PRVJXBBM.mjs";export{a as CardDescription};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{Text as n}from"@jamsrui/text";import{useCardContext as s}from"./card-context.mjs";const d=r=>{const{children:t,...o}=r,{getDescriptionProps:p}=s();return e(n,{render:e("p",{}),...p(o),children:t})};export{d as CardDescription};
@@ -1 +1 @@
1
- import{a}from"./chunk-HE3WEAZV.mjs";import"./chunk-PRVJXBBM.mjs";export{a as CardFooter};
1
+ "use client";import{useRenderElement as o}from"@jamsrui/hooks";import{useCardContext as t}from"./card-context.mjs";const m=e=>{const{getFooterProps:r}=t();return o("div",{props:r(e)})};export{m as CardFooter};
@@ -4,8 +4,6 @@ import { UIProps } from '@jamsrui/utils';
4
4
  declare const CardHeader: (props: CardHeader.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
5
  declare namespace CardHeader {
6
6
  interface Props extends UIProps<"div"> {
7
- startContent?: React.ReactNode;
8
- endContent?: React.ReactNode;
9
7
  }
10
8
  }
11
9
 
@@ -1 +1 @@
1
- import{a}from"./chunk-57UC5TIQ.mjs";import"./chunk-RF72LOBZ.mjs";import"./chunk-PRVJXBBM.mjs";export{a as CardHeader};
1
+ "use client";import{useRenderElement as t}from"@jamsrui/hooks";import{useCardContext as o}from"./card-context.mjs";const d=e=>{const{getHeaderProps:r}=o();return t("div",{props:[r(e)]})};export{d as CardHeader};
@@ -1 +1 @@
1
- import{a}from"./chunk-FZEQ46ZM.mjs";import"./chunk-PRVJXBBM.mjs";export{a as CardTitle};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{Text as n}from"@jamsrui/text";import{useCardContext as s}from"./card-context.mjs";const d=e=>{const{children:r}=e,{getTitleProps:o}=s();return t(n,{render:t("h3",{}),...o(e),children:r})};export{d as CardTitle};
package/dist/card.d.mts CHANGED
@@ -1,12 +1,11 @@
1
1
  import 'react/jsx-runtime';
2
- export { C as Card } from './card-B-x30v8R.mjs';
3
- import '@jamsrui/text';
2
+ export { C as Card } from './card-c7opxkqe.mjs';
4
3
  import '@jamsrui/utils';
5
4
  import './card-content.mjs';
6
5
  import 'react';
7
6
  import './card-description.mjs';
7
+ import '@jamsrui/text';
8
8
  import './card-footer.mjs';
9
9
  import './card-header.mjs';
10
- import './card-header-content.mjs';
11
10
  import './card-title.mjs';
12
11
  import './styles.mjs';
package/dist/card.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-RSO5OMY4.mjs";import"./chunk-4GB2CE7L.mjs";import"./chunk-3NFQCBR5.mjs";import"./chunk-HPZIIMR4.mjs";import"./chunk-PRVJXBBM.mjs";export{a as Card};
1
+ "use client";import{jsx as C}from"react/jsx-runtime";import{useRenderElement as s}from"@jamsrui/hooks";import{mergeConfigProps as p}from"@jamsrui/utils";import{useCardConfig as d}from"./card-config.mjs";import{CardContextProvider as m}from"./card-context.mjs";import{useCard as i}from"./use-card.mjs";const g=e=>{const r=d(),t=p(r,r,e),o=i(t),n=s("div",{props:o.getRootProps({})});return C(m,{ctx:o,children:n})};export{g as Card};
package/dist/index.d.mts CHANGED
@@ -1,14 +1,23 @@
1
- export { C as Card } from './card-B-x30v8R.mjs';
1
+ import * as react from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { C as Card$1 } from './card-c7opxkqe.mjs';
2
4
  export { CardConfig, useCardConfig } from './card-config.mjs';
3
- export { CardContent } from './card-content.mjs';
4
- export { CardDescription } from './card-description.mjs';
5
- export { CardFooter } from './card-footer.mjs';
6
- export { CardHeader } from './card-header.mjs';
7
- export { CardTitle } from './card-title.mjs';
8
- import 'react/jsx-runtime';
9
- import '@jamsrui/text';
5
+ import { CardContent } from './card-content.mjs';
6
+ import { CardDescription } from './card-description.mjs';
7
+ import { CardFooter } from './card-footer.mjs';
8
+ import { CardHeader } from './card-header.mjs';
9
+ import { CardTitle } from './card-title.mjs';
10
10
  import '@jamsrui/utils';
11
- import './card-header-content.mjs';
12
- import 'react';
13
11
  import './styles.mjs';
14
12
  import '@jamsrui/core';
13
+ import '@jamsrui/text';
14
+
15
+ declare const Card: ((props: Card$1.Props) => react_jsx_runtime.JSX.Element) & {
16
+ Content: (props: CardContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
17
+ Description: (props: CardDescription.Props) => react_jsx_runtime.JSX.Element;
18
+ Footer: (props: CardFooter.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
19
+ Header: (props: CardHeader.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
20
+ Title: (props: CardTitle.Props) => react_jsx_runtime.JSX.Element;
21
+ };
22
+
23
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{a as f}from"./chunk-RSO5OMY4.mjs";import"./chunk-4GB2CE7L.mjs";import"./chunk-3NFQCBR5.mjs";import{a as r,b as o}from"./chunk-HPZIIMR4.mjs";import{a as e}from"./chunk-YUKB7KCD.mjs";import{a as t}from"./chunk-RHOMM74N.mjs";import{a as C}from"./chunk-HE3WEAZV.mjs";import{a}from"./chunk-57UC5TIQ.mjs";import"./chunk-RF72LOBZ.mjs";import{a as d}from"./chunk-FZEQ46ZM.mjs";import"./chunk-PRVJXBBM.mjs";export{f as Card,r as CardConfig,e as CardContent,t as CardDescription,C as CardFooter,a as CardHeader,d as CardTitle,o as useCardConfig};
1
+ import{Card as a}from"./card.mjs";import{CardConfig as m,useCardConfig as C}from"./card-config.mjs";import{CardContent as r}from"./card-content.mjs";import{CardDescription as o}from"./card-description.mjs";import{CardFooter as t}from"./card-footer.mjs";import{CardHeader as e}from"./card-header.mjs";import{CardTitle as i}from"./card-title.mjs";const l=Object.assign(a,{Content:r,Description:o,Footer:t,Header:e,Title:i});export{l as Card,m as CardConfig,r as CardContent,o as CardDescription,t as CardFooter,e as CardHeader,i as CardTitle,C as useCardConfig};
package/dist/styles.d.mts CHANGED
@@ -29,7 +29,6 @@ declare const cardVariants: _jamsrui_utils.TVReturnType<{
29
29
  }, {
30
30
  root: string;
31
31
  header: string;
32
- headerContent: string;
33
32
  title: string;
34
33
  description: string;
35
34
  footer: string;
@@ -62,7 +61,6 @@ declare const cardVariants: _jamsrui_utils.TVReturnType<{
62
61
  }, {
63
62
  root: string;
64
63
  header: string;
65
- headerContent: string;
66
64
  title: string;
67
65
  description: string;
68
66
  footer: string;
@@ -95,7 +93,6 @@ declare const cardVariants: _jamsrui_utils.TVReturnType<{
95
93
  }, {
96
94
  root: string;
97
95
  header: string;
98
- headerContent: string;
99
96
  title: string;
100
97
  description: string;
101
98
  footer: string;
package/dist/styles.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-3NFQCBR5.mjs";export{a as cardVariants};
1
+ import{radiusVariant as r,tv as t}from"@jamsrui/utils";const e=t({slots:{root:"card card__root relative flex flex-col overflow-hidden transition-colors",header:"card__header relative flex flex-col gap-1 px-4 pt-4",title:"card__title font-medium",description:"card__description text-foreground-secondary",footer:"card__footer flex justify-end gap-2 px-4 pb-4",content:"card__content h-full p-4"},variants:{bg:{default:{root:"bg-surface"},secondary:{root:"bg-surface"}},isBordered:{true:"border border-divider-dark"},isElevated:{true:"shadow-sm"},radius:r("root","card")},defaultVariants:{bg:"default",variant:"solid",radius:"md"}});export{e as cardVariants};
@@ -1,12 +1,11 @@
1
- import '@jamsrui/text';
2
1
  import '@jamsrui/utils';
3
- export { u as useCard } from './card-B-x30v8R.mjs';
2
+ export { u as useCard } from './card-c7opxkqe.mjs';
4
3
  import './card-content.mjs';
5
4
  import './card-description.mjs';
6
5
  import './card-footer.mjs';
7
6
  import './card-header.mjs';
8
- import './card-header-content.mjs';
9
7
  import './card-title.mjs';
10
8
  import './styles.mjs';
11
9
  import 'react/jsx-runtime';
12
10
  import 'react';
11
+ import '@jamsrui/text';
package/dist/use-card.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-4GB2CE7L.mjs";import"./chunk-3NFQCBR5.mjs";export{a as useCard};
1
+ import{useCallback as a,useMemo as N}from"react";import{cn as f,dataAttrDev as e,mapPropsVariants as y}from"@jamsrui/utils";import{cardVariants as i}from"./styles.mjs";const v=l=>{const[P,C]=y(l,i.variantKeys),r=i(C),{...o}=P,s=a(()=>({"data-slot":e("root"),...o,className:r.root({className:f(o.className)})}),[o,r]),c=a(t=>({"data-slot":e("header"),...t,className:r.header({className:t.className})}),[r]),p=a(t=>({"data-slot":e("title"),...t,className:r.title({className:t.className}),variant:"h5"}),[r]),m=a(t=>({"data-slot":e("description"),variant:"caption",...t,className:r.description({className:t.className})}),[r]),n=a(t=>({"data-slot":e("content"),...t,className:r.content({className:t.className})}),[r]),d=a(t=>({"data-slot":e("footer"),...t,className:r.footer({className:t.className})}),[r]);return N(()=>({getRootProps:s,getHeaderProps:c,getTitleProps:p,getDescriptionProps:m,getContentProps:n,getFooterProps:d}),[n,m,d,c,s,p])};export{v as useCard};
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@jamsrui/card",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "peerDependencies": {
5
5
  "react": ">=19"
6
6
  },
7
7
  "dependencies": {
8
- "@jamsrui/hooks": "^0.0.12",
9
- "@jamsrui/utils": "^0.0.12",
10
- "@jamsrui/core": "^0.0.10",
11
- "@jamsrui/text": "^0.0.12"
8
+ "@jamsrui/hooks": "^0.0.14",
9
+ "@jamsrui/utils": "^0.0.14",
10
+ "@jamsrui/core": "^0.0.12",
11
+ "@jamsrui/text": "^0.0.14"
12
12
  },
13
13
  "exports": {
14
14
  ".": {
@@ -1,10 +0,0 @@
1
- import * as react from 'react';
2
- import { UIProps } from '@jamsrui/utils';
3
-
4
- declare const CardHeaderContent: (props: CardHeaderContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
- declare namespace CardHeaderContent {
6
- interface Props extends UIProps<"div"> {
7
- }
8
- }
9
-
10
- export { CardHeaderContent };
@@ -1 +0,0 @@
1
- import{a}from"./chunk-RF72LOBZ.mjs";import"./chunk-PRVJXBBM.mjs";export{a as CardHeaderContent};
@@ -1 +0,0 @@
1
- import{radiusVariant as r,tv as e}from"@jamsrui/utils";var a=e({slots:{root:"relative flex flex-col overflow-hidden transition-colo",header:"relative flex items-center gap-2 px-4 pt-4",headerContent:"flex flex-col grow gap-1",title:"font-medium",description:"text-foreground-secondary",footer:"flex justify-end gap-2 px-4 pb-4",content:"h-full p-4"},variants:{bg:{default:{root:"bg-surface"},secondary:{root:"bg-surface"}},isBordered:{true:"border border-divider-dark"},isElevated:{true:"shadow-sm"},radius:r("root")},defaultVariants:{bg:"default",variant:"solid",radius:"md"}});export{a};
@@ -1 +0,0 @@
1
- import{a as s}from"./chunk-3NFQCBR5.mjs";import{useCallback as r}from"react";import{cn as h,dataAttrDev as a,mapPropsVariants as u}from"@jamsrui/utils";var T=n=>{let[p,c]=u(n,s.variantKeys),e=s(c),{classNames:d,slotProps:m,...o}=p,l=r(()=>({"data-slot":a("root"),...o,className:e.root({className:h(d?.root,o.className)})}),[o,d?.root,e]),i=r(t=>({"data-slot":a("header"),...t,className:e.header({className:t.className})}),[e]),C=r(t=>({"data-slot":a("title"),...t,className:e.title({className:t.className}),variant:"h5"}),[e]),P=r(t=>({"data-slot":a("description"),variant:"caption",...t,className:e.description({className:t.className})}),[e]),N=r(t=>({"data-slot":a("header-content"),...t,className:e.headerContent({className:t.className})}),[e]),f=r(t=>({"data-slot":a("content"),...t,className:e.content({className:t.className})}),[e]),y=r(t=>({"data-slot":a("footer"),...t,className:e.footer({className:t.className})}),[e]);return{slotProps:m,getRootProps:l,getHeaderProps:i,getHeaderContentProps:N,getTitleProps:C,getDescriptionProps:P,getContentProps:f,getFooterProps:y}};export{T as a};
@@ -1 +0,0 @@
1
- import{a as r}from"./chunk-RF72LOBZ.mjs";import{b as e}from"./chunk-PRVJXBBM.mjs";import{useRenderElement as C}from"@jamsrui/hooks";import{mergeProps as c}from"@jamsrui/utils";import{Fragment as l,jsx as i,jsxs as P}from"react/jsx-runtime";var x=t=>{let{getHeaderProps:o,slotProps:n}=e(),{startContent:d,endContent:s,children:a,...p}=c(n?.header??{},t),m=P(l,{children:[d,i(r,{children:a}),s]});return C("div",{props:[o(p),{children:m}]})};export{x as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-PRVJXBBM.mjs";import{Text as i}from"@jamsrui/text";import{mergeProps as l}from"@jamsrui/utils";import{jsx as r}from"react/jsx-runtime";var P=t=>{let{getTitleProps:o,slotProps:p}=e(),{children:s,...n}=l(p?.title??{},t);return r(i,{render:r("h3",{}),...o(n),children:s})};export{P as a};
@@ -1 +0,0 @@
1
- import{b as r}from"./chunk-PRVJXBBM.mjs";import{useRenderElement as p}from"@jamsrui/hooks";import{mergeProps as m}from"@jamsrui/utils";var P=e=>{let{getFooterProps:o,slotProps:t}=r(),s=m(t?.footer??{},e);return p("div",{props:o(s)})};export{P as a};
@@ -1 +0,0 @@
1
- import{createConfigContext as o}from"@jamsrui/utils";var[a,e]=o({displayName:"CardConfigContext"});export{a,e as b};
@@ -1 +0,0 @@
1
- import{createContext as n,use as a}from"react";import{jsx as C}from"react/jsx-runtime";var t=n(null),x=e=>{let{children:r,ctx:o}=e;return C(t,{value:o,children:r})},c=()=>{let e=a(t);if(!e)throw new Error("useCardContext must be used within a CardProvider");return e};export{x as a,c as b};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-PRVJXBBM.mjs";import{useRenderElement as s}from"@jamsrui/hooks";import{mergeProps as p}from"@jamsrui/utils";var i=r=>{let{getHeaderContentProps:t,slotProps:o}=e(),n=p(o?.headerContent??{},r);return s("div",{props:t(n)})};export{i as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-PRVJXBBM.mjs";import{Text as s}from"@jamsrui/text";import{jsx as r}from"react/jsx-runtime";var d=o=>{let{children:t,...p}=o,{getDescriptionProps:n}=e();return r(s,{render:r("p",{}),...n(p),children:t})};export{d as a};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk-4GB2CE7L.mjs";import{b as e}from"./chunk-HPZIIMR4.mjs";import{a as t}from"./chunk-PRVJXBBM.mjs";import{useRenderElement as m}from"@jamsrui/hooks";import{mergeConfigProps as C}from"@jamsrui/utils";import{jsx as i}from"react/jsx-runtime";var g=p=>{let r=e(),s=C(r,r,p),o=n(s),d=m("div",{props:o.getRootProps({})});return i(t,{ctx:o,children:d})};export{g as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-PRVJXBBM.mjs";import{useRenderElement as s}from"@jamsrui/hooks";import{mergeProps as p}from"@jamsrui/utils";var a=r=>{let{getContentProps:t,slotProps:o}=e(),n=p(o?.content??{},r);return s("div",{props:t(n)})};export{a};