@fvc/card 1.1.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 +1 @@
1
- export { Card } from './Card';
1
+ export { Card, prefixCls } from './Card';
@@ -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";var i=function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)};function c(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 l,s={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 p,v=(l||(l=1,p=s,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}p.exports?(r.default=r,p.exports=r):window.classNames=r}()),s.exports),f=d(v);function u(e){var r=e.minHeight,t=e.height,o=e.borderColor,a=e.scroll,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((function(r){var t=r.children,n=r.testId,i=r.icon,c=r.isEnableMargin,d=void 0===c||c;return e.createElement(o.Row,{className:d?"mt-3":""},e.createElement(a.Text,{"data-testd":n,font:"Roboto",className:"mr-2",size:14,weight:400,lineHeight:"16"},t,i))})),m=r((function(r){var t=r.children,n=r.testId;return e.createElement(a.Text,{font:"Montserrat",className:"mb-3","data-testid":n,size:20,weight:700,lineHeight:"20"},t)})),h=r((function(r){var t,n=r.children,d=void 0===n?"":n,l=r.className,s=r.color,p=void 0===s?"var(--body-text-color-1000)":s,v=r.icon,u=void 0===v?e.createElement(e.Fragment,null):v,b=r.iconPosition,m=void 0===b?"right":b,h=r.lineHeight,y=void 0===h?20:h,g=r.size,x=void 0===g?16:g,w=r.testId,O=r.weight,E=void 0===O?500:O,N=c(r,["children","className","color","icon","iconPosition","lineHeight","size","testId","weight"]);return e.createElement(o.Row,{className:null!=l?l:"mt-1"},"number"==typeof d||"string"==typeof d?e.createElement(a.Text,i({font:"Roboto",color:p,size:x,weight:E,lineHeight:y,testId:w,className:f((t={},t["".concat("fvc-card-value","-icon-").concat(m)]=!!m,t))},N),u,d):d)}));!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}');var y="fvc-card",g=function(r){var n,o=r.type,a=r.testId,d=r.minHeight,l=r.height,s=r.bordered,p=void 0!==s&&s,v=r.disableBorderRadius,b=void 0!==v&&v,m=r.borderColor,h=r.border,g=r.scroll,x=r.isActiveTheme,w=void 0!==x&&x,O=r.overlay,E=void 0!==O&&O,N=c(r,["type","testId","minHeight","height","bordered","disableBorderRadius","borderColor","border","scroll","isActiveTheme","overlay"]),k="inner"===o?o:void 0,C=f(y,((n={})["".concat(y,"-type-").concat(o)]=o,n["".concat(y,"-theme")]=w,n["".concat(y,"-with-border")]=!!m,n["".concat(y,"-border-").concat(h)]=h,n["".concat(y,"-no-border-radius")]=b,n),N.className);return e.createElement("div",{className:"".concat(y,"-wrapper")},e.createElement(t,i({"data-testid":a},N,{prefixCls:y,type:k,bordered:p,style:i(i({},u({minHeight:d,height:l,borderColor:m,scroll:g})),N.style),className:C})),E&&e.createElement("div",{role:"presentation",className:"".concat(y,"-overlay ").concat(y,"-block")}))};g.Title=m,g.Label=b,g.Value=h;export{g as Card};
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.1.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,18 +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",
26
- "@fvc/box": "file:../box",
27
- "@fvc/typography": "file:../typography",
28
- "@fvc/utils": "file:../utils"
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"
29
28
  },
30
29
  "peerDependencies": {
31
30
  "@fvc/box": "*",
32
31
  "@fvc/typography": "*",
33
- "@fvc/utils": "*"
32
+ "@fvc/utils": "*",
33
+ "react": "^18.0.0",
34
+ "antd": "^5.0.0"
34
35
  }
35
36
  }