{"version":3,"file":"UdpIconPicker.mjs","names":["React","UdpFluentIconPicker","UdpFluentIconPickerWebComponent","JSX","createChangeEvent","FormChangeEvent","UdpIconPickerProps","Partial","Omit","onChange","event","children","ReactNode","error","helperText","UdpIconPicker","FC","t0","$","_c","hint","name","props","t1","e","detail","handleValueChanged","hintStr","undefined","normalizedError","normalizedHint","t2"],"sources":["../../../src/UI/fluent-web-components/UdpIconPicker.tsx"],"sourcesContent":["import React from 'react';\nimport { UdpFluentIconPicker as UdpFluentIconPickerWebComponent } from '@univerus/udp-react-stencil-component-library';\nimport { type JSX } from '@univerus/udp-react-stencil-component-library';\nimport { createChangeEvent, FormChangeEvent } from './utils/formEvents';\n\n/**\n * Props for the UdpIconPicker component.\n *\n * Supports both MUI-style and Fluent-style error handling:\n * - MUI style: error={boolean} + helperText={string}\n * - Fluent style: error={string} + hint={string}\n */\nexport interface UdpIconPickerProps\n  extends Partial<Omit<JSX.UdpFluentIconPicker, 'onValueChanged' | 'error'>> {\n  /** Called when the selection changes - compatible with form libraries (event.target.value) */\n  onChange?: (event: FormChangeEvent<string>) => void;\n  /** React children (unused; kept for consistency with other wrappers) */\n  children?: React.ReactNode;\n  /**\n   * Error state - supports both MUI and Fluent patterns:\n   * - string: Fluent style - the error message to display\n   * - boolean: MUI style - when true, displays helperText as error\n   */\n  error?: string | boolean;\n  /**\n   * MUI compatibility: Helper/error text shown below the input.\n   * When error={true}, this is displayed as the error message.\n   * When error={false}, this is displayed as hint text.\n   */\n  helperText?: string;\n}\n\nexport const UdpIconPicker: React.FC<UdpIconPickerProps> = ({\n  onChange,\n  name,\n  error,\n  helperText,\n  hint,\n  ...props\n}) => {\n  const handleValueChanged = (e: CustomEvent<string>) => {\n    onChange?.(createChangeEvent(e.detail, name, 'select'));\n  };\n\n  // Normalize error/hint props to support both MUI and Fluent patterns\n  const hintStr = typeof hint === 'string' ? hint : undefined;\n\n  let normalizedError: string | undefined;\n  let normalizedHint: string | undefined;\n\n  if (typeof error === 'string') {\n    normalizedError = error;\n    normalizedHint = hintStr;\n  } else if (typeof error === 'boolean') {\n    normalizedError = error ? helperText || '' : undefined;\n    normalizedHint = !error ? helperText || hintStr : hintStr;\n  } else {\n    normalizedHint = hintStr ?? helperText;\n  }\n\n  return (\n    <UdpFluentIconPickerWebComponent\n      {...props}\n      name={name}\n      error={normalizedError}\n      hint={normalizedHint}\n      onValueChanged={handleValueChanged}\n    />\n  );\n};\n"],"mappings":";;;;;AAgCA,MAAae,iBAA8CE,OAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAN;CAAA,IAAAC;CAAA,IAAAM;CAAA,IAAAC;CAAA,IAAAZ;CAAA,IAAAa;AAAA,KAAAJ,EAAA,OAAAD,IAAA;AAAC,GAAA,CAAAR,UAAAY,MAAAR,OAAAC,YAAAM,SAAAE,SAAAL;AAO3DC,IAAA,KAAAD;AAAAC,IAAA,KAAAL;AAAAK,IAAA,KAAAJ;AAAAI,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAT;AAAAS,IAAA,KAAAI;QAAA;AAAAT,UAAAK,EAAA;AAAAJ,eAAAI,EAAA;AAAAE,SAAAF,EAAA;AAAAG,SAAAH,EAAA;AAAAT,aAAAS,EAAA;AAAAI,UAAAJ,EAAA;;CAAA,IAAAK;AAAA,KAAAL,EAAA,OAAAG,QAAAH,EAAA,OAAAT,UAAA;AAC4Bc,QAAAC,MAAA;AACzBf,cAAWL,kBAAkBoB,EAACC,QAASJ,MAAM,SAAS,CAAC;;AACxDH,IAAA,KAAAG;AAAAH,IAAA,KAAAT;AAAAS,IAAA,KAAAK;OAAAA,MAAAL,EAAA;CAFD,MAAAQ,qBAA2BH;CAK3B,MAAAI,UAAgB,OAAOP,SAAS,WAAhBA,OAAAQ,KAAAA;CAEZC,IAAAA;CACAC,IAAAA;AAEJ,KAAI,OAAOjB,UAAU,UAAQ;AAC3BgB,oBAAkBhB;AAClBiB,mBAAiBH;YACR,OAAOd,UAAU,WAAS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