@commercetools/nimbus 0.0.0-canary-20250826065101 → 0.0.0-canary-20250826133439

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.
Files changed (89) hide show
  1. package/dist/chunks/DatePicker-5cKqpUC9.cjs.js +2 -0
  2. package/dist/chunks/{DatePicker-BQ6EfAU2.cjs.js.map → DatePicker-5cKqpUC9.cjs.js.map} +1 -1
  3. package/dist/chunks/{DatePicker-ByWwypbW.es.js → DatePicker-8Z6Kf838.es.js} +17 -18
  4. package/dist/chunks/{DatePicker-ByWwypbW.es.js.map → DatePicker-8Z6Kf838.es.js.map} +1 -1
  5. package/dist/chunks/{Dialog-DNPIKkGE.es.js → Dialog-C7IjW1jR.es.js} +24 -25
  6. package/dist/chunks/{Dialog-DNPIKkGE.es.js.map → Dialog-C7IjW1jR.es.js.map} +1 -1
  7. package/dist/chunks/Dialog-Cbq66gyc.cjs.js +2 -0
  8. package/dist/chunks/{Dialog-B4OIDU7t.cjs.js.map → Dialog-Cbq66gyc.cjs.js.map} +1 -1
  9. package/dist/chunks/OverlayArrow-C5Ymp9MC.cjs.js +2 -0
  10. package/dist/chunks/OverlayArrow-C5Ymp9MC.cjs.js.map +1 -0
  11. package/dist/chunks/OverlayArrow-ERS8ZqL3.es.js +479 -0
  12. package/dist/chunks/OverlayArrow-ERS8ZqL3.es.js.map +1 -0
  13. package/dist/chunks/combobox-CFH0OaAM.cjs.js +2 -0
  14. package/dist/chunks/{combobox-BYyNTj5m.cjs.js.map → combobox-CFH0OaAM.cjs.js.map} +1 -1
  15. package/dist/chunks/{combobox-qA8TjWPw.es.js → combobox-CkVqkKdA.es.js} +14 -15
  16. package/dist/chunks/{combobox-qA8TjWPw.es.js.map → combobox-CkVqkKdA.es.js.map} +1 -1
  17. package/dist/chunks/data-table-DIXPr3ke.cjs.js +2 -0
  18. package/dist/chunks/{data-table-D6qEg2qp.cjs.js.map → data-table-DIXPr3ke.cjs.js.map} +1 -1
  19. package/dist/chunks/{data-table-D7Gq4ZYT.es.js → data-table-cBq9JXG7.es.js} +1606 -1476
  20. package/dist/chunks/{data-table-D7Gq4ZYT.es.js.map → data-table-cBq9JXG7.es.js.map} +1 -1
  21. package/dist/chunks/{date-picker-COI-tlHx.es.js → date-picker-Bx2J-sPg.es.js} +3 -3
  22. package/dist/chunks/{date-picker-COI-tlHx.es.js.map → date-picker-Bx2J-sPg.es.js.map} +1 -1
  23. package/dist/chunks/{date-picker-RC0pSYZe.cjs.js → date-picker-UEQeFHA8.cjs.js} +2 -2
  24. package/dist/chunks/{date-picker-RC0pSYZe.cjs.js.map → date-picker-UEQeFHA8.cjs.js.map} +1 -1
  25. package/dist/chunks/{date-range-picker-BnI3m8z-.es.js → date-range-picker-DvaRIy3T.es.js} +3 -3
  26. package/dist/chunks/{date-range-picker-BnI3m8z-.es.js.map → date-range-picker-DvaRIy3T.es.js.map} +1 -1
  27. package/dist/chunks/{date-range-picker-BMAaQ7cS.cjs.js → date-range-picker-Dx1nE1Br.cjs.js} +2 -2
  28. package/dist/chunks/{date-range-picker-BMAaQ7cS.cjs.js.map → date-range-picker-Dx1nE1Br.cjs.js.map} +1 -1
  29. package/dist/chunks/{form-field-B6lCvcf4.cjs.js → form-field-DiW_0hSy.cjs.js} +2 -2
  30. package/dist/chunks/{form-field-B6lCvcf4.cjs.js.map → form-field-DiW_0hSy.cjs.js.map} +1 -1
  31. package/dist/chunks/{form-field-BgKHtyTH.es.js → form-field-Do0NhI0D.es.js} +2 -2
  32. package/dist/chunks/{form-field-BgKHtyTH.es.js.map → form-field-Do0NhI0D.es.js.map} +1 -1
  33. package/dist/chunks/{password-input-XSc2MhLG.es.js → password-input-BT594v5p.es.js} +2 -2
  34. package/dist/chunks/{password-input-XSc2MhLG.es.js.map → password-input-BT594v5p.es.js.map} +1 -1
  35. package/dist/chunks/{password-input--fYkZAW3.cjs.js → password-input-D1LSzb9p.cjs.js} +2 -2
  36. package/dist/chunks/{password-input--fYkZAW3.cjs.js.map → password-input-D1LSzb9p.cjs.js.map} +1 -1
  37. package/dist/chunks/select-BnN5zaBu.cjs.js +2 -0
  38. package/dist/chunks/{select-CxIiux8H.cjs.js.map → select-BnN5zaBu.cjs.js.map} +1 -1
  39. package/dist/chunks/{select-CMZAeYTf.es.js → select-Cr0CSahh.es.js} +12 -13
  40. package/dist/chunks/{select-CMZAeYTf.es.js.map → select-Cr0CSahh.es.js.map} +1 -1
  41. package/dist/chunks/{split-button-BZHi7r1E.es.js → split-button-DhYWuU3x.es.js} +2 -2
  42. package/dist/chunks/{split-button-BZHi7r1E.es.js.map → split-button-DhYWuU3x.es.js.map} +1 -1
  43. package/dist/chunks/{split-button-hRYYvfbx.cjs.js → split-button-DrujRAqS.cjs.js} +2 -2
  44. package/dist/chunks/{split-button-hRYYvfbx.cjs.js.map → split-button-DrujRAqS.cjs.js.map} +1 -1
  45. package/dist/chunks/{tooltip-BLyAAnK-.es.js → tooltip-BOK0Uejw.es.js} +2 -2
  46. package/dist/chunks/{tooltip-BLyAAnK-.es.js.map → tooltip-BOK0Uejw.es.js.map} +1 -1
  47. package/dist/chunks/{tooltip-tZKuAv4E.cjs.js → tooltip-DjUjwciC.cjs.js} +2 -2
  48. package/dist/chunks/{tooltip-tZKuAv4E.cjs.js.map → tooltip-DjUjwciC.cjs.js.map} +1 -1
  49. package/dist/components/combobox.cjs +1 -1
  50. package/dist/components/combobox.es.js +1 -1
  51. package/dist/components/components.cjs +1 -1
  52. package/dist/components/components.es.js +9 -9
  53. package/dist/components/data-table.cjs +1 -1
  54. package/dist/components/data-table.es.js +1 -1
  55. package/dist/components/date-picker.cjs +1 -1
  56. package/dist/components/date-picker.es.js +1 -1
  57. package/dist/components/date-range-picker.cjs +1 -1
  58. package/dist/components/date-range-picker.es.js +1 -1
  59. package/dist/components/form-field.cjs +1 -1
  60. package/dist/components/form-field.es.js +1 -1
  61. package/dist/components/password-input.cjs +1 -1
  62. package/dist/components/password-input.es.js +1 -1
  63. package/dist/components/popover.cjs +1 -1
  64. package/dist/components/popover.es.js +1 -1
  65. package/dist/components/select.cjs +1 -1
  66. package/dist/components/select.es.js +1 -1
  67. package/dist/components/split-button.cjs +1 -1
  68. package/dist/components/split-button.es.js +1 -1
  69. package/dist/components/tooltip.cjs +1 -1
  70. package/dist/components/tooltip.es.js +1 -1
  71. package/dist/components.d.ts +6 -0
  72. package/dist/data-table.d.ts +6 -0
  73. package/dist/index.cjs +1 -1
  74. package/dist/index.d.ts +6 -0
  75. package/dist/index.es.js +9 -9
  76. package/package.json +5 -5
  77. package/dist/chunks/DatePicker-BQ6EfAU2.cjs.js +0 -2
  78. package/dist/chunks/Dialog-B4OIDU7t.cjs.js +0 -2
  79. package/dist/chunks/OverlayArrow-BD-oGsXg.es.js +0 -452
  80. package/dist/chunks/OverlayArrow-BD-oGsXg.es.js.map +0 -1
  81. package/dist/chunks/OverlayArrow-aq8OInch.cjs.js +0 -2
  82. package/dist/chunks/OverlayArrow-aq8OInch.cjs.js.map +0 -1
  83. package/dist/chunks/combobox-BYyNTj5m.cjs.js +0 -2
  84. package/dist/chunks/data-table-D6qEg2qp.cjs.js +0 -2
  85. package/dist/chunks/select-CxIiux8H.cjs.js +0 -2
  86. package/dist/chunks/useResizeObserver-Dx-vDLiW.cjs.js +0 -2
  87. package/dist/chunks/useResizeObserver-Dx-vDLiW.cjs.js.map +0 -1
  88. package/dist/chunks/useResizeObserver-FIPBIG5S.es.js +0 -32
  89. package/dist/chunks/useResizeObserver-FIPBIG5S.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"form-field-B6lCvcf4.cjs.js","sources":["../../src/components/form-field/components/form-field.context.tsx","../../src/components/form-field/form-field.recipe.tsx","../../src/components/form-field/form-field.slots.tsx","../../src/components/form-field/components/form-field.root.tsx","../../src/components/form-field/components/form-field.label.tsx","../../src/components/form-field/components/form-field.input.tsx","../../src/components/form-field/components/form-field.description.tsx","../../src/components/form-field/components/form-field.error.tsx","../../src/components/form-field/components/form-field.info-box.tsx","../../src/components/form-field/form-field.tsx"],"sourcesContent":["import { createContext, type ReactNode } from \"react\";\nimport type {\n FormFieldDescriptionSlotProps,\n FormFieldErrorSlotProps,\n FormFieldInputSlotProps,\n FormFieldLabelSlotProps,\n} from \"../form-field.slots\";\n\nexport type FormFieldContextPayloadType = {\n label: ReactNode;\n labelSlotProps?: FormFieldLabelSlotProps;\n input: ReactNode;\n inputSlotProps?: FormFieldInputSlotProps;\n description: ReactNode;\n descriptionSlotProps?: FormFieldDescriptionSlotProps;\n error: ReactNode;\n errorSlotProps?: FormFieldErrorSlotProps;\n info: ReactNode;\n isInvalid?: boolean;\n isRequired?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n};\n\nexport type FormFieldContextType = {\n context: FormFieldContextPayloadType;\n setContext: React.Dispatch<React.SetStateAction<FormFieldContextPayloadType>>;\n};\n\nexport const FormFieldContext = createContext<FormFieldContextType>({\n context: {\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n },\n setContext: () => {},\n});\n","import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\nconst columnLayout = `\n\"label\"\n\"input\"\n\"description\"\n\"error\"\n`;\nconst rowLayout = `\n\"label input\"\n\"label description\"\n\"label error\"\n`;\n\n/**\n * Recipe configuration for the FormField component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const formFieldRecipe = defineSlotRecipe({\n slots: [\"root\", \"label\", \"input\", \"description\", \"error\", \"popover\"],\n // Unique class name prefix for the component\n className: \"nimbus-ui-form-field\",\n\n base: {\n root: {\n \"--grid-gap\": \"spacing.100\",\n\n display: \"grid\",\n width: \"auto\",\n },\n label: {\n gridArea: \"label\",\n fontWeight: \"500\",\n color: \"neutral.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n input: {\n gridArea: \"input\",\n },\n description: {\n gridArea: \"description\",\n color: \"neutral.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n error: {\n gridArea: \"error\",\n color: \"critical.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n popover: {\n \"--scrollbar-color\": \"colors.neutral.8\",\n \"--scrollbar-bg\": \"colors.neutral.3\",\n bg: \"neutral.1\",\n maxWidth: \"xl\",\n borderRadius: \"200\",\n boxShadow: \"6\",\n border: \"solid-25\",\n borderColor: \"neutral.8\",\n maxHeight: \"40svh\",\n overflow: \"auto\",\n scrollbarWidth: \"thin\",\n scrollbarColor: \"var(--scrollbar-color) var(--scrollbar-bg)\",\n focusRing: \"outside\",\n },\n },\n\n variants: {\n size: {\n md: {\n root: {\n \"--form-field-font-size\": \"fontSizes.350\",\n \"--form-field-line-height\": \"lineHeights.500\",\n },\n },\n sm: {\n root: {\n \"--form-field-font-size\": \"fontSizes.300\",\n \"--form-field-line-height\": \"lineHeights.450\",\n },\n },\n },\n direction: {\n column: {\n root: {\n gridTemplateAreas: columnLayout,\n },\n input: {\n mt: \"var(--grid-gap)\",\n },\n description: {\n mt: \"var(--grid-gap)\",\n },\n error: {\n mt: \"var(--grid-gap)\",\n },\n },\n row: {\n root: {\n gridTemplateAreas: rowLayout,\n gridTemplateColumns: \"auto 1fr\",\n gridColumnGap: \"200\",\n },\n description: {\n mt: \"var(--grid-gap)\",\n },\n error: {\n mt: \"var(--grid-gap)\",\n },\n },\n },\n },\n\n // Default variant values when not explicitly specified\n defaultVariants: {\n direction: \"column\",\n size: \"md\",\n },\n});\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n type HTMLChakraProps,\n type RecipeVariantProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { formFieldRecipe } from \"./form-field.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: formFieldRecipe,\n});\n\n// Root slot\nexport interface FormFieldRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof formFieldRecipe> & UnstyledProp\n > {}\n\nexport const FormFieldRootSlot = withProvider<\n HTMLDivElement,\n FormFieldRootSlotProps\n>(\"div\", \"root\");\n\n// Label Slot\nexport interface FormFieldLabelSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldLabelSlot = withContext<\n HTMLDivElement,\n FormFieldLabelSlotProps\n>(\"div\", \"label\");\n\n// Input Slot\nexport interface FormFieldInputSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldInputSlot = withContext<\n HTMLDivElement,\n FormFieldInputSlotProps\n>(\"div\", \"input\");\n\n// Description Slot\nexport interface FormFieldDescriptionSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldDescriptionSlot = withContext<\n HTMLDivElement,\n FormFieldDescriptionSlotProps\n>(\"div\", \"description\");\n\n// Error Slot\nexport interface FormFieldErrorSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldErrorSlot = withContext<\n HTMLDivElement,\n FormFieldErrorSlotProps\n>(\"div\", \"error\");\n\n// Error Slot\nexport interface FormFieldPopoverSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldPopoverSlot = withContext<\n HTMLDivElement,\n FormFieldPopoverSlotProps\n>(\"div\", \"popover\");\n","import {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useEffect,\n useState,\n} from \"react\";\nimport type { FormFieldProps } from \"../form-field.types\";\nimport { useField } from \"react-aria\";\nimport {\n FormFieldContext,\n type FormFieldContextPayloadType,\n} from \"./form-field.context\";\nimport {\n FormFieldDescriptionSlot,\n FormFieldErrorSlot,\n FormFieldInputSlot,\n FormFieldLabelSlot,\n FormFieldPopoverSlot,\n FormFieldRootSlot,\n} from \"../form-field.slots\";\nimport { Dialog, DialogTrigger, Popover } from \"react-aria-components\";\nimport { Box, IconButton } from \"@/components\";\nimport { ErrorOutline, HelpOutline } from \"@commercetools/nimbus-icons\";\n\n/**\n * # FormField\n *\n * displays miscellaneous inputs in a FormField context\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/formfield}\n */\nexport const FormFieldRoot = forwardRef<HTMLDivElement, FormFieldProps>(\n (\n { isInvalid, isRequired, isDisabled, isReadOnly, children, ...props },\n ref\n ) => {\n const [context, setContext] = useState<FormFieldContextPayloadType>({\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n });\n\n const useFieldArgs: Parameters<typeof useField>[0] = {\n description: context.description,\n errorMessage: context.error,\n };\n\n if (context.label) {\n useFieldArgs.label = context.label;\n } else {\n // Context will always start out null, so we need to stub out some aria attributes\n // FIXME: This is a hack to get the form field to work, but it's not the best solution\n // FIXME: We should find a better way to handle this by redesigning the FormField component's structure\n useFieldArgs[\"aria-label\"] = \"empty-label\";\n useFieldArgs[\"aria-labelledby\"] = \"empty-label\";\n }\n\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField(useFieldArgs);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n }));\n }, [isInvalid, isRequired, isDisabled, isReadOnly]);\n\n const inputProps = {\n ...fieldProps,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n };\n\n return (\n <FormFieldContext.Provider value={{ context, setContext }}>\n <FormFieldRootSlot ref={ref} {...props}>\n {context.label && (\n <FormFieldLabelSlot {...context.labelSlotProps}>\n <label {...labelProps}>\n {context.label}\n {isRequired && <sup aria-hidden=\"true\">*</sup>}\n </label>\n {context.info && (\n <DialogTrigger>\n <Box\n as=\"span\"\n display=\"inline-block\"\n position=\"relative\"\n width=\"1ch\"\n height=\"1ch\"\n ml=\"200\"\n >\n <Box\n as=\"span\"\n display=\"inline-flex\"\n position=\"absolute\"\n top=\"50%\"\n right=\"50%\"\n transform=\"translate(50%, -50%)\"\n >\n <IconButton\n aria-label=\"__MORE INFO\"\n size=\"2xs\"\n tone=\"info\"\n variant=\"link\"\n >\n <HelpOutline />\n </IconButton>\n </Box>\n </Box>\n <Popover>\n <FormFieldPopoverSlot asChild>\n <Dialog>\n <Box p=\"300\">{context.info}</Box>\n </Dialog>\n </FormFieldPopoverSlot>\n </Popover>\n </DialogTrigger>\n )}\n </FormFieldLabelSlot>\n )}\n {context.input && (\n <FormFieldInputSlot {...context.inputSlotProps}>\n {Children.map(context.input, (child) => {\n // Important: Check if the child is a valid React element before cloning.\n if (isValidElement(child)) {\n return cloneElement(child, inputProps);\n }\n // If it's not a valid element (e.g., text node, null, undefined), return it as is.\n return child;\n })}\n </FormFieldInputSlot>\n )}\n {context.description && (\n <FormFieldDescriptionSlot\n {...descriptionProps}\n {...context.descriptionSlotProps}\n >\n {context.description}\n </FormFieldDescriptionSlot>\n )}\n {isInvalid && context.error && (\n <FormFieldErrorSlot\n {...errorMessageProps}\n {...context.errorSlotProps}\n >\n <Box\n as={ErrorOutline}\n display=\"inline-flex\"\n boxSize=\"400\"\n verticalAlign=\"text-bottom\"\n mr=\"100\"\n />\n {context.error}\n </FormFieldErrorSlot>\n )}\n {children}\n </FormFieldRootSlot>\n </FormFieldContext.Provider>\n );\n }\n);\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldLabelSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldLabel = ({\n children,\n ...labelSlotProps\n}: FormFieldLabelSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n label: children,\n labelSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldInputSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldInput = ({\n children,\n ...inputSlotProps\n}: FormFieldInputSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n input: children,\n inputSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldDescriptionSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldDescription = ({\n children,\n ...descriptionSlotProps\n}: FormFieldDescriptionSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n description: children,\n descriptionSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldErrorSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldError = ({\n children,\n ...errorSlotProps\n}: FormFieldErrorSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n error: children,\n errorSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect, type ReactNode } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\n\ntype FormFieldInfoBoxProps = {\n /**\n * The content to display in the InfoBox\n */\n children: ReactNode;\n};\n\nexport const FormFieldInfoBox = ({ children }: FormFieldInfoBoxProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n info: children,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { FormFieldRoot } from \"./components/form-field.root\";\nimport { FormFieldLabel } from \"./components/form-field.label\";\nimport { FormFieldInput } from \"./components/form-field.input\";\nimport { FormFieldDescription } from \"./components/form-field.description\";\nimport { FormFieldError } from \"./components/form-field.error\";\nimport { FormFieldInfoBox } from \"./components/form-field.info-box\";\n\nexport const FormField = {\n Root: FormFieldRoot,\n Label: FormFieldLabel,\n Input: FormFieldInput,\n Description: FormFieldDescription,\n Error: FormFieldError,\n InfoBox: FormFieldInfoBox,\n};\n\nexport {\n FormFieldRoot as _FormFieldRoot,\n FormFieldLabel as _FormFieldLabel,\n FormFieldInput as _FormFieldInput,\n FormFieldDescription as _FormFieldDescription,\n FormFieldError as _FormFieldError,\n FormFieldInfoBox as _FormFieldInfoBox,\n};\n"],"names":["FormFieldContext","createContext","columnLayout","rowLayout","formFieldRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","FormFieldRootSlot","FormFieldLabelSlot","FormFieldInputSlot","FormFieldDescriptionSlot","FormFieldErrorSlot","FormFieldPopoverSlot","FormFieldRoot","forwardRef","isInvalid","isRequired","isDisabled","isReadOnly","children","props","ref","context","setContext","useState","useFieldArgs","labelProps","fieldProps","descriptionProps","errorMessageProps","useField","useEffect","prevContext","inputProps","jsx","jsxs","DialogTrigger","Box","IconButton","HelpOutline","Popover","Dialog","Children","child","isValidElement","cloneElement","ErrorOutline","FormFieldLabel","labelSlotProps","useContext","FormFieldInput","inputSlotProps","FormFieldDescription","descriptionSlotProps","FormFieldError","errorSlotProps","FormFieldInfoBox","FormField"],"mappings":"0WA6BaA,EAAmBC,EAAAA,cAAoC,CAClE,QAAS,CACP,MAAO,KACP,YAAa,KACb,MAAO,KACP,KAAM,KACN,MAAO,IAAA,EAET,WAAY,IAAM,CAAC,CACrB,CAAC,ECpCKC,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA,EAMfC,EAAY;AAAA;AAAA;AAAA;AAAA,EAULC,EAAkBC,EAAAA,iBAAiB,CAC9C,MAAO,CAAC,OAAQ,QAAS,QAAS,cAAe,QAAS,SAAS,EAEnE,UAAW,uBAEX,KAAM,CACJ,KAAM,CACJ,aAAc,cAEd,QAAS,OACT,MAAO,MAAA,EAET,MAAO,CACL,SAAU,QACV,WAAY,MACZ,MAAO,aACP,SAAU,8BACV,WAAY,+BAAA,EAEd,MAAO,CACL,SAAU,OAAA,EAEZ,YAAa,CACX,SAAU,cACV,MAAO,aACP,SAAU,8BACV,WAAY,+BAAA,EAEd,MAAO,CACL,SAAU,QACV,MAAO,cACP,SAAU,8BACV,WAAY,+BAAA,EAEd,QAAS,CACP,oBAAq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y.cjs.js","sources":["../../src/components/form-field/components/form-field.context.tsx","../../src/components/form-field/form-field.recipe.tsx","../../src/components/form-field/form-field.slots.tsx","../../src/components/form-field/components/form-field.root.tsx","../../src/components/form-field/components/form-field.label.tsx","../../src/components/form-field/components/form-field.input.tsx","../../src/components/form-field/components/form-field.description.tsx","../../src/components/form-field/components/form-field.error.tsx","../../src/components/form-field/components/form-field.info-box.tsx","../../src/components/form-field/form-field.tsx"],"sourcesContent":["import { createContext, type ReactNode } from \"react\";\nimport type {\n FormFieldDescriptionSlotProps,\n FormFieldErrorSlotProps,\n FormFieldInputSlotProps,\n FormFieldLabelSlotProps,\n} from \"../form-field.slots\";\n\nexport type FormFieldContextPayloadType = {\n label: ReactNode;\n labelSlotProps?: FormFieldLabelSlotProps;\n input: ReactNode;\n inputSlotProps?: FormFieldInputSlotProps;\n description: ReactNode;\n descriptionSlotProps?: FormFieldDescriptionSlotProps;\n error: ReactNode;\n errorSlotProps?: FormFieldErrorSlotProps;\n info: ReactNode;\n isInvalid?: boolean;\n isRequired?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n};\n\nexport type FormFieldContextType = {\n context: FormFieldContextPayloadType;\n setContext: React.Dispatch<React.SetStateAction<FormFieldContextPayloadType>>;\n};\n\nexport const FormFieldContext = createContext<FormFieldContextType>({\n context: {\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n },\n setContext: () => {},\n});\n","import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\nconst columnLayout = `\n\"label\"\n\"input\"\n\"description\"\n\"error\"\n`;\nconst rowLayout = `\n\"label input\"\n\"label description\"\n\"label error\"\n`;\n\n/**\n * Recipe configuration for the FormField component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const formFieldRecipe = defineSlotRecipe({\n slots: [\"root\", \"label\", \"input\", \"description\", \"error\", \"popover\"],\n // Unique class name prefix for the component\n className: \"nimbus-ui-form-field\",\n\n base: {\n root: {\n \"--grid-gap\": \"spacing.100\",\n\n display: \"grid\",\n width: \"auto\",\n },\n label: {\n gridArea: \"label\",\n fontWeight: \"500\",\n color: \"neutral.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n input: {\n gridArea: \"input\",\n },\n description: {\n gridArea: \"description\",\n color: \"neutral.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n error: {\n gridArea: \"error\",\n color: \"critical.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n popover: {\n \"--scrollbar-color\": \"colors.neutral.8\",\n \"--scrollbar-bg\": \"colors.neutral.3\",\n bg: \"neutral.1\",\n maxWidth: \"xl\",\n borderRadius: \"200\",\n boxShadow: \"6\",\n border: \"solid-25\",\n borderColor: \"neutral.8\",\n maxHeight: \"40svh\",\n overflow: \"auto\",\n scrollbarWidth: \"thin\",\n scrollbarColor: \"var(--scrollbar-color) var(--scrollbar-bg)\",\n focusRing: \"outside\",\n },\n },\n\n variants: {\n size: {\n md: {\n root: {\n \"--form-field-font-size\": \"fontSizes.350\",\n \"--form-field-line-height\": \"lineHeights.500\",\n },\n },\n sm: {\n root: {\n \"--form-field-font-size\": \"fontSizes.300\",\n \"--form-field-line-height\": \"lineHeights.450\",\n },\n },\n },\n direction: {\n column: {\n root: {\n gridTemplateAreas: columnLayout,\n },\n input: {\n mt: \"var(--grid-gap)\",\n },\n description: {\n mt: \"var(--grid-gap)\",\n },\n error: {\n mt: \"var(--grid-gap)\",\n },\n },\n row: {\n root: {\n gridTemplateAreas: rowLayout,\n gridTemplateColumns: \"auto 1fr\",\n gridColumnGap: \"200\",\n },\n description: {\n mt: \"var(--grid-gap)\",\n },\n error: {\n mt: \"var(--grid-gap)\",\n },\n },\n },\n },\n\n // Default variant values when not explicitly specified\n defaultVariants: {\n direction: \"column\",\n size: \"md\",\n },\n});\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n type HTMLChakraProps,\n type RecipeVariantProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { formFieldRecipe } from \"./form-field.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: formFieldRecipe,\n});\n\n// Root slot\nexport interface FormFieldRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof formFieldRecipe> & UnstyledProp\n > {}\n\nexport const FormFieldRootSlot = withProvider<\n HTMLDivElement,\n FormFieldRootSlotProps\n>(\"div\", \"root\");\n\n// Label Slot\nexport interface FormFieldLabelSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldLabelSlot = withContext<\n HTMLDivElement,\n FormFieldLabelSlotProps\n>(\"div\", \"label\");\n\n// Input Slot\nexport interface FormFieldInputSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldInputSlot = withContext<\n HTMLDivElement,\n FormFieldInputSlotProps\n>(\"div\", \"input\");\n\n// Description Slot\nexport interface FormFieldDescriptionSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldDescriptionSlot = withContext<\n HTMLDivElement,\n FormFieldDescriptionSlotProps\n>(\"div\", \"description\");\n\n// Error Slot\nexport interface FormFieldErrorSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldErrorSlot = withContext<\n HTMLDivElement,\n FormFieldErrorSlotProps\n>(\"div\", \"error\");\n\n// Error Slot\nexport interface FormFieldPopoverSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldPopoverSlot = withContext<\n HTMLDivElement,\n FormFieldPopoverSlotProps\n>(\"div\", \"popover\");\n","import {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useEffect,\n useState,\n} from \"react\";\nimport type { FormFieldProps } from \"../form-field.types\";\nimport { useField } from \"react-aria\";\nimport {\n FormFieldContext,\n type FormFieldContextPayloadType,\n} from \"./form-field.context\";\nimport {\n FormFieldDescriptionSlot,\n FormFieldErrorSlot,\n FormFieldInputSlot,\n FormFieldLabelSlot,\n FormFieldPopoverSlot,\n FormFieldRootSlot,\n} from \"../form-field.slots\";\nimport { Dialog, DialogTrigger, Popover } from \"react-aria-components\";\nimport { Box, IconButton } from \"@/components\";\nimport { ErrorOutline, HelpOutline } from \"@commercetools/nimbus-icons\";\n\n/**\n * # FormField\n *\n * displays miscellaneous inputs in a FormField context\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/formfield}\n */\nexport const FormFieldRoot = forwardRef<HTMLDivElement, FormFieldProps>(\n (\n { isInvalid, isRequired, isDisabled, isReadOnly, children, ...props },\n ref\n ) => {\n const [context, setContext] = useState<FormFieldContextPayloadType>({\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n });\n\n const useFieldArgs: Parameters<typeof useField>[0] = {\n description: context.description,\n errorMessage: context.error,\n };\n\n if (context.label) {\n useFieldArgs.label = context.label;\n } else {\n // Context will always start out null, so we need to stub out some aria attributes\n // FIXME: This is a hack to get the form field to work, but it's not the best solution\n // FIXME: We should find a better way to handle this by redesigning the FormField component's structure\n useFieldArgs[\"aria-label\"] = \"empty-label\";\n useFieldArgs[\"aria-labelledby\"] = \"empty-label\";\n }\n\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField(useFieldArgs);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n }));\n }, [isInvalid, isRequired, isDisabled, isReadOnly]);\n\n const inputProps = {\n ...fieldProps,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n };\n\n return (\n <FormFieldContext.Provider value={{ context, setContext }}>\n <FormFieldRootSlot ref={ref} {...props}>\n {context.label && (\n <FormFieldLabelSlot {...context.labelSlotProps}>\n <label {...labelProps}>\n {context.label}\n {isRequired && <sup aria-hidden=\"true\">*</sup>}\n </label>\n {context.info && (\n <DialogTrigger>\n <Box\n as=\"span\"\n display=\"inline-block\"\n position=\"relative\"\n width=\"1ch\"\n height=\"1ch\"\n ml=\"200\"\n >\n <Box\n as=\"span\"\n display=\"inline-flex\"\n position=\"absolute\"\n top=\"50%\"\n right=\"50%\"\n transform=\"translate(50%, -50%)\"\n >\n <IconButton\n aria-label=\"__MORE INFO\"\n size=\"2xs\"\n tone=\"info\"\n variant=\"link\"\n >\n <HelpOutline />\n </IconButton>\n </Box>\n </Box>\n <Popover>\n <FormFieldPopoverSlot asChild>\n <Dialog>\n <Box p=\"300\">{context.info}</Box>\n </Dialog>\n </FormFieldPopoverSlot>\n </Popover>\n </DialogTrigger>\n )}\n </FormFieldLabelSlot>\n )}\n {context.input && (\n <FormFieldInputSlot {...context.inputSlotProps}>\n {Children.map(context.input, (child) => {\n // Important: Check if the child is a valid React element before cloning.\n if (isValidElement(child)) {\n return cloneElement(child, inputProps);\n }\n // If it's not a valid element (e.g., text node, null, undefined), return it as is.\n return child;\n })}\n </FormFieldInputSlot>\n )}\n {context.description && (\n <FormFieldDescriptionSlot\n {...descriptionProps}\n {...context.descriptionSlotProps}\n >\n {context.description}\n </FormFieldDescriptionSlot>\n )}\n {isInvalid && context.error && (\n <FormFieldErrorSlot\n {...errorMessageProps}\n {...context.errorSlotProps}\n >\n <Box\n as={ErrorOutline}\n display=\"inline-flex\"\n boxSize=\"400\"\n verticalAlign=\"text-bottom\"\n mr=\"100\"\n />\n {context.error}\n </FormFieldErrorSlot>\n )}\n {children}\n </FormFieldRootSlot>\n </FormFieldContext.Provider>\n );\n }\n);\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldLabelSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldLabel = ({\n children,\n ...labelSlotProps\n}: FormFieldLabelSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n label: children,\n labelSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldInputSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldInput = ({\n children,\n ...inputSlotProps\n}: FormFieldInputSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n input: children,\n inputSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldDescriptionSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldDescription = ({\n children,\n ...descriptionSlotProps\n}: FormFieldDescriptionSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n description: children,\n descriptionSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldErrorSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldError = ({\n children,\n ...errorSlotProps\n}: FormFieldErrorSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n error: children,\n errorSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect, type ReactNode } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\n\ntype FormFieldInfoBoxProps = {\n /**\n * The content to display in the InfoBox\n */\n children: ReactNode;\n};\n\nexport const FormFieldInfoBox = ({ children }: FormFieldInfoBoxProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n info: children,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { FormFieldRoot } from \"./components/form-field.root\";\nimport { FormFieldLabel } from \"./components/form-field.label\";\nimport { FormFieldInput } from \"./components/form-field.input\";\nimport { FormFieldDescription } from \"./components/form-field.description\";\nimport { FormFieldError } from \"./components/form-field.error\";\nimport { FormFieldInfoBox } from \"./components/form-field.info-box\";\n\nexport const FormField = {\n Root: FormFieldRoot,\n Label: FormFieldLabel,\n Input: FormFieldInput,\n Description: FormFieldDescription,\n Error: FormFieldError,\n InfoBox: FormFieldInfoBox,\n};\n\nexport {\n FormFieldRoot as _FormFieldRoot,\n FormFieldLabel as _FormFieldLabel,\n FormFieldInput as _FormFieldInput,\n FormFieldDescription as _FormFieldDescription,\n FormFieldError as _FormFieldError,\n FormFieldInfoBox as _FormFieldInfoBox,\n};\n"],"names":["FormFieldContext","createContext","columnLayout","rowLayout","formFieldRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","FormFieldRootSlot","FormFieldLabelSlot","FormFieldInputSlot","FormFieldDescriptionSlot","FormFieldErrorSlot","FormFieldPopoverSlot","FormFieldRoot","forwardRef","isInvalid","isRequired","isDisabled","isReadOnly","children","props","ref","context","setContext","useState","useFieldArgs","labelProps","fieldProps","descriptionProps","errorMessageProps","useField","useEffect","prevContext","inputProps","jsx","jsxs","DialogTrigger","Box","IconButton","HelpOutline","Popover","Dialog","Children","child","isValidElement","cloneElement","ErrorOutline","FormFieldLabel","labelSlotProps","useContext","FormFieldInput","inputSlotProps","FormFieldDescription","descriptionSlotProps","FormFieldError","errorSlotProps","FormFieldInfoBox","FormField"],"mappings":"0WA6BaA,EAAmBC,EAAAA,cAAoC,CAClE,QAAS,CACP,MAAO,KACP,YAAa,KACb,MAAO,KACP,KAAM,KACN,MAAO,IAAA,EAET,WAAY,IAAM,CAAC,CACrB,CAAC,ECpCKC,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA,EAMfC,EAAY;AAAA;AAAA;AAAA;AAAA,EAULC,EAAkBC,EAAAA,iBAAiB,CAC9C,MAAO,CAAC,OAAQ,QAAS,QAAS,cAAe,QAAS,SAAS,EAEnE,UAAW,uBAEX,KAAM,CACJ,KAAM,CACJ,aAAc,cAEd,QAAS,OACT,MAAO,MAAA,EAET,MA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AAA,UAAU,IAAM,CACdR,EAAYS,IAAiB,CAC3B,GAAGA,EACH,KAAMb,CAAA,EACN,CACJ,EAAG,CAACA,EAAUI,CAAU,CAAC,EAElB,IACT,ECdakC,EAAY,CACvB,KAAM5C,EACN,MAAOkC,EACP,MAAOG,EACP,YAAaE,EACb,MAAOE,EACP,QAASE,CACX"}
