@fvc/box 1.1.0 → 1.1.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 { JSX, ReactNode, CSSProperties } from 'react';
|
|
2
1
|
import { RowProps as BaseRowProps, ColProps as BaseColProps } from 'antd';
|
|
2
|
+
import { JSX, ReactNode, CSSProperties } from 'react';
|
|
3
3
|
type BoxDisplay = 'flex' | 'inline-flex';
|
|
4
4
|
type BoxDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
5
5
|
export type BoxProps = {
|
package/dist/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from"react";import{Col as n,Row as t}from"antd";
|
|
1
|
+
import e from"react";import{Col as n,Row as t}from"antd";function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o,c={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
|
|
6
|
+
*/var i,a=(o||(o=1,i=c,function(){var e={}.hasOwnProperty;function n(){for(var e="",n=0;n<arguments.length;n++){var o=arguments[n];o&&(e=r(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 n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var o="";for(var c in t)e.call(t,c)&&t[c]&&(o=r(o,c));return o}function r(e,n){return n?e?e+" "+n:e+n:e}i.exports?(n.default=n,i.exports=n):window.classNames=n}()),c.exports),s=r(a);function l(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;const f="fvc-col";!function(e,n){void 0===n&&(n={});var t=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".fvc-box-row {\n display: flex;\n flex-flow: row wrap;\n}\n.fvc-box-row::before, .fvc-box-row::after {\n display: flex;\n}\n.fvc-box-row-no-wrap {\n flex-wrap: nowrap;\n}\n.fvc-box-flex {\n display: flex;\n}\n.fvc-box-inline-flex {\n display: inline-flex;\n}\n.fvc-box-row {\n flex-direction: row;\n}\n.fvc-box-column {\n flex-direction: column;\n}\n.fvc-box-column-reverse {\n flex-direction: column-reverse;\n}\n.fvc-box-row-reverse {\n flex-direction: row-reverse;\n}\n.fvc-box-block {\n width: 100%;\n}\n.fvc-box-row-start {\n justify-content: flex-start;\n}\n.fvc-box-row-center {\n justify-content: center;\n}\n.fvc-box-row-end {\n justify-content: flex-end;\n}\n.fvc-box-row-space-between {\n justify-content: space-between;\n}\n.fvc-box-row-space-around {\n justify-content: space-around;\n}\n.fvc-box-row-top {\n align-items: flex-start;\n}\n.fvc-box-row-middle {\n align-items: center;\n}\n.fvc-box-row-bottom {\n align-items: flex-end;\n}\n.fvc-box-col {\n position: relative;\n max-width: 100%;\n min-height: 1px;\n}");const d="fvc-box",p=({children:n,className:t,display:r,style:o,justify:c,wrap:i,align:a,direction:l,rowGap:f,height:p,block:u,testId:x})=>{const v=s(d,{[`${d}-row-${c}`]:c,[`${d}-row-${a}`]:a,[`${d}-${l}`]:l,[`${d}-${r}`]:r,[`${d}-block`]:u,[`${d}-row-no-wrap`]:!1===i},t),b={};return f&&(b.rowGap=`${f}rem`),p&&(b.minHeight=p),e.createElement("div",{"data-testid":x,className:v,style:Object.assign(Object.assign({},b),o)},n)};p.Row=n=>{var{testId:r}=n,o=l(n,["testId"]);return e.createElement(t,Object.assign({prefixCls:"fvc-row","data-testid":r},o))},p.Column=t=>{var{testId:r,col:o}=t,c=l(t,["testId","col"]);const i=s(f,{[`${f}-${o}`]:void 0!==o},c.className);return e.createElement(n,Object.assign({prefixCls:f,"data-testid":r},c,{className:i}))};export{p as Box};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fvc/box",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"main": "./dist/lib/index.js",
|
|
5
5
|
"types": "./dist/lib/box/src/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -18,9 +18,15 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "
|
|
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"
|
|
22
28
|
},
|
|
23
|
-
"
|
|
29
|
+
"peerDependencies": {
|
|
24
30
|
"react": "^18.0.0",
|
|
25
31
|
"antd": "^5.0.0"
|
|
26
32
|
}
|