@povio/ui 2.2.9-rc.6 → 2.2.9-rc.7

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,14 +1,16 @@
1
1
  import { InfoIcon } from "../../../assets/icons/Info.js";
2
+ import { UIStyle } from "../../../config/uiStyle.context.js";
2
3
  import { Typography } from "../../text/Typography/Typography.js";
3
4
  import { Tooltip as Tooltip$1 } from "../../overlays/Tooltip/Tooltip.js";
4
5
  import { FormFieldLabel } from "./FormFieldLabel.js";
6
+ import { formFieldHeader } from "./formFieldHeader.cva.js";
5
7
  import { jsx, jsxs } from "react/jsx-runtime";
6
8
  import { clsx } from "clsx";
7
9
  import { Focusable } from "react-aria-components";
8
10
  //#region src/components/inputs/FormField/FormFieldHeader.tsx
9
11
  var FormFieldHeader = ({ label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, isDisabled, className, labelProps }) => {
10
12
  return /* @__PURE__ */ jsxs("div", {
11
- className: clsx(isHeaderHidden ? "sr-only" : "mb-1", className),
13
+ className: clsx(UIStyle.useCva("formField.headerCva", formFieldHeader)({ visible: !isHeaderHidden }), className),
12
14
  children: [/* @__PURE__ */ jsxs("div", {
13
15
  className: "flex items-start justify-between",
14
16
  children: [/* @__PURE__ */ jsxs("div", {
@@ -0,0 +1,6 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export declare const formFieldHeader: (props?: ({
3
+ visible?: boolean | null | undefined;
4
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
+ export interface FormFieldHeaderVariantProps extends VariantProps<typeof formFieldHeader> {
6
+ }
@@ -0,0 +1,11 @@
1
+ import { cva } from "class-variance-authority";
2
+ //#region src/components/inputs/FormField/formFieldHeader.cva.ts
3
+ var formFieldHeader = cva("", {
4
+ variants: { visible: {
5
+ true: "mb-1",
6
+ false: "sr-only"
7
+ } },
8
+ defaultVariants: { visible: true }
9
+ });
10
+ //#endregion
11
+ export { formFieldHeader };
@@ -5,6 +5,7 @@ import { ButtonVariantProps } from '../components/buttons/Button/button.cva';
5
5
  import { PillButtonVariants } from '../components/buttons/PillButton/pillButton.cva';
6
6
  import { CheckboxIconVariantProps, CheckboxVariantProps } from '../components/inputs/Checkbox/checkbox.cva';
7
7
  import { FormFieldErrorVariantProps } from '../components/inputs/FormField/formFieldError.cva';
8
+ import { FormFieldHeaderVariantProps } from '../components/inputs/FormField/formFieldHeader.cva';
8
9
  import { FormFieldHelperVariantProps } from '../components/inputs/FormField/formFieldHelper.cva';
9
10
  import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
10
11
  import { InputBaseProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
@@ -145,6 +146,7 @@ export declare namespace UIStyle {
145
146
  cva?: Cva<PopoverVariantProps>;
146
147
  };
147
148
  formField: {
149
+ headerCva?: Cva<FormFieldHeaderVariantProps>;
148
150
  errorLabelCva?: Cva<FormFieldErrorVariantProps>;
149
151
  helperLabelCva?: Cva<FormFieldHelperVariantProps>;
150
152
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.2.9-rc.6",
3
+ "version": "2.2.9-rc.7",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",