@@ -2,7 +2,7 @@ import { jsx as i, jsxs as c } from "react/jsx-runtime";
2
2
  import { createContext as z, forwardRef as $, useState as P, useEffect as n, Children as w, isValidElement as A, cloneElement as E, useContext as d } from "react";
3
3
  import { a as H } from "./config-ufbQ08Vi.es.js";
4
4
  import { c as y } from "./create-slot-recipe-context-DBNItnlK.es.js";
5
- import { e as B, $ as L, a as I } from "./Dialog-DNPIKkGE.es.js";
5
+ import { e as B, $ as L, a as I } from "./Dialog-C7IjW1jR.es.js";
6
6
  import { B as m } from "./box-C8731OYq.es.js";
7
7
  import { I as M } from "./icon-button-D2qU4Eun.es.js";
8
8
  import { HelpOutline as R, ErrorOutline as T } from "@commercetools/nimbus-icons";
@@ -307,4 +307,4 @@ export {
307
307
  Z as e,
308
308
  q as f
309
309
  };
310
- //# sourceMappingURL=form-field-BgKHtyTH.es.js.map
310
+ //# sourceMappingURL=form-field-Do0NhI0D.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-field-BgKHtyTH.es.js","sources":["../../src/components/form-field/components/form-field.context.tsx","../../src/components/form-field/form-field.recipe.tsx","../../src/components/form-field/form-field.slots.tsx","../../src/components/form-field/components/form-field.root.tsx","../../src/components/form-field/components/form-field.label.tsx","../../src/components/form-field/components/form-field.input.tsx","../../src/components/form-field/components/form-field.description.tsx","../../src/components/form-field/components/form-field.error.tsx","../../src/components/form-field/components/form-field.info-box.tsx","../../src/components/form-field/form-field.tsx"],"sourcesContent":["import { createContext, type ReactNode } from \"react\";\nimport type {\n FormFieldDescriptionSlotProps,\n FormFieldErrorSlotProps,\n FormFieldInputSlotProps,\n FormFieldLabelSlotProps,\n} from \"../form-field.slots\";\n\nexport type FormFieldContextPayloadType = {\n label: ReactNode;\n labelSlotProps?: FormFieldLabelSlotProps;\n input: ReactNode;\n inputSlotProps?: FormFieldInputSlotProps;\n description: ReactNode;\n descriptionSlotProps?: FormFieldDescriptionSlotProps;\n error: ReactNode;\n errorSlotProps?: FormFieldErrorSlotProps;\n info: ReactNode;\n isInvalid?: boolean;\n isRequired?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n};\n\nexport type FormFieldContextType = {\n context: FormFieldContextPayloadType;\n setContext: React.Dispatch<React.SetStateAction<FormFieldContextPayloadType>>;\n};\n\nexport const FormFieldContext = createContext<FormFieldContextType>({\n context: {\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n },\n setContext: () => {},\n});\n","import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\nconst columnLayout = `\n\"label\"\n\"input\"\n\"description\"\n\"error\"\n`;\nconst rowLayout = `\n\"label input\"\n\"label description\"\n\"label error\"\n`;\n\n/**\n * Recipe configuration for the FormField component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const formFieldRecipe = defineSlotRecipe({\n slots: [\"root\", \"label\", \"input\", \"description\", \"error\", \"popover\"],\n // Unique class name prefix for the component\n className: \"nimbus-ui-form-field\",\n\n base: {\n root: {\n \"--grid-gap\": \"spacing.100\",\n\n display: \"grid\",\n width: \"auto\",\n },\n label: {\n gridArea: \"label\",\n fontWeight: \"500\",\n color: \"neutral.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n input: {\n gridArea: \"input\",\n },\n description: {\n gridArea: \"description\",\n color: \"neutral.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n error: {\n gridArea: \"error\",\n color: \"critical.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n popover: {\n \"--scrollbar-color\": \"colors.neutral.8\",\n \"--scrollbar-bg\": \"colors.neutral.3\",\n bg: \"neutral.1\",\n maxWidth: \"xl\",\n borderRadius: \"200\",\n boxShadow: \"6\",\n border: \"solid-25\",\n borderColor: \"neutral.8\",\n maxHeight: \"40svh\",\n overflow: \"auto\",\n scrollbarWidth: \"thin\",\n scrollbarColor: \"var(--scrollbar-color) var(--scrollbar-bg)\",\n focusRing: \"outside\",\n },\n },\n\n variants: {\n size: {\n md: {\n root: {\n \"--form-field-font-size\": \"fontSizes.350\",\n \"--form-field-line-height\": \"lineHeights.500\",\n },\n },\n sm: {\n root: {\n \"--form-field-font-size\": \"fontSizes.300\",\n \"--form-field-line-height\": \"lineHeights.450\",\n },\n },\n },\n direction: {\n column: {\n root: {\n gridTemplateAreas: columnLayout,\n },\n input: {\n mt: \"var(--grid-gap)\",\n },\n description: {\n mt: \"var(--grid-gap)\",\n },\n error: {\n mt: \"var(--grid-gap)\",\n },\n },\n row: {\n root: {\n gridTemplateAreas: rowLayout,\n gridTemplateColumns: \"auto 1fr\",\n gridColumnGap: \"200\",\n },\n description: {\n mt: \"var(--grid-gap)\",\n },\n error: {\n mt: \"var(--grid-gap)\",\n },\n },\n },\n },\n\n // Default variant values when not explicitly specified\n defaultVariants: {\n direction: \"column\",\n size: \"md\",\n },\n});\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n type HTMLChakraProps,\n type RecipeVariantProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { formFieldRecipe } from \"./form-field.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: formFieldRecipe,\n});\n\n// Root slot\nexport interface FormFieldRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof formFieldRecipe> & UnstyledProp\n > {}\n\nexport const FormFieldRootSlot = withProvider<\n HTMLDivElement,\n FormFieldRootSlotProps\n>(\"div\", \"root\");\n\n// Label Slot\nexport interface FormFieldLabelSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldLabelSlot = withContext<\n HTMLDivElement,\n FormFieldLabelSlotProps\n>(\"div\", \"label\");\n\n// Input Slot\nexport interface FormFieldInputSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldInputSlot = withContext<\n HTMLDivElement,\n FormFieldInputSlotProps\n>(\"div\", \"input\");\n\n// Description Slot\nexport interface FormFieldDescriptionSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldDescriptionSlot = withContext<\n HTMLDivElement,\n FormFieldDescriptionSlotProps\n>(\"div\", \"description\");\n\n// Error Slot\nexport interface FormFieldErrorSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldErrorSlot = withContext<\n HTMLDivElement,\n FormFieldErrorSlotProps\n>(\"div\", \"error\");\n\n// Error Slot\nexport interface FormFieldPopoverSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldPopoverSlot = withContext<\n HTMLDivElement,\n FormFieldPopoverSlotProps\n>(\"div\", \"popover\");\n","import {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useEffect,\n useState,\n} from \"react\";\nimport type { FormFieldProps } from \"../form-field.types\";\nimport { useField } from \"react-aria\";\nimport {\n FormFieldContext,\n type FormFieldContextPayloadType,\n} from \"./form-field.context\";\nimport {\n FormFieldDescriptionSlot,\n FormFieldErrorSlot,\n FormFieldInputSlot,\n FormFieldLabelSlot,\n FormFieldPopoverSlot,\n FormFieldRootSlot,\n} from \"../form-field.slots\";\nimport { Dialog, DialogTrigger, Popover } from \"react-aria-components\";\nimport { Box, IconButton } from \"@/components\";\nimport { ErrorOutline, HelpOutline } from \"@commercetools/nimbus-icons\";\n\n/**\n * # FormField\n *\n * displays miscellaneous inputs in a FormField context\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/formfield}\n */\nexport const FormFieldRoot = forwardRef<HTMLDivElement, FormFieldProps>(\n (\n { isInvalid, isRequired, isDisabled, isReadOnly, children, ...props },\n ref\n ) => {\n const [context, setContext] = useState<FormFieldContextPayloadType>({\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n });\n\n const useFieldArgs: Parameters<typeof useField>[0] = {\n description: context.description,\n errorMessage: context.error,\n };\n\n if (context.label) {\n useFieldArgs.label = context.label;\n } else {\n // Context will always start out null, so we need to stub out some aria attributes\n // FIXME: This is a hack to get the form field to work, but it's not the best solution\n // FIXME: We should find a better way to handle this by redesigning the FormField component's structure\n useFieldArgs[\"aria-label\"] = \"empty-label\";\n useFieldArgs[\"aria-labelledby\"] = \"empty-label\";\n }\n\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField(useFieldArgs);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n }));\n }, [isInvalid, isRequired, isDisabled, isReadOnly]);\n\n const inputProps = {\n ...fieldProps,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n };\n\n return (\n <FormFieldContext.Provider value={{ context, setContext }}>\n <FormFieldRootSlot ref={ref} {...props}>\n {context.label && (\n <FormFieldLabelSlot {...context.labelSlotProps}>\n <label {...labelProps}>\n {context.label}\n {isRequired && <sup aria-hidden=\"true\">*</sup>}\n </label>\n {context.info && (\n <DialogTrigger>\n <Box\n as=\"span\"\n display=\"inline-block\"\n position=\"relative\"\n width=\"1ch\"\n height=\"1ch\"\n ml=\"200\"\n >\n <Box\n as=\"span\"\n display=\"inline-flex\"\n position=\"absolute\"\n top=\"50%\"\n right=\"50%\"\n transform=\"translate(50%, -50%)\"\n >\n <IconButton\n aria-label=\"__MORE INFO\"\n size=\"2xs\"\n tone=\"info\"\n variant=\"link\"\n >\n <HelpOutline />\n </IconButton>\n </Box>\n </Box>\n <Popover>\n <FormFieldPopoverSlot asChild>\n <Dialog>\n <Box p=\"300\">{context.info}</Box>\n </Dialog>\n </FormFieldPopoverSlot>\n </Popover>\n </DialogTrigger>\n )}\n </FormFieldLabelSlot>\n )}\n {context.input && (\n <FormFieldInputSlot {...context.inputSlotProps}>\n {Children.map(context.input, (child) => {\n // Important: Check if the child is a valid React element before cloning.\n if (isValidElement(child)) {\n return cloneElement(child, inputProps);\n }\n // If it's not a valid element (e.g., text node, null, undefined), return it as is.\n return child;\n })}\n </FormFieldInputSlot>\n )}\n {context.description && (\n <FormFieldDescriptionSlot\n {...descriptionProps}\n {...context.descriptionSlotProps}\n >\n {context.description}\n </FormFieldDescriptionSlot>\n )}\n {isInvalid && context.error && (\n <FormFieldErrorSlot\n {...errorMessageProps}\n {...context.errorSlotProps}\n >\n <Box\n as={ErrorOutline}\n display=\"inline-flex\"\n boxSize=\"400\"\n verticalAlign=\"text-bottom\"\n mr=\"100\"\n />\n {context.error}\n </FormFieldErrorSlot>\n )}\n {children}\n </FormFieldRootSlot>\n </FormFieldContext.Provider>\n );\n }\n);\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldLabelSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldLabel = ({\n children,\n ...labelSlotProps\n}: FormFieldLabelSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n label: children,\n labelSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldInputSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldInput = ({\n children,\n ...inputSlotProps\n}: FormFieldInputSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n input: children,\n inputSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldDescriptionSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldDescription = ({\n children,\n ...descriptionSlotProps\n}: FormFieldDescriptionSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n description: children,\n descriptionSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldErrorSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldError = ({\n children,\n ...errorSlotProps\n}: FormFieldErrorSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n error: children,\n errorSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect, type ReactNode } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\n\ntype FormFieldInfoBoxProps = {\n /**\n * The content to display in the InfoBox\n */\n children: ReactNode;\n};\n\nexport const FormFieldInfoBox = ({ children }: FormFieldInfoBoxProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n info: children,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { FormFieldRoot } from \"./components/form-field.root\";\nimport { FormFieldLabel } from \"./components/form-field.label\";\nimport { FormFieldInput } from \"./components/form-field.input\";\nimport { FormFieldDescription } from \"./components/form-field.description\";\nimport { FormFieldError } from \"./components/form-field.error\";\nimport { FormFieldInfoBox } from \"./components/form-field.info-box\";\n\nexport const FormField = {\n Root: FormFieldRoot,\n Label: FormFieldLabel,\n Input: FormFieldInput,\n Description: FormFieldDescription,\n Error: FormFieldError,\n InfoBox: FormFieldInfoBox,\n};\n\nexport {\n FormFieldRoot as _FormFieldRoot,\n FormFieldLabel as _FormFieldLabel,\n FormFieldInput as _FormFieldInput,\n FormFieldDescription as _FormFieldDescription,\n FormFieldError as _FormFieldError,\n FormFieldInfoBox as _FormFieldInfoBox,\n};\n"],"names":["FormFieldContext","createContext","columnLayout","rowLayout","formFieldRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","FormFieldRootSlot","FormFieldLabelSlot","FormFieldInputSlot","FormFieldDescriptionSlot","FormFieldErrorSlot","FormFieldPopoverSlot","FormFieldRoot","forwardRef","isInvalid","isRequired","isDisabled","isReadOnly","children","props","ref","context","setContext","useState","useFieldArgs","labelProps","fieldProps","descriptionProps","errorMessageProps","useField","useEffect","prevContext","inputProps","jsx","jsxs","DialogTrigger","Box","IconButton","HelpOutline","Popover","Dialog","Children","child","isValidElement","cloneElement","ErrorOutline","FormFieldLabel","labelSlotProps","useContext","FormFieldInput","inputSlotProps","FormFieldDescription","descriptionSlotProps","FormFieldError","errorSlotProps","FormFieldInfoBox","FormField"],"mappings":";;;;;;;;;AA6BO,MAAMA,IAAmB,gBAAAC,EAAoC;AAAA,EAClE,SAAS;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,YAAY,MAAM;AAAA,EAAC;AACrB,CAAC,GCpCKC,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA,GAMfC,IAAY;AAAA;AAAA;AAAA;AAAA,GAULC,IAAkB,gBAAAC,EAAiB;AAAA,EAC9C,OAAO,CAAC,QAAQ,SAAS,SAAS,eAAe,SAAS,SAAS;AAAA;AAAA,EAEnE,WAAW;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM;AAAA,MACJ,cAAc;AAAA,MAEd,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAET,OAAO;AAAA,MACL,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,OAAO;AAAA,MACL,UAAU;AAAA,IAAA;AAAA,IAEZ,aAAa;AAAA,MACX,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,OAAO;AAAA,MACL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aAAaE;AAAA,EACb,OAAOE;AAAA,EACP,SAASE;AACX;"}
1
+ {"version":3,"file":"form-field-Do0NhI0D.es.js","sources":["../../src/components/form-field/components/form-field.context.tsx","../../src/components/form-field/form-field.recipe.tsx","../../src/components/form-field/form-field.slots.tsx","../../src/components/form-field/components/form-field.root.tsx","../../src/components/form-field/components/form-field.label.tsx","../../src/components/form-field/components/form-field.input.tsx","../../src/components/form-field/components/form-field.description.tsx","../../src/components/form-field/components/form-field.error.tsx","../../src/components/form-field/components/form-field.info-box.tsx","../../src/components/form-field/form-field.tsx"],"sourcesContent":["import { createContext, type ReactNode } from \"react\";\nimport type {\n FormFieldDescriptionSlotProps,\n FormFieldErrorSlotProps,\n FormFieldInputSlotProps,\n FormFieldLabelSlotProps,\n} from \"../form-field.slots\";\n\nexport type FormFieldContextPayloadType = {\n label: ReactNode;\n labelSlotProps?: FormFieldLabelSlotProps;\n input: ReactNode;\n inputSlotProps?: FormFieldInputSlotProps;\n description: ReactNode;\n descriptionSlotProps?: FormFieldDescriptionSlotProps;\n error: ReactNode;\n errorSlotProps?: FormFieldErrorSlotProps;\n info: ReactNode;\n isInvalid?: boolean;\n isRequired?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n};\n\nexport type FormFieldContextType = {\n context: FormFieldContextPayloadType;\n setContext: React.Dispatch<React.SetStateAction<FormFieldContextPayloadType>>;\n};\n\nexport const FormFieldContext = createContext<FormFieldContextType>({\n context: {\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n },\n setContext: () => {},\n});\n","import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\nconst columnLayout = `\n\"label\"\n\"input\"\n\"description\"\n\"error\"\n`;\nconst rowLayout = `\n\"label input\"\n\"label description\"\n\"label error\"\n`;\n\n/**\n * Recipe configuration for the FormField component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const formFieldRecipe = defineSlotRecipe({\n slots: [\"root\", \"label\", \"input\", \"description\", \"error\", \"popover\"],\n // Unique class name prefix for the component\n className: \"nimbus-ui-form-field\",\n\n base: {\n root: {\n \"--grid-gap\": \"spacing.100\",\n\n display: \"grid\",\n width: \"auto\",\n },\n label: {\n gridArea: \"label\",\n fontWeight: \"500\",\n color: \"neutral.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n input: {\n gridArea: \"input\",\n },\n description: {\n gridArea: \"description\",\n color: \"neutral.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n error: {\n gridArea: \"error\",\n color: \"critical.11\",\n fontSize: \"var(--form-field-font-size)\",\n lineHeight: \"var(--form-field-line-height)\",\n },\n popover: {\n \"--scrollbar-color\": \"colors.neutral.8\",\n \"--scrollbar-bg\": \"colors.neutral.3\",\n bg: \"neutral.1\",\n maxWidth: \"xl\",\n borderRadius: \"200\",\n boxShadow: \"6\",\n border: \"solid-25\",\n borderColor: \"neutral.8\",\n maxHeight: \"40svh\",\n overflow: \"auto\",\n scrollbarWidth: \"thin\",\n scrollbarColor: \"var(--scrollbar-color) var(--scrollbar-bg)\",\n focusRing: \"outside\",\n },\n },\n\n variants: {\n size: {\n md: {\n root: {\n \"--form-field-font-size\": \"fontSizes.350\",\n \"--form-field-line-height\": \"lineHeights.500\",\n },\n },\n sm: {\n root: {\n \"--form-field-font-size\": \"fontSizes.300\",\n \"--form-field-line-height\": \"lineHeights.450\",\n },\n },\n },\n direction: {\n column: {\n root: {\n gridTemplateAreas: columnLayout,\n },\n input: {\n mt: \"var(--grid-gap)\",\n },\n description: {\n mt: \"var(--grid-gap)\",\n },\n error: {\n mt: \"var(--grid-gap)\",\n },\n },\n row: {\n root: {\n gridTemplateAreas: rowLayout,\n gridTemplateColumns: \"auto 1fr\",\n gridColumnGap: \"200\",\n },\n description: {\n mt: \"var(--grid-gap)\",\n },\n error: {\n mt: \"var(--grid-gap)\",\n },\n },\n },\n },\n\n // Default variant values when not explicitly specified\n defaultVariants: {\n direction: \"column\",\n size: \"md\",\n },\n});\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n type HTMLChakraProps,\n type RecipeVariantProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { formFieldRecipe } from \"./form-field.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: formFieldRecipe,\n});\n\n// Root slot\nexport interface FormFieldRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof formFieldRecipe> & UnstyledProp\n > {}\n\nexport const FormFieldRootSlot = withProvider<\n HTMLDivElement,\n FormFieldRootSlotProps\n>(\"div\", \"root\");\n\n// Label Slot\nexport interface FormFieldLabelSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldLabelSlot = withContext<\n HTMLDivElement,\n FormFieldLabelSlotProps\n>(\"div\", \"label\");\n\n// Input Slot\nexport interface FormFieldInputSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldInputSlot = withContext<\n HTMLDivElement,\n FormFieldInputSlotProps\n>(\"div\", \"input\");\n\n// Description Slot\nexport interface FormFieldDescriptionSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldDescriptionSlot = withContext<\n HTMLDivElement,\n FormFieldDescriptionSlotProps\n>(\"div\", \"description\");\n\n// Error Slot\nexport interface FormFieldErrorSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldErrorSlot = withContext<\n HTMLDivElement,\n FormFieldErrorSlotProps\n>(\"div\", \"error\");\n\n// Error Slot\nexport interface FormFieldPopoverSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const FormFieldPopoverSlot = withContext<\n HTMLDivElement,\n FormFieldPopoverSlotProps\n>(\"div\", \"popover\");\n","import {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useEffect,\n useState,\n} from \"react\";\nimport type { FormFieldProps } from \"../form-field.types\";\nimport { useField } from \"react-aria\";\nimport {\n FormFieldContext,\n type FormFieldContextPayloadType,\n} from \"./form-field.context\";\nimport {\n FormFieldDescriptionSlot,\n FormFieldErrorSlot,\n FormFieldInputSlot,\n FormFieldLabelSlot,\n FormFieldPopoverSlot,\n FormFieldRootSlot,\n} from \"../form-field.slots\";\nimport { Dialog, DialogTrigger, Popover } from \"react-aria-components\";\nimport { Box, IconButton } from \"@/components\";\nimport { ErrorOutline, HelpOutline } from \"@commercetools/nimbus-icons\";\n\n/**\n * # FormField\n *\n * displays miscellaneous inputs in a FormField context\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/formfield}\n */\nexport const FormFieldRoot = forwardRef<HTMLDivElement, FormFieldProps>(\n (\n { isInvalid, isRequired, isDisabled, isReadOnly, children, ...props },\n ref\n ) => {\n const [context, setContext] = useState<FormFieldContextPayloadType>({\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n });\n\n const useFieldArgs: Parameters<typeof useField>[0] = {\n description: context.description,\n errorMessage: context.error,\n };\n\n if (context.label) {\n useFieldArgs.label = context.label;\n } else {\n // Context will always start out null, so we need to stub out some aria attributes\n // FIXME: This is a hack to get the form field to work, but it's not the best solution\n // FIXME: We should find a better way to handle this by redesigning the FormField component's structure\n useFieldArgs[\"aria-label\"] = \"empty-label\";\n useFieldArgs[\"aria-labelledby\"] = \"empty-label\";\n }\n\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField(useFieldArgs);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n }));\n }, [isInvalid, isRequired, isDisabled, isReadOnly]);\n\n const inputProps = {\n ...fieldProps,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n };\n\n return (\n <FormFieldContext.Provider value={{ context, setContext }}>\n <FormFieldRootSlot ref={ref} {...props}>\n {context.label && (\n <FormFieldLabelSlot {...context.labelSlotProps}>\n <label {...labelProps}>\n {context.label}\n {isRequired && <sup aria-hidden=\"true\">*</sup>}\n </label>\n {context.info && (\n <DialogTrigger>\n <Box\n as=\"span\"\n display=\"inline-block\"\n position=\"relative\"\n width=\"1ch\"\n height=\"1ch\"\n ml=\"200\"\n >\n <Box\n as=\"span\"\n display=\"inline-flex\"\n position=\"absolute\"\n top=\"50%\"\n right=\"50%\"\n transform=\"translate(50%, -50%)\"\n >\n <IconButton\n aria-label=\"__MORE INFO\"\n size=\"2xs\"\n tone=\"info\"\n variant=\"link\"\n >\n <HelpOutline />\n </IconButton>\n </Box>\n </Box>\n <Popover>\n <FormFieldPopoverSlot asChild>\n <Dialog>\n <Box p=\"300\">{context.info}</Box>\n </Dialog>\n </FormFieldPopoverSlot>\n </Popover>\n </DialogTrigger>\n )}\n </FormFieldLabelSlot>\n )}\n {context.input && (\n <FormFieldInputSlot {...context.inputSlotProps}>\n {Children.map(context.input, (child) => {\n // Important: Check if the child is a valid React element before cloning.\n if (isValidElement(child)) {\n return cloneElement(child, inputProps);\n }\n // If it's not a valid element (e.g., text node, null, undefined), return it as is.\n return child;\n })}\n </FormFieldInputSlot>\n )}\n {context.description && (\n <FormFieldDescriptionSlot\n {...descriptionProps}\n {...context.descriptionSlotProps}\n >\n {context.description}\n </FormFieldDescriptionSlot>\n )}\n {isInvalid && context.error && (\n <FormFieldErrorSlot\n {...errorMessageProps}\n {...context.errorSlotProps}\n >\n <Box\n as={ErrorOutline}\n display=\"inline-flex\"\n boxSize=\"400\"\n verticalAlign=\"text-bottom\"\n mr=\"100\"\n />\n {context.error}\n </FormFieldErrorSlot>\n )}\n {children}\n </FormFieldRootSlot>\n </FormFieldContext.Provider>\n );\n }\n);\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldLabelSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldLabel = ({\n children,\n ...labelSlotProps\n}: FormFieldLabelSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n label: children,\n labelSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldInputSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldInput = ({\n children,\n ...inputSlotProps\n}: FormFieldInputSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n input: children,\n inputSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldDescriptionSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldDescription = ({\n children,\n ...descriptionSlotProps\n}: FormFieldDescriptionSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n description: children,\n descriptionSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldErrorSlotProps } from \"../form-field.slots\";\n\nexport const FormFieldError = ({\n children,\n ...errorSlotProps\n}: FormFieldErrorSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n error: children,\n errorSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { useContext, useEffect, type ReactNode } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\n\ntype FormFieldInfoBoxProps = {\n /**\n * The content to display in the InfoBox\n */\n children: ReactNode;\n};\n\nexport const FormFieldInfoBox = ({ children }: FormFieldInfoBoxProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n info: children,\n }));\n }, [children, setContext]);\n\n return null;\n};\n","import { FormFieldRoot } from \"./components/form-field.root\";\nimport { FormFieldLabel } from \"./components/form-field.label\";\nimport { FormFieldInput } from \"./components/form-field.input\";\nimport { FormFieldDescription } from \"./components/form-field.description\";\nimport { FormFieldError } from \"./components/form-field.error\";\nimport { FormFieldInfoBox } from \"./components/form-field.info-box\";\n\nexport const FormField = {\n Root: FormFieldRoot,\n Label: FormFieldLabel,\n Input: FormFieldInput,\n Description: FormFieldDescription,\n Error: FormFieldError,\n InfoBox: FormFieldInfoBox,\n};\n\nexport {\n FormFieldRoot as _FormFieldRoot,\n FormFieldLabel as _FormFieldLabel,\n FormFieldInput as _FormFieldInput,\n FormFieldDescription as _FormFieldDescription,\n FormFieldError as _FormFieldError,\n FormFieldInfoBox as _FormFieldInfoBox,\n};\n"],"names":["FormFieldContext","createContext","columnLayout","rowLayout","formFieldRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","FormFieldRootSlot","FormFieldLabelSlot","FormFieldInputSlot","FormFieldDescriptionSlot","FormFieldErrorSlot","FormFieldPopoverSlot","FormFieldRoot","forwardRef","isInvalid","isRequired","isDisabled","isReadOnly","children","props","ref","context","setContext","useState","useFieldArgs","labelProps","fieldProps","descriptionProps","errorMessageProps","useField","useEffect","prevContext","inputProps","jsx","jsxs","DialogTrigger","Box","IconButton","HelpOutline","Popover","Dialog","Children","child","isValidElement","cloneElement","ErrorOutline","FormFieldLabel","labelSlotProps","useContext","FormFieldInput","inputSlotProps","FormFieldDescription","descriptionSlotProps","FormFieldError","errorSlotProps","FormFieldInfoBox","FormField"],"mappings":";;;;;;;;;AA6BO,MAAMA,IAAmB,gBAAAC,EAAoC;AAAA,EAClE,SAAS;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,YAAY,MAAM;AAAA,EAAC;AACrB,CAAC,GCpCKC,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA,GAMfC,IAAY;AAAA;AAAA;AAAA;AAAA,GAULC,IAAkB,gBAAAC,EAAi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;AAAA,MAC3B,GAAGA;AAAA,MACH,OAAOb;AAAA,MACP,gBAAAoC;AAAA,IAAA,EACA;AAAA,EACJ,GAAG,CAACpC,GAAUI,CAAU,CAAC,GAElB;AACT,GCTaiC,IAAmB,CAAC,EAAE,UAAArC,QAAsC;AACvE,QAAM,EAAE,YAAAI,EAAA,IAAe0B,EAAWnD,CAAgB;AAElD,SAAAiC,EAAU,MAAM;AACd,IAAAR,EAAW,CAACS,OAAiB;AAAA,MAC3B,GAAGA;AAAA,MACH,MAAMb;AAAA,IAAA,EACN;AAAA,EACJ,GAAG,CAACA,GAAUI,CAAU,CAAC,GAElB;AACT,GCdakC,KAAY;AAAA,EACvB,MAAM5C;AAAA,EACN,OAAOkC;AAAA,EACP,OAAOG;AAAA,EACP,aAAaE;AAAA,EACb,OAAOE;AAAA,EACP,SAASE;AACX;"}
@@ -2,7 +2,7 @@ import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
2
  import { forwardRef as f, useState as w } from "react";
