@wavv/ui 2.7.0 → 2.7.2

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.
@@ -23,11 +23,13 @@ type Props = {
23
23
  align?: FlexPosition;
24
24
  /** Renders the checkbox icon at 12px instead of the default 24px */
25
25
  tiny?: boolean;
26
+ /** Renders the checkbox icon at 14px instead of the default 24px */
27
+ small?: boolean;
26
28
  onChange?: CheckboxProps['onChange'];
27
29
  className?: CheckboxProps['className'];
28
30
  style?: CheckboxProps['style'];
29
31
  } & Margin & Omit<CheckboxProps, 'value' | 'isDisabled' | 'isReadOnly' | 'isSelected' | 'isIndeterminate'>;
30
- declare const Checkbox: ({ label, labelPosition, checked, partial, disabled, readOnly, onChange, align, labelColor, tiny, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
32
+ declare const Checkbox: ({ label, labelPosition, checked, partial, disabled, readOnly, onChange, align, labelColor, tiny, small, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
31
33
  export declare const ControlContainer: import("@emotion/styled").StyledComponent<CheckboxProps & import("react").RefAttributes<HTMLLabelElement> & {
32
34
  theme?: import("@emotion/react").Theme;
33
35
  } & {
@@ -8,9 +8,10 @@ import { ControlLabel } from "./FormControl.js";
8
8
  import getFlexPosition from "./helpers/getFlexPosition.js";
9
9
  import { marginProps } from "./helpers/styledProps.js";
10
10
  import Icon from "./Icon/index.js";
11
- const Checkbox_Checkbox = ({ label, labelPosition, checked, partial, disabled, readOnly, onChange, align, labelColor, tiny, ...props })=>{
11
+ const Checkbox_Checkbox = ({ label, labelPosition, checked, partial, disabled, readOnly, onChange, align, labelColor, tiny, small, ...props })=>{
12
12
  const labelRight = 'right' === labelPosition;
13
13
  const isControlled = 'boolean' == typeof checked;
14
+ const iconSize = small ? 14 : tiny ? 12 : void 0;
14
15
  return /*#__PURE__*/ jsx(ControlContainer, {
15
16
  labelRight: labelRight,
16
17
  align: align,
@@ -39,7 +40,7 @@ const Checkbox_Checkbox = ({ label, labelPosition, checked, partial, disabled, r
39
40
  }),
40
41
  /*#__PURE__*/ jsx(Icon, {
41
42
  svg: svg,
42
- size: tiny ? 'tiny' : void 0,
43
+ size: iconSize,
43
44
  pointer: !disabled
44
45
  })
45
46
  ]
@@ -14,9 +14,9 @@ declare const Form: {
14
14
  Field({ children, inline, align, disabled, ...props }: FieldProps & {
15
15
  children?: ReactNode;
16
16
  }): import("react/jsx-runtime").JSX.Element;
17
- Radio: ({ id, label, labelPosition, checked, disabled, labelColor, margin, marginTop, marginBottom, marginRight, marginLeft, className, readOnly, iconColor, tiny, ...props }: {
17
+ Radio: ({ id, label, labelPosition, checked, disabled, labelColor, margin, marginTop, marginBottom, marginRight, marginLeft, className, readOnly, iconColor, tiny, small, ...props }: {
18
18
  id?: string;
19
- label?: string;
19
+ label?: ReactNode;
20
20
  labelPosition?: "left" | "right";
21
21
  labelColor?: string;
22
22
  disabled?: boolean;
@@ -24,6 +24,7 @@ declare const Form: {
24
24
  className?: string;
25
25
  iconColor?: string;
26
26
  tiny?: boolean;
27
+ small?: boolean;
27
28
  } & Margin & import("react").HTMLProps<HTMLInputElement> & import("./types").AsProp) => import("react/jsx-runtime").JSX.Element;
28
29
  Toggle: ({ label, labelPosition, checked, disabled, onChange, gap, labelColor, ...props }: {
29
30
  id?: string;
@@ -37,7 +38,7 @@ declare const Form: {
37
38
  className?: import("react-aria-components").SwitchProps["className"];
38
39
  style?: import("react-aria-components").SwitchProps["style"];
39
40
  } & Margin & Omit<import("react-aria-components").SwitchProps, "isDisabled" | "isSelected">) => import("react/jsx-runtime").JSX.Element;
40
- Checkbox: ({ label, labelPosition, checked, partial, disabled, readOnly, onChange, align, labelColor, tiny, ...props }: {
41
+ Checkbox: ({ label, labelPosition, checked, partial, disabled, readOnly, onChange, align, labelColor, tiny, small, ...props }: {
41
42
  id?: string;
42
43
  label?: string;
43
44
  labelPosition?: "left" | "right";
@@ -49,6 +50,7 @@ declare const Form: {
49
50
  gap?: number;
50
51
  align?: import("./types").FlexPosition;
51
52
  tiny?: boolean;
53
+ small?: boolean;
52
54
  onChange?: import("react-aria-components").CheckboxProps["onChange"];
53
55
  className?: import("react-aria-components").CheckboxProps["className"];
54
56
  style?: import("react-aria-components").CheckboxProps["style"];
@@ -1,11 +1,11 @@
1
- import type { HTMLProps } from 'react';
1
+ import type { HTMLProps, ReactNode } from 'react';
2
2
  import type { AsProp, Margin } from './types';
3
3
  type ElAttributes = HTMLProps<HTMLInputElement> & AsProp;
4
4
  type RadioProps = {
5
5
  /** Id of the input element */
6
6
  id?: string;
7
- /** Places a label element beside the radio. The value will set the text of the label */
8
- label?: string;
7
+ /** Places a label element beside the radio. Accepts a string or any React node for custom content. */
8
+ label?: ReactNode;
9
9
  /** Sets the label on the left or right of the radio */
10
10
  labelPosition?: 'left' | 'right';
11
11
  /** Sets the color of the label */
@@ -20,6 +20,8 @@ type RadioProps = {
20
20
  iconColor?: string;
21
21
  /** Renders the radio icon at 12px instead of the default 24px */
22
22
  tiny?: boolean;
23
+ /** Renders the radio icon at 14px instead of the default 24px */
24
+ small?: boolean;
23
25
  } & Margin & ElAttributes;
24
- declare const Radio: ({ id, label, labelPosition, checked, disabled, labelColor, margin, marginTop, marginBottom, marginRight, marginLeft, className, readOnly, iconColor, tiny, ...props }: RadioProps) => import("react/jsx-runtime").JSX.Element;
26
+ declare const Radio: ({ id, label, labelPosition, checked, disabled, labelColor, margin, marginTop, marginBottom, marginRight, marginLeft, className, readOnly, iconColor, tiny, small, ...props }: RadioProps) => import("react/jsx-runtime").JSX.Element;
25
27
  export default Radio;
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import RadioButton from "../assets/icons/RadioButton.js";
3
3
  import { ControlContainer, ControlInput, ControlLabel } from "./FormControl.js";
4
4
  import Icon from "./Icon/index.js";
5
- const Radio = ({ id, label, labelPosition, checked, disabled, labelColor, margin, marginTop, marginBottom, marginRight, marginLeft, className, readOnly, iconColor, tiny, ...props })=>{
5
+ const Radio = ({ id, label, labelPosition, checked, disabled, labelColor, margin, marginTop, marginBottom, marginRight, marginLeft, className, readOnly, iconColor, tiny, small, ...props })=>{
6
6
  const labelRight = 'right' === labelPosition;
7
7
  const marginProps = {
8
8
  margin,
@@ -11,6 +11,7 @@ const Radio = ({ id, label, labelPosition, checked, disabled, labelColor, margin
11
11
  marginRight,
12
12
  marginLeft
13
13
  };
14
+ const iconSize = small ? 14 : tiny ? 12 : void 0;
14
15
  return /*#__PURE__*/ jsxs(ControlContainer, {
15
16
  htmlFor: id,
16
17
  labelRight: labelRight,
@@ -36,7 +37,7 @@ const Radio = ({ id, label, labelPosition, checked, disabled, labelColor, margin
36
37
  }),
37
38
  /*#__PURE__*/ jsx(Icon, {
38
39
  svg: /*#__PURE__*/ jsx(RadioButton, {}),
39
- size: tiny ? 'tiny' : void 0,
40
+ size: iconSize,
40
41
  marginLeft: label && !labelRight ? 8 : 0,
41
42
  marginRight: label && labelRight ? 8 : 0,
42
43
  pointer: !disabled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavv/ui",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {