@fvc/radio 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.
@@ -0,0 +1,6 @@
1
+ import{Radio as r}from"antd";import e from"react";function n(r,e){var n={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(n[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(o=Object.getOwnPropertySymbols(r);t<o.length;t++)e.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(r,o[t])&&(n[o[t]]=r[o[t]])}return n}function o(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}"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 c,i=(t||(t=1,c=a,function(){var r={}.hasOwnProperty;function e(){for(var r="",e=0;e<arguments.length;e++){var t=arguments[e];t&&(r=o(r,n(t)))}return r}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 t="";for(var a in n)r.call(n,a)&&n[a]&&(t=o(t,a));return t}function o(r,e){return e?r?r+" "+e:r+e:r}c.exports?(e.default=e,c.exports=e):window.classNames=e}()),a.exports),d=o(i);!function(r,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===n&&o.firstChild?o.insertBefore(t,o.firstChild):o.appendChild(t),t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}}(".fvc-radio span.fvc-radio-inner {\n border: 2px solid var(--blue-500);\n background-color: var(--neutral-0);\n}\n.fvc-radio span.fvc-radio-checked span.fvc-radio-inner {\n background-color: var(--neutral-0);\n border-color: var(--blue-500);\n}\n.fvc-radio span.fvc-radio-checked span.fvc-radio-inner::after {\n background-color: var(--blue-500);\n}\n.fvc-radio span.fvc-radio-disabled span.fvc-radio-inner {\n background-color: var(--neutral-0);\n border-color: var(--blue-300);\n}\n.fvc-radio span.fvc-radio-disabled:has([checked]) span.fvc-radio-inner::after {\n background-color: var(--blue-300);\n}\n.fvc-radio:hover span.fvc-radio-inner {\n background-color: var(--neutral-0);\n border-color: var(--blue-500);\n}\n/* Grouped Radio Styles */\n.fvc-radio-group-block:has(.fvc-radio-wrapper) {\n display: block;\n width: 100%;\n}\n.fvc-radio-group-block:has(.fvc-radio-wrapper) .fvc-radio-wrapper {\n width: calc(100% - 22px);\n}");const l="fvc-radio",s="fvc-radio",p=o=>{var{testId:t}=o,a=n(o,["testId"]);const c=d(s);return e.createElement(r,Object.assign({"data-testid":t,prefixCls:s,className:c},a))};p.Group=o=>{var{block:t,className:a}=o,c=n(o,["block","className"]);const i=d({[`${l}-group-block`]:!!t},a);return e.createElement(r.Group,Object.assign({prefixCls:l},c,{className:i}))};export{p as Radio};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './Radio.scss';
3
+ import { GroupProps } from './types';
4
+ export declare const Group: React.FC<GroupProps>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './Radio.scss';
3
+ import { RadioProps } from './types';
4
+ export declare const prefixCls = "fvc-radio";
5
+ export declare const Radio: {
6
+ ({ testId, ...props }: RadioProps): React.JSX.Element;
7
+ Group: React.FC<import("./types").GroupProps>;
8
+ };
@@ -0,0 +1 @@
1
+ export { Radio } from './Radio';
@@ -0,0 +1,7 @@
1
+ import { RadioGroupProps, type RadioProps as DefaultRadioProps } from 'antd';
2
+ export type RadioProps = DefaultRadioProps & {
3
+ testId?: string;
4
+ };
5
+ export interface GroupProps extends RadioGroupProps {
6
+ block?: boolean;
7
+ }
@@ -0,0 +1 @@
1
+ export * from './Radio.types';
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@fvc/radio",
3
+ "version": "1.0.1",
4
+ "main": "./dist/lib/index.js",
5
+ "types": "./dist/lib/radio/src/index.d.ts",
6
+ "files": [
7
+ "dist/lib/index.js",
8
+ "dist/lib/radio",
9
+ "package.json"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/lib/index.js",
14
+ "types": "./dist/lib/radio/src/index.d.ts"
15
+ },
16
+ "./types": {
17
+ "types": "./dist/lib/radio/src/types/index.d.ts"
18
+ }
19
+ },
20
+ "scripts": {
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"
28
+ },
29
+ "peerDependencies": {
30
+ "react": "^18.0.0",
31
+ "antd": "^5.0.0"
32
+ }
33
+ }