@cleartrip/ct-design-card 4.0.0 → 4.1.0-SNAPSHOT-native-main.1
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/README.md +121 -0
- package/dist/Card.d.ts +3 -4
- package/dist/Card.d.ts.map +1 -1
- package/dist/Card.native.d.ts +4 -0
- package/dist/Card.native.d.ts.map +1 -0
- package/dist/constants.d.ts +43 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/ct-design-card.browser.cjs.js +1 -1
- package/dist/ct-design-card.browser.cjs.js.map +1 -1
- package/dist/ct-design-card.browser.esm.js +1 -1
- package/dist/ct-design-card.browser.esm.js.map +1 -1
- package/dist/ct-design-card.cjs.js +79 -133
- package/dist/ct-design-card.cjs.js.map +1 -1
- package/dist/ct-design-card.esm.js +78 -127
- package/dist/ct-design-card.esm.js.map +1 -1
- package/dist/ct-design-card.umd.js +81 -173
- package/dist/ct-design-card.umd.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.native.d.ts +4 -0
- package/dist/index.native.d.ts.map +1 -0
- package/dist/style.d.ts +46 -125
- package/dist/style.d.ts.map +1 -1
- package/dist/type.d.ts +30 -39
- package/dist/type.d.ts.map +1 -1
- package/package.json +26 -8
- package/src/Card.native.tsx +68 -0
- package/src/Card.tsx +18 -0
- package/src/constants.ts +50 -0
- package/src/index.native.ts +3 -0
- package/src/index.ts +4 -0
- package/src/style.ts +174 -0
- package/src/type.ts +118 -0
- package/dist/StyledCard/style.d.ts +0 -4
- package/dist/StyledCard/style.d.ts.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
A container component that displays content in a card-like layout with elevation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @cleartrip/ct-design-card
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @cleartrip/ct-design-card
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Peer dependencies
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Required for all targets
|
|
19
|
+
npm install react
|
|
20
|
+
|
|
21
|
+
# Web only
|
|
22
|
+
npm install react-dom
|
|
23
|
+
|
|
24
|
+
# React Native only
|
|
25
|
+
npm install react-native
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### Basic
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Card } from '@cleartrip/ct-design-card';
|
|
36
|
+
|
|
37
|
+
function Example() {
|
|
38
|
+
return (
|
|
39
|
+
<Card>
|
|
40
|
+
{/* Basic usage */}
|
|
41
|
+
</Card>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Props
|
|
49
|
+
|
|
50
|
+
| Prop | Type | Default | Required | Description |
|
|
51
|
+
|------|------|---------|----------|-------------|
|
|
52
|
+
| `borderWidth` | `CardBorderWidthType` | — | No | Set border width of card. Defaults to 'md'. |
|
|
53
|
+
| `cornerRadius` | `CardRadiusType` | — | No | Set the radius of card corners. Defaults to 'md'. |
|
|
54
|
+
| `showShadow` | `boolean` | — | No | Show shadow on the card. Defaults to true. |
|
|
55
|
+
| `shadowDirection` | `CardShadowDirectionType` | — | No | Direction of the shadow. Defaults to 'top' (web only — RN uses standard |
|
|
56
|
+
| `shadowVariant` | `CardShadowVariantType` | — | No | Variant of the shadow. Maps to the theme elevation tokens. Defaults to |
|
|
57
|
+
| `borderDirection` | `CardBorderDirectionType` | — | No | Direction of the border. Defaults to 'default' (all sides). |
|
|
58
|
+
| `noBorder` | `boolean` | — | No | When true, skips rendering the border but keeps the rounded corners. |
|
|
59
|
+
| `children` | `ReactNode` | — | No | Content rendered inside the card. |
|
|
60
|
+
| `styleConfig` | `ICardStyleConfig` | — | No | Style configuration overrides for the root container. |
|
|
61
|
+
| `onClick` | `IContainer['onClick']` | — | No | Callback fired when the card is clicked or pressed. |
|
|
62
|
+
| `onLayout` | `IContainer['onLayout']` | — | No | Callback fired when the card is layout changed. |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## CardRadius
|
|
67
|
+
|
|
68
|
+
- `NONE` — none
|
|
69
|
+
- `SMALL` — sm
|
|
70
|
+
- `MEDIUM` — md
|
|
71
|
+
- `LARGE` — lg
|
|
72
|
+
- `EXTRA_LARGE` — xl
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## CardBorderWidth
|
|
76
|
+
|
|
77
|
+
- `NONE` — none
|
|
78
|
+
- `SMALL` — sm
|
|
79
|
+
- `MEDIUM` — md
|
|
80
|
+
- `LARGE` — lg
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## CardShadowDirection
|
|
84
|
+
|
|
85
|
+
- `TOP` — top
|
|
86
|
+
- `BOTTOM` — bottom
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## CardShadowVariant
|
|
90
|
+
|
|
91
|
+
- `E1` — E1
|
|
92
|
+
- `E2` — E2
|
|
93
|
+
- `E3` — E3
|
|
94
|
+
- `E4` — E4
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## CardBorderDirection
|
|
98
|
+
|
|
99
|
+
- `TOP` — top
|
|
100
|
+
- `BOTTOM` — bottom
|
|
101
|
+
- `LEFT` — left
|
|
102
|
+
- `RIGHT` — right
|
|
103
|
+
- `DEFAULT` — default
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Accessibility
|
|
107
|
+
|
|
108
|
+
- The component follows accessibility best practices
|
|
109
|
+
- Ensure proper ARIA attributes are provided where needed
|
|
110
|
+
- Test with screen readers to ensure usability
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Migration
|
|
115
|
+
|
|
116
|
+
If migrating from a previous version:
|
|
117
|
+
|
|
118
|
+
```diff
|
|
119
|
+
- import { Card } from 'yagami/core/components';
|
|
120
|
+
+ import { Card } from '@cleartrip/ct-design-card';
|
|
121
|
+
```
|
package/dist/Card.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare const Card: PolymorphicCard;
|
|
1
|
+
import { ContainerRef } from '@cleartrip/ct-design-container';
|
|
2
|
+
import { ICardProps } from './type';
|
|
3
|
+
declare const Card: import("react").ForwardRefExoticComponent<ICardProps & import("react").RefAttributes<ContainerRef>>;
|
|
5
4
|
export default Card;
|
|
6
5
|
//# sourceMappingURL=Card.d.ts.map
|
package/dist/Card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../packages/components/Card/src/Card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../packages/components/Card/src/Card.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,QAAA,MAAM,IAAI,qGAQR,CAAC;AAGH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.native.d.ts","sourceRoot":"","sources":["../packages/components/Card/src/Card.native.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAOzE,QAAA,MAAM,IAAI,sHAsDT,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare enum CardSize {
|
|
2
|
+
NONE = "none",
|
|
3
|
+
SMALL = "sm",
|
|
4
|
+
MEDIUM = "md",
|
|
5
|
+
LARGE = "lg",
|
|
6
|
+
EXTRA_LARGE = "xl"
|
|
7
|
+
}
|
|
8
|
+
export declare enum CardRadius {
|
|
9
|
+
NONE = "none",
|
|
10
|
+
SMALL = "sm",
|
|
11
|
+
MEDIUM = "md",
|
|
12
|
+
LARGE = "lg",
|
|
13
|
+
EXTRA_LARGE = "xl"
|
|
14
|
+
}
|
|
15
|
+
export declare enum CardBorderWidth {
|
|
16
|
+
NONE = "none",
|
|
17
|
+
SMALL = "sm",
|
|
18
|
+
MEDIUM = "md",
|
|
19
|
+
LARGE = "lg"
|
|
20
|
+
}
|
|
21
|
+
export declare enum CardShadowDirection {
|
|
22
|
+
TOP = "top",
|
|
23
|
+
BOTTOM = "bottom"
|
|
24
|
+
}
|
|
25
|
+
export declare enum CardShadowVariant {
|
|
26
|
+
E1 = "E1",
|
|
27
|
+
E2 = "E2",
|
|
28
|
+
E3 = "E3",
|
|
29
|
+
E4 = "E4"
|
|
30
|
+
}
|
|
31
|
+
export declare enum CardBorderDirection {
|
|
32
|
+
TOP = "top",
|
|
33
|
+
BOTTOM = "bottom",
|
|
34
|
+
LEFT = "left",
|
|
35
|
+
RIGHT = "right",
|
|
36
|
+
DEFAULT = "default"
|
|
37
|
+
}
|
|
38
|
+
export declare const CardBorderColors: {
|
|
39
|
+
readonly PRIMARY: string;
|
|
40
|
+
readonly SECONDARY: string;
|
|
41
|
+
readonly TERTIARY: string;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../packages/components/Card/src/constants.ts"],"names":[],"mappings":"AAEA,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,KAAK,OAAO;IACZ,MAAM,OAAO;IACb,KAAK,OAAO;IACZ,WAAW,OAAO;CACnB;AAED,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,KAAK,OAAO;IACZ,MAAM,OAAO;IACb,KAAK,OAAO;IACZ,WAAW,OAAO;CACnB;AAED,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,KAAK,OAAO;IACZ,MAAM,OAAO;IACb,KAAK,OAAO;CACb;AAED,oBAAY,mBAAmB;IAC7B,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED,oBAAY,iBAAiB;IAC3B,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED,oBAAY,mBAAmB;IAC7B,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r=require("
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime"),e=require("react"),o=require("@cleartrip/ct-design-container"),d=require("@cleartrip/ct-design-tokens");const t=e.forwardRef(({children:e,styleConfig:d,onClick:t},s)=>{const{root:a=[]}=d||{};return r.jsx(o.Container,{ref:s,onClick:t,styleConfig:{root:[...a]},children:e})});var s,a,i,n,c,u;t.displayName="Card",exports.CardSize=void 0,(s=exports.CardSize||(exports.CardSize={})).NONE="none",s.SMALL="sm",s.MEDIUM="md",s.LARGE="lg",s.EXTRA_LARGE="xl",exports.CardRadius=void 0,(a=exports.CardRadius||(exports.CardRadius={})).NONE="none",a.SMALL="sm",a.MEDIUM="md",a.LARGE="lg",a.EXTRA_LARGE="xl",exports.CardBorderWidth=void 0,(i=exports.CardBorderWidth||(exports.CardBorderWidth={})).NONE="none",i.SMALL="sm",i.MEDIUM="md",i.LARGE="lg",exports.CardShadowDirection=void 0,(n=exports.CardShadowDirection||(exports.CardShadowDirection={})).TOP="top",n.BOTTOM="bottom",exports.CardShadowVariant=void 0,(c=exports.CardShadowVariant||(exports.CardShadowVariant={})).E1="E1",c.E2="E2",c.E3="E3",c.E4="E4",exports.CardBorderDirection=void 0,(u=exports.CardBorderDirection||(exports.CardBorderDirection={})).TOP="top",u.BOTTOM="bottom",u.LEFT="left",u.RIGHT="right",u.DEFAULT="default";const l={PRIMARY:d.colors.black,SECONDARY:d.colors.success,TERTIARY:d.colors.warning},C=(r,e)=>{switch(r){case exports.CardSize.NONE:return e.border.radius[0];case exports.CardSize.SMALL:return e.border.radius[6];case exports.CardSize.MEDIUM:return e.border.radius[8];case exports.CardSize.LARGE:return e.border.radius[12];case exports.CardSize.EXTRA_LARGE:return e.border.radius[16];default:return e.border.radius[8]}},p=(r,e)=>{switch(r){case exports.CardSize.NONE:return e.border.width.none;case exports.CardSize.SMALL:return e.border.width.sm;case exports.CardSize.MEDIUM:return e.border.width.md;case exports.CardSize.LARGE:return e.border.width.lg;default:return e.border.width.md}},b=(r,e,o,d)=>({borderWidth:e,borderStyle:o,borderColor:d}),x=(r,e,o,d,t,s)=>{const a=C(e,t),i=t.border.style.solid,n=p(r,t),c=b(0,n,i,d);return s?{borderRadius:a}:Object.assign({borderRadius:a},c)};exports.Card=t,exports.CardBorderColors=l,exports.getBorderDirectionStyles=b,exports.getCardBorderRadius=C,exports.getCardBorderStyles=x,exports.getCardBorderWidth=p,exports.getCardStyles=({borderColor:r,cornerRadius:e,borderWidth:o,showShadow:d,shadowColor:t,shadowOffset:s,shadowOpacity:a,elevation:i,borderDirection:n,theme:c})=>{const u=d?{shadowColor:t,shadowOffset:s,shadowOpacity:a,shadowRadius:2,elevation:i}:{},l=x(o,e,0,r,c);return Object.assign(Object.assign({},u),l)},exports.getDefaultCardStyles=(r,e)=>{switch(e){case exports.CardSize.LARGE:return{height:r.size[12],borderRadius:r.border.radius[24],borderStyle:r.border.style.solid};case exports.CardSize.MEDIUM:return{height:r.size[10],borderRadius:r.border.radius[20],borderStyle:r.border.style.solid};case exports.CardSize.SMALL:return{height:r.size[8],borderRadius:r.border.radius[16],borderStyle:r.border.style.solid};default:return{height:r.size[10],borderRadius:r.border.radius[20],borderStyle:r.border.style.solid}}};
|
|
2
2
|
//# sourceMappingURL=ct-design-card.browser.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-design-card.browser.cjs.js","sources":["../packages/components/Card/src/
|
|
1
|
+
{"version":3,"file":"ct-design-card.browser.cjs.js","sources":["../packages/components/Card/src/Card.tsx","../packages/components/Card/src/constants.ts","../packages/components/Card/src/style.ts"],"sourcesContent":[null,null,null],"names":["Card","forwardRef","children","styleConfig","onClick","forwardedRef","root","_jsx","Container","ref","CardSize","CardRadius","CardBorderWidth","CardShadowDirection","CardShadowVariant","CardBorderDirection","displayName","CardBorderColors","PRIMARY","colors","black","SECONDARY","success","TERTIARY","warning","getCardBorderRadius","cornerRadius","theme","NONE","border","radius","SMALL","MEDIUM","LARGE","EXTRA_LARGE","getCardBorderWidth","borderWidth","width","none","sm","md","lg","getBorderDirectionStyles","_borderDirection","borderStyle","borderColor","getCardBorderStyles","cardBorderWidth","borderDirection","noBorder","borderRadius","style","solid","Object","assign","showShadow","shadowColor","shadowOffset","shadowOpacity","elevation","shadowStyles","shadowRadius","borderStyles","size","height"],"mappings":"wJAMA,MAAMA,EAAOC,EAAUA,WAA2B,EAAGC,WAAUC,cAAaC,WAAWC,KACrF,MAAMC,KAAEA,EAAO,IAAOH,GAAe,CAAA,EAErC,OACEI,EAAAA,IAACC,EAAAA,UAAU,CAAAC,IAAKJ,EAAcD,QAASA,EAASD,YAAa,CAAEG,KAAM,IAAIA,IACtEJ,SAAAA,MCTP,IAAYQ,EAQAC,EAQAC,EAOAC,EAKAC,EAOAC,EDrBZf,EAAKgB,YAAc,OCdPN,QAMXA,cAAA,GANWA,EAAAA,mBAAAA,QAAAA,SAMX,CAAA,IALC,KAAA,OACAA,EAAA,MAAA,KACAA,EAAA,OAAA,KACAA,EAAA,MAAA,KACAA,EAAA,YAAA,KAGUC,QAMXA,gBAAA,GANWA,EAAAA,qBAAAA,QAAAA,WAMX,CAAA,IALC,KAAA,OACAA,EAAA,MAAA,KACAA,EAAA,OAAA,KAC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LY,OAAQrC,EAAMoC,KAAK,IACnBb,aAAcvB,EAAME,OAAOC,OAAO,IAClCc,YAAajB,EAAME,OAAOsB,MAAMC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as e}from"react";import{Container as o}from"@cleartrip/ct-design-container";import{colors as t}from"@cleartrip/ct-design-tokens";const d=e(({children:e,styleConfig:t,onClick:d},s)=>{const{root:i=[]}=t||{};return r(o,{ref:s,onClick:d,styleConfig:{root:[...i]},children:e})});var s,i,n,a,u,c;d.displayName="Card",function(r){r.NONE="none",r.SMALL="sm",r.MEDIUM="md",r.LARGE="lg",r.EXTRA_LARGE="xl"}(s||(s={})),function(r){r.NONE="none",r.SMALL="sm",r.MEDIUM="md",r.LARGE="lg",r.EXTRA_LARGE="xl"}(i||(i={})),function(r){r.NONE="none",r.SMALL="sm",r.MEDIUM="md",r.LARGE="lg"}(n||(n={})),function(r){r.TOP="top",r.BOTTOM="bottom"}(a||(a={})),function(r){r.E1="E1",r.E2="E2",r.E3="E3",r.E4="E4"}(u||(u={})),function(r){r.TOP="top",r.BOTTOM="bottom",r.LEFT="left",r.RIGHT="right",r.DEFAULT="default"}(c||(c={}));const b={PRIMARY:t.black,SECONDARY:t.success,TERTIARY:t.warning},l=(r,e)=>{switch(r){case s.NONE:return e.border.radius[0];case s.SMALL:return e.border.radius[6];case s.MEDIUM:return e.border.radius[8];case s.LARGE:return e.border.radius[12];case s.EXTRA_LARGE:return e.border.radius[16];default:return e.border.radius[8]}},E=(r,e)=>{switch(r){case s.NONE:return e.border.width.none;case s.SMALL:return e.border.width.sm;case s.MEDIUM:return e.border.width.md;case s.LARGE:return e.border.width.lg;default:return e.border.width.md}},h=(r,e,o,t)=>({borderWidth:e,borderStyle:o,borderColor:t}),R=(r,e,o,t,d,s)=>{const i=l(e,d),n=d.border.style.solid,a=E(r,d),u=h(0,a,n,t);return s?{borderRadius:i}:Object.assign({borderRadius:i},u)},L=(r,e)=>{switch(e){case s.LARGE:return{height:r.size[12],borderRadius:r.border.radius[24],borderStyle:r.border.style.solid};case s.MEDIUM:return{height:r.size[10],borderRadius:r.border.radius[20],borderStyle:r.border.style.solid};case s.SMALL:return{height:r.size[8],borderRadius:r.border.radius[16],borderStyle:r.border.style.solid};default:return{height:r.size[10],borderRadius:r.border.radius[20],borderStyle:r.border.style.solid}}},f=({borderColor:r,cornerRadius:e,borderWidth:o,showShadow:t,shadowColor:d,shadowOffset:s,shadowOpacity:i,elevation:n,borderDirection:a,theme:u})=>{const c=t?{shadowColor:d,shadowOffset:s,shadowOpacity:i,shadowRadius:2,elevation:n}:{},b=R(o,e,0,r,u);return Object.assign(Object.assign({},c),b)};export{d as Card,b as CardBorderColors,c as CardBorderDirection,n as CardBorderWidth,i as CardRadius,a as CardShadowDirection,u as CardShadowVariant,s as CardSize,h as getBorderDirectionStyles,l as getCardBorderRadius,R as getCardBorderStyles,E as getCardBorderWidth,f as getCardStyles,L as getDefaultCardStyles};
|
|
2
2
|
//# sourceMappingURL=ct-design-card.browser.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-design-card.browser.esm.js","sources":["../packages/components/Card/src/
|
|
1
|
+
{"version":3,"file":"ct-design-card.browser.esm.js","sources":["../packages/components/Card/src/Card.tsx","../packages/components/Card/src/constants.ts","../packages/components/Card/src/style.ts"],"sourcesContent":[null,null,null],"names":["Card","forwardRef","children","styleConfig","onClick","forwardedRef","root","_jsx","Container","ref","CardSize","CardRadius","CardBorderWidth","CardShadowDirection","CardShadowVariant","CardBorderDirection","displayName","CardBorderColors","PRIMARY","colors","black","SECONDARY","success","TERTIARY","warning","getCardBorderRadius","cornerRadius","theme","NONE","border","radius","SMALL","MEDIUM","LARGE","EXTRA_LARGE","getCardBorderWidth","borderWidth","width","none","sm","md","lg","getBorderDirectionStyles","_borderDirection","borderStyle","borderColor","getCardBorderStyles","cardBorderWidth","borderDirection","noBorder","borderRadius","style","solid","Object","assign","getDefaultCardStyles","size","height","getCardStyles","showShadow","shadowColor","shadowOffset","shadowOpacity","elevation","shadowStyles","shadowRadius","borderStyles"],"mappings":"2LAMA,MAAMA,EAAOC,EAAqC,EAAGC,WAAUC,cAAaC,WAAWC,KACrF,MAAMC,KAAEA,EAAO,IAAOH,GAAe,CAAA,EAErC,OACEI,EAACC,EAAU,CAAAC,IAAKJ,EAAcD,QAASA,EAASD,YAAa,CAAEG,KAAM,IAAIA,IACtEJ,SAAAA,UCTKQ,EAQAC,EAQAC,EAOAC,EAKAC,EAOAC,EDrBZf,EAAKgB,YAAc,OCdnB,SAAYN,GACVA,EAAA,KAAA,OACAA,EAAA,MAAA,KACAA,EAAA,OAAA,KACAA,EAAA,MAAA,KACAA,EAAA,YAAA,IACD,CAND,CAAYA,IAAAA,EAMX,CAAA,IAED,SAAYC,GACVA,EAAA,KAAA,OACAA,EAAA,MAAA,KACAA,EAAA,OAAA,KACAA,EAAA,MAAA,KACAA,EAAA,YAAA,IACD,CAND,CAAYA,IAAAA,EAMX,CAAA,IAED,SAAYC,GACVA,EAAA,KAAA,OACAA,EAAA,MAAA,KACAA,EAAA,OAAA,KACAA,EAAA,MAAA,IACD,CALD,CAAYA,IAAAA,EAKX,CAAA,IAED,SAAYC,GACVA,EAAA,IAAA,MACAA,EAAA,OAAA,QACD,CAHD,CAAYA,IAAAA,EAGX,CAAA,IAED,SAAYC,GACVA,EAAA,GAAA,KACAA,EAAA,GAAA,KACAA,EAAA,GAAA,KACAA,EAAA,GAAA,IACD,CALD,CAAYA,IAAAA,EAKX,CAAA,IAED,SAAYC,GACVA,EAAA,IAAA,MACAA,EAAA,OAAA,SACAA,EAAA,KAAA,OACAA,EAAA,MAAA,QACAA,EAAA,QAAA,SACD,CAND,CAAYA,IAAAA,EAMX,CAAA,IAEY,MAAAE,EAAmB,CAC9BC,QAASC,EAAOC,MAChBC,UAAWF,EAAOG,QAClBC,SAAUJ,EAAOK,SC3CNC,EAAsB,CAACC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AK,IACnBN,aAAcvB,EAAME,OAAOC,OAAO,IAClCc,YAAajB,EAAME,OAAOsB,MAAMC,OAEpC,KAAK1C,EAASqB,MACZ,MAAO,CACL0B,OAAQ9B,EAAM6B,KAAK,GACnBN,aAAcvB,EAAME,OAAOC,OAAO,IAClCc,YAAajB,EAAME,OAAOsB,MAAMC,OAEpC,QACE,MAAO,CACLK,OAAQ9B,EAAM6B,KAAK,IACnBN,aAAcvB,EAAME,OAAOC,OAAO,IAClCc,YAAajB,EAAME,OAAOsB,MAAMC,SAiB3BM,EAAgB,EAC3Bb,cACAnB,eACAU,cACAuB,aACAC,cACAC,eACAC,gBACAC,YACAf,kBACArB,YAaA,MAAMqC,EAAeL,EACjB,CACEC,cACAC,eACAC,gBACAG,aAAc,EACdF,aAEF,GAEEG,EAAepB,EAAoBV,EAAaV,EAAcsB,EAAiBH,EAAalB,GAElG,OACK0B,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAAU,GACAE"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib = require('tslib');
|
|
4
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
4
|
var react = require('react');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var ctDesignContainer = require('@cleartrip/ct-design-container');
|
|
6
|
+
var ctDesignTokens = require('@cleartrip/ct-design-tokens');
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var borderRadius = _a.borderRadius, border = _a.border, borderTop = _a.borderTop, borderBottom = _a.borderBottom, borderLeft = _a.borderLeft, borderRight = _a.borderRight, boxShadow = _a.boxShadow, borderColor = _a.borderColor, theme = _a.theme, rest = tslib.__rest(_a, ["borderRadius", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "boxShadow", "borderColor", "theme"]);
|
|
15
|
-
return tslib.__assign({ borderRadius: borderRadius, border: border, borderTop: borderTop, borderBottom: borderBottom, borderLeft: borderLeft, borderRight: borderRight, boxShadow: boxShadow, borderColor: borderColor, backgroundColor: theme.color.background.neutral }, rest);
|
|
16
|
-
};
|
|
8
|
+
const Card = react.forwardRef(({ children, styleConfig, onClick }, forwardedRef) => {
|
|
9
|
+
const { root = [] } = styleConfig || {};
|
|
10
|
+
return (jsxRuntime.jsx(ctDesignContainer.Container, { ref: forwardedRef, onClick: onClick, styleConfig: { root: [...root] }, children: children }));
|
|
11
|
+
});
|
|
12
|
+
Card.displayName = 'Card';
|
|
17
13
|
|
|
14
|
+
exports.CardSize = void 0;
|
|
15
|
+
(function (CardSize) {
|
|
16
|
+
CardSize["NONE"] = "none";
|
|
17
|
+
CardSize["SMALL"] = "sm";
|
|
18
|
+
CardSize["MEDIUM"] = "md";
|
|
19
|
+
CardSize["LARGE"] = "lg";
|
|
20
|
+
CardSize["EXTRA_LARGE"] = "xl";
|
|
21
|
+
})(exports.CardSize || (exports.CardSize = {}));
|
|
18
22
|
exports.CardRadius = void 0;
|
|
19
23
|
(function (CardRadius) {
|
|
20
24
|
CardRadius["NONE"] = "none";
|
|
@@ -50,22 +54,27 @@ exports.CardBorderDirection = void 0;
|
|
|
50
54
|
CardBorderDirection["RIGHT"] = "right";
|
|
51
55
|
CardBorderDirection["DEFAULT"] = "default";
|
|
52
56
|
})(exports.CardBorderDirection || (exports.CardBorderDirection = {}));
|
|
57
|
+
const CardBorderColors = {
|
|
58
|
+
PRIMARY: ctDesignTokens.colors.black,
|
|
59
|
+
SECONDARY: ctDesignTokens.colors.success,
|
|
60
|
+
TERTIARY: ctDesignTokens.colors.warning,
|
|
61
|
+
};
|
|
53
62
|
|
|
54
|
-
|
|
63
|
+
const getCardBorderRadius = (cornerRadius, theme) => {
|
|
55
64
|
switch (cornerRadius) {
|
|
56
|
-
case exports.
|
|
65
|
+
case exports.CardSize.NONE: {
|
|
57
66
|
return theme.border.radius[0];
|
|
58
67
|
}
|
|
59
|
-
case exports.
|
|
68
|
+
case exports.CardSize.SMALL: {
|
|
60
69
|
return theme.border.radius[6];
|
|
61
70
|
}
|
|
62
|
-
case exports.
|
|
71
|
+
case exports.CardSize.MEDIUM: {
|
|
63
72
|
return theme.border.radius[8];
|
|
64
73
|
}
|
|
65
|
-
case exports.
|
|
74
|
+
case exports.CardSize.LARGE: {
|
|
66
75
|
return theme.border.radius[12];
|
|
67
76
|
}
|
|
68
|
-
case exports.
|
|
77
|
+
case exports.CardSize.EXTRA_LARGE: {
|
|
69
78
|
return theme.border.radius[16];
|
|
70
79
|
}
|
|
71
80
|
default: {
|
|
@@ -73,18 +82,18 @@ var getCardBorderRadius = function (cornerRadius, theme) {
|
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
84
|
};
|
|
76
|
-
|
|
85
|
+
const getCardBorderWidth = (borderWidth, theme) => {
|
|
77
86
|
switch (borderWidth) {
|
|
78
|
-
case exports.
|
|
87
|
+
case exports.CardSize.NONE: {
|
|
79
88
|
return theme.border.width.none;
|
|
80
89
|
}
|
|
81
|
-
case exports.
|
|
90
|
+
case exports.CardSize.SMALL: {
|
|
82
91
|
return theme.border.width.sm;
|
|
83
92
|
}
|
|
84
|
-
case exports.
|
|
93
|
+
case exports.CardSize.MEDIUM: {
|
|
85
94
|
return theme.border.width.md;
|
|
86
95
|
}
|
|
87
|
-
case exports.
|
|
96
|
+
case exports.CardSize.LARGE: {
|
|
88
97
|
return theme.border.width.lg;
|
|
89
98
|
}
|
|
90
99
|
default: {
|
|
@@ -92,133 +101,70 @@ var getCardBorderWidth = function (borderWidth, theme) {
|
|
|
92
101
|
}
|
|
93
102
|
}
|
|
94
103
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
const getBorderDirectionStyles = (_borderDirection, borderWidth, borderStyle, borderColor) => {
|
|
105
|
+
return {
|
|
106
|
+
borderWidth,
|
|
107
|
+
borderStyle,
|
|
108
|
+
borderColor,
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const getCardBorderStyles = (cardBorderWidth, cornerRadius, borderDirection, borderColor, theme, noBorder) => {
|
|
112
|
+
const borderRadius = getCardBorderRadius(cornerRadius, theme);
|
|
113
|
+
const borderStyle = theme.border.style.solid;
|
|
114
|
+
const borderWidth = getCardBorderWidth(cardBorderWidth, theme);
|
|
115
|
+
const border = getBorderDirectionStyles(borderDirection, borderWidth, borderStyle, borderColor);
|
|
116
|
+
return noBorder
|
|
117
|
+
? { borderRadius }
|
|
118
|
+
: Object.assign({ borderRadius }, border);
|
|
119
|
+
};
|
|
120
|
+
const getDefaultCardStyles = (theme, size) => {
|
|
121
|
+
switch (size) {
|
|
122
|
+
case exports.CardSize.LARGE:
|
|
108
123
|
return {
|
|
109
|
-
|
|
124
|
+
height: theme.size[12],
|
|
125
|
+
borderRadius: theme.border.radius[24],
|
|
126
|
+
borderStyle: theme.border.style.solid,
|
|
110
127
|
};
|
|
111
|
-
|
|
112
|
-
case exports.CardBorderDirection.LEFT: {
|
|
128
|
+
case exports.CardSize.MEDIUM:
|
|
113
129
|
return {
|
|
114
|
-
|
|
130
|
+
height: theme.size[10],
|
|
131
|
+
borderRadius: theme.border.radius[20],
|
|
132
|
+
borderStyle: theme.border.style.solid,
|
|
115
133
|
};
|
|
116
|
-
|
|
117
|
-
case exports.CardBorderDirection.RIGHT: {
|
|
134
|
+
case exports.CardSize.SMALL:
|
|
118
135
|
return {
|
|
119
|
-
|
|
136
|
+
height: theme.size[8],
|
|
137
|
+
borderRadius: theme.border.radius[16],
|
|
138
|
+
borderStyle: theme.border.style.solid,
|
|
120
139
|
};
|
|
121
|
-
|
|
122
|
-
default: {
|
|
140
|
+
default:
|
|
123
141
|
return {
|
|
124
|
-
|
|
142
|
+
height: theme.size[10],
|
|
143
|
+
borderRadius: theme.border.radius[20],
|
|
144
|
+
borderStyle: theme.border.style.solid,
|
|
125
145
|
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
var getCardBorderStyles = function (cardBorderWidth, cornerRadius, borderDirection, theme, noBorder) {
|
|
130
|
-
var borderRadius = getCardBorderRadius(cornerRadius, theme);
|
|
131
|
-
var borderStyle = theme.border.style.solid;
|
|
132
|
-
var borderColor = theme.color.border.default;
|
|
133
|
-
var borderWidth = getCardBorderWidth(cardBorderWidth, theme);
|
|
134
|
-
var border = getBorderDirectionStyles(borderDirection, borderWidth, borderStyle, borderColor);
|
|
135
|
-
return noBorder
|
|
136
|
-
? { borderRadius: borderRadius }
|
|
137
|
-
: tslib.__assign({ borderRadius: borderRadius }, border);
|
|
138
|
-
};
|
|
139
|
-
var getTopShadow = function (shadowVariant, theme) {
|
|
140
|
-
switch (shadowVariant) {
|
|
141
|
-
case exports.CardShadowVariant.E1: {
|
|
142
|
-
return theme.elevation.topE1;
|
|
143
|
-
}
|
|
144
|
-
case exports.CardShadowVariant.E2: {
|
|
145
|
-
return theme.elevation.topE2;
|
|
146
|
-
}
|
|
147
|
-
case exports.CardShadowVariant.E3: {
|
|
148
|
-
return theme.elevation.topE3;
|
|
149
|
-
}
|
|
150
|
-
case exports.CardShadowVariant.E4: {
|
|
151
|
-
return theme.elevation.topE4;
|
|
152
|
-
}
|
|
153
|
-
default: {
|
|
154
|
-
return theme.elevation.topE2;
|
|
155
|
-
}
|
|
156
146
|
}
|
|
157
147
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return theme.elevation.bottomE4;
|
|
171
|
-
}
|
|
172
|
-
default: {
|
|
173
|
-
return theme.elevation.bottomE2;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
148
|
+
const getCardStyles = ({ borderColor, cornerRadius, borderWidth, showShadow, shadowColor, shadowOffset, shadowOpacity, elevation, borderDirection, theme, }) => {
|
|
149
|
+
const shadowStyles = showShadow
|
|
150
|
+
? {
|
|
151
|
+
shadowColor,
|
|
152
|
+
shadowOffset,
|
|
153
|
+
shadowOpacity,
|
|
154
|
+
shadowRadius: 2,
|
|
155
|
+
elevation,
|
|
156
|
+
}
|
|
157
|
+
: {};
|
|
158
|
+
const borderStyles = getCardBorderStyles(borderWidth, cornerRadius, borderDirection, borderColor, theme);
|
|
159
|
+
return Object.assign(Object.assign({}, shadowStyles), borderStyles);
|
|
176
160
|
};
|
|
177
|
-
var getCardShadowStyles = function (shadowDirection, shadowVariant, theme) {
|
|
178
|
-
switch (shadowDirection) {
|
|
179
|
-
case exports.CardShadowDirection.TOP: {
|
|
180
|
-
return getTopShadow(shadowVariant, theme);
|
|
181
|
-
}
|
|
182
|
-
case exports.CardShadowDirection.BOTTOM: {
|
|
183
|
-
return getBottomShadow(shadowVariant, theme);
|
|
184
|
-
}
|
|
185
|
-
default: {
|
|
186
|
-
return getBottomShadow(shadowVariant, theme);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
var getCardStyles = function (_a) {
|
|
191
|
-
var cornerRadius = _a.cornerRadius, borderWidth = _a.borderWidth, showShadow = _a.showShadow, shadowDirection = _a.shadowDirection, shadowVariant = _a.shadowVariant, borderDirection = _a.borderDirection, theme = _a.theme, noBorder = _a.noBorder;
|
|
192
|
-
return tslib.__assign({ boxShadow: showShadow ? getCardShadowStyles(shadowDirection, shadowVariant, theme) : 'none' }, getCardBorderStyles(borderWidth, cornerRadius, borderDirection, theme, noBorder));
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
var StyledCard = styled__default.default.div(function (_a) {
|
|
196
|
-
var css = _a.css, theme = _a.theme, rest = tslib.__rest(_a, ["css", "theme"]);
|
|
197
|
-
return getStyledCardStyled(tslib.__assign(tslib.__assign(tslib.__assign({}, css), { theme: theme }), rest));
|
|
198
|
-
});
|
|
199
|
-
var Card = react.forwardRef(function (_a, forwardedRef) {
|
|
200
|
-
var children = _a.children, _b = _a.cornerRadius, cornerRadius = _b === void 0 ? exports.CardRadius.MEDIUM : _b, _c = _a.borderWidth, borderWidth = _c === void 0 ? exports.CardBorderWidth.MEDIUM : _c, _d = _a.showShadow, showShadow = _d === void 0 ? true : _d, _e = _a.shadowDirection, shadowDirection = _e === void 0 ? exports.CardShadowDirection.TOP : _e, _f = _a.shadowVariant, shadowVariant = _f === void 0 ? exports.CardShadowVariant.E2 : _f, _g = _a.borderDirection, borderDirection = _g === void 0 ? exports.CardBorderDirection.DEFAULT : _g, css = _a.css; _a.onChange; var _h = _a.noBorder, noBorder = _h === void 0 ? false : _h, rest = tslib.__rest(_a, ["children", "cornerRadius", "borderWidth", "showShadow", "shadowDirection", "shadowVariant", "borderDirection", "css", "onChange", "noBorder"]);
|
|
201
|
-
var theme = ctDesignTheme.useTheme();
|
|
202
|
-
var cardStyles = getCardStyles({
|
|
203
|
-
cornerRadius: cornerRadius,
|
|
204
|
-
borderWidth: borderWidth,
|
|
205
|
-
showShadow: showShadow,
|
|
206
|
-
shadowDirection: shadowDirection,
|
|
207
|
-
shadowVariant: shadowVariant,
|
|
208
|
-
borderDirection: borderDirection,
|
|
209
|
-
theme: theme,
|
|
210
|
-
noBorder: noBorder,
|
|
211
|
-
});
|
|
212
|
-
return (jsxRuntime.jsx(StyledCard, tslib.__assign({ ref: forwardedRef, css: tslib.__assign(tslib.__assign({}, cardStyles), css) }, rest, { theme: theme }, { children: children })));
|
|
213
|
-
});
|
|
214
161
|
|
|
215
162
|
exports.Card = Card;
|
|
163
|
+
exports.CardBorderColors = CardBorderColors;
|
|
216
164
|
exports.getBorderDirectionStyles = getBorderDirectionStyles;
|
|
217
|
-
exports.getBottomShadow = getBottomShadow;
|
|
218
165
|
exports.getCardBorderRadius = getCardBorderRadius;
|
|
219
166
|
exports.getCardBorderStyles = getCardBorderStyles;
|
|
220
167
|
exports.getCardBorderWidth = getCardBorderWidth;
|
|
221
|
-
exports.getCardShadowStyles = getCardShadowStyles;
|
|
222
168
|
exports.getCardStyles = getCardStyles;
|
|
223
|
-
exports.
|
|
169
|
+
exports.getDefaultCardStyles = getDefaultCardStyles;
|
|
224
170
|
//# sourceMappingURL=ct-design-card.cjs.js.map
|