@uxf/ui 1.0.0-beta.159 → 1.0.0-beta.160

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.
@@ -3,6 +3,7 @@ import { FormControlProps } from "../types";
3
3
  import { CheckboxSize } from "./theme";
4
4
  export interface CheckboxProps extends FormControlProps<boolean | undefined> {
5
5
  className?: string;
6
+ id?: string;
6
7
  indeterminate?: boolean;
7
8
  renderContent?: (className: string, checked: boolean | undefined) => ReactNode;
8
9
  size?: CheckboxSize;
@@ -39,6 +39,7 @@ exports.Checkbox = (0, react_1.forwardRef)((props, ref) => {
39
39
  "aria-readonly": props.isReadOnly,
40
40
  "aria-required": props.isRequired,
41
41
  className: (0, cx_1.cx)("uxf-checkbox", `uxf-checkbox--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, props.className, props.indeterminate && classes_1.CLASSES.IS_INDETERMINATE, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isFocused && classes_1.CLASSES.IS_FOCUSED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED),
42
+ id: props.id,
42
43
  onBlur: props.onBlur,
43
44
  onClick: onChange,
44
45
  onFocus: props.onFocus,
@@ -2,6 +2,7 @@ import React, { CSSProperties, ReactNode } from "react";
2
2
  import { FormControlProps } from "../types";
3
3
  export interface CheckboxButtonProps extends FormControlProps<boolean | undefined> {
4
4
  className?: string;
5
+ id?: string;
5
6
  label: ReactNode;
6
7
  style?: CSSProperties;
7
8
  }
@@ -30,7 +30,7 @@ const cx_1 = require("@uxf/core/utils/cx");
30
30
  const classes_1 = require("@uxf/core/constants/classes");
31
31
  const icon_1 = require("../icon");
32
32
  exports.CheckboxButton = (0, react_2.forwardRef)((props, ref) => {
33
- return (react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)("uxf-checkbox-button", props.className, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED), disabled: props.isDisabled, name: props.name, onChange: props.onChange, ref: ref, style: props.style },
33
+ return (react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)("uxf-checkbox-button", props.className, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED), disabled: props.isDisabled, id: props.id, name: props.name, onChange: props.onChange, ref: ref, style: props.style },
34
34
  react_2.default.createElement("span", { className: "uxf-checkbox-button__label" }, props.label),
35
35
  react_2.default.createElement("span", { className: "uxf-checkbox-button__icon" },
36
36
  react_2.default.createElement(icon_1.Icon, { name: "check" }))));
@@ -3,6 +3,7 @@ import { FormControlProps } from "../types";
3
3
  import { CheckboxSize } from "../checkbox";
4
4
  export interface CheckboxInputProps extends FormControlProps<boolean | undefined> {
5
5
  className?: string;
6
+ id?: string;
6
7
  indeterminate?: boolean;
7
8
  label: ReactNode;
8
9
  size?: CheckboxSize;
@@ -31,7 +31,7 @@ exports.CheckboxInput = (0, react_2.forwardRef)((props, ref) => {
31
31
  var _a;
32
32
  return (react_2.default.createElement(react_1.Switch.Group, null,
33
33
  react_2.default.createElement("div", { className: `uxf-checkbox-input__wrapper ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` },
34
- react_2.default.createElement(react_1.Switch, { as: react_2.Fragment, checked: props.value, name: props.name, onChange: props.onChange }, ({ checked }) => (react_2.default.createElement(checkbox_1.Checkbox, { className: "uxf-checkbox-input", indeterminate: props.indeterminate, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, onChange: props.onChange, ref: ref, size: props.size, style: props.style, value: checked }))),
34
+ react_2.default.createElement(react_1.Switch, { as: react_2.Fragment, checked: props.value, name: props.name, onChange: props.onChange }, ({ checked }) => (react_2.default.createElement(checkbox_1.Checkbox, { className: "uxf-checkbox-input", id: props.id, indeterminate: props.indeterminate, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, onChange: props.onChange, ref: ref, size: props.size, style: props.style, value: checked }))),
35
35
  react_2.default.createElement(react_1.Switch.Label, { className: "uxf-checkbox-input__label" }, props.label))));
36
36
  });
37
37
  exports.CheckboxInput.displayName = "UxfUiCheckboxInput";
@@ -10,7 +10,7 @@ export interface ColorRadioGroupProps extends FormControlProps<ColorRadioGroupOp
10
10
  className?: string;
11
11
  helperText?: ReactNode;
12
12
  hiddenLabel?: boolean;
13
- id: string;
13
+ id?: string;
14
14
  label: string;
15
15
  options: ColorRadioGroupOption[];
16
16
  style?: CSSProperties;
@@ -6,6 +6,7 @@ export interface DropzoneInputProps extends FormControlProps<DropzoneFile[] | un
6
6
  accept?: Accept;
7
7
  helperText?: ReactNode;
8
8
  icon?: IconName;
9
+ id?: string;
9
10
  label?: ReactNode;
10
11
  maxFileSize?: number;
11
12
  maxFilesCount?: number;
@@ -112,6 +112,7 @@ exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
112
112
  typeof props.label === "string" ? react_1.default.createElement("span", null, props.label) : props.label,
113
113
  react_1.default.createElement("input", { ...getInputProps({
114
114
  className: "uxf-dropzone__input",
115
+ id: props.id,
115
116
  name: props.name,
116
117
  type: "file",
117
118
  }) })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "1.0.0-beta.159",
3
+ "version": "1.0.0-beta.160",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,7 +13,7 @@ export interface RadioGroupProps extends FormControlProps<RadioGroupOptionValue
13
13
  helperText?: ReactNode;
14
14
  forceColumn?: boolean;
15
15
  hiddenLabel?: boolean;
16
- id: string;
16
+ id?: string;
17
17
  label: string;
18
18
  options: RadioGroupOption[];
19
19
  radioSize?: RadioSize;
@@ -4,6 +4,7 @@ import { ToggleVariant } from "./theme";
4
4
  export interface ToggleProps extends FormControlProps<boolean | undefined> {
5
5
  className?: string;
6
6
  hiddenLabel?: boolean;
7
+ id?: string;
7
8
  label: ReactNode;
8
9
  style?: CSSProperties;
9
10
  variant?: ToggleVariant;
package/toggle/toggle.js CHANGED
@@ -32,7 +32,7 @@ exports.Toggle = (0, react_1.forwardRef)((props, ref) => {
32
32
  var _a, _b;
33
33
  return (react_1.default.createElement(react_2.Switch.Group, null,
34
34
  react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-toggle__wrapper", `uxf-toggle__wrapper--${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"}`, props.hiddenLabel && "uxf-toggle__wrapper--hiddenLabel", props.className) },
35
- react_1.default.createElement(react_2.Switch, { checked: props.value, className: (0, cx_1.cx)(props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED, "uxf-toggle", `uxf-toggle--${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`), disabled: props.isDisabled, name: props.name, onChange: props.onChange, style: props.style, ref: ref },
35
+ react_1.default.createElement(react_2.Switch, { checked: props.value, className: (0, cx_1.cx)(props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED, "uxf-toggle", `uxf-toggle--${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`), disabled: props.isDisabled, id: props.id, name: props.name, onChange: props.onChange, ref: ref, style: props.style },
36
36
  react_1.default.createElement("span", { className: "uxf-toggle__inner" })),
37
37
  react_1.default.createElement(react_2.Switch.Label, { hidden: props.hiddenLabel, className: "uxf-toggle__label" }, props.label))));
38
38
  });