@povio/ui 2.2.9-rc.36 → 2.2.9-rc.38

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.
@@ -166,7 +166,7 @@ var NumberInput = ({ renderStaticInput, ...props }) => {
166
166
  onStaticInteract: renderRealInput,
167
167
  inputClassName: props.inputClassName,
168
168
  children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
169
- type: "number",
169
+ type: "text",
170
170
  ref: inputRef,
171
171
  disabled: isDisabled,
172
172
  tabIndex: -1,
@@ -0,0 +1,4 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export declare const textAreaWrapper: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
3
+ export interface TextAreaWrapperVariantProps extends VariantProps<typeof textAreaWrapper> {
4
+ }
@@ -0,0 +1,5 @@
1
+ import { cva } from "class-variance-authority";
2
+ //#region src/components/inputs/Input/TextArea/TextArea.cva.ts
3
+ var textAreaWrapper = cva("group/text-area relative h-full");
4
+ //#endregion
5
+ export { textAreaWrapper };
@@ -5,6 +5,7 @@ import { InputClear } from "../../shared/InputClear.js";
5
5
  import { inputSide, inputSize, useInputCva } from "../../shared/input.cva.js";
6
6
  import { FormField } from "../../FormField/FormField.js";
7
7
  import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
8
+ import { textAreaWrapper } from "./TextArea.cva.js";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
10
  import { clsx } from "clsx";
10
11
  import { useRef } from "react";
@@ -18,6 +19,7 @@ var TextAreaBase = (props) => {
18
19
  const inputCva = useInputCva();
19
20
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
20
21
  const inputSideCva = UIStyle.useCva("input.sideCva", inputSide);
22
+ const textAreaWrapperCva = UIStyle.useCva("textArea.wrapperCva", textAreaWrapper);
21
23
  const { ref, className, inputClassName, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, value, onChange, onBlur, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, isClearable = ui.input.isClearable, ...rest } = props;
22
24
  const textFieldRef = useRef(null);
23
25
  const { labelProps, inputProps } = useTextField({
@@ -66,7 +68,7 @@ var TextAreaBase = (props) => {
66
68
  className: clsx("w-full", className),
67
69
  tabIndex: as === "inline" ? -1 : void 0,
68
70
  children: /* @__PURE__ */ jsxs("div", {
69
- className: "group/text-area relative h-full",
71
+ className: textAreaWrapperCva({}),
70
72
  "data-text-area": true,
71
73
  children: [
72
74
  as === "floating" && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
@@ -5,7 +5,7 @@ import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
5
5
  import { inputBase, inputSize } from "../shared/input.cva.js";
6
6
  import { FormField } from "../FormField/FormField.js";
7
7
  import { TooltipWrapper } from "../shared/TooltipWrapper.js";
8
- import { radio, radioContentClassName, radioIndicatorClass, radioTypography } from "./radio.cva.js";
8
+ import { radio, radioContentClassName, radioContentRow, radioContentWrapper, radioIndicatorClass, radioTypography } from "./radio.cva.js";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { clsx } from "clsx";
11
11
  import { Radio, RadioGroup } from "react-aria-components";
@@ -16,6 +16,8 @@ import { Controller } from "react-hook-form";
16
16
  var RadioGroupBase = (props) => {
17
17
  const ui = UIConfig.useConfig();
18
18
  const radioCva = UIStyle.useCva("radio.cva", radio);
19
+ const radioContentWrapperCva = UIStyle.useCva("radio.contentWrapperCva", radioContentWrapper);
20
+ const radioContentRowCva = UIStyle.useCva("radio.contentRowCva", radioContentRow);
19
21
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
20
22
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
21
23
  const radioTypographyMap = UIStyle.useMapper("radio.typography", radioTypography);
@@ -97,26 +99,39 @@ var RadioGroupBase = (props) => {
97
99
  "data-has-selection": selectedValue != null && selectedValue !== "" ? true : void 0,
98
100
  "data-radio-group-content": "",
99
101
  children: /* @__PURE__ */ jsxs("div", {
100
- className: clsx("relative flex", as === "inline" || as === "filter" ? "flex-row flex-wrap items-center gap-2" : "flex-col", shouldRenderInputFrame && clsx("gap-2", inputSizeCva({
102
+ className: clsx(radioContentWrapperCva({
103
+ variant,
104
+ as,
105
+ hasInputFrame: shouldRenderInputFrame,
106
+ ...rest
107
+ }), shouldRenderInputFrame && inputSizeCva({
101
108
  as,
102
109
  size
103
- }))),
110
+ })),
104
111
  "data-is-dirty": isDirty || void 0,
105
112
  "data-is-required": isRequired || void 0,
106
113
  children: [as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
107
114
  as,
108
115
  size,
109
116
  ...headerProps
110
- }), options.map((option) => /* @__PURE__ */ jsxs(Radio, {
111
- value: option.value,
112
- className: clsx("relative", radioIndicatorClass),
113
- children: [/* @__PURE__ */ jsx("div", { className: radioClassName }), /* @__PURE__ */ jsx(CheckContent, {
114
- typography: radioTypographyProps,
115
- contentClassName: radioContentClassNameValue,
116
- className: labelClassName,
117
- children: option.label
118
- })]
119
- }, option.value))]
117
+ }), /* @__PURE__ */ jsx("div", {
118
+ className: radioContentRowCva({
119
+ variant,
120
+ as,
121
+ hasInputFrame: shouldRenderInputFrame,
122
+ ...rest
123
+ }),
124
+ children: options.map((option) => /* @__PURE__ */ jsxs(Radio, {
125
+ value: option.value,
126
+ className: clsx("relative", radioIndicatorClass),
127
+ children: [/* @__PURE__ */ jsx("div", { className: radioClassName }), /* @__PURE__ */ jsx(CheckContent, {
128
+ typography: radioTypographyProps,
129
+ contentClassName: radioContentClassNameValue,
130
+ className: labelClassName,
131
+ children: option.label
132
+ })]
133
+ }, option.value))
134
+ })]
120
135
  })
121
136
  })
122
137
  })
@@ -5,6 +5,20 @@ export declare const radio: (props?: ({
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  export interface RadioVariantProps extends VariantProps<typeof radio> {
7
7
  }
8
+ export declare const radioContentWrapper: (props?: ({
9
+ variant?: "default" | null | undefined;
10
+ as?: "filter" | "default" | "floating" | "inline" | null | undefined;
11
+ hasInputFrame?: boolean | null | undefined;
12
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
13
+ export interface RadioContentWrapperVariantProps extends VariantProps<typeof radioContentWrapper> {
14
+ }
15
+ export declare const radioContentRow: (props?: ({
16
+ variant?: "default" | null | undefined;
17
+ as?: "filter" | "default" | "floating" | "inline" | null | undefined;
18
+ hasInputFrame?: boolean | null | undefined;
19
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
20
+ export interface RadioContentRowVariantProps extends VariantProps<typeof radioContentRow> {
21
+ }
8
22
  export declare const radioIndicatorClass = "group flex items-center gap-2";
9
23
  export declare const radioTypography: (props: {
10
24
  variant?: "default" | null | undefined;
@@ -25,6 +25,46 @@ var radio = cva([
25
25
  ] } },
26
26
  defaultVariants: { variant: "default" }
27
27
  });
28
+ var radioContentWrapper = cva("relative flex", {
29
+ variants: {
30
+ variant: { default: "" },
31
+ as: {
32
+ default: "flex-col",
33
+ floating: "flex-col",
34
+ filter: "flex-row flex-wrap items-center gap-2",
35
+ inline: "flex-row flex-wrap items-center gap-2"
36
+ },
37
+ hasInputFrame: {
38
+ true: "gap-2",
39
+ false: ""
40
+ }
41
+ },
42
+ defaultVariants: {
43
+ variant: "default",
44
+ as: "default",
45
+ hasInputFrame: false
46
+ }
47
+ });
48
+ var radioContentRow = cva("flex", {
49
+ variants: {
50
+ variant: { default: "" },
51
+ as: {
52
+ default: "flex-col",
53
+ floating: "flex-col",
54
+ filter: "flex-row flex-wrap items-center gap-2",
55
+ inline: "flex-row flex-wrap items-center gap-2"
56
+ },
57
+ hasInputFrame: {
58
+ true: "gap-2",
59
+ false: ""
60
+ }
61
+ },
62
+ defaultVariants: {
63
+ variant: "default",
64
+ as: "default",
65
+ hasInputFrame: false
66
+ }
67
+ });
28
68
  var radioIndicatorClass = "group flex items-center gap-2";
29
69
  var radioTypography = compoundMapper({ default: {
30
70
  size: "label-1",
@@ -33,4 +73,4 @@ var radioTypography = compoundMapper({ default: {
33
73
  } });
34
74
  var radioContentClassName = compoundMapper({ default: "text-text-default-2" });
35
75
  //#endregion
36
- export { radio, radioContentClassName, radioIndicatorClass, radioTypography };
76
+ export { radio, radioContentClassName, radioContentRow, radioContentWrapper, radioIndicatorClass, radioTypography };
@@ -8,7 +8,8 @@ import { DatePickerInputContentRowProps } from '../components/inputs/DateTime/sh
8
8
  import { FormFieldErrorVariantProps } from '../components/inputs/FormField/formFieldError.cva';
9
9
  import { FormFieldHeaderVariantProps } from '../components/inputs/FormField/formFieldHeader.cva';
10
10
  import { FormFieldHelperVariantProps } from '../components/inputs/FormField/formFieldHelper.cva';
11
- import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
11
+ import { TextAreaWrapperVariantProps } from '../components/inputs/Input/TextArea/TextArea.cva';
12
+ import { RadioContentRowVariantProps, RadioContentWrapperVariantProps, RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
12
13
  import { SelectPopoverCva } from '../components/inputs/Selection/shared/selectDesktop.cva';
13
14
  import { SelectListBoxItemCva } from '../components/inputs/Selection/shared/selectItem.cva';
14
15
  import { InputBaseProps, InputClearClassProps, InputContentWrapperProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
@@ -54,6 +55,8 @@ export declare namespace UIStyle {
54
55
  };
55
56
  radio: {
56
57
  cva?: Cva<RadioVariantProps>;
58
+ contentWrapperCva?: Cva<RadioContentWrapperVariantProps>;
59
+ contentRowCva?: Cva<RadioContentRowVariantProps>;
57
60
  typography?: CompoundMapper<TypographyVariantProps, RadioVariantProps>;
58
61
  contentClassName?: CompoundMapper<string, RadioVariantProps>;
59
62
  };
@@ -75,6 +78,9 @@ export declare namespace UIStyle {
75
78
  sizeCva?: Cva<InputSizeProps>;
76
79
  sideCva?: Cva<InputSideProps>;
77
80
  };
81
+ textArea: {
82
+ wrapperCva?: Cva<TextAreaWrapperVariantProps>;
83
+ };
78
84
  tooltipWrapper: {
79
85
  triggerCva?: Cva<TooltipWrapperTriggerVariantProps>;
80
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.2.9-rc.36",
3
+ "version": "2.2.9-rc.38",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",