ui-beyable 1.1.0-beta.23 → 1.1.0-beta.24

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,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { ICheckbox, IRadio, ISwitch } from './types';
3
3
  import { IList } from '../List/types';
4
- declare function Checkbox({ children, type, label, description, tooltip, tooltipHTML, name, value, checked, forcedChecked, disabled, onChange, size, fullWidth }: ICheckbox): JSX.Element;
4
+ declare function Checkbox({ children, type, label, description, tooltip, tooltipHTML, name, value, checked, forcedChecked, disabled, onChange, size, fullWidth, className }: ICheckbox): JSX.Element;
5
5
  declare function Radio(props: IRadio): JSX.Element;
6
- declare function Switch({ children, label, name, value, checked, onChange, disabled, forcedChecked, position, size, align, verticalSize, noMargin }: ISwitch): JSX.Element;
6
+ declare function Switch({ children, label, name, value, checked, onChange, disabled, forcedChecked, position, size, align, verticalSize, noMargin, className }: ISwitch): JSX.Element;
7
7
  declare function CheckboxList(props: IList): JSX.Element;
8
8
  export { Checkbox, Radio, Switch, CheckboxList };
@@ -9,6 +9,7 @@ interface ICommon {
9
9
  forcedChecked?: boolean;
10
10
  disabled?: boolean;
11
11
  onChange?: any;
12
+ className?: string;
12
13
  }
13
14
  interface IRadio extends ICommon {
14
15
  size?: 's' | 'm' | 'l';
package/lib/cjs/index.js CHANGED
@@ -2453,7 +2453,7 @@ var margin = {"l_2":"Margin-module_l_2__SAWjp","l_3":"Margin-module_l_3__oR-rV",
2453
2453
  styleInject(css_248z$p);
2454
2454
 
2455
2455
  function Checkbox(_a) {
2456
- var children = _a.children, _b = _a.type, type = _b === void 0 ? 'checkbox' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.description, description = _d === void 0 ? '' : _d, _e = _a.tooltip, tooltip = _e === void 0 ? '' : _e, _f = _a.tooltipHTML, tooltipHTML = _f === void 0 ? '' : _f, name = _a.name, value = _a.value, checked = _a.checked, forcedChecked = _a.forcedChecked, _g = _a.disabled, disabled = _g === void 0 ? false : _g, onChange = _a.onChange, _h = _a.size, size = _h === void 0 ? 'm' : _h, _j = _a.fullWidth, fullWidth = _j === void 0 ? false : _j;
2456
+ var children = _a.children, _b = _a.type, type = _b === void 0 ? 'checkbox' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.description, description = _d === void 0 ? '' : _d, _e = _a.tooltip, tooltip = _e === void 0 ? '' : _e, _f = _a.tooltipHTML, tooltipHTML = _f === void 0 ? '' : _f, name = _a.name, value = _a.value, checked = _a.checked, forcedChecked = _a.forcedChecked, _g = _a.disabled, disabled = _g === void 0 ? false : _g, onChange = _a.onChange, _h = _a.size, size = _h === void 0 ? 'm' : _h, _j = _a.fullWidth, fullWidth = _j === void 0 ? false : _j, className = _a.className;
2457
2457
  var tooltipID = v4();
2458
2458
  var change = function (ev) {
2459
2459
  if (typeof onChange === 'function') {
@@ -2481,6 +2481,9 @@ function Checkbox(_a) {
2481
2481
  l: styles$i.wrapper_size_l,
2482
2482
  xl: styles$i.wrapper_size_xl,
2483
2483
  };
2484
+ if (className) {
2485
+ cssClass.push(className);
2486
+ }
2484
2487
  if (disabled) {
2485
2488
  cssClass.push(styles$i.wrapper_disabled);
2486
2489
  }
@@ -2533,7 +2536,7 @@ function Radio(props) {
2533
2536
  return (React.createElement(Checkbox, __assign({}, props, { type: "radio" }), props.children));
2534
2537
  }
2535
2538
  function Switch(_a) {
2536
- var children = _a.children, label = _a.label, name = _a.name, value = _a.value, checked = _a.checked, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b, forcedChecked = _a.forcedChecked, _c = _a.position, position = _c === void 0 ? 'left' : _c, _d = _a.size, size = _d === void 0 ? 'm' : _d, _e = _a.align, align = _e === void 0 ? 'top' : _e, _f = _a.verticalSize, verticalSize = _f === void 0 ? 'm' : _f, _g = _a.noMargin, noMargin = _g === void 0 ? false : _g;
2539
+ var children = _a.children, label = _a.label, name = _a.name, value = _a.value, checked = _a.checked, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b, forcedChecked = _a.forcedChecked, _c = _a.position, position = _c === void 0 ? 'left' : _c, _d = _a.size, size = _d === void 0 ? 'm' : _d, _e = _a.align, align = _e === void 0 ? 'top' : _e, _f = _a.verticalSize, verticalSize = _f === void 0 ? 'm' : _f, _g = _a.noMargin, noMargin = _g === void 0 ? false : _g, className = _a.className;
2537
2540
  var change = function (ev) {
2538
2541
  if (typeof onChange === 'function') {
2539
2542
  onChange(ev);
@@ -2557,6 +2560,9 @@ function Switch(_a) {
2557
2560
  l: styles$i.wrapper_padding_l,
2558
2561
  xl: styles$i.wrapper_padding_xl,
2559
2562
  };
2563
+ if (className) {
2564
+ labelClass.push(className);
2565
+ }
2560
2566
  if (isChecked) {
2561
2567
  switchClass.push(styles$i.switch_checked);
2562
2568
  }