@fvc/card 1.2.0 → 1.2.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.
@@ -1,5 +1,5 @@
1
- import { ReactElement, ReactNode } from 'react';
2
1
  import { type CardProps as DefaultCardProps } from 'antd';
2
+ import { ReactElement, ReactNode } from 'react';
3
3
  import { TextProps } from '@fvc/typography/types';
4
4
  export type CardType = 'inner' | 'dark-gray' | 'tab' | 'gray' | 'round';
5
5
  type BorderSize = 'default' | 16 | 32;
package/dist/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import e,{memo as r}from"react";import{Card as t}from"antd";import{cssVarResolver as n}from"@fvc/utils";import{Box as o}from"@fvc/box";import{Typography as a}from"@fvc/typography";function i(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var c,l={exports:{}};
1
+ import{Card as e}from"antd";import r,{memo as t}from"react";import{cssVarResolver as n}from"@fvc/utils";import{Box as o}from"@fvc/box";import{Typography as a}from"@fvc/typography";function i(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var c,l={exports:{}};
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */var s,p=(c||(c=1,s=l,function(){var e={}.hasOwnProperty;function r(){for(var e="",r=0;r<arguments.length;r++){var o=arguments[r];o&&(e=n(e,t(o)))}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 o="";for(var a in t)e.call(t,a)&&t[a]&&(o=n(o,a));return o}function n(e,r){return r?e?e+" "+r:e+r:e}s.exports?(r.default=r,s.exports=r):window.classNames=r}()),l.exports),f=d(p);function v(e){const{minHeight:r,height:t,borderColor:o,scroll:a}=e,i={};return void 0!==r&&(i.minHeight=n(r)),void 0!==t&&(i.height=n(t)),o&&(i.borderColor=o),a&&(i.overflowY="auto"),i}var b=r((({children:r,testId:t,icon:n,isEnableMargin:i=!0})=>e.createElement(o.Row,{className:i?"mt-3":""},e.createElement(a.Text,{"data-testd":t,font:"Roboto",className:"mr-2",size:14,weight:400,lineHeight:"16"},r,n))));var m=r((({children:r,testId:t})=>e.createElement(a.Text,{font:"Montserrat",className:"mb-3","data-testid":t,size:20,weight:700,lineHeight:"20"},r)));var u=r((r=>{var{children:t="",className:n,color:d="var(--body-text-color-1000)",icon:c=e.createElement(e.Fragment,null),iconPosition:l="right",lineHeight:s=20,size:p=16,testId:v,weight:b=500}=r,m=i(r,["children","className","color","icon","iconPosition","lineHeight","size","testId","weight"]);return e.createElement(o.Row,{className:null!=n?n:"mt-1"},"number"==typeof t||"string"==typeof t?e.createElement(a.Text,Object.assign({font:"Roboto",color:d,size:p,weight:b,lineHeight:s,testId:v,className:f({[`fvc-card-value-icon-${l}`]:!!l})},m),c,t):t)}));!function(e,r){void 0===r&&(r={});var t=r.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.fvc-card {\n font-family: "Montserrat", sans-serif;\n background: var(--blue-20);\n border-radius: 8px;\n}\n.fvc-card-wrapper {\n position: relative;\n}\n.fvc-card-head {\n padding: 0 16px;\n font-weight: 500;\n}\n.fvc-card-body {\n padding: 16px;\n}\n.fvc-card-block {\n width: 100%;\n}\n.fvc-card-border-16 {\n border-radius: 16px;\n}\n.fvc-card-border-32 {\n border-radius: 32px;\n}\n.fvc-card-no-border-radius {\n border-radius: 0;\n}\n.fvc-card-with-border {\n border: 1px solid;\n}\n.fvc-card-overlay {\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.fvc-card-type-tab, .fvc-card-type-round {\n color: var(--body-text-color-1000);\n background: var(--neutral-0);\n min-height: calc(100vh - 110px);\n}\n.fvc-card-type-tab {\n border-radius: 0 16px 16px;\n}\n.fvc-card-type-round {\n border-radius: 16px;\n}\n.fvc-card-type-inner {\n background-color: var(--neutral-0) !important;\n display: inline-block;\n width: 100%;\n}\n.fvc-card-type-inner-head {\n padding: 0 16px;\n background-color: var(--neutral-0) !important;\n}\n.fvc-card-type-inner-head-title {\n padding: 16px 0;\n font-size: 16px;\n}\n.fvc-card-type-inner-body {\n padding: 16px;\n}\n.fvc-card-type-inner-extra {\n padding: 17.5px 0;\n}\n.fvc-card-theme {\n background: var(--theme-primary) !important;\n}\n.fvc-card-theme .vis-table-thead > tr > th {\n background: var(--theme-secondary) !important;\n}\n.fvc-card-theme .vis-table-tbody > tr.vis-table-row > td {\n background: var(--theme-primary) !important;\n}\n.fvc-card-theme .vis-table-tbody > tr.vis-table-row > td.el-table-head {\n background: var(--theme-secondary) !important;\n}\n.fvc-card-theme .vis-table-tbody > tr.vis-table-row:not(.vis-table-row-level-0) > td {\n background: var(--theme-secondary) !important;\n}\n.fvc-card-value-icon-left {\n display: flex;\n flex-direction: row;\n}\n.fvc-card-value-icon-right {\n display: flex;\n flex-direction: row-reverse;\n}');const h="fvc-card",y=r=>{var{type:n,testId:o,minHeight:a,height:d,bordered:c=!1,disableBorderRadius:l=!1,borderColor:s,border:p,scroll:b,isActiveTheme:m=!1,overlay:u=!1}=r,y=i(r,["type","testId","minHeight","height","bordered","disableBorderRadius","borderColor","border","scroll","isActiveTheme","overlay"]);const g="inner"===n?n:void 0,x=f(h,{[`${h}-type-${n}`]:n,[`${h}-theme`]:m,[`${h}-with-border`]:!!s,[`${h}-border-${p}`]:p,[`${h}-no-border-radius`]:l},y.className);return e.createElement("div",{className:`${h}-wrapper`},e.createElement(t,Object.assign({"data-testid":o},y,{prefixCls:h,type:g,bordered:c,style:Object.assign(Object.assign({},v({minHeight:a,height:d,borderColor:s,scroll:b})),y.style),className:x})),u&&e.createElement("div",{role:"presentation",className:`${h}-overlay ${h}-block`}))};y.Title=m,y.Label=b,y.Value=u;export{y as Card,h as prefixCls};
6
+ */var s,p=(c||(c=1,s=l,function(){var e={}.hasOwnProperty;function r(){for(var e="",r=0;r<arguments.length;r++){var o=arguments[r];o&&(e=n(e,t(o)))}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 o="";for(var a in t)e.call(t,a)&&t[a]&&(o=n(o,a));return o}function n(e,r){return r?e?e+" "+r:e+r:e}s.exports?(r.default=r,s.exports=r):window.classNames=r}()),l.exports),f=d(p);function v(e){const{minHeight:r,height:t,borderColor:o,scroll:a}=e,i={};return void 0!==r&&(i.minHeight=n(r)),void 0!==t&&(i.height=n(t)),o&&(i.borderColor=o),a&&(i.overflowY="auto"),i}var b=t(({children:e,testId:t,icon:n,isEnableMargin:i=!0})=>r.createElement(o.Row,{className:i?"mt-3":""},r.createElement(a.Text,{"data-testd":t,font:"Roboto",className:"mr-2",size:14,weight:400,lineHeight:"16"},e,n)));var m=t(({children:e,testId:t})=>r.createElement(a.Text,{font:"Montserrat",className:"mb-3","data-testid":t,size:20,weight:700,lineHeight:"20"},e));var u=t(e=>{var{children:t="",className:n,color:d="var(--body-text-color-1000)",icon:c=r.createElement(r.Fragment,null),iconPosition:l="right",lineHeight:s=20,size:p=16,testId:v,weight:b=500}=e,m=i(e,["children","className","color","icon","iconPosition","lineHeight","size","testId","weight"]);return r.createElement(o.Row,{className:null!=n?n:"mt-1"},"number"==typeof t||"string"==typeof t?r.createElement(a.Text,Object.assign({font:"Roboto",color:d,size:p,weight:b,lineHeight:s,testId:v,className:f({[`fvc-card-value-icon-${l}`]:!!l})},m),c,t):t)});!function(e,r){void 0===r&&(r={});var t=r.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.fvc-card {\n font-family: "Montserrat", sans-serif;\n background: var(--blue-20);\n border-radius: 8px;\n}\n.fvc-card-wrapper {\n position: relative;\n}\n.fvc-card-head {\n padding: 0 16px;\n font-weight: 500;\n}\n.fvc-card-body {\n padding: 16px;\n}\n.fvc-card-block {\n width: 100%;\n}\n.fvc-card-border-16 {\n border-radius: 16px;\n}\n.fvc-card-border-32 {\n border-radius: 32px;\n}\n.fvc-card-no-border-radius {\n border-radius: 0;\n}\n.fvc-card-with-border {\n border: 1px solid;\n}\n.fvc-card-overlay {\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.fvc-card-type-tab, .fvc-card-type-round {\n color: var(--body-text-color-1000);\n background: var(--neutral-0);\n min-height: calc(100vh - 110px);\n}\n.fvc-card-type-tab {\n border-radius: 0 16px 16px;\n}\n.fvc-card-type-round {\n border-radius: 16px;\n}\n.fvc-card-type-inner {\n background-color: var(--neutral-0) !important;\n display: inline-block;\n width: 100%;\n}\n.fvc-card-type-inner-head {\n padding: 0 16px;\n background-color: var(--neutral-0) !important;\n}\n.fvc-card-type-inner-head-title {\n padding: 16px 0;\n font-size: 16px;\n}\n.fvc-card-type-inner-body {\n padding: 16px;\n}\n.fvc-card-type-inner-extra {\n padding: 17.5px 0;\n}\n.fvc-card-theme {\n background: var(--theme-primary) !important;\n}\n.fvc-card-theme .vis-table-thead > tr > th {\n background: var(--theme-secondary) !important;\n}\n.fvc-card-theme .vis-table-tbody > tr.vis-table-row > td {\n background: var(--theme-primary) !important;\n}\n.fvc-card-theme .vis-table-tbody > tr.vis-table-row > td.el-table-head {\n background: var(--theme-secondary) !important;\n}\n.fvc-card-theme .vis-table-tbody > tr.vis-table-row:not(.vis-table-row-level-0) > td {\n background: var(--theme-secondary) !important;\n}\n.fvc-card-value-icon-left {\n display: flex;\n flex-direction: row;\n}\n.fvc-card-value-icon-right {\n display: flex;\n flex-direction: row-reverse;\n}');const h="fvc-card",y=t=>{var{type:n,testId:o,minHeight:a,height:d,bordered:c=!1,disableBorderRadius:l=!1,borderColor:s,border:p,scroll:b,isActiveTheme:m=!1,overlay:u=!1}=t,y=i(t,["type","testId","minHeight","height","bordered","disableBorderRadius","borderColor","border","scroll","isActiveTheme","overlay"]);const g="inner"===n?n:void 0,x=f(h,{[`${h}-type-${n}`]:n,[`${h}-theme`]:m,[`${h}-with-border`]:!!s,[`${h}-border-${p}`]:p,[`${h}-no-border-radius`]:l},y.className);return r.createElement("div",{className:`${h}-wrapper`},r.createElement(e,Object.assign({"data-testid":o},y,{prefixCls:h,type:g,bordered:c,style:Object.assign(Object.assign({},v({minHeight:a,height:d,borderColor:s,scroll:b})),y.style),className:x})),u&&r.createElement("div",{role:"presentation",className:`${h}-overlay ${h}-block`}))};y.Title=m,y.Label=b,y.Value=u;export{y as Card,h as prefixCls};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fvc/card",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "main": "./dist/lib/index.js",
5
5
  "types": "./dist/lib/card/src/index.d.ts",
6
6
  "files": [
@@ -18,15 +18,19 @@
18
18
  }
19
19
  },
20
20
  "scripts": {
21
- "build": "rm -rf dist && rm -rf .rollup.cache && eslint --config ../../eslint.config.js . && bunx tsc --noEmit && rollup -c ./rollup.config.mjs"
22
- },
23
- "dependencies": {
24
- "react": "^18.0.0",
25
- "antd": "^5.0.0"
21
+ "build": "rollup -c ./rollup.config.mjs",
22
+ "clean": "rm -rf dist && rm -rf .rollup.cache && rm -rf .turbo",
23
+ "lint": "eslint --config ../../eslint.config.js \"src/**/*.{ts,tsx}\"",
24
+ "lint:fix": "eslint --config ../../eslint.config.js \"src/**/*.{ts,tsx}\" --fix",
25
+ "format": "prettier --write \"src/**/*.{ts,tsx}\"",
26
+ "type-check": "tsc --noEmit",
27
+ "test": "bun test --preload ../../tests/happydom.ts --preload ../../tests/testing-library.tsx"
26
28
  },
27
29
  "peerDependencies": {
28
30
  "@fvc/box": "*",
29
31
  "@fvc/typography": "*",
30
- "@fvc/utils": "*"
32
+ "@fvc/utils": "*",
33
+ "react": "^18.0.0",
34
+ "antd": "^5.0.0"
31
35
  }
32
36
  }