@fvc/box 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,10 @@
1
+ import React from 'react';
2
+ import { BoxProps } from './types';
3
+ export declare const prefixCls = "fvc-box";
4
+ export declare const Box: {
5
+ ({ children, className, display, style, justify, wrap, align, direction, rowGap, height, block, testId, }: BoxProps): React.JSX.Element;
6
+ Row: ({ testId, ...props }: import("antd").RowProps & {
7
+ testId?: string;
8
+ }) => React.JSX.Element;
9
+ Column: ({ testId, col, ...props }: import("./types").ColProps) => React.JSX.Element;
10
+ };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ColProps } from './types';
3
+ export declare const prefixCls = "fvc-col";
4
+ export declare const Col: ({ testId, col, ...props }: ColProps) => React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { RowProps } from 'antd';
3
+ export declare const Row: ({ testId, ...props }: RowProps & {
4
+ testId?: string;
5
+ }) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export { Box } from './Box';
@@ -0,0 +1,23 @@
1
+ import { JSX, ReactNode, CSSProperties } from 'react';
2
+ import { RowProps as BaseRowProps, ColProps as BaseColProps } from 'antd';
3
+ type BoxDisplay = 'flex' | 'inline-flex';
4
+ type BoxDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
5
+ export type BoxProps = {
6
+ children?: JSX.Element | JSX.Element[] | ReactNode;
7
+ className?: string;
8
+ style?: CSSProperties;
9
+ direction?: BoxDirection;
10
+ display?: BoxDisplay;
11
+ align?: BaseRowProps['align'];
12
+ justify?: BaseRowProps['justify'];
13
+ wrap?: boolean;
14
+ block?: boolean;
15
+ rowGap?: number;
16
+ height?: string;
17
+ testId?: string;
18
+ };
19
+ export type ColProps = BaseColProps & {
20
+ testId?: string;
21
+ col?: ColProps['span'];
22
+ };
23
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Box.types';
@@ -0,0 +1,6 @@
1
+ import o from"react";import{Col as e,Row as n}from"antd";var t=function(){return t=Object.assign||function(o){for(var e,n=1,t=arguments.length;n<t;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o},t.apply(this,arguments)};function r(o,e){var n={};for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&e.indexOf(t)<0&&(n[t]=o[t]);if(null!=o&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(o);r<t.length;r++)e.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(o,t[r])&&(n[t[r]]=o[t[r]])}return n}function c(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}"function"==typeof SuppressedError&&SuppressedError;var l,f={exports:{}};
2
+ /*!
3
+ Copyright (c) 2018 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */var x,a=(l||(l=1,x=f,function(){var o={}.hasOwnProperty;function e(){for(var o="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(o=t(o,n(r)))}return o}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var c in n)o.call(n,c)&&n[c]&&(r=t(r,c));return r}function t(o,e){return e?o?o+" "+e:o+e:o}x.exports?(e.default=e,x.exports=e):window.classNames=e}()),f.exports),d=c(a);var _={"fvc-box-row":"Box-module_fvc-box-row__oTEfE","fvc-box-row-no-wrap":"Box-module_fvc-box-row-no-wrap__CIodp","fvc-box-flex":"Box-module_fvc-box-flex__8FkIT","fvc-box-inline-flex":"Box-module_fvc-box-inline-flex__dzdEl","fvc-box-column":"Box-module_fvc-box-column__5nzzf","fvc-box-column-reverse":"Box-module_fvc-box-column-reverse__IE7ZO","fvc-box-row-reverse":"Box-module_fvc-box-row-reverse__6RA8Y","fvc-box-block":"Box-module_fvc-box-block__MoAFo","fvc-box-row-start":"Box-module_fvc-box-row-start__RLwPo","fvc-box-row-center":"Box-module_fvc-box-row-center__SL2V6","fvc-box-row-end":"Box-module_fvc-box-row-end__-POg6","fvc-box-row-space-between":"Box-module_fvc-box-row-space-between__UrK-Z","fvc-box-row-space-around":"Box-module_fvc-box-row-space-around__gMpOi","fvc-box-row-top":"Box-module_fvc-box-row-top__1luzr","fvc-box-row-middle":"Box-module_fvc-box-row-middle__U2xHH","fvc-box-row-bottom":"Box-module_fvc-box-row-bottom__GDOJz","fvc-box-col":"Box-module_fvc-box-col__qg0CX"};!function(o,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o))}}(".Box-module_fvc-box-row__oTEfE {\n display: flex;\n flex-flow: row wrap;\n}\n.Box-module_fvc-box-row__oTEfE::before, .Box-module_fvc-box-row__oTEfE::after {\n display: flex;\n}\n.Box-module_fvc-box-row-no-wrap__CIodp {\n flex-wrap: nowrap;\n}\n\n.Box-module_fvc-box-flex__8FkIT {\n display: flex;\n}\n.Box-module_fvc-box-inline-flex__dzdEl {\n display: inline-flex;\n}\n.Box-module_fvc-box-row__oTEfE {\n flex-direction: row;\n}\n.Box-module_fvc-box-column__5nzzf {\n flex-direction: column;\n}\n.Box-module_fvc-box-column-reverse__IE7ZO {\n flex-direction: column-reverse;\n}\n.Box-module_fvc-box-row-reverse__6RA8Y {\n flex-direction: row-reverse;\n}\n.Box-module_fvc-box-block__MoAFo {\n width: 100%;\n}\n.Box-module_fvc-box-row-start__RLwPo {\n justify-content: flex-start;\n}\n.Box-module_fvc-box-row-center__SL2V6 {\n justify-content: center;\n}\n.Box-module_fvc-box-row-end__-POg6 {\n justify-content: flex-end;\n}\n.Box-module_fvc-box-row-space-between__UrK-Z {\n justify-content: space-between;\n}\n.Box-module_fvc-box-row-space-around__gMpOi {\n justify-content: space-around;\n}\n.Box-module_fvc-box-row-top__1luzr {\n align-items: flex-start;\n}\n.Box-module_fvc-box-row-middle__U2xHH {\n align-items: center;\n}\n.Box-module_fvc-box-row-bottom__GDOJz {\n align-items: flex-end;\n}\n.Box-module_fvc-box-col__qg0CX {\n position: relative;\n max-width: 100%;\n min-height: 1px;\n}");var i="fvc-col",u="fvc-box",s=function(e){var n,r=e.children,c=e.className,l=e.display,f=e.style,x=e.justify,a=e.wrap,i=e.align,s=e.direction,v=e.rowGap,m=e.height,b=e.block,p=e.testId,w=d(u,((n={})[_["".concat(u,"-row-").concat(x)]]=x,n[_["".concat(u,"-row-").concat(i)]]=i,n[_["".concat(u,"-").concat(s)]]=s,n[_["".concat(u,"-").concat(l)]]=l,n[_["".concat(u,"-block")]]=b,n[_["".concat(u,"-row-no-wrap")]]=!1===a,n),c),y={};return v&&(y.rowGap="".concat(v,"rem")),m&&(y.minHeight=m),o.createElement("div",{"data-testid":p,className:w,style:t(t({},y),f)},r)};s.Row=function(e){var c=e.testId,l=r(e,["testId"]);return o.createElement(n,t({prefixCls:"fvc-row","data-testid":c},l))},s.Column=function(n){var c,l=n.testId,f=n.col,x=r(n,["testId","col"]),a=d(i,((c={})["".concat(i,"-").concat(f)]=void 0!==f,c),x.className);return o.createElement(e,t({prefixCls:i,"data-testid":l},x,{className:a}))};export{s as Box};
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@fvc/box",
3
+ "version": "1.0.0",
4
+ "main": "./dist/lib/index.js",
5
+ "types": "./dist/lib/box/src/index.d.ts",
6
+ "files": [
7
+ "dist/lib/index.js",
8
+ "dist/lib/box",
9
+ "package.json"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/lib/index.js",
14
+ "types": "./dist/lib/box/src/index.d.ts"
15
+ },
16
+ "./types/*": "./dist/lib/box/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
+ }
25
+ }