@openfin/ui-library 0.21.0-alpha.1689265368 → 0.21.0-alpha.1689700257

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,10 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { UnitPxType } from '../../system/ThemeProvider';
3
- export type CheckboxGroupProps = React.InputHTMLAttributes<HTMLInputElement> & {
3
+ import { ReactNode } from 'react';
4
+ export type CheckboxGroupProps = {
4
5
  gap?: UnitPxType;
5
6
  message?: string;
6
7
  validationErrorMessage?: string;
7
8
  helperText?: string;
8
9
  label?: string;
10
+ children?: ReactNode;
11
+ disabled?: boolean;
12
+ onChange?: (values: Array<string>) => void;
9
13
  };
10
14
  export declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
@@ -1,8 +1,8 @@
1
- import { InputHTMLAttributes, ChangeEvent } from 'react';
1
+ import { TextareaHTMLAttributes, ChangeEvent } from 'react';
2
2
  import { WithStatusProps } from '../../system/HOC';
3
- export type TextAreaProps = InputHTMLAttributes<HTMLTextAreaElement> & {
3
+ export type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
4
4
  onChange?: (e?: ChangeEvent<HTMLTextAreaElement>) => void;
5
5
  } & WithStatusProps;
6
- export declare const TextArea: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLTextAreaElement> & {
6
+ export declare const TextArea: import("react").ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & {
7
7
  onChange?: ((e?: ChangeEvent<HTMLTextAreaElement>) => void) | undefined;
8
8
  } & WithStatusProps & import("react").RefAttributes<HTMLTextAreaElement>>;
package/dist/index.js CHANGED
@@ -710,7 +710,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
710
710
  &:disabled + ${h} {
711
711
  opacity: 0.5;
712
712
  }
713
- `},8051:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(1),t)},9022:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxGroup=void 0;const a=n(5893),l=i(n(6689)),c=i(n(7518)),s=n(1335),u=n(7769),d=n(1),f=n(7030);t.CheckboxGroup=({disabled:e,gap:t="small",helperText:n,label:r,message:o,name:i,children:c,validationErrorMessage:s,onChange:u})=>{const[w,b]=l.useState([]),y=e=>{const t=e.target.value,n=w.includes(t)?w.filter((e=>e!==t)):[...w,t];b(n),u&&u(e)};return(0,a.jsxs)(v,{children:[r&&(0,a.jsxs)(C,{children:[(0,a.jsx)(p,Object.assign({weight:"bold"},{children:r})),n&&(0,a.jsx)(h,{children:n})]}),(0,a.jsx)(g,Object.assign({gap:t},{children:l.Children.map(c,(t=>{const n=t;return n.type===d.Checkbox?l.cloneElement(n,{name:i,disabled:e,onChange:y,checked:w.includes(n.props.value)}):n}))})),!w.length&&s&&(0,a.jsx)(f.ValidationError,{children:s}),o?(0,a.jsx)(m,Object.assign({disabled:e},{children:o})):null]})};const C=(0,c.default)(s.Box)`
713
+ `},8051:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(1),t)},9022:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxGroup=void 0;const a=n(5893),l=i(n(6689)),c=i(n(7518)),s=n(1335),u=n(7769),d=n(8051),f=n(7030);t.CheckboxGroup=({disabled:e,gap:t="small",helperText:n,label:r,message:o,children:i,validationErrorMessage:c,onChange:s})=>{const[u,w]=l.useState([]),b=e=>{const t=e.target.value,n=u.includes(t)?u.filter((e=>e!==t)):[...u,t];w(n),s&&s(n)};return(0,a.jsxs)(v,{children:[r&&(0,a.jsxs)(C,{children:[(0,a.jsx)(p,Object.assign({weight:"bold"},{children:r})),n&&(0,a.jsx)(h,{children:n})]}),(0,a.jsx)(g,Object.assign({gap:t},{children:l.Children.map(i,(t=>{const n=t;return n.type===d.Checkbox?l.cloneElement(n,{disabled:e,onChange:b,checked:u.includes(n.props.value)}):n}))})),!u.length&&c&&(0,a.jsx)(f.ValidationError,{children:c}),o?(0,a.jsx)(m,Object.assign({disabled:e},{children:o})):null]})};const C=(0,c.default)(s.Box)`
714
714
  display: flex;
715
715
  flex-direction: column;
716
716
  margin-bottom: ${({theme:e})=>e.px.small};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openfin/ui-library",
3
3
  "description": "OpenFin UI Component Library",
4
- "version": "0.21.0-alpha.1689265368",
4
+ "version": "0.21.0-alpha.1689700257",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",