@fvc/checkbox 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.
- package/dist/lib/checkbox/src/Checkbox.d.ts +8 -0
- package/dist/lib/checkbox/src/Group.d.ts +4 -0
- package/dist/lib/checkbox/src/index.d.ts +1 -0
- package/dist/lib/checkbox/src/types/Checkbox.types.d.ts +12 -0
- package/dist/lib/checkbox/src/types/index.d.ts +1 -0
- package/dist/lib/index.js +6 -0
- package/package.json +27 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Checkbox.scss';
|
|
3
|
+
import { CheckboxProps } from './types';
|
|
4
|
+
export declare const prefixCls = "fvc-checkbox";
|
|
5
|
+
export declare const Checkbox: {
|
|
6
|
+
({ indeterminate, visible, size, fullWidth, whiteSpaceWrapped, testId, ...props }: CheckboxProps): React.JSX.Element;
|
|
7
|
+
Group: React.FC<import("./types").GroupProps>;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Checkbox } from './Checkbox';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CheckboxProps as DefaultCheckboxProps } from 'antd';
|
|
2
|
+
import { CheckboxGroupProps } from "antd/es/checkbox";
|
|
3
|
+
export type CheckboxProps = DefaultCheckboxProps & {
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
fullWidth?: boolean;
|
|
6
|
+
whiteSpaceWrapped?: boolean;
|
|
7
|
+
testId?: string;
|
|
8
|
+
size?: 'medium' | 'small';
|
|
9
|
+
};
|
|
10
|
+
export interface GroupProps extends CheckboxGroupProps {
|
|
11
|
+
block?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Checkbox.types';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import e from"react";import{Checkbox as c}from"antd";var n=function(){return n=Object.assign||function(e){for(var c,n=1,r=arguments.length;n<r;n++)for(var o in c=arguments[n])Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);return e},n.apply(this,arguments)};function r(e,c){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&c.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)c.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var t,a={exports:{}};
|
|
2
|
+
/*!
|
|
3
|
+
Copyright (c) 2018 Jed Watson.
|
|
4
|
+
Licensed under the MIT License (MIT), see
|
|
5
|
+
http://jedwatson.github.io/classnames
|
|
6
|
+
*/var i,l=(t||(t=1,i=a,function(){var e={}.hasOwnProperty;function c(){for(var e="",c=0;c<arguments.length;c++){var o=arguments[c];o&&(e=r(e,n(o)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return c.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var o="";for(var t in n)e.call(n,t)&&n[t]&&(o=r(o,t));return o}function r(e,c){return c?e?e+" "+c:e+c:e}i.exports?(c.default=c,i.exports=c):window.classNames=c}()),a.exports),b=o(l);!function(e,c){void 0===c&&(c={});var n=c.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("/* Variables */\n/* Base Checkbox Styles */\nlabel.fvc-checkbox {\n /* Hover States */\n /* Disabled State */\n /* Intermediate State */\n /* Checked State */\n /* Size Variations */\n /* Utility Classes */\n}\nlabel.fvc-checkbox span.fvc-checkbox-inner {\n border: 2px solid var(--blue-500);\n border-radius: 2px;\n width: 18px;\n height: 18px;\n}\nlabel.fvc-checkbox:hover span.fvc-checkbox-disabled span.fvc-checkbox-inner {\n border-color: var(--blue-300);\n}\nlabel.fvc-checkbox:hover span.fvc-checkbox-disabled:has([checked]) span.fvc-checkbox-inner {\n background-color: var(--blue-300);\n}\nlabel.fvc-checkbox:hover .fvc-checkbox-indeterminate span.fvc-checkbox-inner {\n border-color: var(--blue-500);\n background-color: var(--neutral-0);\n}\nlabel.fvc-checkbox:not(.fvc-checkbox-wrapper-disabled):hover:not(:has(.fvc-checkbox-indeterminate)) span.fvc-checkbox span.fvc-checkbox-inner {\n border-color: var(--blue-500);\n}\nlabel.fvc-checkbox:not(.fvc-checkbox-wrapper-disabled):hover:not(:has(.fvc-checkbox-indeterminate)) span.fvc-checkbox-checked span.fvc-checkbox-inner {\n background-color: var(--blue-500);\n}\nlabel.fvc-checkbox span.fvc-checkbox-disabled span.fvc-checkbox-inner {\n border-color: var(--blue-300) !important; /* Overrides default antd styles */\n background-color: var(--neutral-0) !important; /* Overrides default antd styles */\n}\nlabel.fvc-checkbox span.fvc-checkbox-disabled:has([checked]) span.fvc-checkbox-inner {\n background-color: var(--blue-300);\n}\nlabel.fvc-checkbox span.fvc-checkbox-disabled + .fvc-checkbox-label {\n color: initial;\n}\nlabel.fvc-checkbox .fvc-checkbox-indeterminate span.fvc-checkbox-inner {\n border-color: var(--blue-500) !important; /* Overrides default antd styles */\n}\nlabel.fvc-checkbox .fvc-checkbox-indeterminate span.fvc-checkbox-inner::after {\n transition: none;\n visibility: hidden;\n}\nlabel.fvc-checkbox span.fvc-checkbox-checked {\n /* Checked + Intermediate State */\n}\nlabel.fvc-checkbox span.fvc-checkbox-checked span.fvc-checkbox-inner {\n background-color: var(--blue-500);\n}\nlabel.fvc-checkbox span.fvc-checkbox-checked span.fvc-checkbox-inner::after {\n width: 6px;\n height: 12px;\n top: 45%;\n border-color: var(--neutral-0);\n}\nlabel.fvc-checkbox span.fvc-checkbox-checked.fvc-checkbox-indeterminate span.fvc-checkbox-inner {\n border-color: var(--blue-500);\n background-color: var(--neutral-0);\n}\nlabel.fvc-checkbox span.fvc-checkbox-checked.fvc-checkbox-indeterminate span.fvc-checkbox-inner::after {\n width: 10px;\n height: 2px;\n top: 50%;\n visibility: visible;\n}\nlabel.fvc-checkbox span.fvc-checkbox-checked.fvc-checkbox-indeterminate:not(:has([disabled])) span.fvc-checkbox-inner::after {\n background-color: var(--blue-500);\n}\nlabel.fvc-checkbox-small span.fvc-checkbox-inner {\n width: 14px;\n height: 14px;\n}\nlabel.fvc-checkbox-small span.fvc-checkbox-checked span.fvc-checkbox-inner::after {\n width: 5px;\n height: 8px;\n}\nlabel.fvc-checkbox-small span.fvc-checkbox-checked.fvc-checkbox-indeterminate span.fvc-checkbox-inner::after {\n width: 8px;\n height: 2px;\n}\nlabel.fvc-checkbox-white-space-wrapped {\n white-space: normal;\n}\nlabel.fvc-checkbox-full-width {\n min-width: 100%;\n}\nlabel.fvc-checkbox-invisible span.fvc-checkbox-inner {\n display: none;\n}\n\n/* Grouped Checkbox Styles */\n.fvc-checkbox-group {\n width: 100%;\n}\n.fvc-checkbox-group .fvc-checkbox-wrapper {\n margin-left: 8px;\n width: calc(100% - 22px);\n}");var h="fvc-checkbox",s="fvc-checkbox",f=function(o){var t,a=o.indeterminate,i=void 0!==a&&a,l=o.visible,h=void 0===l||l,f=o.size,d=void 0===f?"medium":f,v=o.fullWidth,p=void 0!==v&&v,x=o.whiteSpaceWrapped,k=void 0!==x&&x,u=o.testId,m=r(o,["indeterminate","visible","size","fullWidth","whiteSpaceWrapped","testId"]),y=b(s,((t={})["".concat(s,"-").concat(d)]=d,t["".concat(s,"-invisible")]=!1===h,t["".concat(s,"-full-width")]=!!p,t["".concat(s,"-white-space-wrapped")]=!!k,t));return e.createElement(c,n({"data-testid":u,prefixCls:s,className:y,indeterminate:i},m))};f.Group=function(o){var t,a=o.block,i=o.className,l=r(o,["block","className"]),s=b(((t={})["".concat(h,"-block")]=!!a,t),i);return e.createElement(c.Group,n({prefixCls:h},l,{className:s}))};export{f as Checkbox};
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fvc/checkbox",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "./dist/lib/index.js",
|
|
5
|
+
"types": "./dist/lib/checkbox/src/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/lib/index.js",
|
|
8
|
+
"dist/lib/checkbox",
|
|
9
|
+
"package.json"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/lib/index.js",
|
|
14
|
+
"types": "./dist/lib/checkbox/src/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./types": {
|
|
17
|
+
"types": "./dist/lib/checkbox/src/types/index.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rm -rf dist && 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
|
+
}
|
|
27
|
+
}
|