3
3
  import { B as e } from "./box-C8731OYq.es.js";
4
4
  import { I as h } from "./icon-button-D2qU4Eun.es.js";
5
- import { b as n } from "./tooltip-BLyAAnK-.es.js";
5
+ import { b as n } from "./tooltip-BOK0Uejw.es.js";
6
6
  import { T as u } from "./text-input-B7XCw3SS.es.js";
7
7
  import { VisibilityOff as P, Visibility as S } from "@commercetools/nimbus-icons";
8
8
  const b = /* @__PURE__ */ f(
@@ -47,4 +47,4 @@ b.displayName = "PasswordInput";
47
47
  export {
48
48
  b as P
49
49
  };
50
- //# sourceMappingURL=password-input-XSc2MhLG.es.js.map
50
+ //# sourceMappingURL=password-input-BT594v5p.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password-input-XSc2MhLG.es.js","sources":["../../src/components/password-input/password-input.tsx"],"sourcesContent":["import { forwardRef, useState } from \"react\";\nimport { Box, IconButton, Tooltip } from \"@/components\";\nimport { TextInput } from \"@/components/text-input\";\nimport { Visibility, VisibilityOff } from \"@commercetools/nimbus-icons\";\nimport type { PasswordInputProps } from \"./password-input.types\";\n\n/**\n * # PasswordInput\n *\n * A password input is a text field that hides entered characters for secure password entry.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/passwordinput}\n */\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (props, forwardedRef) => {\n const { size = \"md\", isDisabled } = props;\n const [showPassword, setShowPassword] = useState(false);\n const toggleVisibility = () => setShowPassword(!showPassword);\n\n /** size icon based on input size */\n const iconSize = size === \"md\" ? \"xs\" : \"2xs\";\n /**\n * position the icon button at the right edge of the input based on\n * the size of the input\n */\n const iconPositionProps =\n size === \"md\"\n ? {\n top: \"100\",\n right: \"400\",\n }\n : {\n top: \"50\",\n right: \"400\",\n };\n\n /** safe space between the text within the input and the icon button */\n const iconButtonSafeSpace = size === \"md\" ? \"1400\" : \"1100\";\n\n return (\n <Box display=\"inline-block\" position=\"relative\">\n <TextInput\n width=\"full\"\n ref={forwardedRef}\n type={showPassword ? \"text\" : \"password\"}\n {...props}\n pr={iconButtonSafeSpace}\n />\n <Box position=\"absolute\" {...iconPositionProps}>\n <Tooltip.Root>\n <IconButton\n size={iconSize}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n onPress={toggleVisibility}\n isDisabled={isDisabled}\n >\n {showPassword ? <VisibilityOff /> : <Visibility />}\n </IconButton>\n <Tooltip.Content>\n {showPassword ? \"Hide password\" : \"Show Password\"}\n </Tooltip.Content>\n </Tooltip.Root>\n </Box>\n </Box>\n );\n }\n);\n\nPasswordInput.displayName = \"PasswordInput\";\n"],"names":["PasswordInput","forwardRef","props","forwardedRef","size","isDisabled","showPassword","setShowPassword","useState","toggleVisibility","iconSize","iconPositionProps","jsxs","Box","jsx","TextInput","Tooltip","IconButton","VisibilityOff","Visibility"],"mappings":";;;;;;;AAaO,MAAMA,IAAgB,gBAAAC;AAAA,EAC3B,CAACC,GAAOC,MAAiB;AACvB,UAAM,EAAE,MAAAC,IAAO,MAAM,YAAAC,EAAA,IAAeH,GAC9B,CAACI,GAAcC,CAAe,IAAIC,EAAS,EAAK,GAChDC,IAAmB,MAAMF,EAAgB,CAACD,CAAY,GAGtDI,IAAWN,MAAS,OAAO,OAAO,OAKlCO,IACJP,MAAS,OACL;AAAA,MACE,KAAK;AAAA,MACL,OAAO;AAAA,IAAA,IAET;AAAA,MACE,KAAK;AAAA,MACL,OAAO;AAAA,IAAA;AAMf,WACE,gBAAAQ,EAACC,GAAA,EAAI,SAAQ,gBAAe,UAAS,YACnC,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,KAAKZ;AAAA,UACL,MAAMG,IAAe,SAAS;AAAA,UAC7B,GAAGJ;AAAA,UACJ,IATsBE,MAAS,OAAO,SAAS;AAAA,QAS3C;AAAA,MAAA;AAAA,MAEN,gBAAAU,EAACD,KAAI,UAAS,YAAY,GAAGF,GAC3B,UAAA,gBAAAC,EAACI,EAAQ,MAAR,EACC,UAAA;AAAA,QAAA,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,MAAMP;AAAA,YACN,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,cAAYJ,IAAe,kBAAkB;AAAA,YAC7C,SAASG;AAAA,YACT,YAAAJ;AAAA,YAEC,UAAAC,IAAe,gBAAAQ,EAACI,GAAA,CAAA,CAAc,sBAAMC,GAAA,CAAA,CAAW;AAAA,UAAA;AAAA,QAAA;AAAA,0BAEjDH,EAAQ,SAAR,EACE,UAAAV,IAAe,kBAAkB,gBAAA,CACpC;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,IAAA,GACF;AAAA,EAEJ;AACF;AAEAN,EAAc,cAAc;"}
1
+ {"version":3,"file":"password-input-BT594v5p.es.js","sources":["../../src/components/password-input/password-input.tsx"],"sourcesContent":["import { forwardRef, useState } from \"react\";\nimport { Box, IconButton, Tooltip } from \"@/components\";\nimport { TextInput } from \"@/components/text-input\";\nimport { Visibility, VisibilityOff } from \"@commercetools/nimbus-icons\";\nimport type { PasswordInputProps } from \"./password-input.types\";\n\n/**\n * # PasswordInput\n *\n * A password input is a text field that hides entered characters for secure password entry.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/passwordinput}\n */\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (props, forwardedRef) => {\n const { size = \"md\", isDisabled } = props;\n const [showPassword, setShowPassword] = useState(false);\n const toggleVisibility = () => setShowPassword(!showPassword);\n\n /** size icon based on input size */\n const iconSize = size === \"md\" ? \"xs\" : \"2xs\";\n /**\n * position the icon button at the right edge of the input based on\n * the size of the input\n */\n const iconPositionProps =\n size === \"md\"\n ? {\n top: \"100\",\n right: \"400\",\n }\n : {\n top: \"50\",\n right: \"400\",\n };\n\n /** safe space between the text within the input and the icon button */\n const iconButtonSafeSpace = size === \"md\" ? \"1400\" : \"1100\";\n\n return (\n <Box display=\"inline-block\" position=\"relative\">\n <TextInput\n width=\"full\"\n ref={forwardedRef}\n type={showPassword ? \"text\" : \"password\"}\n {...props}\n pr={iconButtonSafeSpace}\n />\n <Box position=\"absolute\" {...iconPositionProps}>\n <Tooltip.Root>\n <IconButton\n size={iconSize}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n onPress={toggleVisibility}\n isDisabled={isDisabled}\n >\n {showPassword ? <VisibilityOff /> : <Visibility />}\n </IconButton>\n <Tooltip.Content>\n {showPassword ? \"Hide password\" : \"Show Password\"}\n </Tooltip.Content>\n </Tooltip.Root>\n </Box>\n </Box>\n );\n }\n);\n\nPasswordInput.displayName = \"PasswordInput\";\n"],"names":["PasswordInput","forwardRef","props","forwardedRef","size","isDisabled","showPassword","setShowPassword","useState","toggleVisibility","iconSize","iconPositionProps","jsxs","Box","jsx","TextInput","Tooltip","IconButton","VisibilityOff","Visibility"],"mappings":";;;;;;;AAaO,MAAMA,IAAgB,gBAAAC;AAAA,EAC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PfAM3.cjs.js"),r=require("./tooltip-tZKuAv4E.cjs.js"),j=require("./text-input-CCX8LUl1.cjs.js"),c=require("@commercetools/nimbus-icons"),a=e.forwardRef((i,d)=>{const{size:t="md",isDisabled:l}=i,[o,u]=e.useState(!1),p=()=>u(!o),x=t==="md"?"xs":"2xs",w=t==="md"?{top:"100",right:"400"}:{top:"50",right:"400"},h=t==="md"?"1400":"1100";return s.jsxs(n.Box,{display:"inline-block",position:"relative",children:[s.jsx(j.TextInput,{width:"full",ref:d,type:o?"text":"password",...i,pr:h}),s.jsx(n.Box,{position:"absolute",...w,children:s.jsxs(r.Tooltip.Root,{children:[s.jsx(b.IconButton,{size:x,variant:"ghost",tone:"primary","aria-label":o?"Hide password":"Show password",onPress:p,isDisabled:l,children:o?s.jsx(c.VisibilityOff,{}):s.jsx(c.Visibility,{})}),s.jsx(r.Tooltip.Content,{children:o?"Hide password":"Show Password"})]})})]})});a.displayName="PasswordInput";exports.PasswordInput=a;
2
- //# sourceMappingURL=password-input--fYkZAW3.cjs.js.map
1
+ "use strict";const s=require("react/jsx-runtime"),e=require("react"),n=require("./box-BPfqlznQ.cjs.js"),b=require("./icon-button-BBkPfAM3.cjs.js"),r=require("./tooltip-DjUjwciC.cjs.js"),j=require("./text-input-CCX8LUl1.cjs.js"),c=require("@commercetools/nimbus-icons"),a=e.forwardRef((i,d)=>{const{size:t="md",isDisabled:l}=i,[o,u]=e.useState(!1),p=()=>u(!o),x=t==="md"?"xs":"2xs",w=t==="md"?{top:"100",right:"400"}:{top:"50",right:"400"},h=t==="md"?"1400":"1100";return s.jsxs(n.Box,{display:"inline-block",position:"relative",children:[s.jsx(j.TextInput,{width:"full",ref:d,type:o?"text":"password",...i,pr:h}),s.jsx(n.Box,{position:"absolute",...w,children:s.jsxs(r.Tooltip.Root,{children:[s.jsx(b.IconButton,{size:x,variant:"ghost",tone:"primary","aria-label":o?"Hide password":"Show password",onPress:p,isDisabled:l,children:o?s.jsx(c.VisibilityOff,{}):s.jsx(c.Visibility,{})}),s.jsx(r.Tooltip.Content,{children:o?"Hide password":"Show Password"})]})})]})});a.displayName="PasswordInput";exports.PasswordInput=a;
2
+ //# sourceMappingURL=password-input-D1LSzb9p.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password-input--fYkZAW3.cjs.js","sources":["../../src/components/password-input/password-input.tsx"],"sourcesContent":["import { forwardRef, useState } from \"react\";\nimport { Box, IconButton, Tooltip } from \"@/components\";\nimport { TextInput } from \"@/components/text-input\";\nimport { Visibility, VisibilityOff } from \"@commercetools/nimbus-icons\";\nimport type { PasswordInputProps } from \"./password-input.types\";\n\n/**\n * # PasswordInput\n *\n * A password input is a text field that hides entered characters for secure password entry.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/passwordinput}\n */\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (props, forwardedRef) => {\n const { size = \"md\", isDisabled } = props;\n const [showPassword, setShowPassword] = useState(false);\n const toggleVisibility = () => setShowPassword(!showPassword);\n\n /** size icon based on input size */\n const iconSize = size === \"md\" ? \"xs\" : \"2xs\";\n /**\n * position the icon button at the right edge of the input based on\n * the size of the input\n */\n const iconPositionProps =\n size === \"md\"\n ? {\n top: \"100\",\n right: \"400\",\n }\n : {\n top: \"50\",\n right: \"400\",\n };\n\n /** safe space between the text within the input and the icon button */\n const iconButtonSafeSpace = size === \"md\" ? \"1400\" : \"1100\";\n\n return (\n <Box display=\"inline-block\" position=\"relative\">\n <TextInput\n width=\"full\"\n ref={forwardedRef}\n type={showPassword ? \"text\" : \"password\"}\n {...props}\n pr={iconButtonSafeSpace}\n />\n <Box position=\"absolute\" {...iconPositionProps}>\n <Tooltip.Root>\n <IconButton\n size={iconSize}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n onPress={toggleVisibility}\n isDisabled={isDisabled}\n >\n {showPassword ? <VisibilityOff /> : <Visibility />}\n </IconButton>\n <Tooltip.Content>\n {showPassword ? \"Hide password\" : \"Show Password\"}\n </Tooltip.Content>\n </Tooltip.Root>\n </Box>\n </Box>\n );\n }\n);\n\nPasswordInput.displayName = \"PasswordInput\";\n"],"names":["PasswordInput","forwardRef","props","forwardedRef","size","isDisabled","showPassword","setShowPassword","useState","toggleVisibility","iconSize","iconPositionProps","iconButtonSafeSpace","jsxs","Box","jsx","TextInput","Tooltip","IconButton","VisibilityOff","Visibility"],"mappings":"6QAaaA,EAAgBC,EAAAA,WAC3B,CAACC,EAAOC,IAAiB,CACvB,KAAM,CAAE,KAAAC,EAAO,KAAM,WAAAC,CAAA,EAAeH,EAC9B,CAACI,EAAcC,CAAe,EAAIC,EAAAA,SAAS,EAAK,EAChDC,EAAmB,IAAMF,EAAgB,CAACD,CAAY,EAGtDI,EAAWN,IAAS,KAAO,KAAO,MAKlCO,EACJP,IAAS,KACL,CACE,IAAK,MACL,MAAO,KAAA,EAET,CACE,IAAK,KACL,MAAO,KAAA,EAITQ,EAAsBR,IAAS,KAAO,OAAS,OAErD,OACES,EAAAA,KAACC,EAAAA,IAAA,CAAI,QAAQ,eAAe,SAAS,WACnC,SAAA,CAAAC,EAAAA,IAACC,EAAAA,UAAA,CACC,MAAM,OACN,IAAKb,EACL,KAAMG,EAAe,OAAS,WAC7B,GAAGJ,EACJ,GAAIU,CAAA,CAAA,EAENG,EAAAA,IAACD,EAAAA,KAAI,SAAS,WAAY,GAAGH,EAC3B,SAAAE,OAACI,EAAAA,QAAQ,KAAR,CACC,SAAA,CAAAF,EAAAA,IAACG,EAAAA,WAAA,CACC,KAAMR,EACN,QAAQ,QACR,KAAK,UACL,aAAYJ,EAAe,gBAAkB,gBAC7C,QAASG,EACT,WAAAJ,EAEC,SAAAC,EAAeS,MAACI,EAAAA,cAAA,CAAA,CAAc,QAAMC,EAAAA,WAAA,CAAA,CAAW,CAAA,CAAA,QAEjDH,EAAAA,QAAQ,QAAR,CACE,SAAAX,EAAe,gBAAkB,eAAA,CACpC,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EACF,CAEJ,CACF,EAEAN,EAAc,YAAc"}
1
+ {"version":3,"file":"password-input-D1LSzb9p.cjs.js","sources":["../../src/components/password-input/password-input.tsx"],"sourcesContent":["import { forwardRef, useState } from \"react\";\nimport { Box, IconButton, Tooltip } from \"@/components\";\nimport { TextInput } from \"@/components/text-input\";\nimport { Visibility, VisibilityOff } from \"@commercetools/nimbus-icons\";\nimport type { PasswordInputProps } from \"./password-input.types\";\n\n/**\n * # PasswordInput\n *\n * A password input is a text field that hides entered characters for secure password entry.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/passwordinput}\n */\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (props, forwardedRef) => {\n const { size = \"md\", isDisabled } = props;\n const [showPassword, setShowPassword] = useState(false);\n const toggleVisibility = () => setShowPassword(!showPassword);\n\n /** size icon based on input size */\n const iconSize = size === \"md\" ? \"xs\" : \"2xs\";\n /**\n * position the icon button at the right edge of the input based on\n * the size of the input\n */\n const iconPositionProps =\n size === \"md\"\n ? {\n top: \"100\",\n right: \"400\",\n }\n : {\n top: \"50\",\n right: \"400\",\n };\n\n /** safe space between the text within the input and the icon button */\n const iconButtonSafeSpace = size === \"md\" ? \"1400\" : \"1100\";\n\n return (\n <Box display=\"inline-block\" position=\"relative\">\n <TextInput\n width=\"full\"\n ref={forwardedRef}\n type={showPassword ? \"text\" : \"password\"}\n {...props}\n pr={iconButtonSafeSpace}\n />\n <Box position=\"absolute\" {...iconPositionProps}>\n <Tooltip.Root>\n <IconButton\n size={iconSize}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n onPress={toggleVisibility}\n isDisabled={isDisabled}\n >\n {showPassword ? <VisibilityOff /> : <Visibility />}\n </IconButton>\n <Tooltip.Content>\n {showPassword ? \"Hide password\" : \"Show Password\"}\n </Tooltip.Content>\n </Tooltip.Root>\n </Box>\n </Box>\n );\n }\n);\n\nPasswordInput.displayName = \"PasswordInput\";\n"],"names":["PasswordInput","forwardRef","props","forwardedRef","size","isDisabled","showPassword","setShowPassword","useState","toggleVisibility","iconSize","iconPositionProps","iconButtonSafeSpace","jsxs","Box","jsx","TextInput","Tooltip","IconButton","VisibilityOff","Visibility"],"mappings":"6QAaaA,EAAgBC,EAAAA,WAC3B,CAACC,EAAOC,IAAiB,CACvB,KAAM,CAAE,KAAAC,EAAO,KAAM,WAAAC,CAAA,EAAeH,EAC9B,CAACI,EAAcC,CAAe,EAAIC,EAAAA,SAAS,EAAK,EAChDC,EAAmB,IAAMF,EAAgB,CAACD,CAAY,EAGtDI,EAAWN,IAAS,KAAO,KAAO,MAKlCO,EACJP,IAAS,KACL,CACE,IAAK,MACL,MAAO,KAAA,EAET,CACE,IAAK,KACL,MAAO,KAAA,EAITQ,EAAsBR,IAAS,KAAO,OAAS,OAErD,OACES,EAAAA,KAACC,EAAAA,IAAA,CAAI,QAAQ,eAAe,SAAS,WACnC,SAAA,CAAAC,EAAAA,IAACC,EAAAA,UAAA,CACC,MAAM,OACN,IAAKb,EACL,KAAMG,EAAe,OAAS,WAC7B,GAAGJ,EACJ,GAAIU,CAAA,CAAA,EAENG,EAAAA,IAACD,EAAAA,KAAI,SAAS,WAAY,GAAGH,EAC3B,SAAAE,OAACI,EAAAA,QAAQ,KAAR,CACC,SAAA,CAAAF,EAAAA,IAACG,EAAAA,WAAA,CACC,KAAMR,EACN,QAAQ,QACR,KAAK,UACL,aAAYJ,EAAe,gBAAkB,gBAC7C,QAASG,EACT,WAAAJ,EAEC,SAAAC,EAAeS,MAACI,EAAAA,cAAA,CAAA,CAAc,QAAMC,EAAAA,WAAA,CAAA,CAAW,CAAA,CAAA,QAEjDH,EAAAA,QAAQ,QAAR,CACE,SAAAX,EAAe,gBAAkB,eAAA,CACpC,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EACF,CAEJ,CACF,EAEAN,EAAc,YAAc"}
@@ -0,0 +1,2 @@
1
+ "use strict";const s=require("react/jsx-runtime"),i=require("react"),z=require("@commercetools/nimbus-icons"),Y=require("./box-BPfqlznQ.cjs.js"),L=require("./Button-DQ_WkLNH.cjs.js"),F=require("./Dialog-Cbq66gyc.cjs.js"),h=require("./utils-BHdR5Nww.cjs.js"),re=require("./FieldError-DyGFfqST.cjs.js"),ae=require("./Form-BuOomA4T.cjs.js"),ne=require("./intlStrings-ClBuC6xN.cjs.js"),Z=require("./Label-BgrYyYXn.cjs.js"),B=require("./ListBox-CzZFXtHY.cjs.js"),N=require("./Text-BWSfeB9p.cjs.js"),O=require("./Collection-BsItrctR.cjs.js"),D=require("./mergeProps-BA5Cwf5w.cjs.js"),G=require("./filterDOMProps-WUskt27c.cjs.js"),_=require("./OverlayArrow-C5Ymp9MC.cjs.js"),se=require("./useLocalizedStringFormatter-fJnbqb2x.cjs.js"),ee=require("./useFormValidation-DJy_cdgv.cjs.js"),de=require("./useSingleSelectListState-BpAVpRdZ.cjs.js"),ce=require("./useFocusRing-DRIoF592.cjs.js"),ue=require("./useFocusVisible-bRnVksaU.cjs.js"),fe=require("./useCollator-ZqnkTllN.cjs.js"),be=require("./useField-DmqO9k7a.cjs.js"),$e=require("./useFormReset--wPlnEOl.cjs.js"),pe=require("./VisuallyHidden-B4l0wZHw.cjs.js"),te=require("./create-slot-recipe-context-HIF51Igr.cjs.js"),ve=require("./icon-button-BBkPfAM3.cjs.js"),xe=require("./index-XyB4gGC8.cjs.js"),le=require("./extractStyleProps-wjyId_vK.cjs.js"),me=require("./factory-DlCuwIGL.cjs.js"),T=require("./flex-BhVeeItQ.cjs.js"),he=require("./Separator-DBLZ41YB.cjs.js"),H=new WeakMap;function ye(e,t,n){let{keyboardDelegate:r,isDisabled:l,isRequired:d,name:u,form:a,validationBehavior:c="aria"}=e,$=fe.$325a3faab7a68acd$export$a16aca283550c30d({usage:"search",sensitivity:"base"}),o=i.useMemo(()=>r||new O.$2a25aae57d74318e$export$a05409b8bb224a5a(t.collection,t.disabledKeys,n,$),[r,t.collection,t.disabledKeys,$,n]),{menuTriggerProps:v,menuProps:p}=F.$168583247155ddda$export$dc9c12ed27dd1b49({isDisabled:l,type:"listbox"},t,n),f=b=>{switch(b.key){case"ArrowLeft":{var S,g;b.preventDefault();let q=t.selectedKey!=null?(S=o.getKeyAbove)===null||S===void 0?void 0:S.call(o,t.selectedKey):(g=o.getFirstKey)===null||g===void 0?void 0:g.call(o);q&&t.setSelectedKey(q);break}case"ArrowRight":{var M,V;b.preventDefault();let q=t.selectedKey!=null?(M=o.getKeyBelow)===null||M===void 0?void 0:M.call(o,t.selectedKey):(V=o.getFirstKey)===null||V===void 0?void 0:V.call(o);q&&t.setSelectedKey(q);break}}},{typeSelectProps:x}=O.$fb3050f43d946246$export$e32c88dfddc6e1d8({keyboardDelegate:o,selectionManager:t.selectionManager,onTypeSelect(b){t.setSelectedKey(b)}}),{isInvalid:P,validationErrors:R,validationDetails:I}=t.displayValidation,{labelProps:w,fieldProps:C,descriptionProps:y,errorMessageProps:E}=be.$2baaea4c71418dea$export$294aa081a6c6f55d({...e,labelElementType:"span",isInvalid:P,errorMessage:e.errorMessage||R});x.onKeyDown=x.onKeyDownCapture,delete x.onKeyDownCapture;let k=G.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{labelable:!0}),m=D.$3ef42575df84b30b$export$9d1611c77c2fe928(x,v,C),j=D.$bdb11010cef70236$export$f680877a34711e37();return H.set(t,{isDisabled:l,isRequired:d,name:u,form:a,validationBehavior:c}),{labelProps:{...w,onClick:()=>{if(!e.isDisabled){var b;(b=n.current)===null||b===void 0||b.focus(),ue.$507fabe10e71c6fb$export$8397ddfc504fdb9a("keyboard")}}},triggerProps:D.$3ef42575df84b30b$export$9d1611c77c2fe928(k,{...m,isDisabled:l,onKeyDown:D.$ff5963eb1fccf552$export$e08e3b67e392101e(m.onKeyDown,f,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[j,m["aria-labelledby"],m["aria-label"]&&!m["aria-labelledby"]?m.id:null].filter(Boolean).join(" "),onFocus(b){t.isFocused||(e.onFocus&&e.onFocus(b),e.onFocusChange&&e.onFocusChange(!0),t.setFocused(!0))},onBlur(b){t.isOpen||(e.onBlur&&e.onBlur(b),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))}}),valueProps:{id:j},menuProps:{...p,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:b=>{b.currentTarget.contains(b.relatedTarget)||(e.onBlur&&e.onBlur(b),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))},"aria-labelledby":[C["aria-labelledby"],m["aria-label"]&&!C["aria-labelledby"]?m.id:null].filter(Boolean).join(" ")},descriptionProps:y,errorMessageProps:E,isInvalid:P,validationErrors:R,validationDetails:I,hiddenSelectProps:{isDisabled:l,name:u,label:e.label,state:t,triggerRef:n,form:a}}}function Se(e,t,n){let r=H.get(t)||{},{autoComplete:l,name:d=r.name,form:u=r.form,isDisabled:a=r.isDisabled}=e,{validationBehavior:c,isRequired:$}=r,{visuallyHiddenProps:o}=pe.$5c3e21d68f1c4674$export$a966af930f325cab({style:{position:"fixed",top:0,left:0}});$e.$99facab73266f662$export$5add1d006293d136(e.selectRef,t.defaultSelectedKey,t.setSelectedKey),ee.$e93e671b31057976$export$b8473d3665f3a75a({validationBehavior:c,focus:()=>{var f;return(f=n.current)===null||f===void 0?void 0:f.focus()}},t,e.selectRef);let v=i.useCallback(f=>t.setSelectedKey(f.currentTarget.value),[t.setSelectedKey]);var p;return{containerProps:{...o,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:l,disabled:a,required:c==="native"&&$,name:d,form:u,value:(p=t.selectedKey)!==null&&p!==void 0?p:"",onChange:v,onInput:v}}}function ge(e){let{state:t,triggerRef:n,label:r,name:l,form:d,isDisabled:u}=e,a=i.useRef(null),c=i.useRef(null),{containerProps:$,selectProps:o}=Se({...e,selectRef:t.collection.size<=300?a:c},t,n);if(t.collection.size<=300)return i.createElement("div",{...$,"data-testid":"hidden-select-container"},i.createElement("label",null,r,i.createElement("select",{...o,ref:a},i.createElement("option",null),[...t.collection.getKeys()].map(p=>{let f=t.collection.getItem(p);if(f&&f.type==="item")return i.createElement("option",{key:f.key,value:f.key},f.textValue)}))));if(l){let p=H.get(t)||{},{validationBehavior:f}=p;var v;let x={type:"hidden",autoComplete:o.autoComplete,name:l,form:d,disabled:u,value:(v=t.selectedKey)!==null&&v!==void 0?v:""};return f==="native"?i.createElement("input",{...x,ref:c,style:{display:"none"},type:"text",required:o.required,onChange:()=>{}}):i.createElement("input",{...x,ref:c})}return null}function Pe(e){let t=_.$fc909762b330b746$export$61c6a8c84e605fb6(e),[n,r]=i.useState(null),l=de.$a0d645289fe9b86b$export$e7f05e985daf4b5f({...e,onSelectionChange:o=>{e.onSelectionChange!=null&&e.onSelectionChange(o),t.close(),d.commitValidation()}}),d=ee.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,value:l.selectedKey}),[u,a]=i.useState(!1),[c]=i.useState(l.selectedKey);var $;return{...d,...l,...t,defaultSelectedKey:($=e.defaultSelectedKey)!==null&&$!==void 0?$:c,focusStrategy:n,open(o=null){l.collection.size!==0&&(r(o),t.open())},toggle(o=null){l.collection.size!==0&&(r(o),t.toggle())},isFocused:u,setFocused:a}}function Re(e){return e&&e.__esModule?e.default:e}const W=i.createContext(null),A=i.createContext(null),Ce=i.forwardRef(function(t,n){[t,n]=h.$64fa3d84918910a7$export$29f1550f4b0d4415(t,n,W);let{children:r,isDisabled:l=!1,isInvalid:d=!1,isRequired:u=!1}=t,a=i.useMemo(()=>typeof r=="function"?r({isOpen:!1,isDisabled:l,isInvalid:d,isRequired:u,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):r,[r,l,d,u]);return i.createElement(O.$e1995378a142960e$export$bf788dd355e3a401,{content:a},c=>i.createElement(De,{props:t,collection:c,selectRef:n}))}),qe=[Z.$01b77f81d0f07f68$export$75b6ee27786ba447,L.$d2b4bc8c273e7be6$export$24d547caef80ccd1,N.$514c0188e459b4c0$export$9afb8bc826b033ea];function De({props:e,selectRef:t,collection:n}){let{validationBehavior:r}=h.$64fa3d84918910a7$export$fabf2dc03a41866e(ae.$d3e0e05bdfcf66bd$export$c24727297075ec6a)||{};var l,d;let u=(d=(l=e.validationBehavior)!==null&&l!==void 0?l:r)!==null&&d!==void 0?d:"native",a=Pe({...e,collection:n,children:void 0,validationBehavior:u}),{isFocusVisible:c,focusProps:$}=ce.$f7dceffc5ad7768b$export$4e328f61c538687f({within:!0}),o=i.useRef(null),[v,p]=h.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:f,triggerProps:x,valueProps:P,menuProps:R,descriptionProps:I,errorMessageProps:w,hiddenSelectProps:C,...y}=ye({...h.$64fa3d84918910a7$export$ef03459518577ad4(e),label:p,validationBehavior:u},a,o),[E,k]=i.useState(null),m=i.useCallback(()=>{o.current&&k(o.current.offsetWidth+"px")},[o]);_.$9daab02d461809db$export$683480f191c0e3ea({ref:o,onResize:m});let j=i.useMemo(()=>({isOpen:a.isOpen,isFocused:a.isFocused,isFocusVisible:c,isDisabled:e.isDisabled||!1,isInvalid:y.isInvalid||!1,isRequired:e.isRequired||!1}),[a.isOpen,a.isFocused,c,e.isDisabled,y.isInvalid,e.isRequired]),b=h.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,values:j,defaultClassName:"react-aria-Select"}),S=G.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});delete S.id;let g=i.useRef(null);return i.createElement(h.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[W,e],[A,a],[oe,P],[Z.$01b77f81d0f07f68$export$75b6ee27786ba447,{...f,ref:v,elementType:"span"}],[L.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{...x,ref:o,isPressed:a.isOpen,autoFocus:e.autoFocus}],[F.$de32f1b87079253c$export$d2f961adcb0afbe,a],[F.$07b14b47974efb58$export$9b9a0cd73afb7ca4,{trigger:"Select",triggerRef:o,scrollRef:g,placement:"bottom start",style:{"--trigger-width":E},"aria-labelledby":R["aria-labelledby"],clearContexts:qe}],[B.$eed445e0843c11d0$export$7ff8f37d2d81a48d,{...R,ref:g}],[B.$eed445e0843c11d0$export$7c5906fe4f1f2af2,a],[N.$514c0188e459b4c0$export$9afb8bc826b033ea,{slots:{description:I,errorMessage:w}}],[re.$ee014567cb39d3f0$export$ff05c3ac10437e03,y]]},i.createElement("div",{...D.$3ef42575df84b30b$export$9d1611c77c2fe928(S,b,$),ref:t,slot:e.slot||void 0,"data-focused":a.isFocused||void 0,"data-focus-visible":c||void 0,"data-open":a.isOpen||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":y.isInvalid||void 0,"data-required":e.isRequired||void 0},b.children,i.createElement(ge,{...C,autoComplete:e.autoComplete})))}const oe=i.createContext(null),Fe=i.forwardRef(function(t,n){var r,l;[t,n]=h.$64fa3d84918910a7$export$29f1550f4b0d4415(t,n,oe);let d=i.useContext(A),{placeholder:u}=h.$64fa3d84918910a7$export$fabf2dc03a41866e(W),a=d.selectedKey!=null?d.collection.getItem(d.selectedKey):null,c=a?.props.children;typeof c=="function"&&(c=c({isHovered:!1,isPressed:!1,isSelected:!1,isFocused:!1,isFocusVisible:!1,isDisabled:!1,selectionMode:"single",selectionBehavior:"toggle"}));let $=se.$fca6afa0e843324b$export$f12b703ca79dfbb1(Re(ne.$df39c1238ae2b5f3$exports),"react-aria-components");var o,v,p;let f=h.$64fa3d84918910a7$export$4d86445c2cf5e3({...t,defaultChildren:(o=c??u)!==null&&o!==void 0?o:$.format("selectPlaceholder"),defaultClassName:"react-aria-SelectValue",values:{selectedItem:(v=(r=d.selectedItem)===null||r===void 0?void 0:r.value)!==null&&v!==void 0?v:null,selectedText:(p=(l=d.selectedItem)===null||l===void 0?void 0:l.textValue)!==null&&p!==void 0?p:null,isPlaceholder:!a}}),x=G.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(t,{global:!0});return i.createElement("span",{ref:n,...x,...f,"data-placeholder":!a||void 0},i.createElement(N.$514c0188e459b4c0$export$9afb8bc826b033ea.Provider,{value:void 0},f.children))}),{withProvider:Be,withContext:K}=te.createSlotRecipeContext({key:"select"}),Ke=Be("div","root"),je=K("button","trigger"),Oe=K("span","triggerLabel"),Ie=K("div","options"),we=K("div","option"),Ee=K("div","optionGroup"),ie=()=>{const e=i.useContext(A);if(!e?.selectedKey)return null;const t=()=>{e?.setSelectedKey(null)};return s.jsx(F.$f1ab8c75478c6f73$export$cf75428e0b9ed1ea,{children:s.jsx(ve.IconButton,{pointerEvents:"all",size:"2xs",variant:"ghost",tone:"primary","aria-label":"Clear Selection",onPress:t,children:s.jsx(z.Close,{})})})};ie.displayName="Select.ClearButton";const U=i.forwardRef(({children:e,isLoading:t,isDisabled:n,...r},l)=>{const d=te.useSlotRecipe({recipe:xe.selectSlotRecipe}),[u,a]=d.splitVariantProps(r),[c,$]=le.extractStyleProps(a),o={...$,isDisabled:t||n};return s.jsx(Ke,{asChild:!0,ref:l,...u,...c,children:s.jsxs(Ce,{...o,children:[s.jsxs(me.chakra.div,{position:"relative",children:[s.jsx(je,{zIndex:0,asChild:!0,children:s.jsx(L.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,{children:s.jsx(Oe,{asChild:!0,children:s.jsx(Fe,{})})})}),s.jsxs(T.Flex,{position:"absolute",top:"0",bottom:"0",zIndex:1,right:"400",pointerEvents:"none",children:[s.jsx(T.Flex,{width:"600",my:"auto",children:s.jsx(ie,{})}),s.jsx(T.Flex,{my:"auto",w:"600",h:"600",pointerEvents:"none",children:s.jsx(Y.Box,{color:"neutral.9",asChild:!0,m:"auto",w:"400",h:"400",children:t?s.jsx(Y.Box,{asChild:!0,animation:"spin",animationDuration:"slowest",children:s.jsx(z.Loop,{})}):s.jsx(z.KeyboardArrowDown,{})})})]})]}),s.jsx(F.$07b14b47974efb58$export$5b6b19405a83ff9d,{children:e})]})})});U.displayName="Select.Root";const X=e=>{const{ref:t,...n}=e,[r,l]=le.extractStyleProps(n);return s.jsx(Ie,{asChild:!0,...r,children:s.jsx(B.$eed445e0843c11d0$export$41f133550aa26f48,{ref:t,...l})})};X.displayName="Select.Options";const J=({ref:e,...t})=>s.jsx(we,{asChild:!0,ref:e,children:s.jsx(B.$eed445e0843c11d0$export$a11e76429ed99b4,{...t})});J.displayName="Select.Option";const Q=e=>{const{ref:t,label:n,items:r,children:l,...d}=e;if(r&&typeof l!="function")throw new Error('SelectOptionGroup: When "items" is provided, "children" must be a function');return s.jsxs(B.$eed445e0843c11d0$export$dca12b0bb56e4fc,{ref:t,...d,children:[s.jsx(Ee,{asChild:!0,children:s.jsx(he.$72a5793c14baf454$export$8b251419efc915eb,{children:n})}),r?s.jsx(O.$e1995378a142960e$export$fb8073518f34e6ec,{items:r,children:u=>typeof l=="function"?l(u):null}):l]})};Q.displayName="Select.OptionGroup";const ke={Root:U,Options:X,Option:J,OptionGroup:Q};exports.Select=ke;exports.SelectOption=J;exports.SelectOptionGroup=Q;exports.SelectOptions=X;exports.SelectRoot=U;
2
+ //# sourceMappingURL=select-BnN5zaBu.cjs.js.map