@fvc/checkbox 1.0.0 → 1.0.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
1
  import { type CheckboxProps as DefaultCheckboxProps } from 'antd';
2
- import { CheckboxGroupProps } from "antd/es/checkbox";
2
+ import { CheckboxGroupProps } from 'antd/es/checkbox';
3
3
  export type CheckboxProps = DefaultCheckboxProps & {
4
4
  visible?: boolean;
5
5
  fullWidth?: boolean;
package/dist/lib/index.js CHANGED
@@ -1,6 +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:{}};
1
+ import{Checkbox as e}from"antd";import c from"react";function n(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 r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var o,a={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 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};
6
+ */var t,l=(o||(o=1,t=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 a in n)e.call(n,a)&&n[a]&&(o=r(o,a));return o}function r(e,c){return c?e?e+" "+c:e+c:e}t.exports?(c.default=c,t.exports=c):window.classNames=c}()),a.exports),b=r(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 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 {\n /* Hover States */\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 {\n /* Disabled State */\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 {\n /* Intermediate State */\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 {\n /* Checked 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 {\n /* Checked + Intermediate State */\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 {\n /* Size Variations */\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 {\n /* Utility Classes */\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/* Grouped Checkbox Styles */\n.fvc-checkbox-group-block {\n width: 100%;\n}\n.fvc-checkbox-group-block .fvc-checkbox-wrapper {\n width: calc(100% - 22px);\n}");const i="fvc-checkbox",h="fvc-checkbox",s=r=>{var{indeterminate:o=!1,visible:a=!0,size:t="medium",fullWidth:l=!1,whiteSpaceWrapped:i=!1,testId:s}=r,f=n(r,["indeterminate","visible","size","fullWidth","whiteSpaceWrapped","testId"]);const v=b(h,{[`${h}-${t}`]:t,[`${h}-invisible`]:!1===a,[`${h}-full-width`]:!!l,[`${h}-white-space-wrapped`]:!!i});return c.createElement(e,Object.assign({"data-testid":s,prefixCls:h,className:v,indeterminate:o},f))};s.Group=r=>{var{block:o,className:a}=r,t=n(r,["block","className"]);const l=b({[`${i}-group-block`]:!!o},a);return c.createElement(e.Group,Object.assign({prefixCls:i},t,{className:l}))};export{s as Checkbox};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fvc/checkbox",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "./dist/lib/index.js",
5
5
  "types": "./dist/lib/checkbox/src/index.d.ts",
6
6
  "files": [
@@ -18,9 +18,15 @@
18
18
  }
19
19
  },
20
20
  "scripts": {
21
- "build": "rm -rf dist && eslint --config ../../eslint.config.js . && bunx tsc --noEmit && rollup -c ./rollup.config.mjs"
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
- "dependencies": {
29
+ "peerDependencies": {
24
30
  "react": "^18.0.0",
25
31
  "antd": "^5.0.0"
26
32
  }