phx-react 1.3.681 → 1.3.682

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.
@@ -8,5 +8,7 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
8
8
  error?: boolean;
9
9
  errorType?: 'required-field' | 'duplicate-field';
10
10
  description?: string;
11
+ disabled?: boolean;
12
+ defaultChecked?: boolean;
11
13
  }
12
14
  export declare const PHXRadio: React.FC<InputProps>;
@@ -5,14 +5,14 @@ var tslib_1 = require("tslib");
5
5
  var react_1 = tslib_1.__importDefault(require("react"));
6
6
  var types_1 = require("../types");
7
7
  var PHXRadio = function (_a) {
8
- var className = _a.className, error = _a.error, errorType = _a.errorType, label = _a.label, register = _a.register, title = _a.title, description = _a.description, rest = tslib_1.__rest(_a, ["className", "error", "errorType", "label", "register", "title", "description"]);
8
+ var className = _a.className, error = _a.error, errorType = _a.errorType, label = _a.label, register = _a.register, title = _a.title, description = _a.description, disabled = _a.disabled, defaultChecked = _a.defaultChecked, rest = tslib_1.__rest(_a, ["className", "error", "errorType", "label", "register", "title", "description", "disabled", "defaultChecked"]);
9
9
  return (react_1["default"].createElement("div", { className: className },
10
10
  react_1["default"].createElement("label", { className: (0, types_1.classNames)(label ? 'mb-1 block text-xs font-normal text-gray-700' : 'hidden') }, label),
11
11
  react_1["default"].createElement("div", { className: 'flex items-center' },
12
12
  react_1["default"].createElement("label", { className: 'flex items-center text-xs font-normal leading-5 text-gray-700 hover:cursor-pointer' },
13
- react_1["default"].createElement("input", tslib_1.__assign({}, register, rest, { className: (0, types_1.classNames)(error ? 'border-red-800 bg-red-50 hover:bg-red-50 focus:border-red-800 focus:bg-red-50' : '', 'h-4 w-4 border-gray-300 p-0 text-indigo-900 focus:ring-indigo-900'), type: 'radio' })),
14
- react_1["default"].createElement("span", { className: 'ml-2' }, title))),
15
- react_1["default"].createElement("p", { className: 'text-xs font-normal text-gray-500 ml-6' }, description),
13
+ react_1["default"].createElement("input", tslib_1.__assign({}, register, rest, { disabled: disabled, defaultChecked: defaultChecked, className: (0, types_1.classNames)(error ? 'border-red-800 bg-red-50 hover:bg-red-50 focus:border-red-800 focus:bg-red-50' : '', 'h-4 w-4 border-gray-300 p-0 text-indigo-900 focus:ring-indigo-900'), type: 'radio' })),
14
+ react_1["default"].createElement("span", { className: (0, types_1.classNames)('ml-2', disabled && !defaultChecked && 'opacity-80') }, title))),
15
+ react_1["default"].createElement("p", { className: (0, types_1.classNames)('text-xs font-normal text-gray-500 ml-6', disabled && !defaultChecked && 'opacity-80') }, description),
16
16
  error && errorType ? (react_1["default"].createElement("div", { className: 'ml-1 mt-1 flex items-center' },
17
17
  react_1["default"].createElement("svg", { className: 'mr-2 h-4 w-4 text-red-500', fill: 'none', stroke: 'currentColor', strokeWidth: '2', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' },
18
18
  react_1["default"].createElement("path", { d: 'M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z', strokeLinecap: 'round', strokeLinejoin: 'round' })),
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../../src/components/Radio/Radio.tsx"],"names":[],"mappings":";;;;AAAA,wDAAkD;AAElD,kCAAqC;AAY9B,IAAM,QAAQ,GAAyB,UAAC,EASlC;IARX,IAAA,SAAS,eAAA,EACT,KAAK,WAAA,EACL,SAAS,eAAA,EACT,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,WAAW,iBAAA,EACR,IAAI,sBARsC,gFAS9C,CADQ;IACS,OAAA,CAChB,0CAAK,SAAS,EAAE,SAAS;QACvB,4CAAO,SAAS,EAAE,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAG,KAAK,CAAS;QAChH,0CAAK,SAAS,EAAC,mBAAmB;YAChC,4CAAO,SAAS,EAAC,oFA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LAttributes<HTMLInputElement> {
8
8
  error?: boolean;
9
9
  errorType?: 'required-field' | 'duplicate-field';
10
10
  description?: string;
11
+ disabled?: boolean;
12
+ defaultChecked?: boolean;
11
13
  }
12
14
  export declare const PHXRadio: React.FC<InputProps>;
@@ -2,14 +2,14 @@ import { __assign, __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import { classNames } from '../types';
4
4
  export var PHXRadio = function (_a) {
5
- var className = _a.className, error = _a.error, errorType = _a.errorType, label = _a.label, register = _a.register, title = _a.title, description = _a.description, rest = __rest(_a, ["className", "error", "errorType", "label", "register", "title", "description"]);
5
+ var className = _a.className, error = _a.error, errorType = _a.errorType, label = _a.label, register = _a.register, title = _a.title, description = _a.description, disabled = _a.disabled, defaultChecked = _a.defaultChecked, rest = __rest(_a, ["className", "error", "errorType", "label", "register", "title", "description", "disabled", "defaultChecked"]);
6
6
  return (React.createElement("div", { className: className },
7
7
  React.createElement("label", { className: classNames(label ? 'mb-1 block text-xs font-normal text-gray-700' : 'hidden') }, label),
8
8
  React.createElement("div", { className: 'flex items-center' },
9
9
  React.createElement("label", { className: 'flex items-center text-xs font-normal leading-5 text-gray-700 hover:cursor-pointer' },
10
- React.createElement("input", __assign({}, register, rest, { className: classNames(error ? 'border-red-800 bg-red-50 hover:bg-red-50 focus:border-red-800 focus:bg-red-50' : '', 'h-4 w-4 border-gray-300 p-0 text-indigo-900 focus:ring-indigo-900'), type: 'radio' })),
11
- React.createElement("span", { className: 'ml-2' }, title))),
12
- React.createElement("p", { className: 'text-xs font-normal text-gray-500 ml-6' }, description),
10
+ React.createElement("input", __assign({}, register, rest, { disabled: disabled, defaultChecked: defaultChecked, className: classNames(error ? 'border-red-800 bg-red-50 hover:bg-red-50 focus:border-red-800 focus:bg-red-50' : '', 'h-4 w-4 border-gray-300 p-0 text-indigo-900 focus:ring-indigo-900'), type: 'radio' })),
11
+ React.createElement("span", { className: classNames('ml-2', disabled && !defaultChecked && 'opacity-80') }, title))),
12
+ React.createElement("p", { className: classNames('text-xs font-normal text-gray-500 ml-6', disabled && !defaultChecked && 'opacity-80') }, description),
13
13
  error && errorType ? (React.createElement("div", { className: 'ml-1 mt-1 flex items-center' },
14
14
  React.createElement("svg", { className: 'mr-2 h-4 w-4 text-red-500', fill: 'none', stroke: 'currentColor', strokeWidth: '2', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' },
15
15
  React.createElement("path", { d: 'M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z', strokeLinecap: 'round', strokeLinejoin: 'round' })),
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../../src/components/Radio/Radio.tsx"],"names":[],"mappings":";AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAYrC,MAAM,CAAC,IAAM,QAAQ,GAAyB,UAAC,EASlC;IARX,IAAA,SAAS,eAAA,EACT,KAAK,WAAA,EACL,SAAS,eAAA,EACT,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,WAAW,iBAAA,EACR,IAAI,cARsC,gFAS9C,CADQ;IACS,OAAA,CAChB,6BAAK,SAAS,EAAE,SAAS;QACvB,+BAAO,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAG,KAAK,CAAS;QAChH,6BAAK,SAAS,EAAC,mBAAmB;YAChC,+BAAO,SAAS,EAAC,oFAAoF;gBACnG,0CACM,QAAQ,EACR,IAAI,IACR,SAAS,EAAE,UAAU,CACnB,KAAK,CAAC,CAAC,CAAC,+EAA+E,CAAC,CAAC,CAAC,EAAE,EAC5F,mEAAmE,CACpE,EACD,IAAI,EAAC,OAAO,IACZ;gBACF,8BAAM,SAAS,EAAC,MAAM,IAAE,KAAK,CAAQ,CAC/B,CACJ;QACN,2BAAG,SAAS,EA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Q,EAClB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,UAAU,CACnB,KAAK,CAAC,CAAC,CAAC,+EAA+E,CAAC,CAAC,CAAC,EAAE,EAC5F,mEAAmE,CACpE,EACD,IAAI,EAAC,OAAO,IACZ;gBACF,8BAAM,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,QAAQ,IAAI,CAAC,cAAc,IAAI,YAAY,CAAC,IAAG,KAAK,CAAQ,CAC1F,CACJ;QACN,2BAAG,SAAS,EAAE,UAAU,CAAC,wCAAwC,EAAE,QAAQ,IAAI,CAAC,cAAc,IAAI,YAAY,CAAC,IAC5G,WAAW,CACV;QACH,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,CACpB,6BAAK,SAAS,EAAC,6BAA6B;YAC1C,6BACE,SAAS,EAAC,2BAA2B,EACrC,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B;gBAElC,8BACE,CAAC,EAAC,0EAA0E,EAC5E,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,CACE;YAEN,2BAAG,SAAS,EAAC,sBAAsB,IAChC,SAAS,KAAK,gBAAgB,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,sBAAsB,CAClF,CACA,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAA;CAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phx-react",
3
- "version": "1.3.681",
3
+ "version": "1.3.682",
4
4
  "description": "PHX REACT",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",