@fvc/card 1.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.
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CardProps } from './types';
3
+ export declare const prefixCls = "fvc-card";
4
+ export declare const Card: {
5
+ ({ type, testId, minHeight, height, bordered, disableBorderRadius, borderColor, border, scroll, isActiveTheme, overlay, ...props }: CardProps): React.JSX.Element;
6
+ Title: React.NamedExoticComponent<import("./types").CardTitleProps>;
7
+ Label: React.NamedExoticComponent<import("./types").CardLabelProps>;
8
+ Value: React.NamedExoticComponent<import("./types").CardValueProps>;
9
+ };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CardLabelProps } from './types';
3
+ declare const _default: React.NamedExoticComponent<CardLabelProps>;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CardTitleProps } from './types';
3
+ declare const _default: React.NamedExoticComponent<CardTitleProps>;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CardValueProps } from './types';
3
+ declare const _default: React.NamedExoticComponent<CardValueProps>;
4
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { CSSProperties } from 'react';
2
+ interface CardStyleOptions {
3
+ minHeight?: string | number;
4
+ height?: string | number;
5
+ borderColor?: string;
6
+ scroll?: boolean;
7
+ }
8
+ export declare function generateCardStyle(options: CardStyleOptions): CSSProperties;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { Card } from './Card';
@@ -0,0 +1,35 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { type CardProps as DefaultCardProps } from 'antd';
3
+ import { TextProps } from '@fvc/typography/types';
4
+ export type CardType = 'inner' | 'dark-gray' | 'tab' | 'gray' | 'round';
5
+ type BorderSize = 'default' | 16 | 32;
6
+ export type CardProps = Omit<DefaultCardProps, 'type'> & {
7
+ testId?: string;
8
+ height?: string | number;
9
+ minHeight?: string | number;
10
+ scroll?: boolean;
11
+ block?: boolean;
12
+ overlay?: boolean;
13
+ disableBorderRadius?: boolean;
14
+ border?: BorderSize;
15
+ type?: CardType;
16
+ borderColor?: string;
17
+ isActiveTheme?: boolean;
18
+ };
19
+ export interface CardTitleProps {
20
+ children: ReactNode | string;
21
+ testId?: string;
22
+ }
23
+ export interface CardLabelProps {
24
+ children: ReactNode | string;
25
+ testId?: string;
26
+ icon?: ReactNode;
27
+ isEnableMargin?: boolean;
28
+ }
29
+ export interface CardValueProps extends TextProps {
30
+ children?: ReactNode;
31
+ icon?: ReactElement;
32
+ iconPosition?: 'right' | 'left';
33
+ testId?: string;
34
+ }
35
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Card.types';
@@ -0,0 +1,6 @@
1
+ import e,{memo as r}from"react";import{Card as t}from"antd";import{cssVarResolver as o}from"@fvc/utils";import{Box as n}from"@fvc/box";import{Typography as a}from"@fvc/typography";var d=function(){return d=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},d.apply(this,arguments)};function i(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t}function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var l,s={exports:{}};
2
+ /*!
3
+ Copyright (c) 2018 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */var u,p=(l||(l=1,u=s,function(){var e={}.hasOwnProperty;function r(){for(var e="",r=0;r<arguments.length;r++){var n=arguments[r];n&&(e=o(e,t(n)))}return e}function t(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return r.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var n="";for(var a in t)e.call(t,a)&&t[a]&&(n=o(n,a));return n}function o(e,r){return r?e?e+" "+r:e+r:e}u.exports?(r.default=r,u.exports=r):window.classNames=r}()),s.exports),m=c(p);var _={};function v(e){var r=e.minHeight,t=e.height,n=e.borderColor,a=e.scroll,d={};return void 0!==r&&(d.minHeight=o(r)),void 0!==t&&(d.height=o(t)),n&&(d.borderColor=n),a&&(d.overflowY="auto"),d}!function(e,r){void 0===r&&(r={});var t=r.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}('.Card-module_fvc-card__SIHyV {\n font-family: "Montserrat", sans-serif;\n background: var(--blue-20);\n border-radius: 8px;\n}\n.Card-module_fvc-card-wrapper__6M7FO {\n position: relative;\n}\n.Card-module_fvc-card-head__34OLh {\n padding: 0 16px;\n font-weight: 500;\n}\n.Card-module_fvc-card-body__VM86h {\n padding: 16px;\n}\n.Card-module_fvc-card-block__6GrnN {\n width: 100%;\n}\n.Card-module_fvc-card-border-16__lws1F {\n border-radius: 16px;\n}\n.Card-module_fvc-card-border-32__oxKcH {\n border-radius: 32px;\n}\n.Card-module_fvc-card-no-border-radius__3cG-r {\n border-radius: 0;\n}\n.Card-module_fvc-card-with-border__9J4BV {\n border: 1px solid;\n}\n.Card-module_fvc-card-overlay__eYIMP {\n position: absolute;\n top: 0;\n height: 100%;\n border-radius: 8px;\n cursor: pointer;\n background-color: rgba(176, 0, 32, 0.16);\n}\n.Card-module_fvc-card-type-tab__43ouo, .Card-module_fvc-card-type-round__1gcAq {\n color: var(--body-text-color-1000);\n background: var(--neutral-0);\n min-height: calc(100vh - 110px);\n}\n.Card-module_fvc-card-type-tab__43ouo {\n border-radius: 0 16px 16px;\n}\n.Card-module_fvc-card-type-round__1gcAq {\n border-radius: 16px;\n}\n.Card-module_fvc-card-type-inner__Kjj6z {\n background-color: var(--neutral-0) !important;\n display: inline-block;\n width: 100%;\n}\n.Card-module_fvc-card-type-inner-head__eVH70 {\n padding: 0 16px;\n background-color: var(--neutral-0) !important;\n}\n.Card-module_fvc-card-type-inner-head-title__u96M2 {\n padding: 16px 0;\n font-size: 16px;\n}\n.Card-module_fvc-card-type-inner-body__d5aOJ {\n padding: 16px;\n}\n.Card-module_fvc-card-type-inner-extra__cLdc4 {\n padding: 17.5px 0;\n}\n.Card-module_fvc-card-theme__M9p20 {\n background: var(--theme-primary) !important;\n}\n.Card-module_fvc-card-theme__M9p20 .Card-module_vis-table-thead__6jDDx > tr > th {\n background: var(--theme-secondary) !important;\n}\n.Card-module_fvc-card-theme__M9p20 .Card-module_vis-table-tbody__CFOin > tr.Card-module_vis-table-row__5cyrR > td {\n background: var(--theme-primary) !important;\n}\n.Card-module_fvc-card-theme__M9p20 .Card-module_vis-table-tbody__CFOin > tr.Card-module_vis-table-row__5cyrR > td.Card-module_el-table-head__2J3o- {\n background: var(--theme-secondary) !important;\n}\n.Card-module_fvc-card-theme__M9p20 .Card-module_vis-table-tbody__CFOin > tr.Card-module_vis-table-row__5cyrR:not(.Card-module_vis-table-row-level-0__ACI--) > td {\n background: var(--theme-secondary) !important;\n}\n.Card-module_fvc-card-value-icon-left__BMaaJ {\n display: flex;\n flex-direction: row;\n}\n.Card-module_fvc-card-value-icon-right__ZS5Mv {\n display: flex;\n flex-direction: row-reverse;\n}');var f=r((function(r){var t=r.children,o=r.testId,d=r.icon,i=r.isEnableMargin,c=void 0===i||i;return e.createElement(n.Row,{className:c?"mt-3":""},e.createElement(a.Text,{"data-testd":o,font:"Roboto",className:"mr-2",size:14,weight:400,lineHeight:"16"},t,d))})),b=r((function(r){var t=r.children,o=r.testId;return e.createElement(a.Text,{font:"Montserrat",className:"mb-3","data-testid":o,size:20,weight:700,lineHeight:"20"},t)})),h=r((function(r){var t,o=r.children,c=void 0===o?"":o,l=r.className,s=r.color,u=void 0===s?"var(--body-text-color-1000)":s,p=r.icon,_=void 0===p?e.createElement(e.Fragment,null):p,v=r.iconPosition,f=void 0===v?"right":v,b=r.lineHeight,h=void 0===b?20:b,y=r.size,g=void 0===y?16:y,C=r.testId,x=r.weight,w=void 0===x?500:x,O=i(r,["children","className","color","icon","iconPosition","lineHeight","size","testId","weight"]);return e.createElement(n.Row,{className:null!=l?l:"mt-1"},"number"==typeof c||"string"==typeof c?e.createElement(a.Text,d({font:"Roboto",color:u,size:g,weight:w,lineHeight:h,testId:C,className:m((t={},t["".concat("fvc-card-value","-icon-").concat(f)]=!!f,t))},O),_,c):c)})),y="fvc-card",g=function(r){var o,n=r.type,a=r.testId,c=r.minHeight,l=r.height,s=r.bordered,u=void 0!==s&&s,p=r.disableBorderRadius,f=void 0!==p&&p,b=r.borderColor,h=r.border,g=r.scroll,C=r.isActiveTheme,x=void 0!==C&&C,w=r.overlay,O=void 0!==w&&w,E=i(r,["type","testId","minHeight","height","bordered","disableBorderRadius","borderColor","border","scroll","isActiveTheme","overlay"]),M="inner"===n?n:void 0,N=m(_.prefixCls,((o={})["".concat(y,"-type-").concat(n)]=n,o["".concat(y,"-theme")]=x,o["".concat(y,"-with-border")]=!!b,o["".concat(y,"-border-").concat(h)]=h,o["".concat(y,"-no-border-radius")]=f,o),E.className);return e.createElement("div",{className:"".concat(y,"-wrapper")},e.createElement(t,d({"data-testid":a},E,{prefixCls:y,type:M,bordered:u,style:d(d({},v({minHeight:c,height:l,borderColor:b,scroll:g})),E.style),className:N})),O&&e.createElement("div",{role:"presentation",className:"".concat(y,"-overlay ").concat(y,"-block")}))};g.Title=b,g.Label=f,g.Value=h;export{g as Card};
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@fvc/card",
3
+ "version": "1.0.0",
4
+ "main": "./dist/lib/index.js",
5
+ "types": "./dist/lib/card/src/index.d.ts",
6
+ "files": [
7
+ "dist/lib/index.js",
8
+ "dist/lib/card",
9
+ "package.json"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/lib/index.js",
14
+ "types": "./dist/lib/card/src/index.d.ts"
15
+ },
16
+ "./types/*": "./dist/lib/card/src/types/*"
17
+ },
18
+ "scripts": {
19
+ "build": "rm -rf dist && eslint --config ../../eslint.config.js . && bunx tsc --noEmit && rollup -c ./rollup.config.mjs"
20
+ },
21
+ "dependencies": {
22
+ "react": "^18.0.0",
23
+ "antd": "^5.0.0",
24
+ "@fvc/box": "file:../box",
25
+ "@fvc/typography": "file:../typography",
26
+ "@fvc/utils": "file:../utils"
27
+ },
28
+ "peerDependencies": {
29
+ "@fvc/box": "*",
30
+ "@fvc/typography": "*",
31
+ "@fvc/utils": "*"
32
+ }
33
+ }