@texturehq/edges 1.25.2 → 1.26.0
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.
- package/dist/{RichTextEditor-BGQenUvv.d.cts → RichTextEditor-BhX77nTp.d.cts} +16 -2
- package/dist/{RichTextEditor-BGQenUvv.d.ts → RichTextEditor-BhX77nTp.d.ts} +16 -2
- package/dist/{TimeField-p31z8xSR.d.cts → TimeField-DT3apBHn.d.cts} +49 -6
- package/dist/{TimeField-Blk2Ci2M.d.ts → TimeField-TmPbBV-t.d.ts} +49 -6
- package/dist/{colors-Bw6dREwE.d.ts → colors-BER6l3p0.d.ts} +11 -3
- package/dist/{colors-nZbxzpnU.d.cts → colors-DdsCnLrp.d.cts} +11 -3
- package/dist/components.manifest.json +5 -5
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.cjs.map +1 -1
- package/dist/form/index.d.cts +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/{index-DKA9NMRw.d.ts → index-Dkhk7IbI.d.cts} +5 -1
- package/dist/{index-DKA9NMRw.d.cts → index-Dkhk7IbI.d.ts} +5 -1
- package/dist/index.cjs +20 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -13
- package/dist/index.d.ts +74 -13
- package/dist/index.js +20 -14
- package/dist/index.js.map +1 -1
- package/dist/rhf/index.cjs +1 -1
- package/dist/rhf/index.cjs.map +1 -1
- package/dist/rhf/index.d.cts +2 -2
- package/dist/rhf/index.d.ts +2 -2
- package/dist/rhf/index.js +1 -1
- package/dist/rhf/index.js.map +1 -1
- package/dist/server.cjs +2 -2
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/styles/utilities.css +13 -2
- package/dist/styles.css +46 -18
- package/dist/utilities.manifest.json +1 -1
- package/package.json +1 -1
- package/scripts/setup-cursor-rules.js +4 -4
package/dist/rhf/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../@react-aria/ssr/src/SSRProvider.tsx","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/utils.ts","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/useDefaultLocale.ts","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/context.tsx","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/useCollator.ts","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/useFilter.ts","../../src/hooks/useDebounce.ts","../../src/utils/index.ts","../../src/utils/controlStyles.ts","../../src/components/Icon/Icon.tsx","../../src/components/Field/Field.tsx","../../src/components/Button/Button.tsx","../../src/components/ModalBackdrop/ModalBackdrop.tsx","../../src/components/Popover/Popover.tsx","../../src/components/Select/Select.tsx","../../src/components/ListBoxItem/ListBoxItem.tsx","../../src/components/Autocomplete/Autocomplete.tsx","../../src/integrations/rhf/adapters/_helpers.ts","../../src/integrations/rhf/adapters/FormAutocomplete.tsx","../../src/components/Checkbox/Checkbox.tsx","../../src/integrations/rhf/adapters/FormCheckbox.tsx","../../src/integrations/rhf/adapters/FormCheckboxGroup.tsx","../../src/components/ColorField/ColorField.tsx","../../src/integrations/rhf/adapters/FormColorField.tsx","../../src/components/Calendar/Calendar.tsx","../../src/components/DateField/DateField.tsx","../../src/integrations/rhf/adapters/FormDateField.tsx","../../src/components/FileUpload/FileUpload.tsx","../../src/integrations/rhf/adapters/FormFileUpload.tsx","../../src/components/NumberField/NumberField.tsx","../../src/integrations/rhf/adapters/FormNumberField.tsx","../../src/components/RadioGroup/RadioGroup.tsx","../../src/integrations/rhf/adapters/FormRadioGroup.tsx","../../src/components/Heading/Heading.tsx","../../src/components/DialogHeader/DialogHeader.tsx","../../src/components/Loader/Loader.tsx","../../src/components/TextField/TextField.tsx","../../src/components/RichTextEditor/RichTextEditor.tsx","../../src/integrations/rhf/adapters/FormRichTextEditor.tsx","../../src/integrations/rhf/adapters/FormSelect.tsx","../../src/components/Switch/Switch.tsx","../../src/integrations/rhf/adapters/FormSwitch.tsx","../../src/components/TextArea/TextArea.tsx","../../src/integrations/rhf/adapters/FormTextArea.tsx","../../src/integrations/rhf/adapters/FormTextField.tsx","../../src/components/TimeField/TimeField.tsx","../../src/integrations/rhf/adapters/FormTimeField.tsx","../../src/integrations/rhf/components/ErrorSummary.tsx","../../src/integrations/rhf/components/SubmitButton.tsx","../../src/components/Skeleton/Skeleton.tsx","../../src/components/Card/Card.tsx","../../src/integrations/rhf/FieldArrayList.tsx","../../src/components/Form/Form.tsx","../../src/integrations/rhf/utils/focusFirstError.ts","../../src/integrations/rhf/FormProvider.tsx","../../src/form/SaveBar.tsx","../../src/integrations/rhf/FormSaveBar.tsx","../../src/integrations/rhf/hooks/useScrollIntoViewOnError.ts","../../src/integrations/rhf/useAutoSave.ts"],"names":["$b5e257d569688ac6$var$defaultContext","$b5e257d569688ac6$var$SSRContext","$670gB$react","$b5e257d569688ac6$var$IsSSRContext","$b5e257d569688ac6$var$canUseDOM","$b5e257d569688ac6$var$componentIds","$b5e257d569688ac6$var$useCounter","isDisabled","ctx","$670gB$useContext","ref","$670gB$useRef","_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner","_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","currentOwner","prevComponentValue","$b5e257d569688ac6$var$useLegacySSRSafeId","defaultId","counter","prefix","$b5e257d569688ac6$var$useModernSSRSafeId","id","didSSR","$670gB$useState","$b5e257d569688ac6$export$535bd6ca7f90a273","$b5e257d569688ac6$var$getSnapshot","$b5e257d569688ac6$var$getServerSnapshot","$b5e257d569688ac6$var$subscribe","onStoreChange","$148a7a147e38ea7f$var$RTL_SCRIPTS","$148a7a147e38ea7f$var$RTL_LANGS","$148a7a147e38ea7f$export$702d680b21cbd764","localeString","locale","textInfo","lang","$1e5a04cdaf7d1af8$var$localeSymbol","$1e5a04cdaf7d1af8$export$f09106e7c6677ec5","$1e5a04cdaf7d1af8$var$currentLocale","$1e5a04cdaf7d1af8$var$listeners","$1e5a04cdaf7d1af8$var$updateLocale","listener","$1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a","isSSR","defaultLocale","setDefaultLocale","$ffhGL$useState","$ffhGL$useEffect","$18f2051aff69b9bf$var$I18nContext","$h9FiU$react","$18f2051aff69b9bf$export$43bb16f9c6d9e3f7","$h9FiU$useContext","$325a3faab7a68acd$var$cache","$325a3faab7a68acd$export$a16aca283550c30d","options","cacheKey","a","b","formatter","$bb77f239b46e8c72$export$3274cf84b703fff","collator","startsWith","$21ck9$useCallback","string","substring","endsWith","contains","scan","sliceLen","slice","$21ck9$useMemo","useDebounce","value","delay","debouncedValue","setDebouncedValue","useState","useEffect","timer","focusRing","showDefaultOutline","composeTailwindRenderProps","className","tw","composeRenderProps","twMerge","controlStyles","sizePresets","Icon","memo","name","size","color","weight","ariaLabel","props","IconComponent","PhosphorIcons","resolvedSize","iconClassName","jsx","IconWithContainer","variant","shape","containerSize","containerClassName","iconSize","resolvedContainerSize","containerClasses","useInputFocus","isFocused","setIsFocused","React","handleFocus","e","onFocus","handleBlur","onBlur","InputWrapper","children","ClearButton","onClick","getInputStateStyles","isInvalid","baseStyles","getInputBackgroundStyles","getInputMobileFontClass","getInputBaseStyles","transparent","getFieldGroupStyles","isFocusWithin","Label","tooltip","isRequired","htmlFor","jsxs","Description","FieldError","Input","variantStyles","widthStyles","disabledStyles","enabledStyles","badgePositionStyles","badgeVariantStyles","normalizeVariant","getButtonStyles","fullWidth","isLoading","normalizedVariant","styles","focusRingColor","Button","icon","loadingText","loadingIndicator","iconPosition","iconWeight","href","badgeNumber","badgeVariant","badgePosition","style","target","rel","restProps","iconElement","content","Fragment","loadingNode","hasBadge","composedClassName","linkProps","_onPress","_onPressStart","_onPressEnd","_onPressChange","_onPressUp","_onAuxClick","_onContextMenu","_onDoubleClick","safeRestProps","buttonOrLink","RACLink","renderProps","RACButton","ModalBackdrop","ModalOverlay","getPopoverStyles","isEntering","isExiting","disableGroup","enteringStyles","exitingStyles","Popover","showArrow","withBackdrop","isDismissable","isSubmenu","useSlottedContext","PopoverContext","offset","popoverContent","AriaPopover","OverlayArrow","Modal","SelectSizeContext","createContext","useSelectSize","useContext","getSelectValueClassName","useElementFocus","Select","label","description","errorMessage","items","renderItem","controlledSelectedKey","defaultSelectedKey","onSelectionChange","placeholder","showErrors","reserveErrorSpace","placement","shouldFlip","menuWidth","internalSelectedKey","setInternalSelectedKey","triggerWidth","setTriggerWidth","selectedKey","handleSelectionChange","key","selectRef","useRef","triggerRef","AriaSelect","isOpen","SelectValue","ListBox","item","ListBoxItem","contextSize","effectiveSize","AriaListBoxItem","iconSizeClassMap","inputPaddingLeftMap","itemHeightStylesObject","state","ComboBoxStateContext","AriaButton","getItemName","staticItems","sections","selectedItem","s","handleRestRequest","config","filterText","signal","baseUrl","params","finalUrl","response","json","error","handleGraphQLRequest","query","obj","Autocomplete","requestConfig","defaultFilter","validationResult","renderLeftIcon","renderSection","autoFocus","inputValue","setInputValue","debouncedInputValue","setError","textSizeClass","heightSizeClass","dynamicItems","updateTriggerWidth","useAsyncList","result","handleInternalSelectionChange","newName","handleInternalInputChange","text","currentSelectedItemName","ComboBox","section","Group","AriaInput","isPressed","sectionItems","ListBoxSection","Header","getFieldError","errors","segs","node","seg","msg","FormAutocomplete","defaultValue","rest","control","formState","useFormContext","Controller","field","CheckboxGroup","AriaCheckboxGroup","getCheckboxStyles","getBoxStyles","isSelected","isIndeterminate","colorStyles","actionColor","iconStyles","Checkbox","otherProps","AriaCheckbox","checkboxContent","Minus","Check","FormCheckbox","errorBelow","v","FormCheckboxGroup","isValidHexColor","hex","normalizeHexColor","char","ColorField","controlledValue","onChange","showColorSwatch","internalValue","setInternalValue","isPickerOpen","setIsPickerOpen","triggerElement","setTriggerElement","handleInputChange","useCallback","newValue","normalized","handlePickerChange","newColor","handleInputBlur","AriaTextFieldComponent","HexColorPicker","FormColorField","getCellStyles","Calendar","AriaCalendar","CalendarHeader","CalendarGrid","CalendarGridHeader","CalendarGridBody","date","CalendarCell","Text","direction","useLocale","buttonSize","Heading","AriaCalendarGridHeader","day","CalendarHeaderCell","DateField","showCalendar","isCalendarOpen","setIsCalendarOpen","handleCalendarSelect","AriaDateField","DateInput","DialogTrigger","Dialog","getSegmentStyles","isPlaceholder","hasCalendar","AriaDateInput","segment","DateSegment","FormDateField","FileUpload","onUrlChange","accept","maxSize","onUpload","showPreview","isDragging","setIsDragging","isUploading","setIsUploading","preview","setPreview","fileInputRef","handleFile","file","reader","url","err","handleDrop","handleRemove","DropZone","ImageIcon","X","Upload","FileTrigger","files","FormFileUpload","_","getNumberFieldStyles","NumberField","useId","AriaNumberField","FormNumberField","RadioGroupContext","RadioGroup","RACRadioGroup","FormRadioGroup","sizeVariants","heightVariants","Tag","height","sizeClasses","heightClasses","DialogHeader","title","onClose","hideCloseIcon","titleAlign","hasBackArrow","onBack","headerContent","Loader","getTextFieldStyles","paddingStyles","TextField","showSearchIcon","isClearable","onClear","type","showPassword","setShowPassword","isPassword","ToolbarButton","isActive","onPress","LinkDialog","initialUrl","onSubmit","setUrl","RACDialog","RichTextEditor","initialContent","isLinkDialogOpen","setIsLinkDialogOpen","editor","useEditor","StarterKit","Link","handleLinkClick","handleLinkSubmit","BubbleMenu","EditorContent","FormRichTextEditor","html","FormSelect","sizeConfig","getTrackClassName","baseClasses","focusRingClasses","selectedClasses","getHandleClassName","Switch","AriaSwitch","FormSwitch","getTextAreaStyles","textAreaStyles","TextArea","required","isResizable","FormTextArea","FormTextField","TimeField","AriaTimeField","FormTimeField","ErrorSummary","Ke","entries","hasErrors","handleJump","selector","el","message","SubmitButton","formId","disableWhenInvalid","disableWhenPristine","disabled","Skeleton","width","animation","gradient","flex","stack","responsive","adjustAnimationSpeedBasedOnWidth","dataTestId","visible","setVisible","animationSpeed","numWidth","animationClasses","shapeClasses","layoutClasses","responsiveStyles","breakpoint","lineWidth","index","cardVariantStyles","cardBaseStyles","aspectRatioStyles","footerAlignStyles","Card","CardHeader","subtitle","actions","CardMedia","src","alt","aspectRatio","CardContent","defaultPadding","CardFooter","align","FieldArrayList","getItemTitle","onAdd","fields","append","remove","swap","useFieldArray","Form","RACForm","focusFirstError","formEl","invalidEl","FormProvider","onInvalid","shouldFocusError","formOptions","methods","useForm","handleInvalid","evt","form","RHFProvider","SaveBar","show","isSubmitting","onCancel","primaryLabel","secondaryLabel","FormSaveBar","useScrollIntoViewOnError","enabled","Ko","useAutoSave","delayMs","onAutoSave","watch","getValues","timeoutRef","Xe","subscription","values"],"mappings":"gqCAiCA,IAAMA,EAAAA,CAAkC,CACtC,MAAA,CAAQ,MAAA,CAAO,KAAK,KAAA,CAAM,IAAA,CAAK,MAAA,EAAM,CAAK,IAAA,CAAA,CAAA,CAC1C,QAAS,CACX,CAAA,CAEMC,GAAaC,WAAAA,CAAM,aAAA,CAA+BF,EAAA,CAAA,CAClDG,GAAeD,WAAAA,CAAM,aAAA,CAAc,KAAA,CAAA,CAwDzC,IAAIE,GAAY,CAAA,EACd,OAAO,MAAA,CAAW,GAAA,EAClB,OAAO,QAAA,EACP,MAAA,CAAO,SAAS,aAAA,CAAA,CAGdC,EAAAA,CAAe,IAAI,OAAA,CAEvB,SAASC,EAAAA,CAAWC,CAAAA,CAAa,MAAK,CACpC,IAAIC,EAAMC,UAAAA,CAAWR,EAAA,EACjBS,CAAAA,CAAMC,MAAAA,CAAsB,IAAA,CAAA,CAEhC,GAAID,CAAAA,CAAI,OAAA,GAAY,MAAQ,CAACH,CAAAA,CAAY,KAWpBK,CAAAA,CAAAC,CAAAA,CAAnB,IAAIC,CAAAA,CAAAA,CAAeD,CAAAA,CAAAX,YAAM,kDAAA,IAAkD,IAAA,EAAxDW,IAAA,MAAA,EAAA,CAAAD,CAAAA,CAAAC,EAA0D,iBAAA,IA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O,UAAA,CAAW,SAAY,CACjD,IAAMG,EAASJ,CAAAA,EAAU,CACzB,MAAMF,CAAAA,CAAWM,CAAM,EACzB,CAAA,CAAGP,CAAO,CAAA,EACZ,CAAC,EACD,OAAO,IAAM,CACXM,CAAAA,CAAa,aAAY,CACrBF,CAAAA,CAAW,SAAS,MAAA,CAAO,YAAA,CAAaA,EAAW,OAAO,EAChE,CACF,CAAA,CAAG,CAACF,EAAO7Q,CAAAA,CAAU,OAAA,CAAS8Q,EAAWH,CAAAA,CAASC,CAAU,CAAC,EAC/D","file":"index.js","sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We must avoid a circular dependency with @react-aria/utils, and this useLayoutEffect is\n// guarded by a check that it only runs on the client side.\n// eslint-disable-next-line rulesdir/useLayoutEffectRule\nimport React, {JSX, ReactNode, useContext, useLayoutEffect, useMemo, useRef, useState} from 'react';\n\n// To support SSR, the auto incrementing id counter is stored in a context. This allows\n// it to be reset on every request to ensure the client and server are consistent.\n// There is also a prefix string that is used to support async loading components\n// Each async boundary must be wrapped in an SSR provider, which appends to the prefix\n// and resets the current id counter. This ensures that async loaded components have\n// consistent ids regardless of the loading order.\ninterface SSRContextValue {\n prefix: string,\n current: number\n}\n\n// Default context value to use in case there is no SSRProvider. This is fine for\n// client-only apps. In order to support multiple copies of React Aria potentially\n// being on the page at once, the prefix is set to a random number. SSRProvider\n// will reset this to zero for consistency between server and client, so in the\n// SSR case multiple copies of React Aria is not supported.\nconst defaultContext: SSRContextValue = {\n prefix: String(Math.round(Math.random() * 10000000000)),\n current: 0\n};\n\nconst SSRContext = React.createContext<SSRContextValue>(defaultContext);\nconst IsSSRContext = React.createContext(false);\n\nexport interface SSRProviderProps {\n /** Your application here. */\n children: ReactNode\n}\n\n// This is only used in React < 18.\nfunction LegacySSRProvider(props: SSRProviderProps): JSX.Element {\n let cur = useContext(SSRContext);\n let counter = useCounter(cur === defaultContext);\n let [isSSR, setIsSSR] = useState(true);\n let value: SSRContextValue = useMemo(() => ({\n // If this is the first SSRProvider, start with an empty string prefix, otherwise\n // append and increment the counter.\n prefix: cur === defaultContext ? '' : `${cur.prefix}-${counter}`,\n current: 0\n }), [cur, counter]);\n\n // If on the client, and the component was initially server rendered,\n // then schedule a layout effect to update the component after hydration.\n if (typeof document !== 'undefined') {\n // This if statement technically breaks the rules of hooks, but is safe\n // because the condition never changes after mounting.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return (\n <SSRContext.Provider value={value}>\n <IsSSRContext.Provider value={isSSR}>\n {props.children}\n </IsSSRContext.Provider>\n </SSRContext.Provider>\n );\n}\n\nlet warnedAboutSSRProvider = false;\n\n/**\n * When using SSR with React Aria in React 16 or 17, applications must be wrapped in an SSRProvider.\n * This ensures that auto generated ids are consistent between the client and server.\n */\nexport function SSRProvider(props: SSRProviderProps): JSX.Element {\n if (typeof React['useId'] === 'function') {\n if (process.env.NODE_ENV !== 'test' && process.env.NODE_ENV !== 'production' && !warnedAboutSSRProvider) {\n console.warn('In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.');\n warnedAboutSSRProvider = true;\n }\n return <>{props.children}</>;\n }\n return <LegacySSRProvider {...props} />;\n}\n\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\nlet componentIds = new WeakMap();\n\nfunction useCounter(isDisabled = false) {\n let ctx = useContext(SSRContext);\n let ref = useRef<number | null>(null);\n // eslint-disable-next-line rulesdir/pure-render\n if (ref.current === null && !isDisabled) {\n // In strict mode, React renders components twice, and the ref will be reset to null on the second render.\n // This means our id counter will be incremented twice instead of once. This is a problem because on the\n // server, components are only rendered once and so ids generated on the server won't match the client.\n // In React 18, useId was introduced to solve this, but it is not available in older versions. So to solve this\n // we need to use some React internals to access the underlying Fiber instance, which is stable between renders.\n // This is exposed as ReactCurrentOwner in development, which is all we need since StrictMode only runs in development.\n // To ensure that we only increment the global counter once, we store the starting id for this component in\n // a weak map associated with the Fiber. On the second render, we reset the global counter to this value.\n // Since React runs the second render immediately after the first, this is safe.\n // @ts-ignore\n let currentOwner = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;\n if (currentOwner) {\n let prevComponentValue = componentIds.get(currentOwner);\n if (prevComponentValue == null) {\n // On the first render, and first call to useId, store the id and state in our weak map.\n componentIds.set(currentOwner, {\n id: ctx.current,\n state: currentOwner.memoizedState\n });\n } else if (currentOwner.memoizedState !== prevComponentValue.state) {\n // On the second render, the memoizedState gets reset by React.\n // Reset the counter, and remove from the weak map so we don't\n // do this for subsequent useId calls.\n ctx.current = prevComponentValue.id;\n componentIds.delete(currentOwner);\n }\n }\n\n // eslint-disable-next-line rulesdir/pure-render\n ref.current = ++ctx.current;\n }\n\n // eslint-disable-next-line rulesdir/pure-render\n return ref.current;\n}\n\nfunction useLegacySSRSafeId(defaultId?: string): string {\n let ctx = useContext(SSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider,\n // provide a warning to hint to the developer to add one.\n if (ctx === defaultContext && !canUseDOM && process.env.NODE_ENV !== 'production') {\n console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');\n }\n\n let counter = useCounter(!!defaultId);\n let prefix = ctx === defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`;\n return defaultId || `${prefix}-${counter}`;\n}\n\nfunction useModernSSRSafeId(defaultId?: string): string {\n let id = React.useId();\n let [didSSR] = useState(useIsSSR());\n let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${defaultContext.prefix}`;\n return defaultId || `${prefix}-${id}`;\n}\n\n// Use React.useId in React 18 if available, otherwise fall back to our old implementation.\n/** @private */\nexport const useSSRSafeId: typeof useModernSSRSafeId | typeof useLegacySSRSafeId = typeof React['useId'] === 'function' ? useModernSSRSafeId : useLegacySSRSafeId;\n\nfunction getSnapshot() {\n return false;\n}\n\nfunction getServerSnapshot() {\n return true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction subscribe(onStoreChange: () => void): () => void {\n // noop\n return () => {};\n}\n\n/**\n * Returns whether the component is currently being server side rendered or\n * hydrated on the client. Can be used to delay browser-specific rendering\n * until after hydration.\n */\nexport function useIsSSR(): boolean {\n // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.\n if (typeof React['useSyncExternalStore'] === 'function') {\n return React['useSyncExternalStore'](subscribe, getSnapshot, getServerSnapshot);\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useContext(IsSSRContext);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// https://en.wikipedia.org/wiki/Right-to-left\nconst RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);\nconst RTL_LANGS = new Set(['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi']);\n\n/**\n * Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.\n */\nexport function isRTL(localeString: string): boolean {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n if (Intl.Locale) {\n let locale = new Intl.Locale(localeString).maximize();\n\n // Use the text info object to get the direction if possible.\n // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo\n let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;\n if (textInfo) {\n return textInfo.direction === 'rtl';\n }\n\n // Fallback: guess using the script.\n // This is more accurate than guessing by language, since languages can be written in multiple scripts.\n if (locale.script) {\n return RTL_SCRIPTS.has(locale.script);\n }\n }\n\n // If not, just guess by the language (first part of the locale)\n let lang = localeString.split('-')[0];\n return RTL_LANGS.has(lang);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Direction} from '@react-types/shared';\nimport {isRTL} from './utils';\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\n\nexport interface Locale {\n /** The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale. */\n locale: string,\n /** The writing direction for the locale. */\n direction: Direction\n}\n\n// Locale passed from server by PackageLocalizationProvider.\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\n\n/**\n * Gets the locale setting of the browser.\n */\nexport function getDefaultLocale(): Locale {\n let locale = typeof window !== 'undefined' && window[localeSymbol]\n // @ts-ignore\n || (typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage))\n || 'en-US';\n\n try {\n Intl.DateTimeFormat.supportedLocalesOf([locale]);\n } catch {\n locale = 'en-US';\n }\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n };\n}\n\nlet currentLocale = getDefaultLocale();\nlet listeners = new Set<(locale: Locale) => void>();\n\nfunction updateLocale() {\n currentLocale = getDefaultLocale();\n for (let listener of listeners) {\n listener(currentLocale);\n }\n}\n\n/**\n * Returns the current browser/system language, and updates when it changes.\n */\nexport function useDefaultLocale(): Locale {\n let isSSR = useIsSSR();\n let [defaultLocale, setDefaultLocale] = useState(currentLocale);\n\n useEffect(() => {\n if (listeners.size === 0) {\n window.addEventListener('languagechange', updateLocale);\n }\n\n listeners.add(setDefaultLocale);\n\n return () => {\n listeners.delete(setDefaultLocale);\n if (listeners.size === 0) {\n window.removeEventListener('languagechange', updateLocale);\n }\n };\n }, []);\n\n // We cannot determine the browser's language on the server, so default to\n // en-US. This will be updated after hydration on the client to the correct value.\n if (isSSR) {\n return {\n locale: 'en-US',\n direction: 'ltr'\n };\n }\n\n return defaultLocale;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isRTL} from './utils';\nimport {Locale, useDefaultLocale} from './useDefaultLocale';\nimport React, {JSX, ReactNode, useContext} from 'react';\n\nexport interface I18nProviderProps {\n /** Contents that should have the locale applied. */\n children: ReactNode,\n /** The locale to apply to the children. */\n locale?: string\n}\n\nconst I18nContext = React.createContext<Locale | null>(null);\n\ninterface I18nProviderWithLocaleProps extends I18nProviderProps {\n locale: string\n}\n\n/**\n * Internal component that handles the case when locale is provided.\n */\nfunction I18nProviderWithLocale(props: I18nProviderWithLocaleProps): JSX.Element {\n let {locale, children} = props; \n let value: Locale = React.useMemo(() => ({\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n }), [locale]);\n\n return (\n <I18nContext.Provider value={value}>\n {children}\n </I18nContext.Provider>\n );\n}\n\ninterface I18nProviderWithDefaultLocaleProps {\n children: ReactNode\n}\n\n/**\n * Internal component that handles the case when no locale is provided.\n */\nfunction I18nProviderWithDefaultLocale(props: I18nProviderWithDefaultLocaleProps): JSX.Element {\n let {children} = props;\n let defaultLocale = useDefaultLocale();\n\n return (\n <I18nContext.Provider value={defaultLocale}>\n {children}\n </I18nContext.Provider>\n );\n}\n\n/**\n * Provides the locale for the application to all child components.\n */\nexport function I18nProvider(props: I18nProviderProps): JSX.Element {\n let {locale, children} = props;\n\n // Conditionally render different components to avoid calling useDefaultLocale.\n // This is necessary because useDefaultLocale triggers a re-render.\n if (locale) {\n return <I18nProviderWithLocale locale={locale} children={children} />;\n }\n\n return <I18nProviderWithDefaultLocale children={children} />;\n}\n\n/**\n * Returns the current locale and layout direction.\n */\nexport function useLocale(): Locale {\n let defaultLocale = useDefaultLocale();\n let context = useContext(I18nContext);\n return context || defaultLocale;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useLocale} from './context';\n\nlet cache = new Map<string, Intl.Collator>();\n\n/**\n * Provides localized string collation for the current locale. Automatically updates when the locale changes,\n * and handles caching of the collator for performance.\n * @param options - Collator options.\n */\nexport function useCollator(options?: Intl.CollatorOptions): Intl.Collator {\n let {locale} = useLocale();\n\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey)!;\n }\n\n let formatter = new Intl.Collator(locale, options);\n cache.set(cacheKey, formatter);\n return formatter;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useMemo} from 'react';\nimport {useCollator} from './useCollator';\n\nexport interface Filter {\n /** Returns whether a string starts with a given substring. */\n startsWith(string: string, substring: string): boolean,\n /** Returns whether a string ends with a given substring. */\n endsWith(string: string, substring: string): boolean,\n /** Returns whether a string contains a given substring. */\n contains(string: string, substring: string): boolean\n}\n\n/**\n * Provides localized string search functionality that is useful for filtering or matching items\n * in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters.\n */\nexport function useFilter(options?: Intl.CollatorOptions): Filter {\n let collator = useCollator({\n usage: 'search',\n ...options\n });\n\n // TODO(later): these methods don't currently support the ignorePunctuation option.\n let startsWith = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n // Normalize both strings so we can slice safely\n // TODO: take into account the ignorePunctuation option as well...\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n return collator.compare(string.slice(0, substring.length), substring) === 0;\n }, [collator]);\n\n let endsWith = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n return collator.compare(string.slice(-substring.length), substring) === 0;\n }, [collator]);\n\n let contains = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n\n let scan = 0;\n let sliceLen = substring.length;\n for (; scan + sliceLen <= string.length; scan++) {\n let slice = string.slice(scan, scan + sliceLen);\n if (collator.compare(substring, slice) === 0) {\n return true;\n }\n }\n\n return false;\n }, [collator]);\n\n return useMemo(() => ({\n startsWith,\n endsWith,\n contains\n }), [startsWith, endsWith, contains]);\n}\n","import { useEffect, useState } from \"react\";\n\nexport function useDebounce<T>(value: T, delay: number = 300): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay);\n\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n}\n","import { composeRenderProps } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport { ColorModeProvider, useColorMode } from \"./ColorModeProvider\";\n\n// Re-export formatting utilities from the new formatting module\nexport * from \"./formatting\";\n\n// Re-export time formatting utilities\nexport * from \"./timeFormat\";\n\nexport function focusRing(showDefaultOutline: boolean = false) {\n // Use data-[focus-visible] instead of :focus-visible to work with React Aria's focus management\n const baseClasses = showDefaultOutline\n ? \"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2\"\n : \"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2\";\n return `${baseClasses}`;\n}\n\nexport function composeTailwindRenderProps<T>(\n className: string | ((v: T) => string) | undefined,\n tw: string\n): string | ((v: T) => string) {\n return composeRenderProps(className, (className) => twMerge(tw, className));\n}\n","/**\n * Control-specific style utilities for form elements and interactive components.\n * These styles use CSS variables defined in the theme for consistent sizing\n * and spacing across all control elements.\n *\n * Text sizes follow the relationships defined in theme.css:\n * sm: --control-text-sm (maps to --text-xs)\n * md: --control-text-md (maps to --text-sm)\n * lg: --control-text-lg (maps to --text-base)\n * xl: --control-text-xl (maps to --text-lg)\n */\n\nexport type Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport const controlStyles = {\n sm: {\n text: \"text-[length:var(--control-text-sm)]\",\n height: \"h-[var(--control-sm-height)]\",\n padding: \"px-[var(--control-padding-sm)]\",\n paddingY: \"py-[var(--control-gap-sm)]\",\n gap: \"gap-[var(--control-gap-sm)]\",\n },\n md: {\n text: \"text-[length:var(--control-text-md)]\",\n height: \"h-[var(--control-md-height)]\",\n padding: \"px-[var(--control-padding-md)]\",\n paddingY: \"py-[var(--control-gap-md)]\",\n gap: \"gap-[var(--control-gap-md)]\",\n },\n lg: {\n text: \"text-[length:var(--control-text-lg)]\",\n height: \"h-[var(--control-lg-height)]\",\n padding: \"px-[var(--control-padding-lg)]\",\n paddingY: \"py-[var(--control-gap-lg)]\",\n gap: \"gap-[var(--control-gap-lg)]\",\n },\n xl: {\n text: \"text-[length:var(--control-text-xl)]\",\n height: \"h-[var(--control-xl-height)]\",\n padding: \"px-[var(--control-padding-xl)]\",\n paddingY: \"py-[var(--control-gap-xl)]\",\n gap: \"gap-[var(--control-gap-xl)]\",\n },\n} as const;\n","\"use client\";\nimport type { IconProps as PhosphorIconProps } from \"@phosphor-icons/react\";\nimport * as PhosphorIcons from \"@phosphor-icons/react\";\nimport { memo } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\n// Type for any Phosphor icon component\ntype PhosphorIconComponent = typeof PhosphorIcons.House;\n\n// Extract all icon names from the Phosphor package\nexport type PhosphorIconName = keyof typeof PhosphorIcons;\n\n// For backwards compatibility, export IconName as an alias\nexport type IconName = PhosphorIconName;\n\n// Standard size presets for the design system\nconst sizePresets = {\n xs: 16,\n sm: 20,\n md: 24,\n lg: 32,\n xl: 40,\n \"2xl\": 48,\n} as const;\n\ntype SizePreset = keyof typeof sizePresets;\n\ninterface IconProps extends Omit<PhosphorIconProps, \"size\"> {\n /**\n * The name of the Phosphor icon to render\n * Any valid icon from @phosphor-icons/react\n */\n name: PhosphorIconName;\n\n /**\n * Size of the icon - can be a preset or custom number\n */\n size?: SizePreset | number;\n\n /**\n * Accessibility label (maps to aria-label)\n */\n ariaLabel?: string;\n}\n\n/**\n * Icon\n *\n * Phosphor icon wrapper component with standardized sizing and styling.\n * Provides access to the full Phosphor icon library with tree-shaking support and design system presets.\n * - TypeScript autocomplete for all icon names\n *\n * Usage:\n * ```tsx\n * <Icon name=\"House\" size=\"md\" />\n * <Icon name=\"User\" size={32} className=\"text-brand\" />\n * ```\n */\nexport const Icon = memo(\n ({ name, size = \"md\", color, weight = \"regular\", className, ariaLabel, ...props }: IconProps) => {\n // Get the icon component from the Phosphor package\n const IconComponent = PhosphorIcons[name] as PhosphorIconComponent | undefined;\n\n if (!IconComponent) {\n if (process.env.NODE_ENV === \"development\") {\n console.error(`Icon \"${name}\" not found in @phosphor-icons/react`);\n }\n return null;\n }\n\n // Resolve size to pixel value\n const resolvedSize =\n typeof size === \"string\" && size in sizePresets ? sizePresets[size as SizePreset] : size;\n\n // Build className with design system defaults\n const iconClassName = twMerge(\n // Default styles\n \"inline-block flex-shrink-0\",\n // Allow color inheritance from parent\n !color && \"text-current\",\n // Custom classes\n className\n );\n\n return (\n <IconComponent\n {...props}\n size={resolvedSize as number}\n color={color}\n weight={weight}\n className={iconClassName}\n aria-label={ariaLabel || `${name} icon`}\n data-testid={`icon-${name}`}\n />\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n\n/**\n * Helper component for icons with containers\n */\ninterface IconWithContainerProps extends IconProps {\n /**\n * Container variant\n */\n variant?: \"subtle\" | \"solid\" | \"outline\";\n\n /**\n * Container shape\n */\n shape?: \"square\" | \"circle\";\n\n /**\n * Container size (adds padding around icon)\n */\n containerSize?: SizePreset | number;\n\n /**\n * Container background color\n */\n containerClassName?: string;\n}\n\nexport const IconWithContainer = memo(\n ({\n variant = \"subtle\",\n shape = \"square\",\n containerSize,\n containerClassName,\n size = \"md\",\n className,\n name,\n color,\n weight,\n ariaLabel,\n ref,\n ...props\n }: IconWithContainerProps & { ref?: React.Ref<HTMLDivElement> }) => {\n // Calculate container size if not specified\n const iconSize =\n typeof size === \"string\" && size in sizePresets ? sizePresets[size as SizePreset] : size;\n const resolvedContainerSize = containerSize\n ? typeof containerSize === \"string\" && containerSize in sizePresets\n ? sizePresets[containerSize as SizePreset]\n : containerSize\n : (iconSize as number) * 1.75; // Default to 1.75x icon size\n\n const containerClasses = twMerge(\n // Base styles\n \"inline-flex items-center justify-center flex-shrink-0\",\n\n // Shape\n shape === \"circle\" ? \"rounded-full\" : \"rounded-lg\",\n\n // Variant styles using Tailwind 4 CSS variables\n variant === \"subtle\" && \"bg-gray-100 dark:bg-gray-800\",\n variant === \"solid\" && \"bg-brand text-white\",\n variant === \"outline\" && \"border-2 border-current\",\n\n // Container className for overrides\n containerClassName\n );\n\n return (\n <div\n className={containerClasses}\n style={{\n width: resolvedContainerSize,\n height: resolvedContainerSize,\n }}\n >\n <Icon\n {...props}\n name={name}\n size={size}\n color={color}\n weight={weight}\n className={className}\n ariaLabel={ariaLabel}\n />\n </div>\n );\n }\n);\n\nIconWithContainer.displayName = \"IconWithContainer\";\n","\"use client\";\n/**\n * Field Component System\n *\n * A comprehensive system for building form fields and input components with consistent\n * styling, accessibility, and behavior. This module provides both base components and\n * styling utilities that can be composed to create complex form controls.\n *\n * Key Features:\n * - Consistent styling across all form elements\n * - Built-in state handling (invalid, disabled, focused)\n * - Accessibility support out of the box\n * - Flexible composition through style utilities\n *\n * @example Basic Usage\n * ```tsx\n * <Label htmlFor=\"name\">Name</Label>\n * <Input id=\"name\" size=\"md\" />\n * ```\n *\n * @example Complex Field with All Components\n * ```tsx\n * <div>\n * <Label htmlFor=\"email\" tooltip=\"Enter your work email\">Email</Label>\n * <Input\n * id=\"email\"\n * type=\"email\"\n * isInvalid={hasError}\n * isDisabled={isSubmitting}\n * />\n * <Description>We'll never share your email</Description>\n * {hasError && <FieldError>Please enter a valid email</FieldError>}\n * </div>\n * ```\n */\n\nimport React from \"react\";\nimport type { TextProps } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { controlStyles, type Size } from \"../../utils/controlStyles\";\nimport { Icon } from \"../Icon/Icon\";\n\n// Base style props interface for all input-like components\nexport interface InputStyleProps {\n /** Whether the input is in an invalid state */\n isInvalid?: boolean;\n /** Whether the input is disabled */\n isDisabled?: boolean;\n /** Whether the input should have a transparent background */\n transparent?: boolean;\n /** The size variant of the input */\n size?: Size;\n /** Whether the input is currently focused */\n isFocused?: boolean;\n /** Additional CSS classes to apply */\n className?: string;\n}\n\n// Common interfaces\nexport interface BaseProps {\n /** The size variant of the component */\n size?: Size;\n /** Additional CSS classes to apply */\n className?: string;\n}\n\nexport interface BaseInputProps extends BaseProps {\n /** Whether the input should have a transparent background */\n transparent?: boolean;\n /** Whether to show a clear button when the input has a value */\n isClearable?: boolean;\n /** Callback when the clear button is clicked */\n onClear?: () => void;\n /** Whether to show a search icon */\n showSearchIcon?: boolean;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default true\n */\n reserveErrorSpace?: boolean;\n}\n\nexport interface LabelProps extends BaseProps {\n /** The label content */\n children: React.ReactNode;\n /** Optional tooltip text to show next to the label */\n tooltip?: string;\n /** Whether to show a required field indicator (*) */\n isRequired?: boolean;\n /** The ID of the input this label is associated with */\n htmlFor?: string;\n}\n\nexport interface FieldErrorProps extends BaseProps {\n /** The error message to display */\n children: React.ReactNode;\n}\n\nexport interface InputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">,\n InputStyleProps {\n /** The size variant of the input */\n size?: Size;\n}\n\nexport interface DescriptionProps extends Omit<TextProps, \"className\">, BaseProps {\n /** The description content */\n children: React.ReactNode;\n}\n\nexport interface FieldGroupProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\">,\n InputStyleProps {\n /** Whether any child of the group is focused */\n isFocusWithin?: boolean;\n /** Children can be either a ReactNode or a render function */\n children?: React.ReactNode | ((props: InputStyleProps) => React.ReactNode);\n}\n\n/**\n * Hook for managing input focus state\n */\nexport function useInputFocus() {\n const [isFocused, setIsFocused] = React.useState(false);\n\n const handleFocus = React.useCallback(\n (\n e: React.FocusEvent<HTMLInputElement>,\n onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void\n ) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n []\n );\n\n const handleBlur = React.useCallback(\n (\n e: React.FocusEvent<HTMLInputElement>,\n onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void\n ) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n []\n );\n\n return { isFocused, handleFocus, handleBlur };\n}\n\n/**\n * Wrapper component for input containers\n */\nexport function InputWrapper({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) {\n return <div className={twMerge(\"relative w-full\", className)}>{children}</div>;\n}\n\n/**\n * Clear button component for inputs\n */\nexport function ClearButton({\n onClick,\n size = \"md\",\n className,\n}: {\n onClick: () => void;\n size?: Size;\n className?: string;\n}) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n onClick();\n }}\n className={twMerge(\n \"absolute right-2 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body\",\n className\n )}\n aria-label=\"Clear input\"\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <Icon name=\"X\" size={size === \"sm\" ? 16 : 20} />\n </button>\n );\n}\n\n/**\n * Generates state-specific styles for inputs based on their current state\n * (invalid, disabled, focused).\n *\n * State Priority:\n * 1. Disabled (overrides all other states)\n * 2. Invalid + Focused\n * 3. Invalid\n * 4. Focused\n * 5. Default\n *\n * @example\n * ```tsx\n * const styles = getInputStateStyles({ isInvalid: true, isFocused: true });\n * ```\n */\nexport function getInputStateStyles(props: {\n isInvalid?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n}) {\n const { isInvalid, isDisabled, isFocused } = props;\n const baseStyles = \"border rounded-[var(--control-border-radius)] !outline-none \";\n\n // Disabled state overrides all others\n if (isDisabled) {\n return `${baseStyles} border-border-muted`;\n }\n\n // Handle combinations of invalid and focus states\n if (isInvalid && isFocused) {\n return `${baseStyles} border-feedback-error-border shadow-[inset_0_0_0_1px_var(--color-feedback-error-border)]`;\n }\n\n if (isInvalid) {\n return `${baseStyles} border-feedback-error-border`;\n }\n\n if (isFocused) {\n return `${baseStyles} border-border-focus shadow-[inset_0_0_0_1px_var(--color-border-focus)]`;\n }\n\n // Default state - explicitly set border color\n return `${baseStyles} border-border-input`;\n}\n\n/**\n * Generates background styles based on the transparent and disabled props.\n * Uses Tailwind classes for consistent styling across light/dark modes.\n */\nexport function getInputBackgroundStyles(props: { transparent?: boolean; isDisabled?: boolean }) {\n if (props.isDisabled) {\n return \"bg-background-muted\";\n }\n return props.transparent ? \"bg-transparent\" : \"bg-background-input\";\n}\n\n/**\n * Returns the mobile font-size override class for input components.\n * iOS Safari zooms in on inputs with font-size < 16px when focused.\n * This ensures inputs use at least 16px on mobile to prevent auto-zoom,\n * while preserving the original size on desktop (768px+).\n *\n * Uses Tailwind responsive classes for proper handling by twMerge.\n */\nfunction getInputMobileFontClass(size: Size): string {\n // Only sm and md sizes need the override (they're < 16px)\n // lg and xl are already >= 16px\n // Use text-base (16px) on mobile, restore original size on md: breakpoint\n if (size === \"sm\") {\n return \"!text-base md:!text-[length:var(--control-text-sm)]\";\n }\n if (size === \"md\") {\n return \"!text-base md:!text-[length:var(--control-text-md)]\";\n }\n return \"\";\n}\n\n/**\n * Generates the complete set of base styles for input components.\n * This includes state styles, background, sizing, and custom classes.\n *\n * @example\n * ```tsx\n * const styles = getInputBaseStyles({\n * isInvalid: formState.hasError,\n * isDisabled: isLoading,\n * size: \"md\"\n * });\n * ```\n */\nexport function getInputBaseStyles(props: InputStyleProps) {\n const { isInvalid, isDisabled, isFocused, transparent, size = \"md\", className } = props;\n\n return twMerge(\n \"w-full\",\n getInputStateStyles({ isInvalid, isDisabled, isFocused }),\n getInputBackgroundStyles({ transparent, isDisabled }),\n controlStyles[size].text,\n controlStyles[size].height,\n controlStyles[size].padding,\n getInputMobileFontClass(size),\n className\n );\n}\n\n/**\n * Generates styles for grouped form elements (like input with buttons)\n *\n * @example\n * ```tsx\n * <div className={getFieldGroupStyles({ size: \"md\" })}>\n * <Input />\n * <Button>Submit</Button>\n * </div>\n * ```\n */\nexport function getFieldGroupStyles(props: FieldGroupProps) {\n const { size = \"md\", isFocusWithin, isInvalid, isDisabled, transparent, className } = props;\n\n return twMerge(\n \"group flex items-center rounded-[var(--control-border-radius)] overflow-hidden\",\n getInputBackgroundStyles({ transparent, isDisabled }),\n controlStyles[size].height,\n getInputStateStyles({ isFocused: isFocusWithin, isInvalid, isDisabled }),\n className\n );\n}\n\n// Components\n\n/**\n * Label component for form fields. Supports tooltips and required field indicators.\n *\n * @example\n * ```tsx\n * <Label\n * htmlFor=\"email\"\n * tooltip=\"Enter your work email\"\n * isRequired\n * >\n * Email Address\n * </Label>\n * ```\n */\nexport function Label({\n children,\n size = \"md\",\n tooltip,\n isRequired,\n className,\n htmlFor,\n}: LabelProps) {\n return (\n <label\n htmlFor={htmlFor}\n className={twMerge(\n controlStyles[size].text,\n \"!text-text-label font-semibold flex items-center gap-1\",\n className\n )}\n >\n {children}\n {isRequired && <span>*</span>}\n {tooltip && (\n <span className=\"text-text-muted\">\n <Icon name=\"Info\" size={size === \"sm\" ? 16 : 20} />\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Description component for providing additional context about a form field.\n *\n * @example\n * ```tsx\n * <Description>Must be at least 8 characters</Description>\n * ```\n */\nexport function Description({ size = \"md\", className, children, ...props }: DescriptionProps) {\n return (\n <div\n {...props}\n className={twMerge(\"leading-[2.25] text-text-caption\", controlStyles[size].text, className)}\n >\n {children}\n </div>\n );\n}\n\n/**\n * Error message component for form fields. Automatically handles\n * accessibility attributes for screen readers.\n *\n * @example\n * ```tsx\n * {hasError && <FieldError>This field is required</FieldError>}\n * ```\n */\nexport function FieldError({ children, size = \"md\", className }: FieldErrorProps) {\n return (\n <div\n role=\"alert\"\n className={twMerge(controlStyles[size].text, \"text-feedback-error-text\", className)}\n >\n {children}\n </div>\n );\n}\n\n/**\n * Base input component with consistent styling and state handling.\n * Extends the native input element with our custom styling system.\n *\n * @example\n * ```tsx\n * <Input\n * size=\"md\"\n * isInvalid={hasError}\n * isDisabled={isLoading}\n * transparent={false}\n * />\n * ```\n */\nexport function Input({\n size = \"md\",\n isInvalid,\n isDisabled,\n isFocused,\n transparent,\n className,\n ...props\n}: InputProps) {\n return (\n <input\n className={getInputBaseStyles({\n isInvalid,\n isDisabled,\n isFocused,\n transparent,\n size,\n className,\n })}\n {...props}\n />\n );\n}\n\n/**\n * Container for grouping form elements with consistent styling.\n * Useful for creating compound components like input with buttons.\n *\n * @example\n * ```tsx\n * <FieldGroup>\n * <Input placeholder=\"Search...\" />\n * <Button>Search</Button>\n * </FieldGroup>\n * ```\n */\nexport function FieldGroup(props: FieldGroupProps) {\n const { children, ...rest } = props;\n return (\n <div {...rest} className={getFieldGroupStyles(props)}>\n {typeof children === \"function\" ? children(props) : children}\n </div>\n );\n}\n","import type { ComponentProps, ReactNode } from \"react\";\nimport {\n ButtonRenderProps,\n LinkRenderProps,\n Button as RACButton,\n ButtonProps as RACButtonProps,\n Link as RACLink,\n LinkProps as RACLinkProps,\n} from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { focusRing } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport { controlStyles } from \"../../utils/controlStyles\";\nimport { Icon } from \"../Icon\";\n\ntype IconName = ComponentProps<typeof Icon>[\"name\"];\n\ntype BaseButtonProps = Omit<RACButtonProps, \"className\">;\n\n/**\n * Button\n *\n * A versatile action component that supports multiple visual variants, sizes,\n * optional icons, a loading state, and badge indicators. Follows the Edges\n * design system tokens and composes `react-aria-components` under the hood.\n *\n * Example usage:\n * ```tsx\n * <Button variant=\"brand\" size=\"md\" icon=\"Check\">Save</Button>\n * ```\n */\nexport interface ButtonProps extends BaseButtonProps {\n variant?:\n | \"default\"\n | \"brand\"\n | \"secondary\"\n | \"destructive\"\n | \"icon\"\n | \"link\"\n | \"unstyled\"\n | \"ghost\"\n | \"primary\";\n size?: Size;\n badgeNumber?: number;\n badgeVariant?: \"primary\" | \"destructive\";\n badgePosition?: \"top-right\" | \"top-left\" | \"bottom-right\" | \"bottom-left\";\n fullWidth?: boolean;\n icon?: IconName;\n iconWeight?: \"thin\" | \"light\" | \"regular\" | \"bold\" | \"fill\" | \"duotone\";\n iconPosition?: \"left\" | \"right\";\n isLoading?: boolean;\n loadingText?: string;\n loadingIndicator?: React.ReactNode;\n className?: string;\n href?: string;\n target?: string;\n rel?: string;\n style?: React.CSSProperties;\n}\n\nconst baseStyles =\n \"flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border\";\n\nconst variantStyles = {\n default:\n \"bg-action-default text-[color:var(--color-action-default-text)] hover:bg-action-default-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent\",\n brand:\n \"bg-action-brand text-[color:var(--color-action-brand-text)] hover:bg-action-brand-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent\",\n secondary:\n \"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]\",\n ghost:\n \"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]\",\n destructive:\n \"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]\",\n link: \"!text-action-brand hover:text-action-brand/90 hover:underline hover:decoration-2 hover:underline-offset-4\",\n icon: \"border-none text-text-body hover:bg-background-hover hover:text-text-heading forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]\",\n unstyled: \"bg-transparent\",\n} as const;\n\nconst widthStyles = {\n full: \"w-full\",\n default: \"w-fit\",\n};\n\nconst disabledStyles = \"opacity-50 cursor-not-allowed pointer-events-none\";\nconst enabledStyles = \"opacity-100 cursor-pointer\";\n\nconst badgePositionStyles = {\n \"top-right\": \"-right-2 -top-2\",\n \"top-left\": \"-left-2 -top-2\",\n \"bottom-right\": \"-right-2 -bottom-2\",\n \"bottom-left\": \"-left-2 -bottom-2\",\n} as const;\n\nconst badgeVariantStyles = {\n primary: \"bg-action-brand text-white\",\n destructive: \"bg-action-destructive text-white\",\n} as const;\n\nfunction normalizeVariant(\n variant: ButtonProps[\"variant\"]\n): \"default\" | \"brand\" | \"secondary\" | \"destructive\" | \"icon\" | \"link\" | \"unstyled\" | \"ghost\" {\n if (!variant) {\n return \"default\";\n }\n\n if (variant === \"primary\") {\n return \"brand\";\n }\n\n return variant;\n}\n\nfunction getButtonStyles(props: ButtonProps) {\n const {\n variant = \"default\",\n size = \"md\",\n isDisabled,\n fullWidth = false,\n isLoading = false,\n } = props;\n\n const normalizedVariant = normalizeVariant(variant);\n\n let styles =\n normalizedVariant === \"unstyled\" ? \"\" : `${baseStyles} ${variantStyles[normalizedVariant]}`;\n\n // Add size styles using controlStyles\n if (normalizedVariant !== \"unstyled\") {\n styles += ` ${controlStyles[size].text} ${controlStyles[size].height} ${controlStyles[size].padding} ${controlStyles[size].gap}`;\n }\n\n if (isDisabled || isLoading) {\n styles += ` ${disabledStyles}`;\n } else {\n styles += ` ${enabledStyles}`;\n }\n\n if (fullWidth) {\n styles += ` ${widthStyles.full}`;\n } else {\n styles += ` ${widthStyles.default}`;\n }\n\n const focusRingColor =\n normalizedVariant === \"brand\" ? \"focus-visible:outline-action-brand\" : undefined;\n\n return [styles, focusRing(), focusRingColor].filter(Boolean).join(\" \");\n}\n\n/**\n * Renders an Edges Button. When `href` is provided, renders a link-styled\n * button using the same visual system.\n */\nexport function Button(props: ButtonProps) {\n const {\n icon,\n children,\n isLoading = false,\n loadingText,\n loadingIndicator,\n size = \"md\",\n iconPosition = \"left\",\n iconWeight,\n href,\n className,\n badgeNumber,\n badgeVariant = \"primary\",\n badgePosition = \"top-right\",\n style,\n target,\n rel,\n ...restProps\n } = props;\n\n // Shared icon logic\n const iconElement = icon ? <Icon name={icon} size={size} weight={iconWeight} /> : null;\n\n // Shared content logic\n const content = (\n <>\n {iconPosition === \"left\" && iconElement}\n {typeof children === \"function\" ? null : children}\n {iconPosition === \"right\" && iconElement}\n </>\n );\n\n // Loading state\n const loadingNode = (\n <div className=\"relative inline-flex items-center justify-center\">\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {loadingIndicator || (\n <Icon name=\"CircleNotch\" size={size} className=\"animate-spin\" aria-hidden=\"true\" />\n )}\n </div>\n <div className=\"invisible\" aria-hidden=\"true\">\n {content}\n </div>\n {loadingText && (\n <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {loadingText}\n </span>\n )}\n </div>\n );\n\n // Compose className using twMerge to properly handle Tailwind class conflicts\n const hasBadge = (badgeNumber ?? 0) > 0;\n const composedClassName = twMerge(getButtonStyles(props), className);\n\n // Create link-specific props by filtering out button-specific props\n const linkProps: Partial<RACLinkProps> = href\n ? {\n href,\n target,\n rel,\n // Only include props that are valid for both Button and Link\n ...(restProps as Record<string, unknown>),\n }\n : {};\n\n // Remove button-specific event handlers that don't apply to links\n if (href) {\n const {\n onPress: _onPress,\n onPressStart: _onPressStart,\n onPressEnd: _onPressEnd,\n onPressChange: _onPressChange,\n onPressUp: _onPressUp,\n onAuxClick: _onAuxClick,\n onContextMenu: _onContextMenu,\n onDoubleClick: _onDoubleClick,\n ...safeRestProps\n } = restProps as Record<string, unknown>;\n Object.assign(linkProps, safeRestProps);\n }\n\n // Compose the button or link element\n const buttonOrLink = href ? (\n <RACLink\n {...linkProps}\n {...(isLoading && { \"aria-busy\": true })}\n style={hasBadge ? undefined : style}\n className={composedClassName}\n >\n {isLoading\n ? loadingNode\n : typeof children === \"function\"\n ? (function (renderProps: LinkRenderProps & { defaultChildren: ReactNode }) {\n return (\n <>\n {iconPosition === \"left\" && iconElement}\n {children(\n renderProps as unknown as ButtonRenderProps & { defaultChildren: ReactNode }\n )}\n {iconPosition === \"right\" && iconElement}\n </>\n );\n } as (props: LinkRenderProps & { defaultChildren: ReactNode }) => ReactNode)\n : content}\n </RACLink>\n ) : (\n <RACButton\n {...restProps}\n {...(isLoading && { \"aria-busy\": true })}\n style={hasBadge ? undefined : style}\n className={composedClassName}\n >\n {isLoading\n ? loadingNode\n : typeof children === \"function\"\n ? (function (renderProps: ButtonRenderProps & { defaultChildren: ReactNode }) {\n return (\n <>\n {iconPosition === \"left\" && iconElement}\n {children(renderProps)}\n {iconPosition === \"right\" && iconElement}\n </>\n );\n } as (props: ButtonRenderProps & { defaultChildren: ReactNode }) => ReactNode)\n : content}\n </RACButton>\n );\n\n // Render badge if badgeNumber is provided and > 0\n if (hasBadge) {\n return (\n <div className={twMerge(\"relative flex\", className)} style={style}>\n {buttonOrLink}\n <span\n className={`absolute ${badgePositionStyles[badgePosition]} flex h-5 w-5 items-center justify-center rounded-full ${badgeVariantStyles[badgeVariant]} text-xs font-medium`}\n aria-label={`${badgeNumber} items`}\n >\n {badgeNumber}\n </span>\n </div>\n );\n }\n\n return buttonOrLink;\n}\n","import { composeRenderProps, ModalOverlay, ModalOverlayProps } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport interface ModalBackdropProps extends ModalOverlayProps {\n /**\n * Whether to use a transparent backdrop instead of dark overlay\n * @default false\n */\n transparent?: boolean;\n /**\n * Additional CSS classes for the backdrop\n */\n className?: string;\n}\n\n/**\n * ModalBackdrop\n *\n * Shared backdrop/overlay component used by Dialog and Drawer.\n * Wraps React Aria's ModalOverlay with consistent styling and smooth animations.\n */\nexport function ModalBackdrop({\n transparent = false,\n className,\n children,\n ...props\n}: ModalBackdropProps) {\n return (\n <ModalOverlay\n {...props}\n className={composeRenderProps(className, (className, renderProps) => {\n return twMerge(\n // Base positioning and layering\n \"fixed inset-0 z-50\",\n // Backdrop styling - subtle gradient for depth\n transparent\n ? \"bg-transparent\"\n : [\n \"bg-gradient-to-br from-black/20 via-black/15 to-black/20\",\n \"backdrop-blur-[2px]\",\n \"supports-[backdrop-filter]:bg-black/15\",\n ].join(\" \"),\n // Smooth animations\n renderProps.isEntering && [\"animate-in fade-in\", \"duration-300 ease-out\"].join(\" \"),\n renderProps.isExiting && [\"animate-out fade-out\", \"duration-200 ease-in\"].join(\" \"),\n className\n );\n })}\n >\n {children}\n </ModalOverlay>\n );\n}\n","import React from \"react\";\nimport {\n Popover as AriaPopover,\n PopoverProps as AriaPopoverProps,\n composeRenderProps,\n Modal,\n OverlayArrow,\n PopoverContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport { ModalBackdrop } from \"../ModalBackdrop\";\n\n/**\n * Popover\n *\n * Positioned overlay container with optional arrow, built on\n * `react-aria-components` Popover.\n */\nexport interface PopoverProps extends Omit<AriaPopoverProps, \"children\"> {\n /**\n * Whether to show an arrow pointing to the trigger\n * @default false\n */\n showArrow?: boolean;\n /**\n * Whether to include a backdrop (makes it modal)\n * @default false\n */\n withBackdrop?: boolean;\n /**\n * Whether the backdrop/modal can be dismissed by clicking outside\n * Only applies when withBackdrop is true\n * @default true\n */\n isDismissable?: boolean;\n /**\n * Whether to disable the group class (prevents group-hover propagation to children)\n * Useful for calendars and other components that use their own group-hover states\n * @default false\n */\n disableGroup?: boolean;\n /**\n * Popover content\n */\n children: React.ReactNode;\n}\n\nfunction getPopoverStyles({\n isEntering,\n isExiting,\n className = \"\",\n disableGroup = false,\n}: {\n isEntering?: boolean;\n isExiting?: boolean;\n className?: string;\n disableGroup?: boolean;\n}) {\n const baseStyles = [\n !disableGroup && \"group\",\n \"bg-background-surface\",\n \"forced-colors:bg-[Canvas]\",\n \"shadow-lg\",\n \"rounded-[var(--control-border-radius)]\",\n \"bg-clip-padding\",\n \"border\",\n \"border-border-default\",\n \"outline-none\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n const enteringStyles = isEntering\n ? [\n \"animate-in\",\n \"fade-in\",\n \"placement-bottom:slide-in-from-top-1\",\n \"placement-top:slide-in-from-bottom-1\",\n \"placement-left:slide-in-from-right-1\",\n \"placement-right:slide-in-from-left-1\",\n \"ease-out\",\n \"duration-200\",\n ].join(\" \")\n : \"\";\n\n const exitingStyles = isExiting\n ? [\n \"animate-out\",\n \"fade-out\",\n \"placement-bottom:slide-out-to-top-1\",\n \"placement-top:slide-out-to-bottom-1\",\n \"placement-left:slide-out-to-right-1\",\n \"placement-right:slide-out-to-left-1\",\n \"ease-in\",\n \"duration-150\",\n ].join(\" \")\n : \"\";\n\n return [baseStyles, enteringStyles, exitingStyles, className].filter(Boolean).join(\" \");\n}\n\nexport function Popover({\n children,\n showArrow = false,\n withBackdrop = false,\n className,\n isDismissable = true,\n disableGroup = false,\n ...props\n}: PopoverProps) {\n const popoverContext = useSlottedContext(PopoverContext)!;\n const isSubmenu = popoverContext?.trigger === \"SubmenuTrigger\";\n let offset = showArrow ? 12 : 8;\n offset = isSubmenu ? offset - 6 : offset;\n\n const popoverContent = (\n <AriaPopover\n offset={offset}\n {...props}\n className={composeRenderProps(className, (className, renderProps) =>\n getPopoverStyles({ ...renderProps, className, disableGroup })\n )}\n >\n {showArrow && (\n <OverlayArrow>\n <svg\n width={12}\n height={12}\n viewBox=\"0 0 12 12\"\n className=\"block fill-background-surface stroke-border-default stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]\"\n >\n <path d=\"M0 0 L6 6 L12 0\" />\n </svg>\n </OverlayArrow>\n )}\n {children}\n </AriaPopover>\n );\n\n if (withBackdrop) {\n return (\n <ModalBackdrop isDismissable={isDismissable}>\n <Modal isDismissable={isDismissable}>{popoverContent}</Modal>\n </ModalBackdrop>\n );\n }\n\n return popoverContent;\n}\n","\"use client\";\nimport React, { createContext, useContext, useRef, useState } from \"react\";\nimport type { SelectProps as AriaSelectProps, Key, ValidationResult } from \"react-aria-components\";\nimport { Select as AriaSelect, ListBox, SelectValue } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport { controlStyles } from \"../../utils/controlStyles\";\nimport { Button } from \"../Button\";\nimport { Description, FieldError, getInputBaseStyles, InputWrapper, Label } from \"../Field\";\nimport { Icon } from \"../Icon\";\nimport type { DropdownSectionProps } from \"../ListBox\";\nimport { DropdownSection } from \"../ListBox\";\nimport { ListBoxItem } from \"../ListBoxItem\";\nimport { Popover } from \"../Popover\";\n\n// Context to provide size to nested ListBoxItems\nconst SelectSizeContext = createContext<Size>(\"md\");\n\n/**\n * Hook to access the current Select size from context.\n * Used by ListBoxItem to automatically inherit the parent Select's size.\n */\nexport function useSelectSize(): Size {\n return useContext(SelectSizeContext);\n}\n\n// Replace tv() with a regular function\ntype SelectVariants = {\n isDisabled?: boolean;\n size?: Size;\n isOpen?: boolean;\n isInvalid?: boolean;\n};\n\nfunction getSelectValueClassName(size: Size = \"md\") {\n // Use controlStyles for consistent text sizing\n return `flex-1 text-start data-[placeholder]:text-text-placeholder overflow-hidden text-ellipsis whitespace-nowrap ${controlStyles[size].text}`;\n}\n\nexport type SelectVariantType = SelectVariants;\n\n// Define a custom hook for focus handling that works with any element\nfunction useElementFocus() {\n const handleFocus = React.useCallback(\n (e: React.FocusEvent<Element>, onFocus?: (e: React.FocusEvent<Element>) => void) => {\n onFocus?.(e);\n },\n []\n );\n\n const handleBlur = React.useCallback(\n (e: React.FocusEvent<Element>, onBlur?: (e: React.FocusEvent<Element>) => void) => {\n onBlur?.(e);\n },\n []\n );\n\n return { handleFocus, handleBlur };\n}\n\n/**\n * Interface defining the shape of items in the Select component\n */\nexport interface SelectItem<T = unknown> {\n /** Unique identifier for the item */\n id: string;\n /** Display label for the item */\n label: string;\n /** Value associated with the item */\n value: T;\n}\n\n/**\n * Props for the Select component\n * @template T - The type of the items, must extend SelectItem\n */\nexport interface SelectProps<T extends SelectItem>\n extends Omit<AriaSelectProps<T>, \"children\" | \"onSelectionChange\"> {\n /** Label text displayed above the select */\n label?: string;\n /** Helper text displayed below the select */\n description?: string;\n /** Error message or function to generate error message */\n errorMessage?: string | ((validation: ValidationResult) => React.ReactNode);\n /** Collection of items to display in the select */\n items?: Iterable<T>;\n /** Size variant of the select */\n size?: Size;\n /** Render function for items or static children */\n children?: React.ReactNode | ((item: T) => React.ReactNode);\n /** Custom render function for individual items. When provided, items prop is used to render items automatically */\n renderItem?: (item: T) => React.ReactNode;\n /** Currently selected item's id. Uses the SelectItem's `id` field for stable selection tracking */\n selectedKey?: Key;\n /** Default selected item's id for uncontrolled usage */\n defaultSelectedKey?: Key;\n /** Callback when selection changes, provides the selected item's id */\n onSelectionChange?: (key: Key) => void;\n /** Whether to show error states */\n showErrors?: boolean;\n /** Tooltip text */\n tooltip?: string;\n /** Whether the field is required */\n isRequired?: boolean;\n /** Validation result object */\n validationResult?: ValidationResult;\n /** Whether to use transparent background */\n transparent?: boolean;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default false\n */\n reserveErrorSpace?: boolean;\n /** Placement of the dropdown menu relative to the trigger. Defaults to \"bottom start\" */\n placement?:\n | \"bottom\"\n | \"bottom left\"\n | \"bottom right\"\n | \"bottom start\"\n | \"bottom end\"\n | \"top\"\n | \"top left\"\n | \"top right\"\n | \"top start\"\n | \"top end\"\n | \"left\"\n | \"left top\"\n | \"left bottom\"\n | \"start\"\n | \"start top\"\n | \"start bottom\"\n | \"right\"\n | \"right top\"\n | \"right bottom\"\n | \"end\"\n | \"end top\"\n | \"end bottom\";\n /** Whether the menu should flip to the opposite side when there's not enough space. Defaults to true */\n shouldFlip?: boolean;\n /**\n * Controls the menu width behavior relative to the trigger.\n * - \"match\": Menu width matches trigger width exactly (default)\n * - \"auto\": Menu width grows to fit content, with minimum of trigger width\n * @default \"match\"\n */\n menuWidth?: \"match\" | \"auto\";\n}\n\nexport function Select<T extends SelectItem>({\n label,\n description,\n errorMessage,\n children,\n items,\n renderItem,\n size = \"md\",\n selectedKey: controlledSelectedKey,\n defaultSelectedKey,\n onSelectionChange,\n placeholder,\n showErrors = false,\n tooltip,\n isRequired,\n transparent,\n reserveErrorSpace = false,\n placement = \"bottom start\",\n shouldFlip = true,\n menuWidth = \"match\",\n ...props\n}: SelectProps<T>) {\n const [internalSelectedKey, setInternalSelectedKey] = useState<Key | null>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n const selectedKey = controlledSelectedKey ?? internalSelectedKey ?? defaultSelectedKey;\n const { handleFocus, handleBlur } = useElementFocus();\n\n const handleSelectionChange = (key: Key | null) => {\n if (onSelectionChange && key !== null) {\n onSelectionChange(key);\n }\n if (!onSelectionChange) {\n setInternalSelectedKey(key); // Update internal state if uncontrolled\n }\n };\n\n const selectRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n\n return (\n <AriaSelect\n {...props}\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n onSelectionChange={handleSelectionChange}\n placeholder={placeholder}\n className={composeTailwindRenderProps(props.className, \"group flex w-full flex-col\")}\n ref={selectRef}\n onOpenChange={(isOpen) => {\n if (isOpen && triggerRef.current) {\n setTriggerWidth(triggerRef.current.offsetWidth);\n } else if (!isOpen) {\n selectRef.current?.blur();\n }\n }}\n >\n {({\n isDisabled,\n isInvalid,\n isOpen,\n }: {\n isDisabled: boolean;\n isInvalid: boolean;\n isOpen: boolean;\n }) => (\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n <InputWrapper>\n <div ref={triggerRef}>\n <Button\n variant=\"unstyled\"\n className={twMerge(\n getInputBaseStyles({\n isInvalid: isInvalid || (showErrors && !!errorMessage),\n isDisabled,\n isFocused: isOpen,\n transparent,\n size,\n }),\n // Keep left padding consistent across sizes\n \"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]\"\n )}\n onFocus={(e) => handleFocus(e, props.onFocus)}\n onBlur={(e) => handleBlur(e, props.onBlur)}\n data-open={isOpen}\n >\n <SelectValue className={getSelectValueClassName(size)} />\n <Icon\n name=\"CaretDown\"\n aria-hidden\n className={twMerge(\n \"h-4 w-4 text-text-body group-disabled:text-gray-200 forced-colors:text-[ButtonText] transition-transform\",\n isOpen && \"rotate-180\"\n )}\n />\n </Button>\n </div>\n </InputWrapper>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {showErrors ? (\n <FieldError size={size} className=\"text-feedback-error-text\">\n {typeof errorMessage === \"function\" && props.validationResult\n ? errorMessage(props.validationResult)\n : typeof errorMessage === \"string\"\n ? errorMessage\n : null}\n </FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {showErrors ? (\n <FieldError size={size} className=\"mt-1 text-feedback-error-text\">\n {typeof errorMessage === \"function\" && props.validationResult\n ? errorMessage(props.validationResult)\n : typeof errorMessage === \"string\"\n ? errorMessage\n : null}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n <Popover\n className=\"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]\"\n style={{\n width: menuWidth === \"match\" && triggerWidth ? `${triggerWidth}px` : undefined,\n minWidth: menuWidth === \"auto\" && triggerWidth ? `${triggerWidth}px` : undefined,\n maxWidth: menuWidth === \"auto\" ? \"min(600px, 90vw)\" : undefined,\n }}\n placement={placement}\n shouldFlip={shouldFlip}\n >\n <SelectSizeContext.Provider value={size}>\n <ListBox\n items={items}\n className=\"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0\"\n >\n {renderItem && items\n ? (item: T) => (\n <ListBoxItem key={item.id} id={item.id} textValue={item.label} size={size}>\n <span className=\"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1\">\n {renderItem(item)}\n </span>\n </ListBoxItem>\n )\n : children}\n </ListBox>\n </SelectSizeContext.Provider>\n </Popover>\n </div>\n )}\n </AriaSelect>\n );\n}\n\nexport function SelectSection<T extends object>(props: DropdownSectionProps<T>) {\n return <DropdownSection {...props} />;\n}\n","import type { ListBoxItemProps as AriaListBoxItemProps } from \"react-aria-components\";\nimport { ListBoxItem as AriaListBoxItem } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { controlStyles } from \"../../utils/controlStyles\";\nimport { useSelectSize } from \"../Select/Select\";\n\n/**\n * ListBoxItem\n *\n * A styled wrapper around `react-aria-components` ListBoxItem with size\n * variants that align with Edges typography.\n */\nexport interface ExtendedListBoxItemProps extends Omit<AriaListBoxItemProps, \"className\"> {\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n className?: string;\n}\n\nexport type ListBoxItemProps = ExtendedListBoxItemProps;\n\nexport function ListBoxItem({ size, className, ...props }: ExtendedListBoxItemProps) {\n // Use context size from parent Select if no explicit size is provided\n const contextSize = useSelectSize();\n const effectiveSize = size ?? contextSize;\n\n const baseClassName =\n \"flex cursor-default items-center gap-2 rounded-sm px-3 outline-none text-text-body data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-default data-[focus-visible]:ring-inset data-[selected]:bg-background-selected data-[selected]:font-medium overflow-hidden\";\n\n return (\n <AriaListBoxItem\n {...props}\n className={twMerge(\n baseClassName,\n controlStyles[effectiveSize].paddingY,\n controlStyles[effectiveSize].text,\n className\n )}\n />\n );\n}\n","\"use client\";\n\nimport React, { useEffect, useState } from \"react\";\nimport { useFilter } from \"react-aria\";\nimport {\n Button as AriaButton,\n Input as AriaInput,\n ComboBox,\n ComboBoxStateContext,\n Group,\n Header,\n type Key,\n ListBox,\n ListBoxSection,\n ValidationResult,\n} from \"react-aria-components\";\nimport { useAsyncList } from \"react-stately\";\nimport { useDebounce } from \"../../hooks/useDebounce\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport { controlStyles, type Size } from \"../../utils/controlStyles\";\nimport { Description, FieldError, getFieldGroupStyles, Label } from \"../Field/Field\";\nimport { Icon } from \"../Icon/Icon\";\nimport { ListBoxItem } from \"../ListBoxItem/ListBoxItem\";\nimport { Popover } from \"../Popover/Popover\";\n\ninterface Item {\n id: string;\n name: string;\n}\n\ninterface Section {\n name: string;\n items: Item[];\n}\n\nconst iconSizeClassMap = {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n xl: \"h-7 w-7\",\n};\n\nconst inputPaddingLeftMap = {\n sm: \"pl-7\",\n md: \"pl-9\",\n lg: \"pl-10\",\n xl: \"pl-12\",\n};\n\nconst itemHeightStylesObject = {\n sm: \"py-1\",\n md: \"py-2\",\n lg: \"py-3\",\n xl: \"py-4\",\n};\n\ntype RequestMethod = \"GET\" | \"POST\";\n\ninterface BaseRequestConfig {\n url: string;\n headers?: Record<string, string>;\n transformResponse: (data: unknown) => Item[];\n}\n\ninterface RestRequestConfig extends BaseRequestConfig {\n requestType: \"REST\";\n method?: RequestMethod;\n queryKey?: string; // For APIs that expect \"query\" in URL or JSON body\n extraParams?: Record<string, string>;\n shouldLoad?: (filterText: string) => boolean;\n}\n\ninterface GraphQLRequestConfig extends BaseRequestConfig {\n requestType: \"GraphQL\";\n graphqlQuery: string;\n variableKey?: string;\n responsePath?: string;\n shouldLoad?: (filterText: string) => boolean;\n}\n\ntype AutocompleteRequestConfig = RestRequestConfig | GraphQLRequestConfig;\n\n/**\n * Autocomplete\n *\n * Text input with typeahead suggestions and keyboard navigation.\n */\nexport interface AutocompleteProps {\n label?: string;\n staticItems?: Item[];\n sections?: Section[];\n selectedKey?: Key | null;\n defaultSelectedKey?: Key | null;\n onSelectionChange?: (key: Key | null) => void;\n requestConfig?: AutocompleteRequestConfig;\n defaultFilter?: (textValue: string, inputValue: string) => boolean;\n placeholder?: string;\n renderItem?: (item: Item) => React.ReactNode;\n renderLeftIcon?: (isLoading: boolean) => React.ReactNode;\n renderSection?: (section: Section, children: React.ReactNode) => React.ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n description?: string;\n size?: Size;\n tooltip?: string;\n isRequired?: boolean;\n isDisabled?: boolean;\n isInvalid?: boolean;\n validationResult?: ValidationResult;\n showErrors?: boolean;\n autoFocus?: boolean;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default false\n */\n reserveErrorSpace?: boolean;\n}\n\nfunction ClearButton() {\n const state = React.useContext(ComboBoxStateContext);\n return (\n <AriaButton\n // Don't inherit default Button behavior from ComboBox.\n slot={null}\n className=\"clear-button\"\n aria-label=\"Clear\"\n onPress={() => state?.setSelectedKey(null)}\n >\n ✕\n </AriaButton>\n );\n}\n\n// Helper function to get item name by key\nconst getItemName = (\n key: Key | null | undefined,\n staticItems: Item[],\n sections?: Section[]\n): string => {\n if (key == null || key === \"\") return \"\";\n const allItems = sections ? sections.flatMap((s) => s.items) : staticItems || [];\n const selectedItem = allItems.find((item) => item.id === key);\n return selectedItem ? selectedItem.name : \"\";\n};\n\nasync function handleRestRequest(\n config: RestRequestConfig,\n filterText: string,\n signal: AbortSignal\n): Promise<{ items: Item[]; error?: string }> {\n try {\n // Extract the base URL and access token from config\n const baseUrl = config.url.replace(\"{q}\", filterText);\n\n // Add query parameters\n const params = new URLSearchParams();\n if (config.extraParams) {\n Object.entries(config.extraParams).forEach(([key, value]) => {\n params.append(key, value.toString());\n });\n }\n\n // Construct final URL\n const finalUrl = `${baseUrl}${params.toString() ? \"?\" + params.toString() : \"\"}`;\n\n const response = await fetch(finalUrl, {\n method: \"GET\",\n headers: config.headers,\n signal,\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const json = await response.json();\n return { items: config.transformResponse(json) };\n } catch (error) {\n console.error(\"Error in REST request:\", error);\n const errorMessage = error instanceof Error ? error.message : \"Unknown error occurred\";\n return { items: [], error: errorMessage };\n }\n}\n\nasync function handleGraphQLRequest(\n config: GraphQLRequestConfig,\n filterText: string,\n signal: AbortSignal\n): Promise<{ items: Item[]; error?: string }> {\n try {\n const query = config.graphqlQuery.replace(\n `$${config.variableKey || \"filter\"}`,\n `\"${filterText}\"`\n );\n\n const response = await fetch(config.url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n },\n body: JSON.stringify({ query }),\n signal,\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n let json = await response.json();\n\n if (json.errors) {\n throw new Error(json.errors[0]?.message || \"GraphQL error occurred\");\n }\n\n // For GraphQL, traverse the response path if specified\n if (config.responsePath) {\n json = config.responsePath.split(\".\").reduce((obj, key) => obj?.[key], json);\n }\n\n return { items: config.transformResponse(json) };\n } catch (error) {\n console.error(\"Error in GraphQL request:\", error);\n const errorMessage = error instanceof Error ? error.message : \"Unknown error occurred\";\n return { items: [], error: errorMessage };\n }\n}\n\nexport function Autocomplete({\n label,\n staticItems = [],\n sections,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n requestConfig,\n defaultFilter,\n placeholder,\n errorMessage,\n description,\n size = \"md\",\n tooltip,\n isRequired,\n isDisabled,\n isInvalid,\n validationResult,\n showErrors = true,\n renderItem,\n renderLeftIcon,\n renderSection,\n autoFocus = false,\n reserveErrorSpace = false,\n}: AutocompleteProps) {\n const triggerRef = React.useRef<HTMLDivElement>(null);\n const [triggerWidth, setTriggerWidth] = React.useState<number | undefined>();\n const [inputValue, setInputValue] = useState(() =>\n getItemName(selectedKey || defaultSelectedKey, staticItems, sections)\n );\n const [isFocused, setIsFocused] = useState(false);\n const debouncedInputValue = useDebounce(inputValue);\n const { contains } = useFilter({ sensitivity: \"base\" });\n const [error, setError] = useState<string | undefined>();\n\n const textSizeClass = controlStyles[size].text;\n const heightSizeClass = controlStyles[size].height;\n\n let dynamicItems: ReturnType<typeof useAsyncList<Item>> | null = null;\n\n useEffect(() => {\n if (autoFocus) {\n setIsFocused(true);\n }\n }, [autoFocus]);\n\n // Update trigger width when component mounts or resizes\n useEffect(() => {\n const updateTriggerWidth = () => {\n if (triggerRef.current) {\n setTriggerWidth(triggerRef.current.offsetWidth);\n }\n };\n\n updateTriggerWidth();\n window.addEventListener(\"resize\", updateTriggerWidth);\n return () => window.removeEventListener(\"resize\", updateTriggerWidth);\n }, []);\n\n useEffect(() => {\n if (dynamicItems) {\n dynamicItems.setFilterText(debouncedInputValue);\n }\n }, [debouncedInputValue, dynamicItems]);\n\n if (requestConfig) {\n dynamicItems = useAsyncList<Item>({\n async load({ signal, filterText = \"\" }) {\n if (\n !requestConfig.url ||\n (requestConfig.shouldLoad && !requestConfig.shouldLoad(filterText))\n ) {\n return { items: [] };\n }\n\n try {\n let result;\n if (requestConfig.requestType === \"GraphQL\") {\n result = await handleGraphQLRequest(requestConfig, filterText, signal);\n } else {\n result = await handleRestRequest(requestConfig, filterText, signal);\n }\n\n setError(result.error);\n return { items: result.items };\n } catch (error) {\n console.error(\"Error loading items:\", error);\n setError(error instanceof Error ? error.message : \"Unknown error occurred\");\n return { items: [] };\n }\n },\n initialFilterText: \"\",\n });\n }\n\n if (debouncedInputValue === \"\") {\n dynamicItems = null;\n }\n\n const handleInternalSelectionChange = (key: Key | null) => {\n const newName = getItemName(key, staticItems, sections);\n setInputValue(newName);\n if (onSelectionChange) {\n onSelectionChange(key);\n }\n };\n\n const handleInternalInputChange = (text: string) => {\n setInputValue(text);\n const currentSelectedItemName = getItemName(selectedKey, staticItems, sections);\n if (selectedKey != null && text !== currentSelectedItemName) {\n if (onSelectionChange) {\n // Clear selection if input text no longer matches selected item's name\n onSelectionChange(null);\n }\n }\n };\n\n return (\n <ComboBox\n onSelectionChange={handleInternalSelectionChange}\n selectedKey={selectedKey || undefined}\n defaultSelectedKey={defaultSelectedKey || undefined}\n defaultItems={sections ? sections.flatMap((section) => section.items) : staticItems}\n items={dynamicItems ? dynamicItems.items : undefined}\n className={composeTailwindRenderProps(\"group flex flex-col\", \"w-full\")}\n menuTrigger=\"focus\"\n isDisabled={isDisabled}\n isInvalid={isInvalid || !!errorMessage}\n inputValue={inputValue}\n onInputChange={handleInternalInputChange}\n autoFocus={autoFocus}\n defaultFilter={defaultFilter || contains}\n aria-label={label || placeholder || \"Autocomplete\"}\n >\n {(state) => (\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n <Group\n ref={triggerRef}\n className={getFieldGroupStyles({\n size,\n isInvalid: isInvalid || !!errorMessage,\n isDisabled,\n isFocusWithin: isFocused || state.isOpen,\n className: \"w-full cursor-pointer\",\n })}\n aria-label={label || placeholder || \"Autocomplete\"}\n style={{ position: \"relative\" }}\n >\n {renderLeftIcon ? (\n <div className=\"absolute left-3\">{renderLeftIcon(!!dynamicItems?.isLoading)}</div>\n ) : (\n <Icon\n name=\"MagnifyingGlass\"\n className={`${iconSizeClassMap[size]} absolute left-3 text-inherit`}\n />\n )}\n <AriaInput\n className={`flex-1 min-w-0 border-none pr-3 outline-0 placeholder:text-text-placeholder ${inputPaddingLeftMap[size]} ${textSizeClass} ${heightSizeClass} ${isDisabled ? \"bg-background-muted\" : \"bg-background-input\"}`}\n placeholder={placeholder}\n disabled={isDisabled}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n />\n {inputValue && !isDisabled && <ClearButton />}\n <AriaButton\n className={`px-2 text-text-body ${textSizeClass} ${heightSizeClass} ${isDisabled ? \"bg-background-muted\" : \"bg-background-input\"}`}\n aria-label=\"Toggle menu\"\n isDisabled={isDisabled}\n >\n {({ isPressed }) => (\n <Icon name={isPressed ? \"CaretUp\" : \"CaretDown\"} className=\"h-4 w-4\" />\n )}\n </AriaButton>\n </Group>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {showErrors && error ? (\n <FieldError size={size} className=\"text-feedback-error-text\">\n {error}\n </FieldError>\n ) : showErrors && typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"text-feedback-error-text\">\n {errorMessage}\n </FieldError>\n ) : showErrors && typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"text-feedback-error-text\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {description && (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n )}\n {showErrors && error && (\n <FieldError size={size} className=\"text-feedback-error-text mt-1\">\n {error}\n </FieldError>\n )}\n {showErrors && typeof errorMessage === \"string\" && (\n <FieldError size={size} className=\"text-feedback-error-text mt-1\">\n {errorMessage}\n </FieldError>\n )}\n {showErrors && typeof errorMessage === \"function\" && validationResult && (\n <FieldError size={size} className=\"text-feedback-error-text mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n )}\n </>\n )}\n <Popover\n className=\"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5 rounded-[var(--control-border-radius)]\"\n style={{ minWidth: triggerWidth ? `${triggerWidth}px` : undefined }}\n >\n <ListBox\n className={`max-h-[300px] overflow-auto bg-background-input outline-none ${textSizeClass}`}\n >\n {sections\n ? sections.map((section) => {\n const sectionItems = section.items.map((item) => (\n <ListBoxItem\n key={item.id}\n id={item.id}\n textValue={item.name}\n size={size}\n className={`flex cursor-default items-center gap-2 px-3 ${itemHeightStylesObject[size]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`}\n >\n {renderItem ? (\n renderItem(item)\n ) : (\n <>\n {item.name}\n <Icon\n name=\"X\"\n className=\"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100\"\n />\n </>\n )}\n </ListBoxItem>\n ));\n\n if (renderSection) {\n const content = renderSection(section, sectionItems);\n return React.isValidElement(content) && content.type === ListBoxSection ? (\n content\n ) : (\n <ListBoxSection key={section.name}>{content}</ListBoxSection>\n );\n }\n\n return (\n <ListBoxSection key={section.name}>\n <Header className=\"px-3 py-1 text-sm font-bold text-text-muted\">\n {section.name}\n </Header>\n {sectionItems}\n </ListBoxSection>\n );\n })\n : (item: Item) => (\n <ListBoxItem\n key={item.id}\n id={item.id}\n textValue={item.name}\n size={size}\n className={`flex cursor-default items-center gap-2 px-3 ${itemHeightStylesObject[size]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`}\n >\n {renderItem ? (\n renderItem(item)\n ) : (\n <>\n {item.name}\n <Icon\n name=\"X\"\n className=\"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100\"\n />\n </>\n )}\n </ListBoxItem>\n )}\n </ListBox>\n </Popover>\n </div>\n )}\n </ComboBox>\n );\n}\n","import type { FieldPath, FieldValues } from \"react-hook-form\";\n\nexport function getFieldError<TFieldValues extends FieldValues>(\n errors: Record<string, unknown>,\n name: FieldPath<TFieldValues>\n): string | undefined {\n const segs = name.split(\".\");\n let node: unknown = errors;\n for (const seg of segs) {\n if (node && typeof node === \"object\" && seg in (node as Record<string, unknown>)) {\n node = (node as Record<string, unknown>)[seg];\n } else {\n node = undefined;\n break;\n }\n }\n const msg = (node as { message?: string } | undefined)?.message;\n return typeof msg === \"string\" ? msg : undefined;\n}\n","import * as React from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { Autocomplete } from \"@/components/Autocomplete\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormAutocompleteProps<T extends FieldValues>\n extends Omit<\n React.ComponentProps<typeof Autocomplete>,\n \"selectedKey\" | \"defaultSelectedKey\" | \"onSelectionChange\"\n > {\n name: FieldPath<T>;\n defaultValue?: Key | null;\n}\n\nexport function FormAutocomplete<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormAutocompleteProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n defaultValue={defaultValue as unknown as T[typeof name]}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <Autocomplete\n {...rest}\n selectedKey={(field.value as Key) ?? null}\n onSelectionChange={(key) => field.onChange(key)}\n showErrors={!!error}\n errorMessage={error}\n />\n )}\n />\n );\n}\n","import { Check, Minus } from \"lucide-react\";\nimport { ReactNode } from \"react\";\nimport {\n Checkbox as AriaCheckbox,\n CheckboxGroup as AriaCheckboxGroup,\n CheckboxGroupProps as AriaCheckboxGroupProps,\n CheckboxProps as AriaCheckboxProps,\n CheckboxRenderProps,\n composeRenderProps,\n ValidationResult,\n} from \"react-aria-components\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport { Description, FieldError, Label } from \"../Field\";\n\n/**\n * CheckboxGroup\n *\n * Groups multiple checkboxes with shared label/description.\n */\nexport interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, \"children\"> {\n label?: string;\n children?: ReactNode;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n}\n\n/**\n * Checkbox\n *\n * Single checkbox with Edges visuals.\n */\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, \"children\"> {\n children?: ReactNode | ((props: CheckboxRenderProps) => ReactNode);\n /**\n * Visual variant of the checkbox\n * @default \"default\"\n */\n variant?: \"default\" | \"brand\";\n}\n\nexport function CheckboxGroup(props: CheckboxGroupProps) {\n return (\n <AriaCheckboxGroup\n {...props}\n className={composeTailwindRenderProps(props.className, \"flex flex-col gap-2\")}\n >\n <Label>{props.label}</Label>\n {props.children}\n {props.description && <Description>{props.description}</Description>}\n <FieldError>\n {typeof props.errorMessage === \"function\" ? undefined : props.errorMessage}\n </FieldError>\n </AriaCheckboxGroup>\n );\n}\n\nfunction getCheckboxStyles({ isDisabled }: { isDisabled?: boolean }) {\n return `flex gap-2 items-center group text-sm transition ${isDisabled ? \"text-text-disabled\" : \"text-text-caption\"}`;\n}\n\nfunction getBoxStyles({\n isSelected,\n isInvalid,\n isDisabled,\n isIndeterminate,\n variant = \"default\",\n}: {\n isSelected?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n isIndeterminate?: boolean;\n variant?: \"default\" | \"brand\";\n}) {\n const baseStyles =\n \"w-5 h-5 flex-shrink-0 rounded-[var(--control-border-radius)] flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2\";\n\n const focusRingColor =\n variant === \"brand\" ? \"focus:ring-action-brand\" : \"focus:ring-action-default\";\n\n let colorStyles = \"\";\n if (isDisabled) {\n colorStyles = \"border-border-muted bg-background-muted\";\n } else if (isInvalid) {\n colorStyles = \"border-feedback-error-border bg-feedback-error-background\";\n } else if (isSelected || isIndeterminate) {\n const actionColor = variant === \"brand\" ? \"action-brand\" : \"action-default\";\n colorStyles = `bg-${actionColor} border-${actionColor} hover:bg-${actionColor}-hover hover:border-${actionColor}-hover`;\n } else {\n colorStyles = \"bg-background-input border-border-input hover:border-border-focus\";\n }\n\n return `${baseStyles} ${focusRingColor} ${colorStyles}`;\n}\n\nconst iconStyles = \"w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled\";\n\nexport function Checkbox(props: CheckboxProps) {\n const { children, variant = \"default\", ...otherProps } = props;\n return (\n <AriaCheckbox\n {...otherProps}\n className={composeRenderProps(\n props.className,\n (className, renderProps) => `${getCheckboxStyles(renderProps)} ${className || \"\"}`\n )}\n >\n {(renderProps) => {\n const { isSelected, isIndeterminate, ...rest } = renderProps;\n const checkboxContent = (\n <div\n className={getBoxStyles({\n isSelected,\n isIndeterminate,\n variant,\n ...rest,\n })}\n >\n {isIndeterminate ? (\n <Minus aria-hidden className={iconStyles} />\n ) : isSelected ? (\n <Check aria-hidden className={iconStyles} />\n ) : null}\n </div>\n );\n\n return (\n <>\n {checkboxContent}\n {typeof children === \"function\" ? children(renderProps) : children}\n </>\n );\n }}\n </AriaCheckbox>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { Checkbox } from \"@/components/Checkbox\";\nimport { FieldError } from \"@/components/Field\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormCheckboxProps<T extends FieldValues>\n extends Omit<\n React.ComponentProps<typeof Checkbox>,\n \"isSelected\" | \"defaultSelected\" | \"onChange\"\n > {\n name: FieldPath<T>;\n defaultValue?: boolean;\n errorBelow?: boolean;\n}\n\nexport function FormCheckbox<T extends FieldValues>({\n name,\n defaultValue,\n errorBelow = false,\n ...rest\n}: FormCheckboxProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <div className=\"flex flex-col gap-1\">\n <Checkbox\n {...rest}\n isSelected={!!field.value}\n onChange={(v) => field.onChange(v)}\n aria-invalid={!!error}\n >\n {rest.children}\n </Checkbox>\n {errorBelow && error && <FieldError>{error}</FieldError>}\n </div>\n )}\n />\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { CheckboxGroup } from \"@/components/Checkbox\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormCheckboxGroupProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof CheckboxGroup>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string[];\n}\n\nexport function FormCheckboxGroup<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormCheckboxGroupProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n defaultValue={defaultValue as unknown as T[typeof name]}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <CheckboxGroup\n {...rest}\n value={(field.value as string[]) || []}\n onChange={(v) => field.onChange(v)}\n errorMessage={error}\n >\n {rest.children}\n </CheckboxGroup>\n )}\n />\n );\n}\n","\"use client\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport type {\n TextFieldProps as AriaTextFieldProps,\n TextFieldRenderProps,\n ValidationResult,\n} from \"react-aria-components\";\nimport { TextField as AriaTextFieldComponent } from \"react-aria-components\";\nimport { HexColorPicker } from \"react-colorful\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport { controlStyles } from \"../../utils/controlStyles\";\nimport { Button } from \"../Button\";\nimport {\n type BaseInputProps,\n Description,\n FieldError,\n getInputBaseStyles,\n Input,\n InputWrapper,\n Label,\n useInputFocus,\n} from \"../Field\";\nimport { Popover } from \"../Popover\";\n\n/**\n * Validates if a string is a valid hex color code\n * Accepts formats: #RGB, #RRGGBB, RGB, RRGGBB\n */\nfunction isValidHexColor(value: string): boolean {\n if (!value) return false;\n const hex = value.startsWith(\"#\") ? value.slice(1) : value;\n return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(hex);\n}\n\n/**\n * Normalizes a hex color to always include # and be uppercase\n * Expands 3-digit hex to 6-digit format\n */\nfunction normalizeHexColor(value: string): string {\n if (!value) return \"\";\n let hex = value.startsWith(\"#\") ? value.slice(1) : value;\n\n // Expand 3-digit hex to 6-digit\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\");\n }\n\n return `#${hex.toUpperCase()}`;\n}\n\n/**\n * ColorField Props\n */\nexport interface ColorFieldProps\n extends Omit<AriaTextFieldProps, \"isRequired\" | \"size\" | \"className\">,\n BaseInputProps {\n /** Label text displayed above the color field */\n label?: string;\n /** Helper text displayed below the color field */\n description?: string;\n /** Error message or function to generate error message */\n errorMessage?: string | ((validation: ValidationResult) => string);\n /** Placeholder text for the input */\n placeholder?: string;\n /** Optional tooltip text to show next to the label */\n tooltip?: string;\n /** Whether the field is required */\n isRequired?: boolean;\n /** Additional CSS classes to apply */\n className?: string;\n /** Validation result object */\n validationResult?: ValidationResult;\n /** The current hex color value (controlled) */\n value?: string;\n /** Default hex color value (uncontrolled) */\n defaultValue?: string;\n /** Callback when the color changes */\n onChange?: (color: string) => void;\n /** Whether to show the color swatch preview */\n showColorSwatch?: boolean;\n}\n\n/**\n * ColorField Component\n *\n * A form control that allows users to input hex color codes manually\n * or select colors using a visual color picker. Integrates seamlessly\n * with the Edges design system.\n *\n * @example\n * ```tsx\n * <ColorField\n * label=\"Brand Color\"\n * value={color}\n * onChange={setColor}\n * description=\"Choose your primary brand color\"\n * />\n * ```\n */\nexport function ColorField({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n transparent,\n className,\n validationResult,\n value: controlledValue,\n defaultValue,\n onChange,\n placeholder = \"#000000\",\n showColorSwatch = true,\n reserveErrorSpace = true,\n ...props\n}: ColorFieldProps) {\n const [internalValue, setInternalValue] = useState(defaultValue || \"\");\n const [inputValue, setInputValue] = useState(controlledValue || defaultValue || \"\");\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n const [triggerElement, setTriggerElement] = useState<HTMLElement | null>(null);\n const { isFocused, handleFocus, handleBlur } = useInputFocus();\n\n // Use controlled value if provided, otherwise use internal state\n const value = controlledValue !== undefined ? controlledValue : internalValue;\n\n // Sync inputValue with controlled value when it changes\n useEffect(() => {\n if (controlledValue !== undefined) {\n setInputValue(controlledValue);\n }\n }, [controlledValue]);\n\n // Validate the current value\n const isInvalid = value ? !isValidHexColor(value) : false;\n\n // Handle input change\n const handleInputChange = useCallback(\n (newValue: string) => {\n setInputValue(newValue);\n\n // Only update the actual color value if it's valid\n if (isValidHexColor(newValue)) {\n const normalized = normalizeHexColor(newValue);\n if (onChange) {\n onChange(normalized);\n } else {\n setInternalValue(normalized);\n }\n } else if (newValue === \"\") {\n // Allow clearing the value\n if (onChange) {\n onChange(\"\");\n } else {\n setInternalValue(\"\");\n }\n }\n },\n [onChange]\n );\n\n // Handle color picker change\n const handlePickerChange = useCallback(\n (newColor: string) => {\n const normalized = normalizeHexColor(newColor);\n setInputValue(normalized);\n if (onChange) {\n onChange(normalized);\n } else {\n setInternalValue(normalized);\n }\n },\n [onChange]\n );\n\n // Handle input blur - normalize valid values\n const handleInputBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n if (isValidHexColor(inputValue)) {\n const normalized = normalizeHexColor(inputValue);\n setInputValue(normalized);\n if (onChange && normalized !== value) {\n onChange(normalized);\n } else if (!onChange && normalized !== internalValue) {\n setInternalValue(normalized);\n }\n }\n handleBlur(e, props.onBlur);\n },\n [inputValue, value, internalValue, onChange, handleBlur, props.onBlur]\n );\n\n return (\n <AriaTextFieldComponent\n {...props}\n isRequired={isRequired}\n className={composeTailwindRenderProps(className, \"group flex flex-col\")}\n >\n {({ isDisabled }: TextFieldRenderProps) => (\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n <InputWrapper>\n <div className=\"flex gap-2\">\n <div className=\"flex-1 relative\">\n <Input\n size={size}\n disabled={isDisabled}\n type=\"text\"\n value={inputValue}\n placeholder={placeholder}\n onFocus={(e) => handleFocus(e, props.onFocus)}\n onBlur={handleInputBlur}\n onChange={(e) => handleInputChange(e.target.value)}\n className={twMerge(\n getInputBaseStyles({\n isInvalid,\n isDisabled,\n isFocused,\n size,\n transparent,\n }),\n showColorSwatch ? \"pr-12\" : \"pr-3\",\n \"pl-3\"\n )}\n />\n {showColorSwatch && (\n <div\n className=\"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none\"\n style={{ width: controlStyles[size].height }}\n >\n <div\n className={twMerge(\n \"w-6 h-6 rounded border shadow-sm\",\n isValidHexColor(value)\n ? \"border-border-default\"\n : \"border-border-default bg-background-muted\"\n )}\n style={isValidHexColor(value) ? { backgroundColor: value } : undefined}\n aria-hidden=\"true\"\n >\n {!isValidHexColor(value) && (\n <div className=\"w-full h-full flex items-center justify-center\">\n <div className=\"w-3 h-3 rounded-full border-2 border-border-muted\" />\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n <div ref={setTriggerElement}>\n <Button\n variant=\"secondary\"\n size={size}\n icon=\"Palette\"\n onPress={() => setIsPickerOpen(!isPickerOpen)}\n isDisabled={isDisabled}\n className=\"flex-shrink-0\"\n >\n Pick\n </Button>\n </div>\n </div>\n </InputWrapper>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n\n {/* Color Picker Popover */}\n {isPickerOpen && triggerElement && (\n <Popover\n triggerRef={{ current: triggerElement }}\n isOpen={isPickerOpen}\n onOpenChange={setIsPickerOpen}\n placement=\"bottom end\"\n className=\"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-lg p-4\"\n >\n <div className=\"flex flex-col gap-4\">\n <HexColorPicker\n color={value || \"#000000\"}\n onChange={handlePickerChange}\n style={{ width: \"200px\", height: \"200px\" }}\n />\n <div className=\"flex items-center gap-2\">\n <div\n className=\"w-10 h-10 rounded border border-border-default shadow-sm flex-shrink-0\"\n style={{ backgroundColor: value || \"#000000\" }}\n />\n <div className=\"flex-1 text-text-body text-[length:var(--control-text-sm)] font-mono\">\n {value || \"#000000\"}\n </div>\n </div>\n </div>\n </Popover>\n )}\n </div>\n )}\n </AriaTextFieldComponent>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { ColorField } from \"@/components/ColorField\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormColorFieldProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof ColorField>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n}\n\nexport function FormColorField<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormColorFieldProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <ColorField\n {...rest}\n value={(field.value as unknown as string) ?? \"\"}\n onChange={(v) => field.onChange(v)}\n isInvalid={!!error}\n errorMessage={error}\n />\n )}\n />\n );\n}\n","import {\n Calendar as AriaCalendar,\n CalendarGridHeader as AriaCalendarGridHeader,\n CalendarProps as AriaCalendarProps,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarHeaderCell,\n DateValue,\n Heading,\n Text,\n useLocale,\n} from \"react-aria-components\";\nimport { focusRing } from \"../../utils\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\n\nfunction getCellStyles({ isSelected, isDisabled }: { isSelected: boolean; isDisabled: boolean }) {\n const baseStyles = [\n focusRing,\n \"w-9 h-9 text-sm cursor-default rounded-sm flex items-center justify-center forced-color-adjust-none font-semibold\",\n ];\n\n if (isDisabled) {\n baseStyles.push(\"text-text-disabled forced-colors:text-[GrayText]\");\n } else if (isSelected) {\n baseStyles.push(\n \"bg-action-default text-text-onPrimary invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]\"\n );\n } else {\n baseStyles.push(\"text-text-body hover:bg-background-hover pressed:bg-background-selected\");\n }\n\n return baseStyles.join(\" \");\n}\n\n/**\n * Calendar\n *\n * Single-date calendar primitive with Edges styling.\n */\nexport interface CalendarProps<T extends DateValue>\n extends Omit<AriaCalendarProps<T>, \"visibleDuration\"> {\n errorMessage?: string;\n}\n\nexport function Calendar<T extends DateValue>({ errorMessage, ...props }: CalendarProps<T>) {\n return (\n <AriaCalendar {...props}>\n <CalendarHeader />\n <CalendarGrid className=\"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0\">\n <CalendarGridHeader />\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n date={date}\n className={({ isSelected, isDisabled }) =>\n `${getCellStyles({ isSelected, isDisabled })} border-0`\n }\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n {errorMessage && (\n <Text slot=\"errorMessage\" className=\"text-sm text-red-600\">\n {errorMessage}\n </Text>\n )}\n </AriaCalendar>\n );\n}\n\nexport function CalendarHeader() {\n const { direction } = useLocale();\n\n const buttonSize = 18;\n\n return (\n <header className=\"flex w-full items-center gap-1 px-1 pb-4\">\n <Button variant=\"icon\" slot=\"previous\" className=\"pl-0\">\n {direction === \"rtl\" ? (\n <Icon name=\"CaretRight\" aria-hidden size={buttonSize} />\n ) : (\n <Icon name=\"CaretLeft\" aria-hidden size={buttonSize} />\n )}\n </Button>\n <Heading className=\"text-md mx-2 flex-1 text-center font-semibold text-zinc-900 dark:text-zinc-200\" />\n <Button variant=\"icon\" slot=\"next\" className=\"pr-0\">\n {direction === \"rtl\" ? (\n <Icon name=\"CaretLeft\" aria-hidden size={buttonSize} />\n ) : (\n <Icon name=\"CaretRight\" aria-hidden size={buttonSize} />\n )}\n </Button>\n </header>\n );\n}\n\nexport function CalendarGridHeader() {\n return (\n <AriaCalendarGridHeader>\n {(day) => (\n <CalendarHeaderCell className=\"text-xs font-semibold text-text-caption\">\n {day}\n </CalendarHeaderCell>\n )}\n </AriaCalendarGridHeader>\n );\n}\n","\"use client\";\nimport { useState } from \"react\";\nimport {\n DateField as AriaDateField,\n DateFieldProps as AriaDateFieldProps,\n DateInput as AriaDateInput,\n DateInputProps,\n DateSegment,\n DateValue,\n Dialog,\n DialogTrigger,\n Popover,\n ValidationResult,\n} from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport { Button } from \"../Button\";\nimport { Calendar } from \"../Calendar\";\nimport {\n BaseInputProps,\n Description,\n FieldError,\n getInputStateStyles,\n InputWrapper,\n Label,\n} from \"../Field\";\nimport { Icon } from \"../Icon\";\n\n/**\n * DateField\n *\n * A segmented date input with optional calendar popup. Matches the API and styling\n * of TextField for consistency across form controls.\n */\nexport interface DateFieldProps<T extends DateValue>\n extends Omit<AriaDateFieldProps<T>, \"isRequired\" | \"size\" | \"className\">,\n Omit<BaseInputProps, \"transparent\" | \"isClearable\" | \"onClear\"> {\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n placeholder?: string;\n tooltip?: string;\n isRequired?: boolean;\n className?: string;\n validationResult?: ValidationResult;\n /**\n * Whether to show a calendar button for date selection\n * @default true\n */\n showCalendar?: boolean;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default true\n */\n reserveErrorSpace?: boolean;\n}\n\n/**\n * Renders an Edges DateField with label, description, validation states,\n * and optional calendar picker.\n */\nexport function DateField<T extends DateValue>({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n isDisabled,\n isInvalid,\n showCalendar = true,\n reserveErrorSpace = true,\n validationResult,\n className,\n ...props\n}: DateFieldProps<T>) {\n const [isCalendarOpen, setIsCalendarOpen] = useState(false);\n\n const handleCalendarSelect = (date: DateValue | null) => {\n if (props.onChange && date) {\n // @ts-expect-error - Complex type mapping between DateValue and MappedDateValue<T>\n props.onChange(date);\n }\n setIsCalendarOpen(false);\n };\n\n return (\n <AriaDateField\n {...props}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isInvalid={isInvalid}\n className={composeTailwindRenderProps(className, \"flex flex-col gap-1\")}\n >\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n\n <InputWrapper>\n <div className=\"relative w-full\">\n <DateInput\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n hasCalendar={showCalendar}\n />\n {showCalendar && !isDisabled && (\n <DialogTrigger isOpen={isCalendarOpen} onOpenChange={setIsCalendarOpen}>\n <Button\n variant=\"unstyled\"\n className=\"absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center rounded hover:bg-background-hover text-text-muted hover:text-text-body transition-colors\"\n aria-label=\"Open calendar\"\n >\n <Icon name=\"Calendar\" size={18} />\n </Button>\n <Popover className=\"bg-background-surface rounded-lg border border-border-default shadow-xl\">\n <Dialog className=\"p-4 outline-none\">\n <Calendar\n value={props.value}\n onChange={handleCalendarSelect}\n minValue={props.minValue}\n maxValue={props.maxValue}\n isDisabled={isDisabled}\n isReadOnly={props.isReadOnly}\n isDateUnavailable={props.isDateUnavailable}\n />\n </Dialog>\n </Popover>\n </DialogTrigger>\n )}\n </div>\n </InputWrapper>\n\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </AriaDateField>\n );\n}\n\nfunction getSegmentStyles({\n isPlaceholder,\n isDisabled,\n size = \"md\",\n}: {\n isPlaceholder?: boolean;\n isDisabled?: boolean;\n size?: Size;\n}) {\n // Size styles with mobile font-size fix\n // iOS Safari zooms in on inputs with font-size < 16px when focused.\n // On mobile, we use text-base (16px) for sm/md sizes to prevent auto-zoom.\n // On desktop (md: breakpoint), we restore the original smaller sizes.\n const sizeStyles: Record<Size, string> = {\n sm: \"text-base md:text-xs\",\n md: \"text-base md:text-sm\",\n lg: \"text-base\",\n xl: \"text-lg\",\n };\n\n return twMerge(\n // Base\n \"inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors\",\n sizeStyles[size],\n // Text color\n isPlaceholder ? \"text-text-placeholder italic\" : \"text-text-body\",\n // Disabled state\n isDisabled ? \"text-text-disabled cursor-not-allowed\" : \"cursor-text\",\n // Hover/focus\n !isDisabled && \"hover:bg-background-hover\",\n \"data-[focused]:bg-background-selected data-[focused]:text-text-body\"\n );\n}\n\ninterface DateInputComponentProps extends Omit<DateInputProps, \"children\"> {\n size?: Size;\n isDisabled?: boolean;\n isInvalid?: boolean;\n hasCalendar?: boolean;\n}\n\nexport function DateInput({\n size = \"md\",\n isDisabled,\n isInvalid,\n hasCalendar,\n className,\n ...props\n}: DateInputComponentProps) {\n return (\n <AriaDateInput\n className={twMerge(\n getInputStateStyles({\n isInvalid,\n isDisabled,\n }),\n // Padding adjustments\n \"px-3 py-2 flex items-center gap-0.5 w-full\",\n hasCalendar && \"pr-10\", // Make room for calendar icon\n className as string\n )}\n {...props}\n >\n {(segment) => (\n <DateSegment\n segment={segment}\n className={getSegmentStyles({\n isPlaceholder: segment.isPlaceholder,\n isDisabled: !segment.isEditable || isDisabled,\n size,\n })}\n />\n )}\n </AriaDateInput>\n );\n}\n","import * as React from \"react\";\nimport type { DateValue } from \"react-aria-components\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { DateField } from \"@/components/DateField\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormDateFieldProps<T extends FieldValues, D extends DateValue = DateValue>\n extends Omit<React.ComponentProps<typeof DateField<D>>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: D | null;\n}\n\nexport function FormDateField<T extends FieldValues, D extends DateValue = DateValue>({\n name,\n defaultValue,\n ...rest\n}: FormDateFieldProps<T, D>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <DateField\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n {...(rest as any)}\n value={(field.value as unknown as D) ?? null}\n onChange={(v: D) => field.onChange(v)}\n isInvalid={!!error}\n errorMessage={error}\n />\n )}\n />\n );\n}\n","\"use client\";\nimport { Image as ImageIcon, Upload, X } from \"lucide-react\";\nimport { useRef, useState } from \"react\";\nimport { DropZone, FileTrigger } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Button } from \"../Button\";\n\nexport interface FileUploadProps {\n /**\n * Current file URL or preview\n */\n value?: string;\n /**\n * Callback when file is selected\n */\n onChange?: (file: File | null, url?: string) => void;\n /**\n * Callback when file URL changes (for external upload handlers)\n */\n onUrlChange?: (url: string) => void;\n /**\n * Accepted file types\n */\n accept?: string;\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n /**\n * Whether the component is disabled\n */\n isDisabled?: boolean;\n /**\n * Custom upload handler (e.g., for cloud storage)\n */\n onUpload?: (file: File) => Promise<string>;\n /**\n * Additional CSS classes\n */\n className?: string;\n /**\n * Show image preview for image files\n */\n showPreview?: boolean;\n /**\n * Placeholder text\n */\n placeholder?: string;\n}\n\n/**\n * FileUpload\n *\n * A file upload component with drag-and-drop support.\n * Supports image preview, custom upload handlers, and file validation.\n */\nexport function FileUpload({\n value,\n onChange,\n onUrlChange,\n accept = \"image/*\",\n maxSize,\n isDisabled = false,\n onUpload,\n className,\n showPreview = true,\n placeholder = \"Drop files here or click to browse\",\n}: FileUploadProps) {\n const [isDragging, setIsDragging] = useState(false);\n const [isUploading, setIsUploading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [preview, setPreview] = useState<string | undefined>(value);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const handleFile = async (file: File) => {\n setError(null);\n\n // Validate file size\n if (maxSize && file.size > maxSize) {\n setError(`File size must be less than ${(maxSize / 1024 / 1024).toFixed(2)}MB`);\n return;\n }\n\n // Handle file preview for images\n if (showPreview && file.type.startsWith(\"image/\")) {\n const reader = new FileReader();\n reader.onloadend = () => {\n setPreview(reader.result as string);\n };\n reader.readAsDataURL(file);\n }\n\n // If custom upload handler is provided, use it\n if (onUpload) {\n setIsUploading(true);\n try {\n const url = await onUpload(file);\n setPreview(url);\n onUrlChange?.(url);\n } catch (err) {\n setError(\"Failed to upload file\");\n console.error(\"Upload error:\", err);\n } finally {\n setIsUploading(false);\n }\n }\n\n onChange?.(file, preview);\n };\n\n const handleDrop = (e: any) => {\n const items = e.items;\n if (items.length > 0) {\n const item = items[0];\n if (item.kind === \"file\") {\n const file = item.getAsFile();\n if (file) {\n handleFile(file);\n }\n }\n }\n setIsDragging(false);\n };\n\n const handleRemove = () => {\n setPreview(undefined);\n setError(null);\n onChange?.(null);\n onUrlChange?.(\"\");\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n };\n\n return (\n <div className={twMerge(\"w-full\", className)}>\n <DropZone\n className={twMerge(\n \"relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors\",\n isDragging\n ? \"border-action-brand bg-action-brand/5\"\n : \"border-border-muted hover:border-border-default\",\n isDisabled && \"pointer-events-none opacity-50\",\n error && \"border-feedback-error-border bg-feedback-error-background/50\"\n )}\n onDrop={handleDrop}\n onDropEnter={() => setIsDragging(true)}\n onDropExit={() => setIsDragging(false)}\n >\n {preview ? (\n <div className=\"relative flex h-full w-full items-center justify-center p-4\">\n {showPreview && preview.startsWith(\"data:image\") ? (\n <img\n src={preview}\n alt=\"Preview\"\n className=\"max-h-48 max-w-full rounded-md object-contain\"\n />\n ) : (\n <div className=\"flex flex-col items-center gap-2\">\n <ImageIcon className=\"h-12 w-12 text-text-muted\" />\n <span className=\"text-sm text-text-muted\">File uploaded</span>\n </div>\n )}\n {!isDisabled && (\n <Button\n variant=\"icon\"\n size=\"sm\"\n onPress={handleRemove}\n className=\"absolute right-2 top-2 bg-background-surface shadow-md\"\n >\n <X className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n ) : (\n <div className=\"flex flex-col items-center gap-4 p-6\">\n <Upload className=\"h-12 w-12 text-text-muted\" />\n <div className=\"text-center\">\n <p className=\"text-sm text-text-body\">{placeholder}</p>\n <p className=\"mt-1 text-xs text-text-muted\">\n {accept === \"image/*\" ? \"PNG, JPG, GIF up to 10MB\" : `Accepts ${accept}`}\n </p>\n </div>\n <FileTrigger\n acceptedFileTypes={accept.split(\",\")}\n onSelect={(e) => {\n const files = Array.from(e || []);\n if (files.length > 0) {\n handleFile(files[0]);\n }\n }}\n >\n <Button variant=\"secondary\" size=\"sm\" isDisabled={isDisabled}>\n Choose File\n </Button>\n </FileTrigger>\n </div>\n )}\n {isUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80\">\n <div className=\"flex flex-col items-center gap-2\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-2 border-action-brand border-t-transparent\" />\n <span className=\"text-sm text-text-muted\">Uploading...</span>\n </div>\n </div>\n )}\n </DropZone>\n {error && <p className=\"mt-2 text-sm text-feedback-error-text\">{error}</p>}\n </div>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { FieldError } from \"@/components/Field\";\nimport { FileUpload } from \"@/components/FileUpload\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormFileUploadProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof FileUpload>, \"value\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n errorBelow?: boolean;\n}\n\nexport function FormFileUpload<T extends FieldValues>({\n name,\n defaultValue,\n errorBelow = true,\n ...rest\n}: FormFileUploadProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <div className=\"flex flex-col gap-1\">\n <FileUpload\n {...rest}\n value={(field.value as unknown as string) ?? \"\"}\n onChange={(_, url) => field.onChange(url || \"\")}\n />\n {errorBelow && error && <FieldError>{error}</FieldError>}\n </div>\n )}\n />\n );\n}\n","import { useId } from \"react\";\nimport {\n Button as AriaButton,\n Input as AriaInput,\n NumberField as AriaNumberField,\n NumberFieldProps as AriaNumberFieldProps,\n Group,\n ValidationResult,\n} from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport {\n BaseInputProps,\n Description,\n FieldError,\n getInputBaseStyles,\n Label,\n useInputFocus,\n} from \"../Field\";\nimport { Icon } from \"../Icon\";\n\nconst getNumberFieldStyles = (props: {\n isInvalid?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n transparent?: boolean;\n size?: Size;\n className?: string;\n}): string => {\n // Get base input styles (includes state, background, sizing, padding)\n const baseStyles = getInputBaseStyles({\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isFocused: props.isFocused,\n transparent: props.transparent,\n size: props.size,\n });\n\n // Add NumberField-specific styles\n return twMerge(\n baseStyles,\n \"pr-9\", // Space for stepper buttons\n \"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none\", // Hide native spinners\n props.className\n );\n};\n\n/**\n * NumberField\n *\n * Numeric input with stepper controls and validation.\n */\nexport interface NumberFieldProps\n extends Omit<AriaNumberFieldProps, \"size\" | \"className\">,\n BaseInputProps {\n value?: number;\n defaultValue?: number;\n onChange?: (value: number) => void;\n minValue?: number;\n maxValue?: number;\n step?: number;\n formatOptions?: Intl.NumberFormatOptions;\n id?: string;\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n tooltip?: string;\n isRequired?: boolean;\n className?: string;\n validationResult?: ValidationResult;\n}\n\nexport function NumberField({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n transparent,\n validationResult,\n reserveErrorSpace = true,\n ...props\n}: NumberFieldProps) {\n const id = useId();\n const { isFocused, handleFocus, handleBlur } = useInputFocus();\n\n return (\n <AriaNumberField\n {...props}\n id={id}\n isRequired={isRequired}\n className={composeTailwindRenderProps(props.className, \"group flex flex-col gap-1\")}\n step={props.step ?? 1}\n onChange={(value) => {\n if (typeof value === \"number\") {\n if (props.maxValue != null && value > props.maxValue) {\n props.onChange?.(props.maxValue);\n } else if (props.minValue != null && value < props.minValue) {\n props.onChange?.(props.minValue);\n } else {\n props.onChange?.(value);\n }\n }\n }}\n isInvalid={\n !!errorMessage ||\n (typeof props.value === \"number\" &&\n ((props.maxValue != null && props.value > props.maxValue) ||\n (props.minValue != null && props.value < props.minValue)))\n }\n >\n {({ isDisabled, isInvalid }) => {\n const isValueInvalid = isInvalid || !!errorMessage;\n return (\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired} htmlFor={id}>\n {label}\n </Label>\n )}\n <div className=\"relative\">\n <Group className=\"relative\">\n <AriaInput\n onFocus={(e) => handleFocus(e, props.onFocus)}\n onBlur={(e) => handleBlur(e, props.onBlur)}\n className={getNumberFieldStyles({\n isInvalid: isValueInvalid,\n isDisabled,\n isFocused,\n transparent,\n size,\n className: typeof props.className === \"string\" ? props.className : undefined,\n })}\n />\n <div className=\"absolute inset-y-[2px] right-[2px] flex flex-col divide-y divide-border-default border-l border-border-default overflow-hidden rounded-r-[calc(var(--control-border-radius)-2px)]\">\n <AriaButton\n slot=\"increment\"\n isDisabled={isDisabled}\n className=\"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Icon name=\"CaretUp\" size={14} />\n </AriaButton>\n <AriaButton\n slot=\"decrement\"\n isDisabled={isDisabled}\n className=\"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Icon name=\"CaretDown\" size={14} />\n </AriaButton>\n </div>\n </Group>\n </div>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {errorMessage ? (\n <FieldError size={size}>\n {typeof errorMessage === \"function\"\n ? errorMessage(validationResult!)\n : errorMessage}\n </FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {errorMessage ? (\n <FieldError size={size} className=\"mt-1\">\n {typeof errorMessage === \"function\"\n ? errorMessage(validationResult!)\n : errorMessage}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </div>\n );\n }}\n </AriaNumberField>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { NumberField } from \"@/components/NumberField\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormNumberFieldProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof NumberField>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: number;\n}\n\nexport function FormNumberField<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormNumberFieldProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <NumberField\n {...rest}\n value={typeof field.value === \"number\" ? (field.value as number) : undefined}\n onChange={(v) => field.onChange(v)}\n isInvalid={!!error}\n errorMessage={error}\n isRequired={rest.isRequired}\n />\n )}\n />\n );\n}\n","\"use client\";\n\nimport { createContext, type ReactNode, useContext } from \"react\";\nimport {\n Radio as RACRadio,\n RadioGroup as RACRadioGroup,\n RadioGroupProps as RACRadioGroupProps,\n RadioProps,\n ValidationResult,\n} from \"react-aria-components\";\nimport { composeTailwindRenderProps, focusRing } from \"../../utils\";\nimport { Description, FieldError, Label } from \"../Field\";\n\n// Context to pass variant to Radio components\nconst RadioGroupContext = createContext<{ variant: \"default\" | \"brand\" }>({ variant: \"brand\" });\n\nexport interface RadioGroupProps extends Omit<RACRadioGroupProps, \"children\"> {\n /** Label for the radio group */\n label?: string;\n /** Children elements */\n children?: ReactNode;\n /** Optional description for the radio group */\n description?: string;\n /** Error message to display when validation fails */\n errorMessage?: string | ((validation: ValidationResult) => string);\n /** Validation result object for functional errorMessage */\n validationResult?: ValidationResult;\n /**\n * Visual variant of the radio buttons\n * @default \"default\"\n */\n variant?: \"default\" | \"brand\";\n}\n\nexport function RadioGroup(props: RadioGroupProps) {\n const { variant = \"default\", ...otherProps } = props;\n return (\n <RadioGroupContext.Provider value={{ variant }}>\n <RACRadioGroup\n {...otherProps}\n className={composeTailwindRenderProps(props.className, \"group flex flex-col gap-2\")}\n >\n <Label>{props.label}</Label>\n <div className=\"flex gap-2 group-orientation-horizontal:gap-4 group-orientation-vertical:flex-col\">\n {props.children}\n </div>\n {props.description && <Description>{props.description}</Description>}\n <FieldError>\n {typeof props.errorMessage === \"function\" && props.validationResult\n ? props.errorMessage(props.validationResult)\n : typeof props.errorMessage === \"string\"\n ? props.errorMessage\n : null}\n </FieldError>\n </RACRadioGroup>\n </RadioGroupContext.Provider>\n );\n}\n\nfunction getRadioStyles({\n isSelected,\n isInvalid,\n isDisabled,\n variant = \"brand\",\n}: {\n isSelected?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n variant?: \"default\" | \"brand\";\n}) {\n const focusRingColor =\n variant === \"brand\"\n ? \"focus-visible:outline-action-brand\"\n : \"focus-visible:outline-action-default\";\n const baseClasses = [\n focusRing(),\n focusRingColor,\n \"w-5 h-5 rounded-full border-2 bg-background-surface transition-all\",\n ];\n\n if (isDisabled) {\n baseClasses.push(\"border-border-muted forced-colors:!border-[GrayText]\");\n } else if (isInvalid) {\n baseClasses.push(\n \"border-feedback-error-border group-pressed:border-feedback-error-border dark:group-pressed:border-feedback-error-border forced-colors:!border-[Mark]\"\n );\n } else if (isSelected) {\n const actionColor = variant === \"brand\" ? \"action-brand\" : \"action-default\";\n baseClasses.push(\n `border-[7px] border-${actionColor} forced-colors:!border-[Highlight] group-pressed:border-${actionColor}-hover dark:group-pressed:border-${actionColor}-hover`\n );\n } else {\n baseClasses.push(\n \"border-border-default group-pressed:border-border-focus dark:group-pressed:border-border-focus\"\n );\n }\n\n return baseClasses.join(\" \");\n}\n\nexport function Radio(props: RadioProps) {\n const { variant } = useContext(RadioGroupContext);\n return (\n <RACRadio\n {...props}\n className={composeTailwindRenderProps(\n props.className,\n \"group flex items-center gap-2 text-sm text-text-body transition disabled:text-text-muted dark:text-text-body dark:disabled:text-text-muted forced-colors:disabled:text-[GrayText]\"\n )}\n >\n {(renderProps) => (\n <>\n <div className={getRadioStyles({ ...renderProps, variant })} />\n {props.children}\n </>\n )}\n </RACRadio>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { RadioGroup } from \"@/components/RadioGroup\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormRadioGroupProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof RadioGroup>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n}\n\nexport function FormRadioGroup<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormRadioGroupProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <RadioGroup\n {...rest}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n value={field.value as any}\n onChange={(v) => field.onChange(v)}\n errorMessage={error}\n >\n {rest.children}\n </RadioGroup>\n )}\n />\n );\n}\n","import React from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\nconst sizeVariants = {\n xs: \"text-lg font-semibold\",\n sm: \"text-xl font-semibold\",\n md: \"text-2xl font-semibold\",\n lg: \"text-3xl font-semibold\",\n xl: \"text-4xl font-semibold\",\n} as const;\n\nconst heightVariants = {\n page: \"h-16 leading-[62px]\",\n} as const;\n\nexport type HeadingSize = keyof typeof sizeVariants;\nexport type HeadingHeight = keyof typeof heightVariants;\n\n/**\n * Heading\n *\n * Typography component for page/section headings with size and height options.\n */\nexport interface HeadingProps {\n tag?: React.ElementType;\n size?: HeadingSize;\n height?: HeadingHeight;\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function Heading({\n tag: Tag = \"h1\",\n size = \"lg\",\n height,\n className = \"\",\n children,\n}: HeadingProps) {\n const sizeClasses = sizeVariants[size];\n const heightClasses = height ? heightVariants[height] : \"\";\n\n return <Tag className={twMerge(sizeClasses, heightClasses, className)}>{children}</Tag>;\n}\n","import React from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Button } from \"../Button\";\nimport { Heading } from \"../Heading\";\nimport { Icon } from \"../Icon\";\n\ntype BaseDialogHeaderProps = {\n title?: string;\n onClose?: () => void;\n hideCloseIcon?: boolean;\n titleAlign?: \"left\" | \"center\";\n headerContent?: React.ReactNode;\n};\n\ntype WithBackArrow = BaseDialogHeaderProps & {\n hasBackArrow: true;\n onBack: () => void;\n};\n\ntype WithoutBackArrow = BaseDialogHeaderProps & {\n hasBackArrow?: false;\n onBack?: never;\n};\n\n/**\n * DialogHeader\n *\n * Header area for dialogs with optional back arrow.\n */\nexport type DialogHeaderProps = WithBackArrow | WithoutBackArrow;\n\nexport const DialogHeader: React.FC<DialogHeaderProps> = ({\n title,\n onClose,\n hideCloseIcon = false,\n titleAlign = \"left\",\n hasBackArrow = false,\n onBack,\n headerContent,\n}) => {\n return (\n <div\n className={twMerge(\n \"relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6\",\n title && \"border-b\",\n titleAlign === \"center\" ? \"justify-center\" : \"\"\n )}\n >\n {hasBackArrow && (\n <Button variant=\"icon\" onPress={onBack} className=\"absolute left-6\" aria-label=\"Go back\">\n <Icon name=\"CaretLeft\" data-testid=\"back-arrow\" />\n </Button>\n )}\n {headerContent || (\n <>\n {title && <Heading size=\"xs\">{title}</Heading>}\n {onClose && !hideCloseIcon && (\n <Button variant=\"icon\" onPress={onClose} aria-label=\"Close dialog\">\n <Icon name=\"X\" data-testid=\"close-button\" />\n </Button>\n )}\n </>\n )}\n </div>\n );\n};\n","import { twMerge } from \"tailwind-merge\";\n\nexport interface LoaderProps {\n /**\n * Optional className for custom styling\n */\n className?: string;\n /**\n * Size of the loader in pixels\n * @default 24\n */\n size?: number;\n /**\n * Color of the loader\n * @default \"text-action-brand\"\n */\n color?: string;\n}\n\n/**\n * Loader\n *\n * Animated loading spinner component.\n * Displays a circular spinner with customizable size and color for loading states.\n */\nexport const Loader = ({ className, size = 24, color = \"text-action-brand\" }: LoaderProps) => {\n return (\n <div\n className={twMerge(\n \"inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent\",\n color,\n className\n )}\n style={{\n width: size,\n height: size,\n }}\n role=\"status\"\n aria-label=\"loading\"\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n};\n","\"use client\";\nimport React from \"react\";\nimport type {\n TextFieldProps as AriaTextFieldProps,\n TextFieldRenderProps,\n ValidationResult,\n} from \"react-aria-components\";\nimport { TextField as AriaTextFieldComponent } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport {\n BaseInputProps,\n ClearButton,\n Description,\n FieldError,\n getInputBaseStyles,\n Input,\n InputWrapper,\n Label,\n useInputFocus,\n} from \"../Field\";\nimport { Icon } from \"../Icon/Icon\";\nimport { Loader } from \"../Loader\";\n\nconst getTextFieldStyles = (props: {\n isInvalid?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n transparent?: boolean;\n size?: Size;\n showSearchIcon?: boolean;\n isClearable?: boolean;\n hasValue?: boolean;\n isPassword?: boolean;\n className?: string;\n}): string => {\n // Get base input styles\n const baseStyles = getInputBaseStyles({\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isFocused: props.isFocused,\n transparent: props.transparent,\n size: props.size,\n });\n\n // Add TextField-specific padding styles\n const paddingStyles = [\n props.showSearchIcon ? \"pl-8\" : \"pl-3\",\n (props.isClearable && props.hasValue) || props.isPassword ? \"pr-8\" : \"pr-3\",\n ].join(\" \");\n\n return twMerge(baseStyles, paddingStyles, props.className);\n};\n\n/**\n * TextField\n *\n * A controlled or uncontrolled text input with Edges styling, label,\n * description, error messaging, and optional affordances like a search icon,\n * clear button, and password visibility toggle. Wraps\n * `react-aria-components` TextField for accessible behavior.\n */\nexport interface TextFieldProps\n extends Omit<AriaTextFieldProps, \"isRequired\" | \"size\" | \"className\">,\n BaseInputProps {\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n placeholder?: string;\n tooltip?: string;\n isRequired?: boolean;\n className?: string;\n validationResult?: ValidationResult;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default true\n */\n reserveErrorSpace?: boolean;\n /**\n * Shows a loading spinner instead of the search icon (only applicable when showSearchIcon is true)\n * @default false\n */\n isLoading?: boolean;\n}\n\n/**\n * Renders an Edges TextField with label, description, validation states and\n * optional search/clear/password affordances.\n */\nexport function TextField({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n transparent,\n showSearchIcon,\n isClearable,\n onClear,\n type,\n validationResult,\n reserveErrorSpace = true,\n isLoading = false,\n ...props\n}: TextFieldProps) {\n const [showPassword, setShowPassword] = React.useState(false);\n const { isFocused, handleFocus, handleBlur } = useInputFocus();\n const isPassword = type === \"password\";\n\n return (\n <AriaTextFieldComponent\n {...props}\n isRequired={isRequired}\n className={composeTailwindRenderProps(props.className, \"group flex flex-col\")}\n >\n {({ isDisabled, isInvalid }: TextFieldRenderProps) => (\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n <InputWrapper>\n {showSearchIcon && (\n <div className=\"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 transform flex items-center\">\n {isLoading ? (\n <Loader size={16} color=\"text-text-muted\" />\n ) : (\n <Icon\n name=\"MagnifyingGlass\"\n className=\"h-4 w-4 text-text-muted translate-y-[0.5px]\"\n />\n )}\n </div>\n )}\n <Input\n size={size}\n disabled={isDisabled}\n type={isPassword ? (showPassword ? \"text\" : \"password\") : type}\n value={props.value as string | undefined}\n defaultValue={props.defaultValue as string | undefined}\n placeholder={props.placeholder}\n onFocus={(e) => handleFocus(e, props.onFocus)}\n onBlur={(e) => handleBlur(e, props.onBlur)}\n onChange={(e) => props.onChange?.(e.target.value)}\n className={getTextFieldStyles({\n isInvalid,\n isDisabled,\n isFocused,\n size,\n transparent,\n showSearchIcon,\n isClearable,\n hasValue: !!props.value,\n isPassword,\n className: typeof props.className === \"string\" ? props.className : undefined,\n })}\n />\n {isClearable && props.value && !isDisabled && (\n <ClearButton\n onClick={() => {\n if (onClear) {\n onClear();\n } else if (props.onChange) {\n props.onChange(\"\");\n }\n }}\n size={size}\n />\n )}\n {isPassword && !isDisabled && (\n <button\n type=\"button\"\n onClick={() => setShowPassword(!showPassword)}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body\"\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <Icon\n name={showPassword ? \"EyeSlash\" : \"Eye\"}\n size={size === \"sm\" ? 16 : 20}\n className=\"text-text-body\"\n />\n </button>\n )}\n </InputWrapper>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </div>\n )}\n </AriaTextFieldComponent>\n );\n}\n","\"use client\";\nimport Link from \"@tiptap/extension-link\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport { BubbleMenu } from \"@tiptap/react/menus\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport React, { useState } from \"react\";\nimport { Modal, Dialog as RACDialog } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Button } from \"../Button\";\nimport { DialogHeader } from \"../DialogHeader\";\nimport { Icon } from \"../Icon\";\nimport { ModalBackdrop } from \"../ModalBackdrop\";\nimport { TextField } from \"../TextField\";\n\nexport interface RichTextEditorProps {\n /**\n * The initial content of the editor\n */\n initialContent?: string;\n /**\n * Callback when the content changes\n */\n onChange?: (html: string) => void;\n /**\n * Additional className to apply to the editor\n */\n className?: string;\n /**\n * Whether the editor is disabled\n */\n isDisabled?: boolean;\n /**\n * Placeholder text when editor is empty\n */\n placeholder?: string;\n /**\n * ID for the editor element for label association\n */\n id?: string;\n}\n\nconst ToolbarButton = ({\n isActive = false,\n onPress,\n children,\n}: {\n isActive?: boolean;\n onPress: () => void;\n children: React.ReactNode;\n}) => (\n <Button variant={isActive ? \"secondary\" : \"ghost\"} size=\"sm\" onPress={onPress} className=\"p-1\">\n {children}\n </Button>\n);\n\ninterface LinkDialogProps {\n initialUrl: string;\n isOpen: boolean;\n onClose: () => void;\n onSubmit: (url: string) => void;\n}\n\nfunction LinkDialog({ initialUrl, isOpen, onClose, onSubmit }: LinkDialogProps) {\n const [url, setUrl] = useState(initialUrl);\n\n React.useEffect(() => {\n setUrl(initialUrl);\n }, [initialUrl]);\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n onSubmit(url);\n onClose();\n };\n\n return (\n <ModalBackdrop isDismissable isOpen={isOpen} onOpenChange={(isOpen) => !isOpen && onClose()}>\n <Modal isDismissable className=\"flex items-center justify-center p-4\">\n <RACDialog className=\"relative bg-background-surface rounded-lg shadow-xl max-w-md w-full\">\n <form onSubmit={handleSubmit}>\n <DialogHeader title=\"Insert Link\" onClose={onClose} />\n <div className=\"p-6\">\n <TextField\n label=\"URL\"\n type=\"url\"\n value={url}\n onChange={setUrl}\n autoFocus\n className=\"w-full\"\n />\n </div>\n <div className=\"flex justify-end gap-2 border-t border-border-muted p-4\">\n <Button variant=\"secondary\" onPress={onClose}>\n Cancel\n </Button>\n <Button type=\"submit\">Save</Button>\n </div>\n </form>\n </RACDialog>\n </Modal>\n </ModalBackdrop>\n );\n}\n\n/**\n * RichTextEditor\n *\n * A rich text editor with formatting capabilities including headings, bold, italic, lists, and links.\n * Built on top of TipTap/ProseMirror.\n */\nexport function RichTextEditor({\n initialContent = \"\",\n onChange,\n className,\n isDisabled = false,\n placeholder = \"Start typing...\",\n id,\n}: RichTextEditorProps) {\n const [isLinkDialogOpen, setIsLinkDialogOpen] = useState(false);\n const editor = useEditor({\n immediatelyRender: false,\n extensions: [\n StarterKit.configure({\n heading: {\n levels: [1, 2],\n },\n }),\n Link.configure({\n openOnClick: false,\n HTMLAttributes: {\n class:\n \"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer\",\n },\n }),\n ],\n content: initialContent,\n editable: !isDisabled,\n onUpdate: ({ editor }) => {\n onChange?.(editor.getHTML());\n },\n editorProps: {\n attributes: {\n class: twMerge(\n \"prose prose-sm max-w-none\",\n \"focus:outline-none\",\n \"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0\"\n ),\n },\n },\n });\n\n const handleLinkClick = () => {\n setIsLinkDialogOpen(true);\n };\n\n const handleLinkSubmit = (url: string) => {\n if (url === \"\") {\n editor?.chain().focus().unsetLink().run();\n } else {\n editor?.chain().focus().setLink({ href: url }).run();\n }\n };\n\n if (!editor) {\n return null;\n }\n\n return (\n <div\n id={id}\n data-richtexteditor\n className={twMerge(\n \"flex flex-col rounded-md border border-border-input bg-background-input\",\n \"outline-none focus-within:outline-none focus-within:border-border-input focus-within:ring-0 focus-within:shadow-none\",\n isDisabled && \"opacity-50\",\n className\n )}\n style={{ outline: \"none\" }}\n >\n {editor && (\n <>\n <BubbleMenu\n editor={editor}\n shouldShow={({ editor }) => editor.isActive(\"link\") && !isLinkDialogOpen}\n className=\"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md\"\n >\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-8 px-2\"\n onPress={() => {\n const href = editor.getAttributes(\"link\").href;\n window.open(href, \"_blank\");\n }}\n >\n <Icon name=\"ArrowSquareOut\" className=\"mr-1 h-4 w-4\" />\n Open\n </Button>\n <Button variant=\"ghost\" size=\"sm\" className=\"h-8 px-2\" onPress={handleLinkClick}>\n <Icon name=\"PencilSimple\" className=\"mr-1 h-4 w-4\" />\n Edit\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-8 px-2\"\n onPress={() => editor.chain().focus().unsetLink().run()}\n >\n <Icon name=\"X\" className=\"mr-1 h-4 w-4\" />\n Remove\n </Button>\n </BubbleMenu>\n\n <LinkDialog\n isOpen={isLinkDialogOpen}\n onClose={() => setIsLinkDialogOpen(false)}\n onSubmit={handleLinkSubmit}\n initialUrl={editor.getAttributes(\"link\").href || \"\"}\n />\n </>\n )}\n <div className=\"flex items-center gap-1 border-b border-border-input p-2\">\n <ToolbarButton\n isActive={editor.isActive(\"heading\", { level: 1 })}\n onPress={() => editor.chain().focus().toggleHeading({ level: 1 }).run()}\n >\n <span className=\"text-xs font-bold\">H1</span>\n </ToolbarButton>\n <ToolbarButton\n isActive={editor.isActive(\"heading\", { level: 2 })}\n onPress={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}\n >\n <span className=\"text-xs font-bold\">H2</span>\n </ToolbarButton>\n <ToolbarButton\n isActive={editor.isActive(\"bold\")}\n onPress={() => editor.chain().focus().toggleBold().run()}\n >\n <span className=\"text-xs font-bold\">B</span>\n </ToolbarButton>\n <ToolbarButton\n isActive={editor.isActive(\"italic\")}\n onPress={() => editor.chain().focus().toggleItalic().run()}\n >\n <span className=\"text-xs italic\">I</span>\n </ToolbarButton>\n <div className=\"mx-1 h-4 w-px bg-border-muted\" />\n <ToolbarButton\n isActive={editor.isActive(\"bulletList\")}\n onPress={() => editor.chain().focus().toggleBulletList().run()}\n >\n <Icon name=\"ListBullets\" className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n isActive={editor.isActive(\"orderedList\")}\n onPress={() => editor.chain().focus().toggleOrderedList().run()}\n >\n <Icon name=\"ListNumbers\" className=\"h-4 w-4\" />\n </ToolbarButton>\n <div className=\"mx-1 h-4 w-px bg-border-muted\" />\n <ToolbarButton isActive={editor.isActive(\"link\")} onPress={handleLinkClick}>\n <Icon name=\"PaperclipHorizontal\" className=\"h-4 w-4\" />\n </ToolbarButton>\n </div>\n <div className=\"relative min-h-[200px] w-full outline-none focus:outline-none\">\n <EditorContent\n editor={editor}\n className={twMerge(\n \"w-full p-4 outline-none focus:outline-none\",\n \"[&_.ProseMirror]:min-h-[inherit]\",\n \"[&_.ProseMirror]:outline-none [&_.ProseMirror]:focus:outline-none\",\n \"[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold\",\n \"[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold\",\n \"[&_.ProseMirror_p]:mb-2\",\n \"[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ul]:list-disc\",\n \"[&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6 [&_.ProseMirror_ol]:list-decimal\",\n \"[&_.ProseMirror_li]:mb-1\",\n \"[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic\",\n \"[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm\",\n \"[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm\",\n \"[&_.ProseMirror_hr]:border-border-muted\",\n isDisabled && \"pointer-events-none\"\n )}\n />\n {editor.isEmpty && !isDisabled && (\n <div className=\"pointer-events-none absolute left-4 top-4 text-text-muted\">\n {placeholder}\n </div>\n )}\n </div>\n </div>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { RichTextEditor } from \"@/components/RichTextEditor\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormRichTextEditorProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof RichTextEditor>, \"initialContent\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n /**\n * Label for the field\n */\n label?: string;\n /**\n * Description text shown below the field\n */\n description?: string;\n /**\n * Whether to reserve space for error messages\n * @default true\n */\n reserveErrorSpace?: boolean;\n}\n\nexport function FormRichTextEditor<T extends FieldValues>({\n name,\n defaultValue,\n label,\n description,\n reserveErrorSpace = true,\n ...rest\n}: FormRichTextEditorProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <div className=\"flex flex-col gap-1\">\n {label && (\n <label htmlFor={name} className=\"text-sm font-medium text-text-heading\">\n {label}\n </label>\n )}\n {description && <p className=\"text-sm text-text-muted\">{description}</p>}\n <RichTextEditor\n {...rest}\n id={name}\n initialContent={(field.value as unknown as string) ?? \"\"}\n onChange={(html) => field.onChange(html)}\n />\n {error && <p className=\"text-sm text-feedback-error-text\">{error}</p>}\n {reserveErrorSpace && !error && <div className=\"h-5\" />}\n </div>\n )}\n />\n );\n}\n","import * as React from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { Select } from \"@/components/Select\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormSelectProps<T extends FieldValues>\n extends Omit<\n // biome-ignore lint/suspicious/noExplicitAny: Select component typing\n React.ComponentProps<typeof Select<any>>,\n \"selectedKey\" | \"defaultSelectedKey\" | \"onSelectionChange\"\n > {\n name: FieldPath<T>;\n defaultValue?: Key | null;\n}\n\nexport function FormSelect<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormSelectProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <Select\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n {...(rest as any)}\n selectedKey={(field.value as unknown as Key) ?? null}\n onSelectionChange={(key) => field.onChange(key)}\n showErrors={!!error}\n errorMessage={error}\n />\n )}\n />\n );\n}\n","import React from \"react\";\nimport { Switch as AriaSwitch, SwitchProps as AriaSwitchProps } from \"react-aria-components\";\nimport { composeTailwindRenderProps, focusRing } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, \"children\"> {\n children: React.ReactNode;\n /**\n * Visual variant of the switch\n * @default \"default\"\n */\n variant?: \"default\" | \"brand\";\n /**\n * Size of the switch\n * @default \"md\"\n */\n size?: Size;\n}\n\n// Size configurations for track and handle\nconst sizeConfig = {\n sm: {\n track: \"h-4 w-7\",\n handle: \"h-3.5 w-3.5\",\n text: \"text-xs\",\n },\n md: {\n track: \"h-5 w-9\",\n handle: \"h-4 w-4\",\n text: \"text-sm\",\n },\n lg: {\n track: \"h-6 w-11\",\n handle: \"h-5 w-5\",\n text: \"text-base\",\n },\n xl: {\n track: \"h-7 w-14\",\n handle: \"h-6 w-6\",\n text: \"text-lg\",\n },\n} as const;\n\nfunction getTrackClassName({\n isSelected,\n isDisabled,\n variant = \"default\",\n size = \"md\",\n}: {\n isSelected: boolean;\n isDisabled: boolean;\n variant?: \"default\" | \"brand\";\n size?: Size;\n}) {\n const baseClasses =\n \"flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent\";\n const sizeClasses = sizeConfig[size].track;\n const focusRingClasses = focusRing;\n const focusRingColor =\n variant === \"brand\"\n ? \"focus-visible:outline-action-brand\"\n : \"focus-visible:outline-action-default\";\n\n let selectedClasses = \"\";\n if (isSelected) {\n if (variant === \"brand\") {\n selectedClasses =\n \"bg-action-brand forced-colors:!bg-[Highlight] group-pressed:bg-action-brand-hover\";\n } else {\n selectedClasses =\n \"bg-action-default forced-colors:!bg-[Highlight] group-pressed:bg-action-default-hover\";\n }\n } else {\n selectedClasses =\n \"bg-gray-400 dark:bg-zinc-400 group-pressed:bg-gray-500 dark:group-pressed:bg-zinc-300\";\n }\n\n const disabledClasses = isDisabled\n ? \"bg-gray-200 dark:bg-zinc-700 forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]\"\n : \"\";\n\n return [\n baseClasses,\n sizeClasses,\n focusRingClasses,\n focusRingColor,\n selectedClasses,\n disabledClasses,\n ]\n .filter(Boolean)\n .join(\" \");\n}\n\nfunction getHandleClassName({\n isSelected,\n isDisabled,\n size = \"md\",\n}: {\n isSelected: boolean;\n isDisabled: boolean;\n size?: Size;\n}) {\n const baseClasses =\n \"transform rounded-full bg-white dark:bg-zinc-900 outline-none shadow transition duration-200 ease-in-out\";\n const sizeClasses = sizeConfig[size].handle;\n const selectedClasses = isSelected ? \"translate-x-[100%]\" : \"translate-x-0\";\n const disabledClasses = isDisabled ? \"forced-colors:outline-[GrayText]\" : \"\";\n\n return [baseClasses, sizeClasses, selectedClasses, disabledClasses].filter(Boolean).join(\" \");\n}\n\n/**\n * Switch\n *\n * Toggle switch component for binary on/off states.\n * Provides an accessible alternative to checkboxes for settings and preferences.\n */\nexport function Switch({ children, variant = \"default\", size = \"md\", ...props }: SwitchProps) {\n return (\n <AriaSwitch\n {...props}\n className={composeTailwindRenderProps(\n props.className,\n `group flex items-center gap-2 ${sizeConfig[size].text} text-gray-800 transition disabled:text-gray-300 dark:text-zinc-200 dark:disabled:text-zinc-600 forced-colors:disabled:text-[GrayText]`\n )}\n >\n {(renderProps) => (\n <>\n <div className={getTrackClassName({ ...renderProps, variant, size })}>\n <span className={getHandleClassName({ ...renderProps, size })} />\n </div>\n {children}\n </>\n )}\n </AriaSwitch>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { Switch } from \"@/components/Switch\";\n\nexport interface FormSwitchProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof Switch>, \"isSelected\" | \"defaultSelected\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: boolean;\n}\n\nexport function FormSwitch<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormSwitchProps<T>) {\n const { control } = useFormContext<T>();\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <Switch {...rest} isSelected={!!field.value} onChange={(v) => field.onChange(v)}>\n {rest.children}\n </Switch>\n )}\n />\n );\n}\n","import React from \"react\";\nimport type { ValidationResult } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport {\n BaseInputProps,\n Description,\n FieldError,\n getInputBaseStyles,\n InputWrapper,\n Label,\n useInputFocus,\n} from \"../Field\";\n\nconst getTextAreaStyles = (props: {\n isInvalid?: boolean;\n isDisabled?: boolean;\n isResizable?: boolean;\n isFocused?: boolean;\n transparent?: boolean;\n size?: Size;\n className?: string;\n}): string => {\n // Get base input styles\n const baseStyles = getInputBaseStyles({\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isFocused: props.isFocused,\n transparent: props.transparent,\n size: props.size,\n });\n\n // Add TextArea-specific styles\n const textAreaStyles = `min-h-[100px] py-2 ${\n props.isDisabled ? \"resize-none\" : props.isResizable ? \"resize-y\" : \"resize-none\"\n }`;\n\n return twMerge(baseStyles, textAreaStyles, props.className);\n};\n\n/**\n * TextArea\n *\n * Multi-line text input with Edges styling, label, description, and error.\n */\nexport interface TextAreaProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"size\" | \"disabled\">,\n BaseInputProps {\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n tooltip?: string;\n size?: Size;\n isInvalid?: boolean;\n isDisabled?: boolean;\n /**\n * Allow user resizing of the textarea. Defaults to false (non-resizable).\n * When true, enables vertical resize.\n */\n isResizable?: boolean;\n validationResult?: ValidationResult;\n}\n\nexport function TextArea({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n required,\n transparent,\n isInvalid,\n isDisabled,\n isResizable = false,\n className,\n validationResult,\n reserveErrorSpace = true,\n ...props\n}: TextAreaProps) {\n const { isFocused, handleFocus, handleBlur } = useInputFocus();\n\n return (\n <div className=\"group flex flex-col\">\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={required}>\n {label}\n </Label>\n )}\n <InputWrapper>\n <textarea\n {...props}\n required={required}\n onFocus={(e) => {\n // Properly handle the textarea focus event\n if (props.onFocus) {\n props.onFocus(e);\n }\n handleFocus(e as unknown as React.FocusEvent<HTMLInputElement>);\n }}\n onBlur={(e) => {\n // Properly handle the textarea blur event\n if (props.onBlur) {\n props.onBlur(e);\n }\n handleBlur(e as unknown as React.FocusEvent<HTMLInputElement>);\n }}\n className={getTextAreaStyles({\n isInvalid,\n isDisabled,\n isResizable,\n isFocused,\n size,\n transparent,\n className,\n })}\n disabled={isDisabled}\n />\n </InputWrapper>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </div>\n </div>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { TextArea } from \"@/components/TextArea\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormTextAreaProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof TextArea>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n}\n\nexport function FormTextArea<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormTextAreaProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <TextArea\n {...rest}\n value={(field.value as unknown as string) ?? \"\"}\n onChange={(e) => field.onChange((e.target as HTMLTextAreaElement).value)}\n onBlur={(e) => {\n field.onBlur();\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n rest.onBlur?.(e as any);\n }}\n isInvalid={!!error}\n errorMessage={error}\n required={rest.required}\n />\n )}\n />\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { TextField } from \"@/components/TextField\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormTextFieldProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof TextField>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n}\n\nexport function FormTextField<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormTextFieldProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <TextField\n {...rest}\n value={(field.value as unknown as string) ?? \"\"}\n onChange={(v) => field.onChange(v)}\n onBlur={(e) => {\n field.onBlur();\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n rest.onBlur?.(e as any);\n }}\n isInvalid={!!error}\n errorMessage={error}\n isRequired={rest.isRequired}\n />\n )}\n />\n );\n}\n","\"use client\";\nimport {\n TimeField as AriaTimeField,\n TimeFieldProps as AriaTimeFieldProps,\n DateInput,\n DateSegment,\n TimeValue,\n ValidationResult,\n} from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport {\n BaseInputProps,\n Description,\n FieldError,\n getInputStateStyles,\n InputWrapper,\n Label,\n} from \"../Field\";\n\n/**\n * TimeField\n *\n * A segmented time input with Edges styling. Matches the API and styling\n * of TextField and DateField for consistency across form controls.\n */\nexport interface TimeFieldProps\n extends Omit<AriaTimeFieldProps<TimeValue>, \"isRequired\" | \"size\" | \"className\">,\n Omit<BaseInputProps, \"transparent\" | \"isClearable\" | \"onClear\"> {\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n placeholder?: string;\n tooltip?: string;\n isRequired?: boolean;\n className?: string;\n validationResult?: ValidationResult;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default true\n */\n reserveErrorSpace?: boolean;\n}\n\nfunction getSegmentStyles({\n isPlaceholder,\n isDisabled,\n size = \"md\",\n}: {\n isPlaceholder?: boolean;\n isDisabled?: boolean;\n size?: Size;\n}) {\n // Size styles with mobile font-size fix\n // iOS Safari zooms in on inputs with font-size < 16px when focused.\n // On mobile, we use text-base (16px) for sm/md sizes to prevent auto-zoom.\n // On desktop (md: breakpoint), we restore the original smaller sizes.\n const sizeStyles = {\n sm: \"text-base md:text-xs\",\n md: \"text-base md:text-sm\",\n lg: \"text-base\",\n xl: \"text-lg\",\n };\n\n return twMerge(\n // Base\n \"inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors\",\n sizeStyles[size],\n // Text color\n isPlaceholder ? \"text-text-placeholder italic\" : \"text-text-body\",\n // Disabled state\n isDisabled ? \"text-text-disabled cursor-not-allowed\" : \"cursor-text\",\n // Hover/focus\n !isDisabled && \"hover:bg-background-hover\",\n \"data-[focused]:bg-background-selected data-[focused]:text-text-body\"\n );\n}\n\n/**\n * Renders an Edges TimeField with label, description, validation states,\n * and segmented time input.\n */\nexport function TimeField({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n isDisabled,\n isInvalid,\n reserveErrorSpace = true,\n validationResult,\n className,\n ...props\n}: TimeFieldProps) {\n return (\n <AriaTimeField\n {...props}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isInvalid={isInvalid}\n className={composeTailwindRenderProps(className, \"flex flex-col gap-1\")}\n >\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n\n <InputWrapper>\n <DateInput\n className={twMerge(\n getInputStateStyles({\n isInvalid,\n isDisabled,\n }),\n // Padding and layout\n \"px-3 py-2 flex items-center gap-0.5 w-full\"\n )}\n >\n {(segment) => (\n <DateSegment\n segment={segment}\n className={getSegmentStyles({\n isPlaceholder: segment.isPlaceholder,\n isDisabled: !segment.isEditable || isDisabled,\n size,\n })}\n />\n )}\n </DateInput>\n </InputWrapper>\n\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </AriaTimeField>\n );\n}\n","import { Controller, FieldValues, Path, useFormContext } from \"react-hook-form\";\nimport { TimeField, TimeFieldProps } from \"@/components/TimeField\";\n\nexport interface FormTimeFieldProps<TFieldValues extends FieldValues = FieldValues>\n extends Omit<TimeFieldProps, \"name\" | \"value\" | \"onChange\" | \"isInvalid\"> {\n name: Path<TFieldValues>;\n}\n\nexport function FormTimeField<TFieldValues extends FieldValues = FieldValues>({\n name,\n ...props\n}: FormTimeFieldProps<TFieldValues>) {\n const {\n control,\n formState: { errors },\n } = useFormContext<TFieldValues>();\n\n const error = errors[name];\n const errorMessage = error?.message as string | undefined;\n\n return (\n <Controller\n name={name}\n control={control}\n render={({ field }) => (\n <TimeField\n {...props}\n value={field.value}\n onChange={field.onChange}\n isInvalid={!!error}\n errorMessage={errorMessage}\n />\n )}\n />\n );\n}\n","import * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport interface ErrorSummaryProps {\n className?: string;\n title?: string;\n autoFocus?: boolean;\n}\n\nexport function ErrorSummary({\n className,\n title = \"Please fix the following errors:\",\n autoFocus = true,\n}: ErrorSummaryProps) {\n const { formState } = useFormContext();\n const ref = React.useRef<HTMLDivElement | null>(null);\n\n const errors = formState.errors;\n const entries = Object.entries(errors || {});\n const hasErrors = entries.length > 0;\n\n React.useEffect(() => {\n if (autoFocus && hasErrors) {\n ref.current?.focus();\n }\n }, [autoFocus, hasErrors]);\n\n if (!hasErrors) return null;\n\n const handleJump = (name: string) => {\n const selector = `[name=\"${CSS.escape(name)}\"]`;\n const el = document.querySelector<HTMLElement>(selector);\n if (el) {\n el.focus();\n el.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\n }\n };\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n tabIndex={-1}\n className={twMerge(\n \"rounded-md border border-feedback-error-border bg-feedback-error-background p-3 text-sm text-feedback-error-text\",\n className\n )}\n >\n <div className=\"font-medium\">{title}</div>\n <ul className=\"mt-2 list-disc pl-5\">\n {entries.map(([name, err]) => {\n const message = (err as { message?: string })?.message || \"Invalid value\";\n return (\n <li key={name}>\n <button\n type=\"button\"\n className=\"underline underline-offset-2\"\n onClick={() => handleJump(name)}\n >\n {message}\n </button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n","import * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\nimport { Button } from \"@/components/Button\";\n\nexport interface SubmitButtonProps extends React.ComponentProps<typeof Button> {\n formId?: string;\n disableWhenInvalid?: boolean;\n disableWhenPristine?: boolean;\n}\n\nexport function SubmitButton({\n formId,\n disableWhenInvalid,\n disableWhenPristine,\n isDisabled,\n children,\n ...rest\n}: SubmitButtonProps) {\n const { formState } = useFormContext();\n const disabled =\n isDisabled ||\n formState.isSubmitting ||\n (disableWhenInvalid && !formState.isValid) ||\n (disableWhenPristine && !formState.isDirty);\n\n return (\n <Button type=\"submit\" form={formId} isDisabled={disabled} {...rest}>\n {children}\n </Button>\n );\n}\n","\"use client\";\n\nimport React, { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\ninterface SkeletonProps {\n width?: number | string;\n height?: number | string;\n variant?: \"text\" | \"rect\" | \"circle\";\n animation?: \"pulse\" | \"wave\" | \"none\";\n gradient?: boolean;\n flex?: boolean;\n stack?: (number | string)[]; // Array of widths for stacked skeletons\n responsive?: Record<string, string | number>;\n delay?: number;\n adjustAnimationSpeedBasedOnWidth?: boolean;\n ariaLabel?: string;\n className?: string;\n \"data-testid\"?: string;\n}\n\n/**\n * Skeleton\n *\n * Loading placeholder component that mimics content structure.\n * Supports various shapes, animations, and responsive configurations for skeleton screens.\n */\nexport const Skeleton: React.FC<SkeletonProps> = ({\n width,\n height,\n variant = \"rect\",\n animation = \"pulse\",\n gradient = false,\n flex = false,\n stack,\n responsive,\n delay = 0,\n adjustAnimationSpeedBasedOnWidth = false,\n ariaLabel,\n className,\n \"data-testid\": dataTestId,\n}) => {\n const [visible, setVisible] = useState(delay === 0);\n\n useEffect(() => {\n if (delay > 0) {\n const timer = setTimeout(() => setVisible(true), delay);\n return () => clearTimeout(timer);\n }\n }, [delay]);\n\n if (!visible) return null;\n\n // Base styles\n const baseClasses = gradient\n ? \"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]\"\n : \"bg-[var(--color-skeleton-base)]\";\n\n // Adjust animation speed dynamically based on width\n const animationSpeed =\n adjustAnimationSpeedBasedOnWidth && width\n ? (() => {\n const numWidth = typeof width === \"number\" ? width : parseFloat(String(width));\n return !isNaN(numWidth) ? `animation-duration-[${Math.max(0.8, numWidth / 100)}s]` : \"\";\n })()\n : \"\";\n\n // Animation styles\n const animationClasses =\n animation === \"pulse\"\n ? `animate-pulse ${animationSpeed}`\n : animation === \"wave\"\n ? `relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${animationSpeed}`\n : \"\";\n\n // Shape-specific styles\n let shapeClasses = \"rounded-sm\";\n if (variant === \"circle\") shapeClasses = \"rounded-full\";\n if (variant === \"text\") shapeClasses = \"h-4 w-full rounded-sm\";\n\n // Dynamic layout handling\n const layoutClasses = flex ? \"flex-1 min-w-0\" : \"\";\n\n // Responsive styles\n const responsiveStyles = responsive\n ? Object.entries(responsive)\n .map(([breakpoint, value]) => `${breakpoint}:w-[${value}]`)\n .join(\" \")\n : \"\";\n\n // Stacking Multiple Skeletons\n if (stack) {\n return (\n <div className=\"space-y-2\" data-testid={dataTestId}>\n {stack.map((lineWidth, index) => (\n <div\n key={index}\n className={twMerge(\n baseClasses,\n animationClasses,\n shapeClasses,\n layoutClasses,\n responsiveStyles,\n className\n )}\n style={{\n width: lineWidth,\n height,\n }}\n />\n ))}\n </div>\n );\n }\n\n return (\n <div\n className={twMerge(\n baseClasses,\n animationClasses,\n shapeClasses,\n layoutClasses,\n responsiveStyles,\n className\n )}\n style={{\n width,\n height,\n }}\n role=\"presentation\"\n aria-hidden={!ariaLabel}\n aria-label={ariaLabel ?? undefined}\n data-testid={dataTestId}\n />\n );\n};\n\ninterface SkeletonGroupProps {\n count?: number;\n children: React.ReactNode;\n className?: string;\n \"data-testid\"?: string;\n}\n\nexport const SkeletonGroup: React.FC<SkeletonGroupProps> = ({\n count = 1,\n children,\n className,\n \"data-testid\": dataTestId,\n}) => {\n return (\n <div className={className} data-testid={dataTestId}>\n {Array.from({ length: count }).map((_, index) => (\n <div key={index}>{children}</div>\n ))}\n </div>\n );\n};\n","import React from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Heading } from \"../Heading\";\nimport { Skeleton } from \"../Skeleton\";\n\n/**\n * Card - Enterprise surface container component\n *\n * A flexible, composable card component following enterprise design system best practices.\n * Supports modular content sections with consistent styling and accessibility.\n *\n * Usage:\n * ```tsx\n * <Card variant=\"outlined\" size=\"md\">\n * <Card.Header\n * title=\"Card Title\"\n * subtitle=\"Optional subtitle\"\n * actions={<Button variant=\"ghost\" icon=\"MoreHorizontal\" />}\n * />\n * <Card.Media src=\"image.jpg\" alt=\"Description\" />\n * <Card.Content>\n * <p>Main content goes here</p>\n * </Card.Content>\n * <Card.Footer>\n * <Button variant=\"brand\">Action</Button>\n * </Card.Footer>\n * </Card>\n * ```\n */\n\n// ——————————————————————————————————————————\n// Types\n// ——————————————————————————————————————————\n\nexport type CardVariant = \"outlined\" | \"elevated\" | \"filled\" | \"ghost\";\nexport interface CardProps {\n variant?: CardVariant;\n className?: string;\n children?: React.ReactNode;\n isLoading?: boolean;\n}\n\nexport interface CardHeaderProps {\n title?: React.ReactNode;\n subtitle?: React.ReactNode;\n actions?: React.ReactNode;\n className?: string;\n isLoading?: boolean;\n}\n\nexport interface CardMediaProps {\n src?: string;\n alt?: string;\n aspectRatio?: \"square\" | \"video\" | \"wide\" | \"auto\";\n className?: string;\n children?: React.ReactNode;\n isLoading?: boolean;\n}\n\nexport interface CardContentProps {\n className?: string;\n children?: React.ReactNode;\n isLoading?: boolean;\n}\n\nexport interface CardFooterProps {\n className?: string;\n children?: React.ReactNode;\n align?: \"start\" | \"end\" | \"center\" | \"between\";\n isLoading?: boolean;\n}\n\n// ——————————————————————————————————————————\n// Styles\n// ——————————————————————————————————————————\n\nconst cardVariantStyles: Record<CardVariant, string> = {\n outlined: \"bg-background-surface border border-border-default\",\n elevated: \"bg-background-surface border-0 shadow-md\",\n filled: \"bg-background-muted border-0\",\n ghost: \"bg-transparent border-0 shadow-none\",\n};\n\nconst cardBaseStyles = \"rounded-lg\";\n\nconst aspectRatioStyles = {\n square: \"aspect-square\",\n video: \"aspect-video\",\n wide: \"aspect-[2/1]\",\n auto: \"\",\n};\n\nconst footerAlignStyles = {\n start: \"justify-start\",\n end: \"justify-end\",\n center: \"justify-center\",\n between: \"justify-between\",\n};\n\n// ——————————————————————————————————————————\n// Main Card Component\n// ——————————————————————————————————————————\n\nexport function Card({ variant = \"outlined\", className, children, isLoading = false }: CardProps) {\n return (\n <div\n className={twMerge(\n \"w-full overflow-hidden\",\n cardVariantStyles[variant],\n cardBaseStyles,\n className\n )}\n data-testid=\"card\"\n >\n {isLoading ? (\n // Skeleton fills the card completely - respects height set on card\n <Skeleton width=\"100%\" height=\"100%\" className=\"rounded-none\" />\n ) : (\n children\n )}\n </div>\n );\n}\n\n// ——————————————————————————————————————————\n// Card Header\n// ——————————————————————————————————————————\n\nexport function CardHeader({\n title,\n subtitle,\n actions,\n className,\n isLoading = false,\n}: CardHeaderProps) {\n if (isLoading) {\n return (\n <div className={twMerge(\"p-6 pb-4\", className)}>\n <div className=\"flex justify-between items-start mb-1\">\n <Skeleton width={120} height={20} />\n <Skeleton width={24} height={24} />\n </div>\n {subtitle && <Skeleton width={200} height={16} />}\n </div>\n );\n }\n\n if (!title && !subtitle && !actions) {\n return null;\n }\n\n return (\n <div className={twMerge(\"p-6 pb-4\", className)}>\n <div className=\"flex justify-between items-start gap-4\">\n <div className=\"min-w-0 flex-1\">\n {title && (\n <div className=\"mb-1\">\n {typeof title === \"string\" ? (\n <Heading tag=\"h3\" size=\"sm\" className=\"text-text-heading\">\n {title}\n </Heading>\n ) : (\n title\n )}\n </div>\n )}\n {subtitle && <div className=\"text-sm text-text-muted\">{subtitle}</div>}\n </div>\n {actions && <div className=\"flex-shrink-0\">{actions}</div>}\n </div>\n </div>\n );\n}\n\n// ——————————————————————————————————————————\n// Card Media\n// ——————————————————————————————————————————\n\nexport function CardMedia({\n src,\n alt,\n aspectRatio = \"auto\",\n className,\n children,\n isLoading = false,\n}: CardMediaProps) {\n if (isLoading) {\n return (\n <div className={twMerge(\"bg-background-muted\", aspectRatioStyles[aspectRatio], className)}>\n <Skeleton width=\"100%\" height=\"100%\" />\n </div>\n );\n }\n\n if (children) {\n return (\n <div className={twMerge(\"overflow-hidden\", aspectRatioStyles[aspectRatio], className)}>\n {children}\n </div>\n );\n }\n\n if (!src) {\n return null;\n }\n\n return (\n <div className={twMerge(\"overflow-hidden\", aspectRatioStyles[aspectRatio], className)}>\n <img src={src} alt={alt || \"\"} className=\"w-full h-full object-cover\" loading=\"lazy\" />\n </div>\n );\n}\n\n// ——————————————————————————————————————————\n// Card Content\n// ——————————————————————————————————————————\n\nexport function CardContent({ className, children, isLoading = false }: CardContentProps) {\n // Extract padding classes from className - if any padding class is set, respect it\n const hasPadding = className?.match(/p(?:t|b|l|r|x|y)?-(?:\\d+(?:\\.\\d+)?|px|\\[.+?\\])/);\n const defaultPadding = hasPadding ? \"\" : \"px-6 py-4\";\n\n if (isLoading) {\n return (\n <div className={twMerge(defaultPadding, className)}>\n <div className=\"space-y-2\">\n <Skeleton width=\"100%\" height={16} />\n <Skeleton width=\"80%\" height={16} />\n <Skeleton width=\"60%\" height={16} />\n </div>\n </div>\n );\n }\n\n if (!children) {\n return null;\n }\n\n return <div className={twMerge(\"px-6 py-4 text-text-body\", className)}>{children}</div>;\n}\n\n// ——————————————————————————————————————————\n// Card Footer\n// ——————————————————————————————————————————\n\nexport function CardFooter({\n className,\n children,\n align = \"end\",\n isLoading = false,\n}: CardFooterProps) {\n if (isLoading) {\n return (\n <div className={twMerge(\"px-6 py-4 flex gap-2 justify-end\", className)}>\n <Skeleton width={80} height={32} />\n <Skeleton width={60} height={32} />\n </div>\n );\n }\n\n if (!children) {\n return null;\n }\n\n return (\n <div\n className={twMerge(\"px-6 py-4 flex items-center gap-2\", footerAlignStyles[align], className)}\n >\n {children}\n </div>\n );\n}\n\n// ——————————————————————————————————————————\n// Compound Component API\n// ——————————————————————————————————————————\n\nCard.Header = CardHeader;\nCard.Media = CardMedia;\nCard.Content = CardContent;\nCard.Footer = CardFooter;\n","import * as React from \"react\";\nimport { useFieldArray, useFormContext } from \"react-hook-form\";\nimport { Button } from \"@/components/Button\";\nimport { Card, CardContent, CardHeader } from \"@/components/Card\";\n\nexport interface FieldArrayListProps<TFieldValues> {\n name: string;\n getItemTitle?: (index: number) => string;\n renderItem: (index: number) => React.ReactNode;\n onAdd?: () => Partial<TFieldValues[keyof TFieldValues]>;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: Generic constraint for RHF\nexport function FieldArrayList<TFieldValues extends Record<string, any>>({\n name,\n getItemTitle,\n renderItem,\n onAdd,\n}: FieldArrayListProps<TFieldValues>) {\n const { control } = useFormContext<TFieldValues>();\n // biome-ignore lint/suspicious/noExplicitAny: RHF FieldArray typing complexity\n const { fields, append, remove, swap } = useFieldArray({ control, name: name as any });\n\n return (\n <div className=\"flex flex-col gap-3\">\n {fields.map((field, index) => (\n <Card key={field.id}>\n <CardHeader\n title={getItemTitle ? getItemTitle(index) : `Item ${index + 1}`}\n actions={\n <div className=\"flex gap-2\">\n {index > 0 && (\n <Button size=\"sm\" variant=\"secondary\" onPress={() => swap(index, index - 1)}>\n Up\n </Button>\n )}\n {index < fields.length - 1 && (\n <Button size=\"sm\" variant=\"secondary\" onPress={() => swap(index, index + 1)}>\n Down\n </Button>\n )}\n <Button size=\"sm\" variant=\"secondary\" onPress={() => remove(index)}>\n Remove\n </Button>\n </div>\n }\n />\n <CardContent>{renderItem(index)}</CardContent>\n </Card>\n ))}\n <div>\n {/* biome-ignore lint/suspicious/noExplicitAny: RHF FieldArray append typing */}\n <Button variant=\"secondary\" onPress={() => append((onAdd?.() || {}) as unknown as any)}>\n Add item\n </Button>\n </div>\n </div>\n );\n}\n","import { FormProps, Form as RACForm } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Form\n *\n * Accessibility-first form wrapper with consistent spacing.\n * Defaults to ARIA validation to use custom error styling instead of native browser tooltips.\n */\nexport function Form(props: FormProps) {\n return (\n <RACForm\n validationBehavior=\"aria\"\n {...props}\n className={twMerge(\"flex flex-col gap-6\", props.className)}\n />\n );\n}\n","export function focusFirstError(formEl: HTMLFormElement) {\n // Prefer elements explicitly marked invalid\n const invalidEl =\n formEl.querySelector<HTMLElement>(\n \"[aria-invalid='true'], .aria-invalid, [data-invalid='true']\"\n ) ||\n // Fallback: any input/select/textarea with aria-invalid\n formEl.querySelector<HTMLElement>(\n \"input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']\"\n ) ||\n // Last resort: first input/select/textarea\n formEl.querySelector<HTMLElement>(\"input, select, textarea\");\n\n if (invalidEl) {\n invalidEl.focus({ preventScroll: false });\n if (invalidEl instanceof HTMLElement) {\n invalidEl.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\n }\n }\n}\n","import * as React from \"react\";\nimport type { FieldValues, SubmitErrorHandler, SubmitHandler, UseFormProps } from \"react-hook-form\";\nimport { FormProvider as RHFProvider, useForm } from \"react-hook-form\";\nimport { Form } from \"@/components/Form\";\nimport { focusFirstError } from \"./utils/focusFirstError\";\n\nexport interface FormProviderProps<TFieldValues extends FieldValues = FieldValues>\n extends Omit<UseFormProps<TFieldValues>, \"values\"> {\n id?: string;\n onSubmit: SubmitHandler<TFieldValues>;\n onInvalid?: SubmitErrorHandler<TFieldValues>;\n children: React.ReactNode;\n /**\n * If true, automatically focuses and scrolls the first invalid field on submit.\n * @default true\n */\n shouldFocusError?: boolean;\n /** Additional className applied to underlying Form */\n className?: string;\n}\n\nexport function FormProvider<TFieldValues extends FieldValues = FieldValues>({\n id,\n onSubmit,\n onInvalid,\n children,\n shouldFocusError = true,\n className,\n ...formOptions\n}: FormProviderProps<TFieldValues>) {\n const methods = useForm<TFieldValues>(formOptions);\n\n const handleInvalid: SubmitErrorHandler<TFieldValues> = (errors, evt) => {\n if (shouldFocusError && id) {\n // Find form by ID and focus first error\n const form = document.getElementById(id) as HTMLFormElement | null;\n if (form) {\n focusFirstError(form);\n }\n }\n onInvalid?.(errors, evt);\n };\n\n return (\n <RHFProvider {...methods}>\n <Form id={id} className={className} onSubmit={methods.handleSubmit(onSubmit, handleInvalid)}>\n {children}\n </Form>\n </RHFProvider>\n );\n}\n","import { twMerge } from \"tailwind-merge\";\nimport { Button } from \"@/components/Button\";\n\nexport interface SaveBarProps {\n formId?: string;\n show: boolean;\n isSubmitting?: boolean;\n onCancel?: () => void;\n primaryLabel?: string;\n secondaryLabel?: string;\n className?: string;\n}\n\nexport function SaveBar({\n formId,\n show,\n isSubmitting,\n onCancel,\n primaryLabel = \"Save changes\",\n secondaryLabel = \"Cancel\",\n className,\n}: SaveBarProps) {\n if (!show) return null;\n\n return (\n <div\n className={twMerge(\n \"fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70\",\n className\n )}\n >\n <div className=\"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3\">\n <div className=\"text-sm text-text-muted\">You have unsaved changes</div>\n <div className=\"flex gap-2\">\n <Button variant=\"secondary\" onPress={onCancel}>\n {secondaryLabel}\n </Button>\n <Button type=\"submit\" form={formId} isDisabled={!!isSubmitting}>\n {isSubmitting ? \"Saving...\" : primaryLabel}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n","import { useFormContext } from \"react-hook-form\";\nimport { SaveBar } from \"@/form/SaveBar\";\n\nexport interface FormSaveBarProps {\n formId?: string;\n onCancel?: () => void;\n primaryLabel?: string;\n secondaryLabel?: string;\n className?: string;\n}\n\nexport function FormSaveBar({\n formId,\n onCancel,\n primaryLabel,\n secondaryLabel,\n className,\n}: FormSaveBarProps) {\n const { formState } = useFormContext();\n return (\n <SaveBar\n formId={formId}\n show={formState.isDirty}\n isSubmitting={formState.isSubmitting}\n onCancel={onCancel}\n primaryLabel={primaryLabel}\n secondaryLabel={secondaryLabel}\n className={className}\n />\n );\n}\n","import * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\n\n/**\n * When the form has submit errors, scroll to the first one.\n */\nexport function useScrollIntoViewOnError(enabled: boolean = true) {\n const { formState } = useFormContext();\n\n React.useEffect(() => {\n if (!enabled) return;\n if (!formState.isSubmitted) return;\n if (!formState.errors || Object.keys(formState.errors).length === 0) return;\n\n const el =\n document.querySelector<HTMLElement>(\n \"[aria-invalid='true'], .aria-invalid, [data-invalid='true']\"\n ) ||\n document.querySelector<HTMLElement>(\n \"input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']\"\n );\n if (el) {\n el.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\n }\n }, [enabled, formState.isSubmitted, formState.errors]);\n}\n","import * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\n\nexport interface UseAutoSaveOptions<TValues> {\n delayMs?: number;\n onAutoSave: (values: TValues) => Promise<void> | void;\n}\n\nexport function useAutoSave<TValues extends Record<string, unknown>>({\n delayMs = 800,\n onAutoSave,\n}: UseAutoSaveOptions<TValues>) {\n const { watch, formState, getValues } = useFormContext<TValues>();\n const timeoutRef = React.useRef<number | undefined>(undefined);\n\n React.useEffect(() => {\n const subscription = watch(() => {\n if (!formState.isDirty) return;\n if (timeoutRef.current) window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(async () => {\n const values = getValues();\n await onAutoSave(values);\n }, delayMs);\n });\n return () => {\n subscription.unsubscribe();\n if (timeoutRef.current) window.clearTimeout(timeoutRef.current);\n };\n }, [watch, formState.isDirty, getValues, delayMs, onAutoSave]);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../@react-aria/ssr/src/SSRProvider.tsx","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/utils.ts","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/useDefaultLocale.ts","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/context.tsx","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/useCollator.ts","../../../../node_modules/@react-aria/i18n/dist/packages/@react-aria/i18n/src/useFilter.ts","../../src/hooks/useDebounce.ts","../../src/utils/index.ts","../../src/utils/controlStyles.ts","../../src/components/Icon/Icon.tsx","../../src/components/Tooltip/Tooltip.tsx","../../src/components/Field/Field.tsx","../../src/components/Button/Button.tsx","../../src/components/ModalBackdrop/ModalBackdrop.tsx","../../src/components/Popover/Popover.tsx","../../src/components/Select/Select.tsx","../../src/components/ListBoxItem/ListBoxItem.tsx","../../src/components/Autocomplete/Autocomplete.tsx","../../src/integrations/rhf/adapters/_helpers.ts","../../src/integrations/rhf/adapters/FormAutocomplete.tsx","../../src/components/Checkbox/Checkbox.tsx","../../src/integrations/rhf/adapters/FormCheckbox.tsx","../../src/integrations/rhf/adapters/FormCheckboxGroup.tsx","../../src/components/ColorField/ColorField.tsx","../../src/integrations/rhf/adapters/FormColorField.tsx","../../src/components/Calendar/Calendar.tsx","../../src/components/DateField/DateField.tsx","../../src/integrations/rhf/adapters/FormDateField.tsx","../../src/components/FileUpload/FileUpload.tsx","../../src/integrations/rhf/adapters/FormFileUpload.tsx","../../src/components/NumberField/NumberField.tsx","../../src/integrations/rhf/adapters/FormNumberField.tsx","../../src/components/RadioGroup/RadioGroup.tsx","../../src/integrations/rhf/adapters/FormRadioGroup.tsx","../../src/components/Heading/Heading.tsx","../../src/components/DialogHeader/DialogHeader.tsx","../../src/components/Loader/Loader.tsx","../../src/components/TextField/TextField.tsx","../../src/components/RichTextEditor/RichTextEditor.tsx","../../src/integrations/rhf/adapters/FormRichTextEditor.tsx","../../src/integrations/rhf/adapters/FormSelect.tsx","../../src/components/Switch/Switch.tsx","../../src/integrations/rhf/adapters/FormSwitch.tsx","../../src/components/TextArea/TextArea.tsx","../../src/integrations/rhf/adapters/FormTextArea.tsx","../../src/integrations/rhf/adapters/FormTextField.tsx","../../src/components/TimeField/TimeField.tsx","../../src/integrations/rhf/adapters/FormTimeField.tsx","../../src/integrations/rhf/components/ErrorSummary.tsx","../../src/integrations/rhf/components/SubmitButton.tsx","../../src/components/Skeleton/Skeleton.tsx","../../src/components/Card/Card.tsx","../../src/integrations/rhf/FieldArrayList.tsx","../../src/components/Form/Form.tsx","../../src/integrations/rhf/utils/focusFirstError.ts","../../src/integrations/rhf/FormProvider.tsx","../../src/form/SaveBar.tsx","../../src/integrations/rhf/FormSaveBar.tsx","../../src/integrations/rhf/hooks/useScrollIntoViewOnError.ts","../../src/integrations/rhf/useAutoSave.ts"],"names":["$b5e257d569688ac6$var$defaultContext","$b5e257d569688ac6$var$SSRContext","$670gB$react","$b5e257d569688ac6$var$IsSSRContext","$b5e257d569688ac6$var$canUseDOM","$b5e257d569688ac6$var$componentIds","$b5e257d569688ac6$var$useCounter","isDisabled","ctx","$670gB$useContext","ref","$670gB$useRef","_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner","_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","currentOwner","prevComponentValue","$b5e257d569688ac6$var$useLegacySSRSafeId","defaultId","counter","prefix","$b5e257d569688ac6$var$useModernSSRSafeId","id","didSSR","$670gB$useState","$b5e257d569688ac6$export$535bd6ca7f90a273","$b5e257d569688ac6$var$getSnapshot","$b5e257d569688ac6$var$getServerSnapshot","$b5e257d569688ac6$var$subscribe","onStoreChange","$148a7a147e38ea7f$var$RTL_SCRIPTS","$148a7a147e38ea7f$var$RTL_LANGS","$148a7a147e38ea7f$export$702d680b21cbd764","localeString","locale","textInfo","lang","$1e5a04cdaf7d1af8$var$localeSymbol","$1e5a04cdaf7d1af8$export$f09106e7c6677ec5","$1e5a04cdaf7d1af8$var$currentLocale","$1e5a04cdaf7d1af8$var$listeners","$1e5a04cdaf7d1af8$var$updateLocale","listener","$1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a","isSSR","defaultLocale","setDefaultLocale","$ffhGL$useState","$ffhGL$useEffect","$18f2051aff69b9bf$var$I18nContext","$h9FiU$react","$18f2051aff69b9bf$export$43bb16f9c6d9e3f7","$h9FiU$useContext","$325a3faab7a68acd$var$cache","$325a3faab7a68acd$export$a16aca283550c30d","options","cacheKey","b","formatter","$bb77f239b46e8c72$export$3274cf84b703fff","collator","startsWith","$21ck9$useCallback","string","substring","endsWith","contains","scan","sliceLen","slice","$21ck9$useMemo","useDebounce","value","delay","debouncedValue","setDebouncedValue","useState","useEffect","timer","focusRing","showDefaultOutline","composeTailwindRenderProps","className","tw","composeRenderProps","twMerge","controlStyles","sizePresets","Icon","memo","name","size","color","weight","ariaLabel","props","IconComponent","PhosphorIcons","resolvedSize","iconClassName","jsx","IconWithContainer","variant","shape","containerSize","containerClassName","iconSize","resolvedContainerSize","containerClasses","styles","isEntering","isExiting","Tooltip","children","content","jsxs","TooltipTrigger","AriaTooltip","renderProps","OverlayArrow","useInputFocus","isFocused","setIsFocused","React","handleFocus","e","onFocus","handleBlur","onBlur","InputWrapper","ClearButton","onClick","getInputStateStyles","isInvalid","baseStyles","getInputBackgroundStyles","getInputMobileFontClass","getInputBaseStyles","transparent","getFieldGroupStyles","isFocusWithin","Label","tooltip","description","descriptionPlacement","isRequired","htmlFor","showTooltip","tooltipContent","showInlineDescription","labelContent","Description","FieldError","Input","variantStyles","widthStyles","disabledStyles","enabledStyles","badgePositionStyles","badgeVariantStyles","normalizeVariant","getButtonStyles","fullWidth","isLoading","normalizedVariant","focusRingColor","Button","icon","loadingText","loadingIndicator","iconPosition","iconWeight","href","badgeNumber","badgeVariant","badgePosition","style","target","rel","restProps","iconElement","Fragment","loadingNode","hasBadge","composedClassName","linkProps","_onPress","_onPressStart","_onPressEnd","_onPressChange","_onPressUp","_onAuxClick","_onContextMenu","_onDoubleClick","safeRestProps","buttonOrLink","RACLink","RACButton","ModalBackdrop","ModalOverlay","getPopoverStyles","disableGroup","enteringStyles","exitingStyles","Popover","showArrow","withBackdrop","isDismissable","isSubmenu","useSlottedContext","PopoverContext","offset","popoverContent","AriaPopover","Modal","SelectSizeContext","createContext","useSelectSize","useContext","getSelectValueClassName","useElementFocus","Select","label","errorMessage","items","renderItem","renderSelectedValue","controlledSelectedKey","defaultSelectedKey","onSelectionChange","placeholder","showErrors","reserveErrorSpace","placement","shouldFlip","menuWidth","internalSelectedKey","setInternalSelectedKey","triggerWidth","setTriggerWidth","selectedKey","displaySelectedItem","item","handleSelectionChange","key","selectRef","useRef","triggerRef","AriaSelect","isOpen","SelectValue","ListBox","ListBoxItem","contextSize","effectiveSize","AriaListBoxItem","iconSizeClassMap","inputPaddingLeftMap","itemHeightStylesObject","state","ComboBoxStateContext","AriaButton","getItemName","staticItems","sections","selectedItem","s","handleRestRequest","config","filterText","signal","baseUrl","params","finalUrl","response","json","error","handleGraphQLRequest","query","obj","Autocomplete","requestConfig","defaultFilter","validationResult","renderLeftIcon","renderSection","autoFocus","hideChevron","inputValue","setInputValue","debouncedInputValue","setError","textSizeClass","heightSizeClass","dynamicItems","updateTriggerWidth","useAsyncList","result","handleInternalSelectionChange","newName","handleInternalInputChange","text","currentSelectedItemName","ComboBox","section","Group","AriaInput","isPressed","sectionItems","ListBoxSection","Header","getFieldError","errors","segs","node","seg","msg","FormAutocomplete","defaultValue","rest","control","formState","useFormContext","Controller","field","CheckboxGroup","AriaCheckboxGroup","getCheckboxStyles","getBoxStyles","isSelected","isIndeterminate","colorStyles","actionColor","iconStyles","Checkbox","otherProps","AriaCheckbox","checkboxContent","Minus","Check","FormCheckbox","errorBelow","v","FormCheckboxGroup","isValidHexColor","hex","normalizeHexColor","char","ColorField","controlledValue","onChange","showColorSwatch","internalValue","setInternalValue","isPickerOpen","setIsPickerOpen","triggerElement","setTriggerElement","handleInputChange","useCallback","newValue","normalized","handlePickerChange","newColor","handleInputBlur","AriaTextFieldComponent","HexColorPicker","FormColorField","getCellStyles","Calendar","AriaCalendar","CalendarHeader","CalendarGrid","CalendarGridHeader","CalendarGridBody","date","CalendarCell","Text","direction","useLocale","buttonSize","Heading","AriaCalendarGridHeader","day","CalendarHeaderCell","DateField","showCalendar","isCalendarOpen","setIsCalendarOpen","handleCalendarSelect","AriaDateField","DateInput","DialogTrigger","Dialog","getSegmentStyles","isPlaceholder","hasCalendar","AriaDateInput","segment","DateSegment","FormDateField","FileUpload","onUrlChange","accept","maxSize","onUpload","showPreview","isDragging","setIsDragging","isUploading","setIsUploading","preview","setPreview","fileInputRef","handleFile","file","reader","url","err","handleDrop","handleRemove","DropZone","ImageIcon","X","Upload","FileTrigger","files","FormFileUpload","_","getNumberFieldStyles","NumberField","useId","AriaNumberField","FormNumberField","RadioGroupContext","RadioGroup","RACRadioGroup","FormRadioGroup","sizeVariants","heightVariants","Tag","height","sizeClasses","heightClasses","DialogHeader","title","onClose","hideCloseIcon","titleAlign","hasBackArrow","onBack","headerContent","Loader","getTextFieldStyles","paddingStyles","TextField","showSearchIcon","isClearable","onClear","type","showPassword","setShowPassword","isPassword","ToolbarButton","isActive","onPress","LinkDialog","initialUrl","onSubmit","setUrl","RACDialog","RichTextEditor","initialContent","isLinkDialogOpen","setIsLinkDialogOpen","editor","useEditor","StarterKit","Link","handleLinkClick","handleLinkSubmit","BubbleMenu","EditorContent","FormRichTextEditor","html","FormSelect","sizeConfig","getTrackClassName","baseClasses","focusRingClasses","selectedClasses","getHandleClassName","Switch","AriaSwitch","FormSwitch","getTextAreaStyles","textAreaStyles","TextArea","required","isResizable","FormTextArea","FormTextField","TimeField","AriaTimeField","FormTimeField","ErrorSummary","Qe","entries","hasErrors","handleJump","selector","el","message","SubmitButton","formId","disableWhenInvalid","disableWhenPristine","disabled","Skeleton","width","animation","gradient","flex","stack","responsive","adjustAnimationSpeedBasedOnWidth","dataTestId","visible","setVisible","animationSpeed","numWidth","animationClasses","shapeClasses","layoutClasses","responsiveStyles","breakpoint","lineWidth","index","cardVariantStyles","cardBaseStyles","aspectRatioStyles","footerAlignStyles","Card","CardHeader","subtitle","actions","CardMedia","src","alt","aspectRatio","CardContent","defaultPadding","CardFooter","align","FieldArrayList","getItemTitle","onAdd","fields","append","remove","swap","useFieldArray","Form","RACForm","focusFirstError","formEl","invalidEl","FormProvider","onInvalid","shouldFocusError","formOptions","methods","useForm","handleInvalid","evt","form","RHFProvider","SaveBar","show","isSubmitting","onCancel","primaryLabel","secondaryLabel","FormSaveBar","useScrollIntoViewOnError","enabled","Yo","useAutoSave","delayMs","onAutoSave","watch","getValues","timeoutRef","Ze","subscription","values"],"mappings":"grCAiCA,IAAMA,EAAAA,CAAkC,CACtC,MAAA,CAAQ,MAAA,CAAO,KAAK,KAAA,CAAM,IAAA,CAAK,MAAA,EAAM,CAAK,IAAA,CAAA,CAAA,CAC1C,QAAS,CACX,CAAA,CAEMC,GAAaC,WAAAA,CAAM,aAAA,CAA+BF,EAAA,CAAA,CAClDG,EAAAA,CAAeD,YAAM,aAAA,CAAc,KAAA,EAwDzC,IAAIE,EAAAA,CAAY,GACd,OAAO,MAAA,CAAW,GAAA,EAClB,MAAA,CAAO,UACP,MAAA,CAAO,QAAA,CAAS,eAGdC,EAAAA,CAAe,IAAI,QAEvB,SAASC,EAAAA,CAAWC,EAAa,KAAA,CAAK,CACpC,IAAIC,CAAAA,CAAMC,UAAAA,CAAWR,EAAA,CAAA,CACjBS,CAAAA,CAAMC,OAAsB,IAAA,CAAA,CAEhC,GAAID,CAAAA,CAAI,UAAY,IAAA,EAAQ,CAACH,EAAY,CAAA,IAWpBK,CAAAA,CAAAC,EAAnB,IAAIC,CAAAA,CAAAA,CAAeD,EAAAX,WAAAA,CAAM,kDAAA,IAAkD,MAAxDW,CAAAA,GAAA,MAAA,EAAA,CAAAD,EAAAC,CAAAA,CAA0D,iBAAA,IAAiB,MAA3ED,CAAAA,GAAA,MAAA,CAAA,MAAA,CAAAA,CAAAA,CAA6E,QAChG,GAAIE,CAAAA,CAAc,CAChB,IAAIC,CAAAA,CAAqBV,GAAa,GAAA,CAAIS,CAAA,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AA,CAAAC,CACF,EAAgC,CAC9B,GAAM,CAAE,KAAA,CAAAC,CAAAA,CAAO,UAAA7Q,CAAAA,CAAW,SAAA,CAAA8Q,CAAU,CAAA,CAAI7Q,gBAAwB,CAC1D8Q,CAAAA,CAAmBC,UAA2B,MAAS,CAAA,CAEvDA,aAAU,IAAM,CACpB,IAAMC,CAAAA,CAAeJ,CAAAA,CAAM,IAAM,CAC1B7Q,CAAAA,CAAU,UACX+Q,CAAAA,CAAW,OAAA,EAAS,OAAO,YAAA,CAAaA,CAAAA,CAAW,OAAO,CAAA,CAC9DA,EAAW,OAAA,CAAU,MAAA,CAAO,WAAW,SAAY,CACjD,IAAMG,CAAAA,CAASJ,CAAAA,GACf,MAAMF,CAAAA,CAAWM,CAAM,EACzB,CAAA,CAAGP,CAAO,CAAA,EACZ,CAAC,EACD,OAAO,IAAM,CACXM,CAAAA,CAAa,aAAY,CACrBF,CAAAA,CAAW,SAAS,MAAA,CAAO,YAAA,CAAaA,EAAW,OAAO,EAChE,CACF,CAAA,CAAG,CAACF,EAAO7Q,CAAAA,CAAU,OAAA,CAAS8Q,EAAWH,CAAAA,CAASC,CAAU,CAAC,EAC/D","file":"index.js","sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We must avoid a circular dependency with @react-aria/utils, and this useLayoutEffect is\n// guarded by a check that it only runs on the client side.\n// eslint-disable-next-line rulesdir/useLayoutEffectRule\nimport React, {JSX, ReactNode, useContext, useLayoutEffect, useMemo, useRef, useState} from 'react';\n\n// To support SSR, the auto incrementing id counter is stored in a context. This allows\n// it to be reset on every request to ensure the client and server are consistent.\n// There is also a prefix string that is used to support async loading components\n// Each async boundary must be wrapped in an SSR provider, which appends to the prefix\n// and resets the current id counter. This ensures that async loaded components have\n// consistent ids regardless of the loading order.\ninterface SSRContextValue {\n prefix: string,\n current: number\n}\n\n// Default context value to use in case there is no SSRProvider. This is fine for\n// client-only apps. In order to support multiple copies of React Aria potentially\n// being on the page at once, the prefix is set to a random number. SSRProvider\n// will reset this to zero for consistency between server and client, so in the\n// SSR case multiple copies of React Aria is not supported.\nconst defaultContext: SSRContextValue = {\n prefix: String(Math.round(Math.random() * 10000000000)),\n current: 0\n};\n\nconst SSRContext = React.createContext<SSRContextValue>(defaultContext);\nconst IsSSRContext = React.createContext(false);\n\nexport interface SSRProviderProps {\n /** Your application here. */\n children: ReactNode\n}\n\n// This is only used in React < 18.\nfunction LegacySSRProvider(props: SSRProviderProps): JSX.Element {\n let cur = useContext(SSRContext);\n let counter = useCounter(cur === defaultContext);\n let [isSSR, setIsSSR] = useState(true);\n let value: SSRContextValue = useMemo(() => ({\n // If this is the first SSRProvider, start with an empty string prefix, otherwise\n // append and increment the counter.\n prefix: cur === defaultContext ? '' : `${cur.prefix}-${counter}`,\n current: 0\n }), [cur, counter]);\n\n // If on the client, and the component was initially server rendered,\n // then schedule a layout effect to update the component after hydration.\n if (typeof document !== 'undefined') {\n // This if statement technically breaks the rules of hooks, but is safe\n // because the condition never changes after mounting.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return (\n <SSRContext.Provider value={value}>\n <IsSSRContext.Provider value={isSSR}>\n {props.children}\n </IsSSRContext.Provider>\n </SSRContext.Provider>\n );\n}\n\nlet warnedAboutSSRProvider = false;\n\n/**\n * When using SSR with React Aria in React 16 or 17, applications must be wrapped in an SSRProvider.\n * This ensures that auto generated ids are consistent between the client and server.\n */\nexport function SSRProvider(props: SSRProviderProps): JSX.Element {\n if (typeof React['useId'] === 'function') {\n if (process.env.NODE_ENV !== 'test' && process.env.NODE_ENV !== 'production' && !warnedAboutSSRProvider) {\n console.warn('In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.');\n warnedAboutSSRProvider = true;\n }\n return <>{props.children}</>;\n }\n return <LegacySSRProvider {...props} />;\n}\n\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\nlet componentIds = new WeakMap();\n\nfunction useCounter(isDisabled = false) {\n let ctx = useContext(SSRContext);\n let ref = useRef<number | null>(null);\n // eslint-disable-next-line rulesdir/pure-render\n if (ref.current === null && !isDisabled) {\n // In strict mode, React renders components twice, and the ref will be reset to null on the second render.\n // This means our id counter will be incremented twice instead of once. This is a problem because on the\n // server, components are only rendered once and so ids generated on the server won't match the client.\n // In React 18, useId was introduced to solve this, but it is not available in older versions. So to solve this\n // we need to use some React internals to access the underlying Fiber instance, which is stable between renders.\n // This is exposed as ReactCurrentOwner in development, which is all we need since StrictMode only runs in development.\n // To ensure that we only increment the global counter once, we store the starting id for this component in\n // a weak map associated with the Fiber. On the second render, we reset the global counter to this value.\n // Since React runs the second render immediately after the first, this is safe.\n // @ts-ignore\n let currentOwner = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;\n if (currentOwner) {\n let prevComponentValue = componentIds.get(currentOwner);\n if (prevComponentValue == null) {\n // On the first render, and first call to useId, store the id and state in our weak map.\n componentIds.set(currentOwner, {\n id: ctx.current,\n state: currentOwner.memoizedState\n });\n } else if (currentOwner.memoizedState !== prevComponentValue.state) {\n // On the second render, the memoizedState gets reset by React.\n // Reset the counter, and remove from the weak map so we don't\n // do this for subsequent useId calls.\n ctx.current = prevComponentValue.id;\n componentIds.delete(currentOwner);\n }\n }\n\n // eslint-disable-next-line rulesdir/pure-render\n ref.current = ++ctx.current;\n }\n\n // eslint-disable-next-line rulesdir/pure-render\n return ref.current;\n}\n\nfunction useLegacySSRSafeId(defaultId?: string): string {\n let ctx = useContext(SSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider,\n // provide a warning to hint to the developer to add one.\n if (ctx === defaultContext && !canUseDOM && process.env.NODE_ENV !== 'production') {\n console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');\n }\n\n let counter = useCounter(!!defaultId);\n let prefix = ctx === defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`;\n return defaultId || `${prefix}-${counter}`;\n}\n\nfunction useModernSSRSafeId(defaultId?: string): string {\n let id = React.useId();\n let [didSSR] = useState(useIsSSR());\n let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${defaultContext.prefix}`;\n return defaultId || `${prefix}-${id}`;\n}\n\n// Use React.useId in React 18 if available, otherwise fall back to our old implementation.\n/** @private */\nexport const useSSRSafeId: typeof useModernSSRSafeId | typeof useLegacySSRSafeId = typeof React['useId'] === 'function' ? useModernSSRSafeId : useLegacySSRSafeId;\n\nfunction getSnapshot() {\n return false;\n}\n\nfunction getServerSnapshot() {\n return true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction subscribe(onStoreChange: () => void): () => void {\n // noop\n return () => {};\n}\n\n/**\n * Returns whether the component is currently being server side rendered or\n * hydrated on the client. Can be used to delay browser-specific rendering\n * until after hydration.\n */\nexport function useIsSSR(): boolean {\n // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.\n if (typeof React['useSyncExternalStore'] === 'function') {\n return React['useSyncExternalStore'](subscribe, getSnapshot, getServerSnapshot);\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useContext(IsSSRContext);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// https://en.wikipedia.org/wiki/Right-to-left\nconst RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);\nconst RTL_LANGS = new Set(['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi']);\n\n/**\n * Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.\n */\nexport function isRTL(localeString: string): boolean {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n if (Intl.Locale) {\n let locale = new Intl.Locale(localeString).maximize();\n\n // Use the text info object to get the direction if possible.\n // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo\n let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;\n if (textInfo) {\n return textInfo.direction === 'rtl';\n }\n\n // Fallback: guess using the script.\n // This is more accurate than guessing by language, since languages can be written in multiple scripts.\n if (locale.script) {\n return RTL_SCRIPTS.has(locale.script);\n }\n }\n\n // If not, just guess by the language (first part of the locale)\n let lang = localeString.split('-')[0];\n return RTL_LANGS.has(lang);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Direction} from '@react-types/shared';\nimport {isRTL} from './utils';\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\n\nexport interface Locale {\n /** The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale. */\n locale: string,\n /** The writing direction for the locale. */\n direction: Direction\n}\n\n// Locale passed from server by PackageLocalizationProvider.\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\n\n/**\n * Gets the locale setting of the browser.\n */\nexport function getDefaultLocale(): Locale {\n let locale = typeof window !== 'undefined' && window[localeSymbol]\n // @ts-ignore\n || (typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage))\n || 'en-US';\n\n try {\n Intl.DateTimeFormat.supportedLocalesOf([locale]);\n } catch {\n locale = 'en-US';\n }\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n };\n}\n\nlet currentLocale = getDefaultLocale();\nlet listeners = new Set<(locale: Locale) => void>();\n\nfunction updateLocale() {\n currentLocale = getDefaultLocale();\n for (let listener of listeners) {\n listener(currentLocale);\n }\n}\n\n/**\n * Returns the current browser/system language, and updates when it changes.\n */\nexport function useDefaultLocale(): Locale {\n let isSSR = useIsSSR();\n let [defaultLocale, setDefaultLocale] = useState(currentLocale);\n\n useEffect(() => {\n if (listeners.size === 0) {\n window.addEventListener('languagechange', updateLocale);\n }\n\n listeners.add(setDefaultLocale);\n\n return () => {\n listeners.delete(setDefaultLocale);\n if (listeners.size === 0) {\n window.removeEventListener('languagechange', updateLocale);\n }\n };\n }, []);\n\n // We cannot determine the browser's language on the server, so default to\n // en-US. This will be updated after hydration on the client to the correct value.\n if (isSSR) {\n return {\n locale: 'en-US',\n direction: 'ltr'\n };\n }\n\n return defaultLocale;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isRTL} from './utils';\nimport {Locale, useDefaultLocale} from './useDefaultLocale';\nimport React, {JSX, ReactNode, useContext} from 'react';\n\nexport interface I18nProviderProps {\n /** Contents that should have the locale applied. */\n children: ReactNode,\n /** The locale to apply to the children. */\n locale?: string\n}\n\nconst I18nContext = React.createContext<Locale | null>(null);\n\ninterface I18nProviderWithLocaleProps extends I18nProviderProps {\n locale: string\n}\n\n/**\n * Internal component that handles the case when locale is provided.\n */\nfunction I18nProviderWithLocale(props: I18nProviderWithLocaleProps): JSX.Element {\n let {locale, children} = props; \n let value: Locale = React.useMemo(() => ({\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n }), [locale]);\n\n return (\n <I18nContext.Provider value={value}>\n {children}\n </I18nContext.Provider>\n );\n}\n\ninterface I18nProviderWithDefaultLocaleProps {\n children: ReactNode\n}\n\n/**\n * Internal component that handles the case when no locale is provided.\n */\nfunction I18nProviderWithDefaultLocale(props: I18nProviderWithDefaultLocaleProps): JSX.Element {\n let {children} = props;\n let defaultLocale = useDefaultLocale();\n\n return (\n <I18nContext.Provider value={defaultLocale}>\n {children}\n </I18nContext.Provider>\n );\n}\n\n/**\n * Provides the locale for the application to all child components.\n */\nexport function I18nProvider(props: I18nProviderProps): JSX.Element {\n let {locale, children} = props;\n\n // Conditionally render different components to avoid calling useDefaultLocale.\n // This is necessary because useDefaultLocale triggers a re-render.\n if (locale) {\n return <I18nProviderWithLocale locale={locale} children={children} />;\n }\n\n return <I18nProviderWithDefaultLocale children={children} />;\n}\n\n/**\n * Returns the current locale and layout direction.\n */\nexport function useLocale(): Locale {\n let defaultLocale = useDefaultLocale();\n let context = useContext(I18nContext);\n return context || defaultLocale;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useLocale} from './context';\n\nlet cache = new Map<string, Intl.Collator>();\n\n/**\n * Provides localized string collation for the current locale. Automatically updates when the locale changes,\n * and handles caching of the collator for performance.\n * @param options - Collator options.\n */\nexport function useCollator(options?: Intl.CollatorOptions): Intl.Collator {\n let {locale} = useLocale();\n\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey)!;\n }\n\n let formatter = new Intl.Collator(locale, options);\n cache.set(cacheKey, formatter);\n return formatter;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useMemo} from 'react';\nimport {useCollator} from './useCollator';\n\nexport interface Filter {\n /** Returns whether a string starts with a given substring. */\n startsWith(string: string, substring: string): boolean,\n /** Returns whether a string ends with a given substring. */\n endsWith(string: string, substring: string): boolean,\n /** Returns whether a string contains a given substring. */\n contains(string: string, substring: string): boolean\n}\n\n/**\n * Provides localized string search functionality that is useful for filtering or matching items\n * in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters.\n */\nexport function useFilter(options?: Intl.CollatorOptions): Filter {\n let collator = useCollator({\n usage: 'search',\n ...options\n });\n\n // TODO(later): these methods don't currently support the ignorePunctuation option.\n let startsWith = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n // Normalize both strings so we can slice safely\n // TODO: take into account the ignorePunctuation option as well...\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n return collator.compare(string.slice(0, substring.length), substring) === 0;\n }, [collator]);\n\n let endsWith = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n return collator.compare(string.slice(-substring.length), substring) === 0;\n }, [collator]);\n\n let contains = useCallback((string, substring) => {\n if (substring.length === 0) {\n return true;\n }\n\n string = string.normalize('NFC');\n substring = substring.normalize('NFC');\n\n let scan = 0;\n let sliceLen = substring.length;\n for (; scan + sliceLen <= string.length; scan++) {\n let slice = string.slice(scan, scan + sliceLen);\n if (collator.compare(substring, slice) === 0) {\n return true;\n }\n }\n\n return false;\n }, [collator]);\n\n return useMemo(() => ({\n startsWith,\n endsWith,\n contains\n }), [startsWith, endsWith, contains]);\n}\n","import { useEffect, useState } from \"react\";\n\nexport function useDebounce<T>(value: T, delay: number = 300): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay);\n\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n}\n","import { composeRenderProps } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport { ColorModeProvider, useColorMode } from \"./ColorModeProvider\";\n\n// Re-export formatting utilities from the new formatting module\nexport * from \"./formatting\";\n\n// Re-export time formatting utilities\nexport * from \"./timeFormat\";\n\nexport function focusRing(showDefaultOutline: boolean = false) {\n // Use data-[focus-visible] instead of :focus-visible to work with React Aria's focus management\n const baseClasses = showDefaultOutline\n ? \"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2\"\n : \"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2\";\n return `${baseClasses}`;\n}\n\nexport function composeTailwindRenderProps<T>(\n className: string | ((v: T) => string) | undefined,\n tw: string\n): string | ((v: T) => string) {\n return composeRenderProps(className, (className) => twMerge(tw, className));\n}\n","/**\n * Control-specific style utilities for form elements and interactive components.\n * These styles use CSS variables defined in the theme for consistent sizing\n * and spacing across all control elements.\n *\n * Text sizes follow the relationships defined in theme.css:\n * sm: --control-text-sm (maps to --text-xs)\n * md: --control-text-md (maps to --text-sm)\n * lg: --control-text-lg (maps to --text-base)\n * xl: --control-text-xl (maps to --text-lg)\n */\n\nexport type Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport const controlStyles = {\n sm: {\n text: \"text-[length:var(--control-text-sm)]\",\n height: \"h-[var(--control-sm-height)]\",\n padding: \"px-[var(--control-padding-sm)]\",\n paddingY: \"py-[var(--control-gap-sm)]\",\n gap: \"gap-[var(--control-gap-sm)]\",\n },\n md: {\n text: \"text-[length:var(--control-text-md)]\",\n height: \"h-[var(--control-md-height)]\",\n padding: \"px-[var(--control-padding-md)]\",\n paddingY: \"py-[var(--control-gap-md)]\",\n gap: \"gap-[var(--control-gap-md)]\",\n },\n lg: {\n text: \"text-[length:var(--control-text-lg)]\",\n height: \"h-[var(--control-lg-height)]\",\n padding: \"px-[var(--control-padding-lg)]\",\n paddingY: \"py-[var(--control-gap-lg)]\",\n gap: \"gap-[var(--control-gap-lg)]\",\n },\n xl: {\n text: \"text-[length:var(--control-text-xl)]\",\n height: \"h-[var(--control-xl-height)]\",\n padding: \"px-[var(--control-padding-xl)]\",\n paddingY: \"py-[var(--control-gap-xl)]\",\n gap: \"gap-[var(--control-gap-xl)]\",\n },\n} as const;\n","\"use client\";\nimport type { IconProps as PhosphorIconProps } from \"@phosphor-icons/react\";\nimport * as PhosphorIcons from \"@phosphor-icons/react\";\nimport { memo } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\n// Type for any Phosphor icon component\ntype PhosphorIconComponent = typeof PhosphorIcons.House;\n\n// Extract all icon names from the Phosphor package\nexport type PhosphorIconName = keyof typeof PhosphorIcons;\n\n// For backwards compatibility, export IconName as an alias\nexport type IconName = PhosphorIconName;\n\n// Standard size presets for the design system\nconst sizePresets = {\n xs: 16,\n sm: 20,\n md: 24,\n lg: 32,\n xl: 40,\n \"2xl\": 48,\n} as const;\n\ntype SizePreset = keyof typeof sizePresets;\n\ninterface IconProps extends Omit<PhosphorIconProps, \"size\"> {\n /**\n * The name of the Phosphor icon to render\n * Any valid icon from @phosphor-icons/react\n */\n name: PhosphorIconName;\n\n /**\n * Size of the icon - can be a preset or custom number\n */\n size?: SizePreset | number;\n\n /**\n * Accessibility label (maps to aria-label)\n */\n ariaLabel?: string;\n}\n\n/**\n * Icon\n *\n * Phosphor icon wrapper component with standardized sizing and styling.\n * Provides access to the full Phosphor icon library with tree-shaking support and design system presets.\n * - TypeScript autocomplete for all icon names\n *\n * Usage:\n * ```tsx\n * <Icon name=\"House\" size=\"md\" />\n * <Icon name=\"User\" size={32} className=\"text-brand\" />\n * ```\n */\nexport const Icon = memo(\n ({ name, size = \"md\", color, weight = \"regular\", className, ariaLabel, ...props }: IconProps) => {\n // Get the icon component from the Phosphor package\n const IconComponent = PhosphorIcons[name] as PhosphorIconComponent | undefined;\n\n if (!IconComponent) {\n if (process.env.NODE_ENV === \"development\") {\n console.error(`Icon \"${name}\" not found in @phosphor-icons/react`);\n }\n return null;\n }\n\n // Resolve size to pixel value\n const resolvedSize =\n typeof size === \"string\" && size in sizePresets ? sizePresets[size as SizePreset] : size;\n\n // Build className with design system defaults\n const iconClassName = twMerge(\n // Default styles\n \"inline-block flex-shrink-0\",\n // Allow color inheritance from parent\n !color && \"text-current\",\n // Custom classes\n className\n );\n\n return (\n <IconComponent\n {...props}\n size={resolvedSize as number}\n color={color}\n weight={weight}\n className={iconClassName}\n aria-label={ariaLabel || `${name} icon`}\n data-testid={`icon-${name}`}\n />\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n\n/**\n * Helper component for icons with containers\n */\ninterface IconWithContainerProps extends IconProps {\n /**\n * Container variant\n */\n variant?: \"subtle\" | \"solid\" | \"outline\";\n\n /**\n * Container shape\n */\n shape?: \"square\" | \"circle\";\n\n /**\n * Container size (adds padding around icon)\n */\n containerSize?: SizePreset | number;\n\n /**\n * Container background color\n */\n containerClassName?: string;\n}\n\nexport const IconWithContainer = memo(\n ({\n variant = \"subtle\",\n shape = \"square\",\n containerSize,\n containerClassName,\n size = \"md\",\n className,\n name,\n color,\n weight,\n ariaLabel,\n ref,\n ...props\n }: IconWithContainerProps & { ref?: React.Ref<HTMLDivElement> }) => {\n // Calculate container size if not specified\n const iconSize =\n typeof size === \"string\" && size in sizePresets ? sizePresets[size as SizePreset] : size;\n const resolvedContainerSize = containerSize\n ? typeof containerSize === \"string\" && containerSize in sizePresets\n ? sizePresets[containerSize as SizePreset]\n : containerSize\n : (iconSize as number) * 1.75; // Default to 1.75x icon size\n\n const containerClasses = twMerge(\n // Base styles\n \"inline-flex items-center justify-center flex-shrink-0\",\n\n // Shape\n shape === \"circle\" ? \"rounded-full\" : \"rounded-lg\",\n\n // Variant styles using Tailwind 4 CSS variables\n variant === \"subtle\" && \"bg-gray-100 dark:bg-gray-800\",\n variant === \"solid\" && \"bg-brand text-white\",\n variant === \"outline\" && \"border-2 border-current\",\n\n // Container className for overrides\n containerClassName\n );\n\n return (\n <div\n className={containerClasses}\n style={{\n width: resolvedContainerSize,\n height: resolvedContainerSize,\n }}\n >\n <Icon\n {...props}\n name={name}\n size={size}\n color={color}\n weight={weight}\n className={className}\n ariaLabel={ariaLabel}\n />\n </div>\n );\n }\n);\n\nIconWithContainer.displayName = \"IconWithContainer\";\n","import React from \"react\";\nimport {\n Tooltip as AriaTooltip,\n TooltipProps as AriaTooltipProps,\n composeRenderProps,\n OverlayArrow,\n TooltipTrigger,\n} from \"react-aria-components\";\n\n/**\n * Tooltip\n *\n * Lightweight content container that appears on hover/focus/press.\n */\nexport interface TooltipProps extends Omit<AriaTooltipProps, \"children\"> {\n children: React.ReactNode;\n content: React.ReactNode;\n}\n\nconst styles = ({\n isEntering,\n isExiting,\n className,\n}: {\n isEntering?: boolean;\n isExiting?: boolean;\n className?: string;\n}) => {\n const baseClasses =\n \"max-w-[200px] group bg-slate-700 dark:bg-slate-600 border border-slate-800 dark:border-white/10 shadow-[inset_0_1px_0_0_theme(colors.gray.600)] dark:shadow-none text-white text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1\";\n\n const enteringClasses = isEntering\n ? \"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200\"\n : \"\";\n\n const exitingClasses = isExiting\n ? \"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150\"\n : \"\";\n\n return [baseClasses, enteringClasses, exitingClasses, className].filter(Boolean).join(\" \");\n};\n\nexport function Tooltip({ children, content, ...props }: TooltipProps) {\n return (\n <TooltipTrigger delay={200}>\n {children}\n <AriaTooltip\n {...props}\n offset={10}\n className={composeRenderProps(props.className, (className, renderProps) =>\n styles({ ...renderProps, className })\n )}\n >\n <OverlayArrow>\n <svg\n width={8}\n height={8}\n viewBox=\"0 0 8 8\"\n className=\"fill-slate-700 stroke-gray-800 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-slate-600 dark:stroke-white/10 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]\"\n >\n <path d=\"M0 0 L4 4 L8 0\" />\n </svg>\n </OverlayArrow>\n {content}\n </AriaTooltip>\n </TooltipTrigger>\n );\n}\n","\"use client\";\n/**\n * Field Component System\n *\n * A comprehensive system for building form fields and input components with consistent\n * styling, accessibility, and behavior. This module provides both base components and\n * styling utilities that can be composed to create complex form controls.\n *\n * Key Features:\n * - Consistent styling across all form elements\n * - Built-in state handling (invalid, disabled, focused)\n * - Accessibility support out of the box\n * - Flexible composition through style utilities\n *\n * @example Basic Usage\n * ```tsx\n * <Label htmlFor=\"name\">Name</Label>\n * <Input id=\"name\" size=\"md\" />\n * ```\n *\n * @example Complex Field with All Components\n * ```tsx\n * <div>\n * <Label htmlFor=\"email\" tooltip=\"Enter your work email\">Email</Label>\n * <Input\n * id=\"email\"\n * type=\"email\"\n * isInvalid={hasError}\n * isDisabled={isSubmitting}\n * />\n * <Description>We'll never share your email</Description>\n * {hasError && <FieldError>Please enter a valid email</FieldError>}\n * </div>\n * ```\n */\n\nimport React from \"react\";\nimport type { TextProps } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { controlStyles, type Size } from \"../../utils/controlStyles\";\nimport { Icon } from \"../Icon/Icon\";\nimport { Tooltip } from \"../Tooltip/Tooltip\";\n\n// Base style props interface for all input-like components\nexport interface InputStyleProps {\n /** Whether the input is in an invalid state */\n isInvalid?: boolean;\n /** Whether the input is disabled */\n isDisabled?: boolean;\n /** Whether the input should have a transparent background */\n transparent?: boolean;\n /** The size variant of the input */\n size?: Size;\n /** Whether the input is currently focused */\n isFocused?: boolean;\n /** Additional CSS classes to apply */\n className?: string;\n}\n\n// Common interfaces\nexport interface BaseProps {\n /** The size variant of the component */\n size?: Size;\n /** Additional CSS classes to apply */\n className?: string;\n}\n\nexport type DescriptionPlacement = \"below\" | \"tooltip\" | \"inline\" | \"hidden\";\n\nexport interface BaseInputProps extends BaseProps {\n /** Whether the input should have a transparent background */\n transparent?: boolean;\n /** Whether to show a clear button when the input has a value */\n isClearable?: boolean;\n /** Callback when the clear button is clicked */\n onClear?: () => void;\n /** Whether to show a search icon */\n showSearchIcon?: boolean;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default true\n */\n reserveErrorSpace?: boolean;\n /**\n * Where to display the description text\n * - \"below\": Show below the field (default)\n * - \"tooltip\": Show as a tooltip on the label icon\n * - \"inline\": Show inline with the label\n * - \"hidden\": Don't display the description\n * @default \"below\"\n */\n descriptionPlacement?: DescriptionPlacement;\n}\n\nexport interface LabelProps extends BaseProps {\n /** The label content */\n children: React.ReactNode;\n /** Optional tooltip text to show next to the label */\n tooltip?: string;\n /** Optional description to show as tooltip or inline */\n description?: string;\n /** Where to display the description (only used if description is provided) */\n descriptionPlacement?: DescriptionPlacement;\n /** Whether to show a required field indicator (*) */\n isRequired?: boolean;\n /** The ID of the input this label is associated with */\n htmlFor?: string;\n}\n\nexport interface FieldErrorProps extends BaseProps {\n /** The error message to display */\n children: React.ReactNode;\n}\n\nexport interface InputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">,\n InputStyleProps {\n /** The size variant of the input */\n size?: Size;\n}\n\nexport interface DescriptionProps extends Omit<TextProps, \"className\">, BaseProps {\n /** The description content */\n children: React.ReactNode;\n}\n\nexport interface FieldGroupProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\">,\n InputStyleProps {\n /** Whether any child of the group is focused */\n isFocusWithin?: boolean;\n /** Children can be either a ReactNode or a render function */\n children?: React.ReactNode | ((props: InputStyleProps) => React.ReactNode);\n}\n\n/**\n * Hook for managing input focus state\n */\nexport function useInputFocus() {\n const [isFocused, setIsFocused] = React.useState(false);\n\n const handleFocus = React.useCallback(\n (\n e: React.FocusEvent<HTMLInputElement>,\n onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void\n ) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n []\n );\n\n const handleBlur = React.useCallback(\n (\n e: React.FocusEvent<HTMLInputElement>,\n onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void\n ) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n []\n );\n\n return { isFocused, handleFocus, handleBlur };\n}\n\n/**\n * Wrapper component for input containers\n */\nexport function InputWrapper({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) {\n return <div className={twMerge(\"relative w-full\", className)}>{children}</div>;\n}\n\n/**\n * Clear button component for inputs\n */\nexport function ClearButton({\n onClick,\n size = \"md\",\n className,\n}: {\n onClick: () => void;\n size?: Size;\n className?: string;\n}) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n onClick();\n }}\n className={twMerge(\n \"absolute right-2 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body\",\n className\n )}\n aria-label=\"Clear input\"\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <Icon name=\"X\" size={size === \"sm\" ? 16 : 20} />\n </button>\n );\n}\n\n/**\n * Generates state-specific styles for inputs based on their current state\n * (invalid, disabled, focused).\n *\n * State Priority:\n * 1. Disabled (overrides all other states)\n * 2. Invalid + Focused\n * 3. Invalid\n * 4. Focused\n * 5. Default\n *\n * @example\n * ```tsx\n * const styles = getInputStateStyles({ isInvalid: true, isFocused: true });\n * ```\n */\nexport function getInputStateStyles(props: {\n isInvalid?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n}) {\n const { isInvalid, isDisabled, isFocused } = props;\n const baseStyles = \"border rounded-[var(--control-border-radius)] !outline-none \";\n\n // Disabled state overrides all others\n if (isDisabled) {\n return `${baseStyles} border-border-muted`;\n }\n\n // Handle combinations of invalid and focus states\n if (isInvalid && isFocused) {\n return `${baseStyles} border-feedback-error-border shadow-[inset_0_0_0_1px_var(--color-feedback-error-border)]`;\n }\n\n if (isInvalid) {\n return `${baseStyles} border-feedback-error-border`;\n }\n\n if (isFocused) {\n return `${baseStyles} border-border-focus shadow-[inset_0_0_0_1px_var(--color-border-focus)]`;\n }\n\n // Default state - explicitly set border color\n return `${baseStyles} border-border-input`;\n}\n\n/**\n * Generates background styles based on the transparent and disabled props.\n * Uses Tailwind classes for consistent styling across light/dark modes.\n */\nexport function getInputBackgroundStyles(props: { transparent?: boolean; isDisabled?: boolean }) {\n if (props.isDisabled) {\n return \"bg-background-muted\";\n }\n return props.transparent ? \"bg-transparent\" : \"bg-background-input\";\n}\n\n/**\n * Returns the mobile font-size override class for input components.\n * iOS Safari zooms in on inputs with font-size < 16px when focused.\n * This ensures inputs use at least 16px on mobile to prevent auto-zoom,\n * while preserving the original size on desktop (768px+).\n *\n * Uses Tailwind responsive classes for proper handling by twMerge.\n */\nfunction getInputMobileFontClass(size: Size): string {\n // Only sm and md sizes need the override (they're < 16px)\n // lg and xl are already >= 16px\n // Use text-base (16px) on mobile, restore original size on md: breakpoint\n if (size === \"sm\") {\n return \"!text-base md:!text-[length:var(--control-text-sm)]\";\n }\n if (size === \"md\") {\n return \"!text-base md:!text-[length:var(--control-text-md)]\";\n }\n return \"\";\n}\n\n/**\n * Generates the complete set of base styles for input components.\n * This includes state styles, background, sizing, and custom classes.\n *\n * @example\n * ```tsx\n * const styles = getInputBaseStyles({\n * isInvalid: formState.hasError,\n * isDisabled: isLoading,\n * size: \"md\"\n * });\n * ```\n */\nexport function getInputBaseStyles(props: InputStyleProps) {\n const { isInvalid, isDisabled, isFocused, transparent, size = \"md\", className } = props;\n\n return twMerge(\n \"w-full\",\n getInputStateStyles({ isInvalid, isDisabled, isFocused }),\n getInputBackgroundStyles({ transparent, isDisabled }),\n controlStyles[size].text,\n controlStyles[size].height,\n controlStyles[size].padding,\n getInputMobileFontClass(size),\n className\n );\n}\n\n/**\n * Generates styles for grouped form elements (like input with buttons)\n *\n * @example\n * ```tsx\n * <div className={getFieldGroupStyles({ size: \"md\" })}>\n * <Input />\n * <Button>Submit</Button>\n * </div>\n * ```\n */\nexport function getFieldGroupStyles(props: FieldGroupProps) {\n const { size = \"md\", isFocusWithin, isInvalid, isDisabled, transparent, className } = props;\n\n return twMerge(\n \"group flex items-center rounded-[var(--control-border-radius)] overflow-hidden\",\n getInputBackgroundStyles({ transparent, isDisabled }),\n controlStyles[size].height,\n getInputStateStyles({ isFocused: isFocusWithin, isInvalid, isDisabled }),\n className\n );\n}\n\n// Components\n\n/**\n * Label component for form fields. Supports tooltips and required field indicators.\n *\n * @example\n * ```tsx\n * <Label\n * htmlFor=\"email\"\n * tooltip=\"Enter your work email\"\n * isRequired\n * >\n * Email Address\n * </Label>\n * ```\n */\nexport function Label({\n children,\n size = \"md\",\n tooltip,\n description,\n descriptionPlacement = \"below\",\n isRequired,\n className,\n htmlFor,\n}: LabelProps) {\n const showTooltip = tooltip || (description && descriptionPlacement === \"tooltip\");\n const tooltipContent = tooltip || description;\n const showInlineDescription = description && descriptionPlacement === \"inline\";\n\n const labelContent = (\n <label\n htmlFor={htmlFor}\n className={twMerge(\n controlStyles[size].text,\n \"!text-text-label font-semibold flex items-center gap-1\",\n className\n )}\n >\n {children}\n {isRequired && <span>*</span>}\n {showTooltip && (\n <span className=\"text-text-muted\">\n <Icon name=\"Info\" size={size === \"sm\" ? 16 : 20} />\n </span>\n )}\n {showInlineDescription && (\n <span className=\"text-text-caption font-normal ml-1\">{description}</span>\n )}\n </label>\n );\n\n if (showTooltip && tooltipContent) {\n return <Tooltip content={tooltipContent}>{labelContent}</Tooltip>;\n }\n\n return labelContent;\n}\n\n/**\n * Description component for providing additional context about a form field.\n *\n * @example\n * ```tsx\n * <Description>Must be at least 8 characters</Description>\n * ```\n */\nexport function Description({ size = \"md\", className, children, ...props }: DescriptionProps) {\n return (\n <div\n {...props}\n className={twMerge(\"leading-[2.25] text-text-caption\", controlStyles[size].text, className)}\n >\n {children}\n </div>\n );\n}\n\n/**\n * Error message component for form fields. Automatically handles\n * accessibility attributes for screen readers.\n *\n * @example\n * ```tsx\n * {hasError && <FieldError>This field is required</FieldError>}\n * ```\n */\nexport function FieldError({ children, size = \"md\", className }: FieldErrorProps) {\n return (\n <div\n role=\"alert\"\n className={twMerge(controlStyles[size].text, \"text-feedback-error-text\", className)}\n >\n {children}\n </div>\n );\n}\n\n/**\n * Base input component with consistent styling and state handling.\n * Extends the native input element with our custom styling system.\n *\n * @example\n * ```tsx\n * <Input\n * size=\"md\"\n * isInvalid={hasError}\n * isDisabled={isLoading}\n * transparent={false}\n * />\n * ```\n */\nexport function Input({\n size = \"md\",\n isInvalid,\n isDisabled,\n isFocused,\n transparent,\n className,\n ...props\n}: InputProps) {\n return (\n <input\n className={getInputBaseStyles({\n isInvalid,\n isDisabled,\n isFocused,\n transparent,\n size,\n className,\n })}\n {...props}\n />\n );\n}\n\n/**\n * Container for grouping form elements with consistent styling.\n * Useful for creating compound components like input with buttons.\n *\n * @example\n * ```tsx\n * <FieldGroup>\n * <Input placeholder=\"Search...\" />\n * <Button>Search</Button>\n * </FieldGroup>\n * ```\n */\nexport function FieldGroup(props: FieldGroupProps) {\n const { children, ...rest } = props;\n return (\n <div {...rest} className={getFieldGroupStyles(props)}>\n {typeof children === \"function\" ? children(props) : children}\n </div>\n );\n}\n","import type { ComponentProps, ReactNode } from \"react\";\nimport {\n ButtonRenderProps,\n LinkRenderProps,\n Button as RACButton,\n ButtonProps as RACButtonProps,\n Link as RACLink,\n LinkProps as RACLinkProps,\n} from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { focusRing } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport { controlStyles } from \"../../utils/controlStyles\";\nimport { Icon } from \"../Icon\";\n\ntype IconName = ComponentProps<typeof Icon>[\"name\"];\n\ntype BaseButtonProps = Omit<RACButtonProps, \"className\">;\n\n/**\n * Button\n *\n * A versatile action component that supports multiple visual variants, sizes,\n * optional icons, a loading state, and badge indicators. Follows the Edges\n * design system tokens and composes `react-aria-components` under the hood.\n *\n * Example usage:\n * ```tsx\n * <Button variant=\"brand\" size=\"md\" icon=\"Check\">Save</Button>\n * ```\n */\nexport interface ButtonProps extends BaseButtonProps {\n variant?:\n | \"default\"\n | \"brand\"\n | \"secondary\"\n | \"destructive\"\n | \"icon\"\n | \"link\"\n | \"unstyled\"\n | \"ghost\"\n | \"primary\";\n size?: Size;\n badgeNumber?: number;\n badgeVariant?: \"primary\" | \"destructive\";\n badgePosition?: \"top-right\" | \"top-left\" | \"bottom-right\" | \"bottom-left\";\n fullWidth?: boolean;\n icon?: IconName;\n iconWeight?: \"thin\" | \"light\" | \"regular\" | \"bold\" | \"fill\" | \"duotone\";\n iconPosition?: \"left\" | \"right\";\n isLoading?: boolean;\n loadingText?: string;\n loadingIndicator?: React.ReactNode;\n className?: string;\n href?: string;\n target?: string;\n rel?: string;\n style?: React.CSSProperties;\n}\n\nconst baseStyles =\n \"flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border\";\n\nconst variantStyles = {\n default:\n \"bg-action-default text-[color:var(--color-action-default-text)] hover:bg-action-default-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent\",\n brand:\n \"bg-action-brand text-[color:var(--color-action-brand-text)] hover:bg-action-brand-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent\",\n secondary:\n \"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]\",\n ghost:\n \"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]\",\n destructive:\n \"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]\",\n link: \"!text-action-brand hover:text-action-brand/90 hover:underline hover:decoration-2 hover:underline-offset-4\",\n icon: \"border-none text-text-body hover:bg-background-hover hover:text-text-heading forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]\",\n unstyled: \"bg-transparent\",\n} as const;\n\nconst widthStyles = {\n full: \"w-full\",\n default: \"w-fit\",\n};\n\nconst disabledStyles = \"opacity-50 cursor-not-allowed pointer-events-none\";\nconst enabledStyles = \"opacity-100 cursor-pointer\";\n\nconst badgePositionStyles = {\n \"top-right\": \"-right-2 -top-2\",\n \"top-left\": \"-left-2 -top-2\",\n \"bottom-right\": \"-right-2 -bottom-2\",\n \"bottom-left\": \"-left-2 -bottom-2\",\n} as const;\n\nconst badgeVariantStyles = {\n primary: \"bg-action-brand text-white\",\n destructive: \"bg-action-destructive text-white\",\n} as const;\n\nfunction normalizeVariant(\n variant: ButtonProps[\"variant\"]\n): \"default\" | \"brand\" | \"secondary\" | \"destructive\" | \"icon\" | \"link\" | \"unstyled\" | \"ghost\" {\n if (!variant) {\n return \"default\";\n }\n\n if (variant === \"primary\") {\n return \"brand\";\n }\n\n return variant;\n}\n\nfunction getButtonStyles(props: ButtonProps) {\n const {\n variant = \"default\",\n size = \"md\",\n isDisabled,\n fullWidth = false,\n isLoading = false,\n } = props;\n\n const normalizedVariant = normalizeVariant(variant);\n\n let styles =\n normalizedVariant === \"unstyled\" ? \"\" : `${baseStyles} ${variantStyles[normalizedVariant]}`;\n\n // Add size styles using controlStyles\n if (normalizedVariant !== \"unstyled\") {\n styles += ` ${controlStyles[size].text} ${controlStyles[size].height} ${controlStyles[size].padding} ${controlStyles[size].gap}`;\n }\n\n if (isDisabled || isLoading) {\n styles += ` ${disabledStyles}`;\n } else {\n styles += ` ${enabledStyles}`;\n }\n\n if (fullWidth) {\n styles += ` ${widthStyles.full}`;\n } else {\n styles += ` ${widthStyles.default}`;\n }\n\n const focusRingColor =\n normalizedVariant === \"brand\" ? \"focus-visible:outline-action-brand\" : undefined;\n\n return [styles, focusRing(), focusRingColor].filter(Boolean).join(\" \");\n}\n\n/**\n * Renders an Edges Button. When `href` is provided, renders a link-styled\n * button using the same visual system.\n */\nexport function Button(props: ButtonProps) {\n const {\n icon,\n children,\n isLoading = false,\n loadingText,\n loadingIndicator,\n size = \"md\",\n iconPosition = \"left\",\n iconWeight,\n href,\n className,\n badgeNumber,\n badgeVariant = \"primary\",\n badgePosition = \"top-right\",\n style,\n target,\n rel,\n ...restProps\n } = props;\n\n // Shared icon logic\n const iconElement = icon ? <Icon name={icon} size={size} weight={iconWeight} /> : null;\n\n // Shared content logic\n const content = (\n <>\n {iconPosition === \"left\" && iconElement}\n {typeof children === \"function\" ? null : children}\n {iconPosition === \"right\" && iconElement}\n </>\n );\n\n // Loading state\n const loadingNode = (\n <div className=\"relative inline-flex items-center justify-center\">\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {loadingIndicator || (\n <Icon name=\"CircleNotch\" size={size} className=\"animate-spin\" aria-hidden=\"true\" />\n )}\n </div>\n <div className=\"invisible\" aria-hidden=\"true\">\n {content}\n </div>\n {loadingText && (\n <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {loadingText}\n </span>\n )}\n </div>\n );\n\n // Compose className using twMerge to properly handle Tailwind class conflicts\n const hasBadge = (badgeNumber ?? 0) > 0;\n const composedClassName = twMerge(getButtonStyles(props), className);\n\n // Create link-specific props by filtering out button-specific props\n const linkProps: Partial<RACLinkProps> = href\n ? {\n href,\n target,\n rel,\n // Only include props that are valid for both Button and Link\n ...(restProps as Record<string, unknown>),\n }\n : {};\n\n // Remove button-specific event handlers that don't apply to links\n if (href) {\n const {\n onPress: _onPress,\n onPressStart: _onPressStart,\n onPressEnd: _onPressEnd,\n onPressChange: _onPressChange,\n onPressUp: _onPressUp,\n onAuxClick: _onAuxClick,\n onContextMenu: _onContextMenu,\n onDoubleClick: _onDoubleClick,\n ...safeRestProps\n } = restProps as Record<string, unknown>;\n Object.assign(linkProps, safeRestProps);\n }\n\n // Compose the button or link element\n const buttonOrLink = href ? (\n <RACLink\n {...linkProps}\n {...(isLoading && { \"aria-busy\": true })}\n style={hasBadge ? undefined : style}\n className={composedClassName}\n >\n {isLoading\n ? loadingNode\n : typeof children === \"function\"\n ? (function (renderProps: LinkRenderProps & { defaultChildren: ReactNode }) {\n return (\n <>\n {iconPosition === \"left\" && iconElement}\n {children(\n renderProps as unknown as ButtonRenderProps & { defaultChildren: ReactNode }\n )}\n {iconPosition === \"right\" && iconElement}\n </>\n );\n } as (props: LinkRenderProps & { defaultChildren: ReactNode }) => ReactNode)\n : content}\n </RACLink>\n ) : (\n <RACButton\n {...restProps}\n {...(isLoading && { \"aria-busy\": true })}\n style={hasBadge ? undefined : style}\n className={composedClassName}\n >\n {isLoading\n ? loadingNode\n : typeof children === \"function\"\n ? (function (renderProps: ButtonRenderProps & { defaultChildren: ReactNode }) {\n return (\n <>\n {iconPosition === \"left\" && iconElement}\n {children(renderProps)}\n {iconPosition === \"right\" && iconElement}\n </>\n );\n } as (props: ButtonRenderProps & { defaultChildren: ReactNode }) => ReactNode)\n : content}\n </RACButton>\n );\n\n // Render badge if badgeNumber is provided and > 0\n if (hasBadge) {\n return (\n <div className={twMerge(\"relative flex\", className)} style={style}>\n {buttonOrLink}\n <span\n className={`absolute ${badgePositionStyles[badgePosition]} flex h-5 w-5 items-center justify-center rounded-full ${badgeVariantStyles[badgeVariant]} text-xs font-medium`}\n aria-label={`${badgeNumber} items`}\n >\n {badgeNumber}\n </span>\n </div>\n );\n }\n\n return buttonOrLink;\n}\n","import { composeRenderProps, ModalOverlay, ModalOverlayProps } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport interface ModalBackdropProps extends ModalOverlayProps {\n /**\n * Whether to use a transparent backdrop instead of dark overlay\n * @default false\n */\n transparent?: boolean;\n /**\n * Additional CSS classes for the backdrop\n */\n className?: string;\n}\n\n/**\n * ModalBackdrop\n *\n * Shared backdrop/overlay component used by Dialog and Drawer.\n * Wraps React Aria's ModalOverlay with consistent styling and smooth animations.\n */\nexport function ModalBackdrop({\n transparent = false,\n className,\n children,\n ...props\n}: ModalBackdropProps) {\n return (\n <ModalOverlay\n {...props}\n className={composeRenderProps(className, (className, renderProps) => {\n return twMerge(\n // Base positioning and layering\n \"fixed inset-0 z-50\",\n // Remove focus outlines from modal overlay\n \"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0\",\n // Backdrop styling - subtle gradient for depth\n transparent\n ? \"bg-transparent\"\n : [\n \"bg-gradient-to-br from-black/20 via-black/15 to-black/20\",\n \"backdrop-blur-[2px]\",\n \"supports-[backdrop-filter]:bg-black/15\",\n ].join(\" \"),\n // Smooth animations\n renderProps.isEntering && [\"animate-in fade-in\", \"duration-300 ease-out\"].join(\" \"),\n renderProps.isExiting && [\"animate-out fade-out\", \"duration-200 ease-in\"].join(\" \"),\n className\n );\n })}\n >\n {children}\n </ModalOverlay>\n );\n}\n","import React from \"react\";\nimport {\n Popover as AriaPopover,\n PopoverProps as AriaPopoverProps,\n composeRenderProps,\n Modal,\n OverlayArrow,\n PopoverContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport { ModalBackdrop } from \"../ModalBackdrop\";\n\n/**\n * Popover\n *\n * Positioned overlay container with optional arrow, built on\n * `react-aria-components` Popover.\n */\nexport interface PopoverProps extends Omit<AriaPopoverProps, \"children\"> {\n /**\n * Whether to show an arrow pointing to the trigger\n * @default false\n */\n showArrow?: boolean;\n /**\n * Whether to include a backdrop (makes it modal)\n * @default false\n */\n withBackdrop?: boolean;\n /**\n * Whether the backdrop/modal can be dismissed by clicking outside\n * Only applies when withBackdrop is true\n * @default true\n */\n isDismissable?: boolean;\n /**\n * Whether to disable the group class (prevents group-hover propagation to children)\n * Useful for calendars and other components that use their own group-hover states\n * @default false\n */\n disableGroup?: boolean;\n /**\n * Popover content\n */\n children: React.ReactNode;\n}\n\nfunction getPopoverStyles({\n isEntering,\n isExiting,\n className = \"\",\n disableGroup = false,\n}: {\n isEntering?: boolean;\n isExiting?: boolean;\n className?: string;\n disableGroup?: boolean;\n}) {\n const baseStyles = [\n !disableGroup && \"group\",\n \"bg-background-surface\",\n \"forced-colors:bg-[Canvas]\",\n \"shadow-lg\",\n \"rounded-[var(--control-border-radius)]\",\n \"bg-clip-padding\",\n \"border\",\n \"border-border-default\",\n \"outline-none\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n const enteringStyles = isEntering\n ? [\n \"animate-in\",\n \"fade-in\",\n \"placement-bottom:slide-in-from-top-1\",\n \"placement-top:slide-in-from-bottom-1\",\n \"placement-left:slide-in-from-right-1\",\n \"placement-right:slide-in-from-left-1\",\n \"ease-out\",\n \"duration-200\",\n ].join(\" \")\n : \"\";\n\n const exitingStyles = isExiting\n ? [\n \"animate-out\",\n \"fade-out\",\n \"placement-bottom:slide-out-to-top-1\",\n \"placement-top:slide-out-to-bottom-1\",\n \"placement-left:slide-out-to-right-1\",\n \"placement-right:slide-out-to-left-1\",\n \"ease-in\",\n \"duration-150\",\n ].join(\" \")\n : \"\";\n\n return [baseStyles, enteringStyles, exitingStyles, className].filter(Boolean).join(\" \");\n}\n\nexport function Popover({\n children,\n showArrow = false,\n withBackdrop = false,\n className,\n isDismissable = true,\n disableGroup = false,\n ...props\n}: PopoverProps) {\n const popoverContext = useSlottedContext(PopoverContext)!;\n const isSubmenu = popoverContext?.trigger === \"SubmenuTrigger\";\n let offset = showArrow ? 12 : 8;\n offset = isSubmenu ? offset - 6 : offset;\n\n const popoverContent = (\n <AriaPopover\n offset={offset}\n {...props}\n className={composeRenderProps(className, (className, renderProps) =>\n getPopoverStyles({ ...renderProps, className, disableGroup })\n )}\n >\n {showArrow && (\n <OverlayArrow>\n <svg\n width={12}\n height={12}\n viewBox=\"0 0 12 12\"\n className=\"block fill-background-surface stroke-border-default stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]\"\n >\n <path d=\"M0 0 L6 6 L12 0\" />\n </svg>\n </OverlayArrow>\n )}\n {children}\n </AriaPopover>\n );\n\n if (withBackdrop) {\n return (\n <ModalBackdrop isDismissable={isDismissable}>\n <Modal\n className=\"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0\"\n isDismissable={isDismissable}\n >\n {popoverContent}\n </Modal>\n </ModalBackdrop>\n );\n }\n\n return popoverContent;\n}\n","\"use client\";\nimport React, { createContext, useContext, useRef, useState } from \"react\";\nimport type { SelectProps as AriaSelectProps, Key, ValidationResult } from \"react-aria-components\";\nimport { Select as AriaSelect, ListBox, SelectValue } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport { controlStyles } from \"../../utils/controlStyles\";\nimport { Button } from \"../Button\";\nimport { Description, FieldError, getInputBaseStyles, InputWrapper, Label } from \"../Field\";\nimport { Icon } from \"../Icon\";\nimport type { DropdownSectionProps } from \"../ListBox\";\nimport { DropdownSection } from \"../ListBox\";\nimport { ListBoxItem } from \"../ListBoxItem\";\nimport { Popover } from \"../Popover\";\n\n// Context to provide size to nested ListBoxItems\nconst SelectSizeContext = createContext<Size>(\"md\");\n\n/**\n * Hook to access the current Select size from context.\n * Used by ListBoxItem to automatically inherit the parent Select's size.\n */\nexport function useSelectSize(): Size {\n return useContext(SelectSizeContext);\n}\n\n// Replace tv() with a regular function\ntype SelectVariants = {\n isDisabled?: boolean;\n size?: Size;\n isOpen?: boolean;\n isInvalid?: boolean;\n};\n\nfunction getSelectValueClassName(size: Size = \"md\") {\n // Use controlStyles for consistent text sizing\n return `flex-1 text-start data-[placeholder]:text-text-placeholder overflow-hidden text-ellipsis whitespace-nowrap ${controlStyles[size].text}`;\n}\n\nexport type SelectVariantType = SelectVariants;\n\n// Define a custom hook for focus handling that works with any element\nfunction useElementFocus() {\n const handleFocus = React.useCallback(\n (e: React.FocusEvent<Element>, onFocus?: (e: React.FocusEvent<Element>) => void) => {\n onFocus?.(e);\n },\n []\n );\n\n const handleBlur = React.useCallback(\n (e: React.FocusEvent<Element>, onBlur?: (e: React.FocusEvent<Element>) => void) => {\n onBlur?.(e);\n },\n []\n );\n\n return { handleFocus, handleBlur };\n}\n\n/**\n * Interface defining the shape of items in the Select component\n */\nexport interface SelectItem<T = unknown> {\n /** Unique identifier for the item */\n id: string;\n /** Display label for the item */\n label: string;\n /** Value associated with the item */\n value: T;\n}\n\n/**\n * Props for the Select component\n * @template T - The type of the items, must extend SelectItem\n */\nexport interface SelectProps<T extends SelectItem>\n extends Omit<AriaSelectProps<T>, \"children\" | \"onSelectionChange\"> {\n /** Label text displayed above the select */\n label?: string;\n /** Helper text displayed below the select */\n description?: string;\n /** Error message or function to generate error message */\n errorMessage?: string | ((validation: ValidationResult) => React.ReactNode);\n /** Collection of items to display in the select */\n items?: Iterable<T>;\n /** Size variant of the select */\n size?: Size;\n /** Render function for items or static children */\n children?: React.ReactNode | ((item: T) => React.ReactNode);\n /** Custom render function for individual items. When provided, items prop is used to render items automatically */\n renderItem?: (item: T) => React.ReactNode;\n /** Custom render function for the selected value display. When provided, this overrides the default SelectValue display */\n renderSelectedValue?: (item: T) => React.ReactNode;\n /** Currently selected item's id. Uses the SelectItem's `id` field for stable selection tracking */\n selectedKey?: Key;\n /** Default selected item's id for uncontrolled usage */\n defaultSelectedKey?: Key;\n /** Callback when selection changes, provides the selected item's id */\n onSelectionChange?: (key: Key) => void;\n /** Whether to show error states */\n showErrors?: boolean;\n /** Tooltip text */\n tooltip?: string;\n /** Whether the field is required */\n isRequired?: boolean;\n /** Validation result object */\n validationResult?: ValidationResult;\n /** Whether to use transparent background */\n transparent?: boolean;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default false\n */\n reserveErrorSpace?: boolean;\n /** Placement of the dropdown menu relative to the trigger. Defaults to \"bottom start\" */\n placement?:\n | \"bottom\"\n | \"bottom left\"\n | \"bottom right\"\n | \"bottom start\"\n | \"bottom end\"\n | \"top\"\n | \"top left\"\n | \"top right\"\n | \"top start\"\n | \"top end\"\n | \"left\"\n | \"left top\"\n | \"left bottom\"\n | \"start\"\n | \"start top\"\n | \"start bottom\"\n | \"right\"\n | \"right top\"\n | \"right bottom\"\n | \"end\"\n | \"end top\"\n | \"end bottom\";\n /** Whether the menu should flip to the opposite side when there's not enough space. Defaults to true */\n shouldFlip?: boolean;\n /**\n * Controls the menu width behavior relative to the trigger.\n * - \"match\": Menu width matches trigger width exactly (default)\n * - \"auto\": Menu width grows to fit content, with minimum of trigger width\n * @default \"match\"\n */\n menuWidth?: \"match\" | \"auto\";\n /**\n * Where to display the description text\n * - \"below\": Show below the field (default)\n * - \"tooltip\": Show as a tooltip on the label icon\n * - \"inline\": Show inline with the label\n * - \"hidden\": Don't display the description\n * @default \"below\"\n */\n descriptionPlacement?: \"below\" | \"tooltip\" | \"inline\" | \"hidden\";\n}\n\nexport function Select<T extends SelectItem>({\n label,\n description,\n errorMessage,\n children,\n items,\n renderItem,\n renderSelectedValue,\n size = \"md\",\n selectedKey: controlledSelectedKey,\n defaultSelectedKey,\n onSelectionChange,\n placeholder,\n showErrors = false,\n tooltip,\n isRequired,\n transparent,\n reserveErrorSpace = false,\n placement = \"bottom start\",\n shouldFlip = true,\n menuWidth = \"match\",\n descriptionPlacement = \"below\",\n ...props\n}: SelectProps<T>) {\n const [internalSelectedKey, setInternalSelectedKey] = useState<Key | null>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n const selectedKey = controlledSelectedKey ?? internalSelectedKey ?? defaultSelectedKey;\n const { handleFocus, handleBlur } = useElementFocus();\n\n // Find the selected item if renderSelectedValue is provided\n const displaySelectedItem = React.useMemo(() => {\n if (!renderSelectedValue || !selectedKey || !items) return null;\n const itemsArray = Array.from(items);\n return itemsArray.find((item) => item.id === selectedKey) ?? null;\n }, [renderSelectedValue, selectedKey, items]);\n\n const handleSelectionChange = (key: Key | null) => {\n if (onSelectionChange && key !== null) {\n onSelectionChange(key);\n }\n if (!onSelectionChange) {\n setInternalSelectedKey(key); // Update internal state if uncontrolled\n }\n };\n\n const selectRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n\n return (\n <AriaSelect\n {...props}\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n onSelectionChange={handleSelectionChange}\n placeholder={placeholder}\n className={composeTailwindRenderProps(props.className, \"group flex w-full flex-col\")}\n ref={selectRef}\n onOpenChange={(isOpen) => {\n if (isOpen && triggerRef.current) {\n setTriggerWidth(triggerRef.current.offsetWidth);\n } else if (!isOpen) {\n selectRef.current?.blur();\n }\n }}\n >\n {({\n isDisabled,\n isInvalid,\n isOpen,\n }: {\n isDisabled: boolean;\n isInvalid: boolean;\n isOpen: boolean;\n }) => (\n <div className=\"flex flex-col\">\n {label && (\n <Label\n size={size}\n tooltip={tooltip}\n description={\n descriptionPlacement === \"tooltip\" || descriptionPlacement === \"inline\"\n ? description\n : undefined\n }\n descriptionPlacement={descriptionPlacement}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n <InputWrapper>\n <div ref={triggerRef}>\n <Button\n variant=\"unstyled\"\n className={twMerge(\n getInputBaseStyles({\n isInvalid: isInvalid || (showErrors && !!errorMessage),\n isDisabled,\n isFocused: isOpen,\n transparent,\n size,\n }),\n // Keep left padding consistent across sizes\n \"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]\"\n )}\n onFocus={(e) => handleFocus(e, props.onFocus)}\n onBlur={(e) => handleBlur(e, props.onBlur)}\n data-open={isOpen}\n >\n {renderSelectedValue && displaySelectedItem ? (\n <div className={getSelectValueClassName(size)}>\n {renderSelectedValue(displaySelectedItem)}\n </div>\n ) : (\n <SelectValue className={getSelectValueClassName(size)} />\n )}\n <Icon\n name=\"CaretDown\"\n aria-hidden\n className={twMerge(\n \"h-4 w-4 text-text-body group-disabled:text-gray-200 forced-colors:text-[ButtonText] transition-transform\",\n isOpen && \"rotate-180\"\n )}\n />\n </Button>\n </div>\n </InputWrapper>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {showErrors ? (\n <FieldError size={size} className=\"text-feedback-error-text\">\n {typeof errorMessage === \"function\" && props.validationResult\n ? errorMessage(props.validationResult)\n : typeof errorMessage === \"string\"\n ? errorMessage\n : null}\n </FieldError>\n ) : description && descriptionPlacement === \"below\" ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {showErrors ? (\n <FieldError size={size} className=\"mt-1 text-feedback-error-text\">\n {typeof errorMessage === \"function\" && props.validationResult\n ? errorMessage(props.validationResult)\n : typeof errorMessage === \"string\"\n ? errorMessage\n : null}\n </FieldError>\n ) : description && descriptionPlacement === \"below\" ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n <Popover\n className=\"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]\"\n style={{\n width: menuWidth === \"match\" && triggerWidth ? `${triggerWidth}px` : undefined,\n minWidth: menuWidth === \"auto\" && triggerWidth ? `${triggerWidth}px` : undefined,\n maxWidth: menuWidth === \"auto\" ? \"min(600px, 90vw)\" : undefined,\n }}\n placement={placement}\n shouldFlip={shouldFlip}\n >\n <SelectSizeContext.Provider value={size}>\n <ListBox\n items={items}\n className=\"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0\"\n >\n {renderItem && items\n ? (item: T) => (\n <ListBoxItem key={item.id} id={item.id} textValue={item.label} size={size}>\n <span className=\"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1\">\n {renderItem(item)}\n </span>\n </ListBoxItem>\n )\n : children}\n </ListBox>\n </SelectSizeContext.Provider>\n </Popover>\n </div>\n )}\n </AriaSelect>\n );\n}\n\nexport function SelectSection<T extends object>(props: DropdownSectionProps<T>) {\n return <DropdownSection {...props} />;\n}\n","import type { ListBoxItemProps as AriaListBoxItemProps } from \"react-aria-components\";\nimport { ListBoxItem as AriaListBoxItem } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { controlStyles } from \"../../utils/controlStyles\";\nimport { useSelectSize } from \"../Select/Select\";\n\n/**\n * ListBoxItem\n *\n * A styled wrapper around `react-aria-components` ListBoxItem with size\n * variants that align with Edges typography.\n */\nexport interface ExtendedListBoxItemProps extends Omit<AriaListBoxItemProps, \"className\"> {\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n className?: string;\n}\n\nexport type ListBoxItemProps = ExtendedListBoxItemProps;\n\nexport function ListBoxItem({ size, className, ...props }: ExtendedListBoxItemProps) {\n // Use context size from parent Select if no explicit size is provided\n const contextSize = useSelectSize();\n const effectiveSize = size ?? contextSize;\n\n const baseClassName =\n \"flex cursor-default items-center gap-2 rounded-sm px-3 outline-none text-text-body data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-default data-[focus-visible]:ring-inset data-[selected]:bg-background-selected data-[selected]:font-medium overflow-hidden\";\n\n return (\n <AriaListBoxItem\n {...props}\n className={twMerge(\n baseClassName,\n controlStyles[effectiveSize].paddingY,\n controlStyles[effectiveSize].text,\n className\n )}\n />\n );\n}\n","\"use client\";\n\nimport React, { useEffect, useState } from \"react\";\nimport { useFilter } from \"react-aria\";\nimport {\n Button as AriaButton,\n Input as AriaInput,\n ComboBox,\n ComboBoxStateContext,\n Group,\n Header,\n type Key,\n ListBox,\n ListBoxSection,\n ValidationResult,\n} from \"react-aria-components\";\nimport { useAsyncList } from \"react-stately\";\nimport { useDebounce } from \"../../hooks/useDebounce\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport { controlStyles, type Size } from \"../../utils/controlStyles\";\nimport { Description, FieldError, getFieldGroupStyles, Label } from \"../Field/Field\";\nimport { Icon } from \"../Icon/Icon\";\nimport { ListBoxItem } from \"../ListBoxItem/ListBoxItem\";\nimport { Popover } from \"../Popover/Popover\";\n\ninterface Item {\n id: string;\n name: string;\n}\n\ninterface Section {\n name: string;\n items: Item[];\n}\n\nconst iconSizeClassMap = {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n xl: \"h-7 w-7\",\n};\n\nconst inputPaddingLeftMap = {\n sm: \"pl-7\",\n md: \"pl-9\",\n lg: \"pl-10\",\n xl: \"pl-12\",\n};\n\nconst itemHeightStylesObject = {\n sm: \"py-1\",\n md: \"py-2\",\n lg: \"py-3\",\n xl: \"py-4\",\n};\n\ntype RequestMethod = \"GET\" | \"POST\";\n\ninterface BaseRequestConfig {\n url: string;\n headers?: Record<string, string>;\n transformResponse: (data: unknown) => Item[];\n}\n\ninterface RestRequestConfig extends BaseRequestConfig {\n requestType: \"REST\";\n method?: RequestMethod;\n queryKey?: string; // For APIs that expect \"query\" in URL or JSON body\n extraParams?: Record<string, string>;\n shouldLoad?: (filterText: string) => boolean;\n}\n\ninterface GraphQLRequestConfig extends BaseRequestConfig {\n requestType: \"GraphQL\";\n graphqlQuery: string;\n variableKey?: string;\n responsePath?: string;\n shouldLoad?: (filterText: string) => boolean;\n}\n\ntype AutocompleteRequestConfig = RestRequestConfig | GraphQLRequestConfig;\n\n/**\n * Autocomplete\n *\n * Text input with typeahead suggestions and keyboard navigation.\n */\nexport interface AutocompleteProps {\n label?: string;\n staticItems?: Item[];\n sections?: Section[];\n selectedKey?: Key | null;\n defaultSelectedKey?: Key | null;\n onSelectionChange?: (key: Key | null) => void;\n requestConfig?: AutocompleteRequestConfig;\n defaultFilter?: (textValue: string, inputValue: string) => boolean;\n placeholder?: string;\n renderItem?: (item: Item) => React.ReactNode;\n renderLeftIcon?: (isLoading: boolean) => React.ReactNode;\n renderSection?: (section: Section, children: React.ReactNode) => React.ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n description?: string;\n size?: Size;\n tooltip?: string;\n isRequired?: boolean;\n isDisabled?: boolean;\n isInvalid?: boolean;\n validationResult?: ValidationResult;\n showErrors?: boolean;\n autoFocus?: boolean;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default false\n */\n reserveErrorSpace?: boolean;\n /**\n * Whether to hide the dropdown chevron icon\n * @default false\n */\n hideChevron?: boolean;\n}\n\nfunction ClearButton() {\n const state = React.useContext(ComboBoxStateContext);\n return (\n <AriaButton\n // Don't inherit default Button behavior from ComboBox.\n slot={null}\n className=\"clear-button\"\n aria-label=\"Clear\"\n onPress={() => state?.setSelectedKey(null)}\n >\n ✕\n </AriaButton>\n );\n}\n\n// Helper function to get item name by key\nconst getItemName = (\n key: Key | null | undefined,\n staticItems: Item[],\n sections?: Section[]\n): string => {\n if (key == null || key === \"\") return \"\";\n const allItems = sections ? sections.flatMap((s) => s.items) : staticItems || [];\n const selectedItem = allItems.find((item) => item.id === key);\n return selectedItem ? selectedItem.name : \"\";\n};\n\nasync function handleRestRequest(\n config: RestRequestConfig,\n filterText: string,\n signal: AbortSignal\n): Promise<{ items: Item[]; error?: string }> {\n try {\n // Extract the base URL and access token from config\n const baseUrl = config.url.replace(\"{q}\", filterText);\n\n // Add query parameters\n const params = new URLSearchParams();\n if (config.extraParams) {\n Object.entries(config.extraParams).forEach(([key, value]) => {\n params.append(key, value.toString());\n });\n }\n\n // Construct final URL\n const finalUrl = `${baseUrl}${params.toString() ? \"?\" + params.toString() : \"\"}`;\n\n const response = await fetch(finalUrl, {\n method: \"GET\",\n headers: config.headers,\n signal,\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const json = await response.json();\n return { items: config.transformResponse(json) };\n } catch (error) {\n console.error(\"Error in REST request:\", error);\n const errorMessage = error instanceof Error ? error.message : \"Unknown error occurred\";\n return { items: [], error: errorMessage };\n }\n}\n\nasync function handleGraphQLRequest(\n config: GraphQLRequestConfig,\n filterText: string,\n signal: AbortSignal\n): Promise<{ items: Item[]; error?: string }> {\n try {\n const query = config.graphqlQuery.replace(\n `$${config.variableKey || \"filter\"}`,\n `\"${filterText}\"`\n );\n\n const response = await fetch(config.url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n },\n body: JSON.stringify({ query }),\n signal,\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n let json = await response.json();\n\n if (json.errors) {\n throw new Error(json.errors[0]?.message || \"GraphQL error occurred\");\n }\n\n // For GraphQL, traverse the response path if specified\n if (config.responsePath) {\n json = config.responsePath.split(\".\").reduce((obj, key) => obj?.[key], json);\n }\n\n return { items: config.transformResponse(json) };\n } catch (error) {\n console.error(\"Error in GraphQL request:\", error);\n const errorMessage = error instanceof Error ? error.message : \"Unknown error occurred\";\n return { items: [], error: errorMessage };\n }\n}\n\nexport function Autocomplete({\n label,\n staticItems = [],\n sections,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n requestConfig,\n defaultFilter,\n placeholder,\n errorMessage,\n description,\n size = \"md\",\n tooltip,\n isRequired,\n isDisabled,\n isInvalid,\n validationResult,\n showErrors = true,\n renderItem,\n renderLeftIcon,\n renderSection,\n autoFocus = false,\n reserveErrorSpace = false,\n hideChevron = false,\n}: AutocompleteProps) {\n const triggerRef = React.useRef<HTMLDivElement>(null);\n const [triggerWidth, setTriggerWidth] = React.useState<number | undefined>();\n const [inputValue, setInputValue] = useState(() =>\n getItemName(selectedKey || defaultSelectedKey, staticItems, sections)\n );\n const [isFocused, setIsFocused] = useState(false);\n const debouncedInputValue = useDebounce(inputValue);\n const { contains } = useFilter({ sensitivity: \"base\" });\n const [error, setError] = useState<string | undefined>();\n\n const textSizeClass = controlStyles[size].text;\n const heightSizeClass = controlStyles[size].height;\n\n let dynamicItems: ReturnType<typeof useAsyncList<Item>> | null = null;\n\n useEffect(() => {\n if (autoFocus) {\n setIsFocused(true);\n }\n }, [autoFocus]);\n\n // Update trigger width when component mounts or resizes\n useEffect(() => {\n const updateTriggerWidth = () => {\n if (triggerRef.current) {\n setTriggerWidth(triggerRef.current.offsetWidth);\n }\n };\n\n updateTriggerWidth();\n window.addEventListener(\"resize\", updateTriggerWidth);\n return () => window.removeEventListener(\"resize\", updateTriggerWidth);\n }, []);\n\n useEffect(() => {\n if (dynamicItems) {\n dynamicItems.setFilterText(debouncedInputValue);\n }\n }, [debouncedInputValue, dynamicItems]);\n\n if (requestConfig) {\n dynamicItems = useAsyncList<Item>({\n async load({ signal, filterText = \"\" }) {\n if (\n !requestConfig.url ||\n (requestConfig.shouldLoad && !requestConfig.shouldLoad(filterText))\n ) {\n return { items: [] };\n }\n\n try {\n let result;\n if (requestConfig.requestType === \"GraphQL\") {\n result = await handleGraphQLRequest(requestConfig, filterText, signal);\n } else {\n result = await handleRestRequest(requestConfig, filterText, signal);\n }\n\n setError(result.error);\n return { items: result.items };\n } catch (error) {\n console.error(\"Error loading items:\", error);\n setError(error instanceof Error ? error.message : \"Unknown error occurred\");\n return { items: [] };\n }\n },\n initialFilterText: \"\",\n });\n }\n\n if (debouncedInputValue === \"\") {\n dynamicItems = null;\n }\n\n const handleInternalSelectionChange = (key: Key | null) => {\n const newName = getItemName(key, staticItems, sections);\n setInputValue(newName);\n if (onSelectionChange) {\n onSelectionChange(key);\n }\n };\n\n const handleInternalInputChange = (text: string) => {\n setInputValue(text);\n const currentSelectedItemName = getItemName(selectedKey, staticItems, sections);\n if (selectedKey != null && text !== currentSelectedItemName) {\n if (onSelectionChange) {\n // Clear selection if input text no longer matches selected item's name\n onSelectionChange(null);\n }\n }\n };\n\n return (\n <ComboBox\n onSelectionChange={handleInternalSelectionChange}\n selectedKey={selectedKey || undefined}\n defaultSelectedKey={defaultSelectedKey || undefined}\n defaultItems={sections ? sections.flatMap((section) => section.items) : staticItems}\n items={dynamicItems ? dynamicItems.items : undefined}\n className={composeTailwindRenderProps(\"group flex flex-col\", \"w-full\")}\n menuTrigger=\"focus\"\n isDisabled={isDisabled}\n isInvalid={isInvalid || !!errorMessage}\n inputValue={inputValue}\n onInputChange={handleInternalInputChange}\n autoFocus={autoFocus}\n defaultFilter={defaultFilter || contains}\n aria-label={label || placeholder || \"Autocomplete\"}\n >\n {(state) => (\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n <Group\n ref={triggerRef}\n className={getFieldGroupStyles({\n size,\n isInvalid: isInvalid || !!errorMessage,\n isDisabled,\n isFocusWithin: isFocused || state.isOpen,\n className: \"w-full cursor-pointer\",\n })}\n aria-label={label || placeholder || \"Autocomplete\"}\n style={{ position: \"relative\" }}\n >\n {renderLeftIcon ? (\n <div className=\"absolute left-3\">{renderLeftIcon(!!dynamicItems?.isLoading)}</div>\n ) : (\n <Icon\n name=\"MagnifyingGlass\"\n className={`${iconSizeClassMap[size]} absolute left-3 text-inherit`}\n />\n )}\n <AriaInput\n className={`flex-1 min-w-0 border-none pr-3 outline-0 placeholder:text-text-placeholder ${inputPaddingLeftMap[size]} ${textSizeClass} ${heightSizeClass} ${isDisabled ? \"bg-background-muted\" : \"bg-background-input\"}`}\n placeholder={placeholder}\n disabled={isDisabled}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n />\n {inputValue && !isDisabled && <ClearButton />}\n {!hideChevron && (\n <AriaButton\n className={`px-2 text-text-body ${textSizeClass} ${heightSizeClass} ${isDisabled ? \"bg-background-muted\" : \"bg-background-input\"}`}\n aria-label=\"Toggle menu\"\n isDisabled={isDisabled}\n >\n {({ isPressed }) => (\n <Icon name={isPressed ? \"CaretUp\" : \"CaretDown\"} className=\"h-4 w-4\" />\n )}\n </AriaButton>\n )}\n </Group>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {showErrors && error ? (\n <FieldError size={size} className=\"text-feedback-error-text\">\n {error}\n </FieldError>\n ) : showErrors && typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"text-feedback-error-text\">\n {errorMessage}\n </FieldError>\n ) : showErrors && typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"text-feedback-error-text\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {description && (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n )}\n {showErrors && error && (\n <FieldError size={size} className=\"text-feedback-error-text mt-1\">\n {error}\n </FieldError>\n )}\n {showErrors && typeof errorMessage === \"string\" && (\n <FieldError size={size} className=\"text-feedback-error-text mt-1\">\n {errorMessage}\n </FieldError>\n )}\n {showErrors && typeof errorMessage === \"function\" && validationResult && (\n <FieldError size={size} className=\"text-feedback-error-text mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n )}\n </>\n )}\n <Popover\n className=\"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5 rounded-[var(--control-border-radius)]\"\n style={{ minWidth: triggerWidth ? `${triggerWidth}px` : undefined }}\n >\n <ListBox\n className={`max-h-[300px] overflow-auto bg-background-input outline-none ${textSizeClass}`}\n >\n {sections\n ? sections.map((section) => {\n const sectionItems = section.items.map((item) => (\n <ListBoxItem\n key={item.id}\n id={item.id}\n textValue={item.name}\n size={size}\n className={`flex cursor-default items-center gap-2 px-3 ${itemHeightStylesObject[size]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`}\n >\n {renderItem ? (\n renderItem(item)\n ) : (\n <>\n {item.name}\n <Icon\n name=\"X\"\n className=\"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100\"\n />\n </>\n )}\n </ListBoxItem>\n ));\n\n if (renderSection) {\n const content = renderSection(section, sectionItems);\n return React.isValidElement(content) && content.type === ListBoxSection ? (\n content\n ) : (\n <ListBoxSection key={section.name}>{content}</ListBoxSection>\n );\n }\n\n return (\n <ListBoxSection key={section.name}>\n <Header className=\"px-3 py-1 text-sm font-bold text-text-muted\">\n {section.name}\n </Header>\n {sectionItems}\n </ListBoxSection>\n );\n })\n : (item: Item) => (\n <ListBoxItem\n key={item.id}\n id={item.id}\n textValue={item.name}\n size={size}\n className={`flex cursor-default items-center gap-2 px-3 ${itemHeightStylesObject[size]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`}\n >\n {renderItem ? (\n renderItem(item)\n ) : (\n <>\n {item.name}\n <Icon\n name=\"X\"\n className=\"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100\"\n />\n </>\n )}\n </ListBoxItem>\n )}\n </ListBox>\n </Popover>\n </div>\n )}\n </ComboBox>\n );\n}\n","import type { FieldPath, FieldValues } from \"react-hook-form\";\n\nexport function getFieldError<TFieldValues extends FieldValues>(\n errors: Record<string, unknown>,\n name: FieldPath<TFieldValues>\n): string | undefined {\n const segs = name.split(\".\");\n let node: unknown = errors;\n for (const seg of segs) {\n if (node && typeof node === \"object\" && seg in (node as Record<string, unknown>)) {\n node = (node as Record<string, unknown>)[seg];\n } else {\n node = undefined;\n break;\n }\n }\n const msg = (node as { message?: string } | undefined)?.message;\n return typeof msg === \"string\" ? msg : undefined;\n}\n","import * as React from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { Autocomplete } from \"@/components/Autocomplete\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormAutocompleteProps<T extends FieldValues>\n extends Omit<\n React.ComponentProps<typeof Autocomplete>,\n \"selectedKey\" | \"defaultSelectedKey\" | \"onSelectionChange\"\n > {\n name: FieldPath<T>;\n defaultValue?: Key | null;\n}\n\nexport function FormAutocomplete<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormAutocompleteProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n defaultValue={defaultValue as unknown as T[typeof name]}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <Autocomplete\n {...rest}\n selectedKey={(field.value as Key) ?? null}\n onSelectionChange={(key) => field.onChange(key)}\n showErrors={!!error}\n errorMessage={error}\n />\n )}\n />\n );\n}\n","import { Check, Minus } from \"lucide-react\";\nimport { ReactNode } from \"react\";\nimport {\n Checkbox as AriaCheckbox,\n CheckboxGroup as AriaCheckboxGroup,\n CheckboxGroupProps as AriaCheckboxGroupProps,\n CheckboxProps as AriaCheckboxProps,\n CheckboxRenderProps,\n composeRenderProps,\n ValidationResult,\n} from \"react-aria-components\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport { Description, FieldError, Label } from \"../Field\";\n\n/**\n * CheckboxGroup\n *\n * Groups multiple checkboxes with shared label/description.\n */\nexport interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, \"children\"> {\n label?: string;\n children?: ReactNode;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n}\n\n/**\n * Checkbox\n *\n * Single checkbox with Edges visuals.\n */\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, \"children\"> {\n children?: ReactNode | ((props: CheckboxRenderProps) => ReactNode);\n /**\n * Visual variant of the checkbox\n * @default \"default\"\n */\n variant?: \"default\" | \"brand\";\n}\n\nexport function CheckboxGroup(props: CheckboxGroupProps) {\n return (\n <AriaCheckboxGroup\n {...props}\n className={composeTailwindRenderProps(props.className, \"flex flex-col gap-2\")}\n >\n <Label>{props.label}</Label>\n {props.children}\n {props.description && <Description>{props.description}</Description>}\n <FieldError>\n {typeof props.errorMessage === \"function\" ? undefined : props.errorMessage}\n </FieldError>\n </AriaCheckboxGroup>\n );\n}\n\nfunction getCheckboxStyles({ isDisabled }: { isDisabled?: boolean }) {\n return `flex gap-2 items-center group text-sm transition ${isDisabled ? \"text-text-disabled\" : \"text-text-caption\"}`;\n}\n\nfunction getBoxStyles({\n isSelected,\n isInvalid,\n isDisabled,\n isIndeterminate,\n variant = \"default\",\n}: {\n isSelected?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n isIndeterminate?: boolean;\n variant?: \"default\" | \"brand\";\n}) {\n const baseStyles =\n \"w-5 h-5 flex-shrink-0 rounded-[var(--control-border-radius)] flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2\";\n\n const focusRingColor =\n variant === \"brand\" ? \"focus:ring-action-brand\" : \"focus:ring-action-default\";\n\n let colorStyles = \"\";\n if (isDisabled) {\n colorStyles = \"border-border-muted bg-background-muted\";\n } else if (isInvalid) {\n colorStyles = \"border-feedback-error-border bg-feedback-error-background\";\n } else if (isSelected || isIndeterminate) {\n const actionColor = variant === \"brand\" ? \"action-brand\" : \"action-default\";\n colorStyles = `bg-${actionColor} border-${actionColor} hover:bg-${actionColor}-hover hover:border-${actionColor}-hover`;\n } else {\n colorStyles = \"bg-background-input border-border-input hover:border-border-focus\";\n }\n\n return `${baseStyles} ${focusRingColor} ${colorStyles}`;\n}\n\nconst iconStyles = \"w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled\";\n\nexport function Checkbox(props: CheckboxProps) {\n const { children, variant = \"default\", ...otherProps } = props;\n return (\n <AriaCheckbox\n {...otherProps}\n className={composeRenderProps(\n props.className,\n (className, renderProps) => `${getCheckboxStyles(renderProps)} ${className || \"\"}`\n )}\n >\n {(renderProps) => {\n const { isSelected, isIndeterminate, ...rest } = renderProps;\n const checkboxContent = (\n <div\n className={getBoxStyles({\n isSelected,\n isIndeterminate,\n variant,\n ...rest,\n })}\n >\n {isIndeterminate ? (\n <Minus aria-hidden className={iconStyles} />\n ) : isSelected ? (\n <Check aria-hidden className={iconStyles} />\n ) : null}\n </div>\n );\n\n return (\n <>\n {checkboxContent}\n {typeof children === \"function\" ? children(renderProps) : children}\n </>\n );\n }}\n </AriaCheckbox>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { Checkbox } from \"@/components/Checkbox\";\nimport { FieldError } from \"@/components/Field\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormCheckboxProps<T extends FieldValues>\n extends Omit<\n React.ComponentProps<typeof Checkbox>,\n \"isSelected\" | \"defaultSelected\" | \"onChange\"\n > {\n name: FieldPath<T>;\n defaultValue?: boolean;\n errorBelow?: boolean;\n}\n\nexport function FormCheckbox<T extends FieldValues>({\n name,\n defaultValue,\n errorBelow = false,\n ...rest\n}: FormCheckboxProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <div className=\"flex flex-col gap-1\">\n <Checkbox\n {...rest}\n isSelected={!!field.value}\n onChange={(v) => field.onChange(v)}\n aria-invalid={!!error}\n >\n {rest.children}\n </Checkbox>\n {errorBelow && error && <FieldError>{error}</FieldError>}\n </div>\n )}\n />\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { CheckboxGroup } from \"@/components/Checkbox\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormCheckboxGroupProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof CheckboxGroup>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string[];\n}\n\nexport function FormCheckboxGroup<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormCheckboxGroupProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n defaultValue={defaultValue as unknown as T[typeof name]}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <CheckboxGroup\n {...rest}\n value={(field.value as string[]) || []}\n onChange={(v) => field.onChange(v)}\n errorMessage={error}\n >\n {rest.children}\n </CheckboxGroup>\n )}\n />\n );\n}\n","\"use client\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport type {\n TextFieldProps as AriaTextFieldProps,\n TextFieldRenderProps,\n ValidationResult,\n} from \"react-aria-components\";\nimport { TextField as AriaTextFieldComponent } from \"react-aria-components\";\nimport { HexColorPicker } from \"react-colorful\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport { controlStyles } from \"../../utils/controlStyles\";\nimport { Button } from \"../Button\";\nimport {\n type BaseInputProps,\n Description,\n FieldError,\n getInputBaseStyles,\n Input,\n InputWrapper,\n Label,\n useInputFocus,\n} from \"../Field\";\nimport { Popover } from \"../Popover\";\n\n/**\n * Validates if a string is a valid hex color code\n * Accepts formats: #RGB, #RRGGBB, RGB, RRGGBB\n */\nfunction isValidHexColor(value: string): boolean {\n if (!value) return false;\n const hex = value.startsWith(\"#\") ? value.slice(1) : value;\n return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(hex);\n}\n\n/**\n * Normalizes a hex color to always include # and be uppercase\n * Expands 3-digit hex to 6-digit format\n */\nfunction normalizeHexColor(value: string): string {\n if (!value) return \"\";\n let hex = value.startsWith(\"#\") ? value.slice(1) : value;\n\n // Expand 3-digit hex to 6-digit\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\");\n }\n\n return `#${hex.toUpperCase()}`;\n}\n\n/**\n * ColorField Props\n */\nexport interface ColorFieldProps\n extends Omit<AriaTextFieldProps, \"isRequired\" | \"size\" | \"className\">,\n BaseInputProps {\n /** Label text displayed above the color field */\n label?: string;\n /** Helper text displayed below the color field */\n description?: string;\n /** Error message or function to generate error message */\n errorMessage?: string | ((validation: ValidationResult) => string);\n /** Placeholder text for the input */\n placeholder?: string;\n /** Optional tooltip text to show next to the label */\n tooltip?: string;\n /** Whether the field is required */\n isRequired?: boolean;\n /** Additional CSS classes to apply */\n className?: string;\n /** Validation result object */\n validationResult?: ValidationResult;\n /** The current hex color value (controlled) */\n value?: string;\n /** Default hex color value (uncontrolled) */\n defaultValue?: string;\n /** Callback when the color changes */\n onChange?: (color: string) => void;\n /** Whether to show the color swatch preview */\n showColorSwatch?: boolean;\n}\n\n/**\n * ColorField Component\n *\n * A form control that allows users to input hex color codes manually\n * or select colors using a visual color picker. Integrates seamlessly\n * with the Edges design system.\n *\n * @example\n * ```tsx\n * <ColorField\n * label=\"Brand Color\"\n * value={color}\n * onChange={setColor}\n * description=\"Choose your primary brand color\"\n * />\n * ```\n */\nexport function ColorField({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n transparent,\n className,\n validationResult,\n value: controlledValue,\n defaultValue,\n onChange,\n placeholder = \"#000000\",\n showColorSwatch = true,\n reserveErrorSpace = true,\n ...props\n}: ColorFieldProps) {\n const [internalValue, setInternalValue] = useState(defaultValue || \"\");\n const [inputValue, setInputValue] = useState(controlledValue || defaultValue || \"\");\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n const [triggerElement, setTriggerElement] = useState<HTMLElement | null>(null);\n const { isFocused, handleFocus, handleBlur } = useInputFocus();\n\n // Use controlled value if provided, otherwise use internal state\n const value = controlledValue !== undefined ? controlledValue : internalValue;\n\n // Sync inputValue with controlled value when it changes\n useEffect(() => {\n if (controlledValue !== undefined) {\n setInputValue(controlledValue);\n }\n }, [controlledValue]);\n\n // Validate the current value\n const isInvalid = value ? !isValidHexColor(value) : false;\n\n // Handle input change\n const handleInputChange = useCallback(\n (newValue: string) => {\n setInputValue(newValue);\n\n // Only update the actual color value if it's valid\n if (isValidHexColor(newValue)) {\n const normalized = normalizeHexColor(newValue);\n if (onChange) {\n onChange(normalized);\n } else {\n setInternalValue(normalized);\n }\n } else if (newValue === \"\") {\n // Allow clearing the value\n if (onChange) {\n onChange(\"\");\n } else {\n setInternalValue(\"\");\n }\n }\n },\n [onChange]\n );\n\n // Handle color picker change\n const handlePickerChange = useCallback(\n (newColor: string) => {\n const normalized = normalizeHexColor(newColor);\n setInputValue(normalized);\n if (onChange) {\n onChange(normalized);\n } else {\n setInternalValue(normalized);\n }\n },\n [onChange]\n );\n\n // Handle input blur - normalize valid values\n const handleInputBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n if (isValidHexColor(inputValue)) {\n const normalized = normalizeHexColor(inputValue);\n setInputValue(normalized);\n if (onChange && normalized !== value) {\n onChange(normalized);\n } else if (!onChange && normalized !== internalValue) {\n setInternalValue(normalized);\n }\n }\n handleBlur(e, props.onBlur);\n },\n [inputValue, value, internalValue, onChange, handleBlur, props.onBlur]\n );\n\n return (\n <AriaTextFieldComponent\n {...props}\n isRequired={isRequired}\n className={composeTailwindRenderProps(className, \"group flex flex-col\")}\n >\n {({ isDisabled }: TextFieldRenderProps) => (\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n <InputWrapper>\n <div className=\"flex gap-2\">\n <div className=\"flex-1 relative\">\n <Input\n size={size}\n disabled={isDisabled}\n type=\"text\"\n value={inputValue}\n placeholder={placeholder}\n onFocus={(e) => handleFocus(e, props.onFocus)}\n onBlur={handleInputBlur}\n onChange={(e) => handleInputChange(e.target.value)}\n className={twMerge(\n getInputBaseStyles({\n isInvalid,\n isDisabled,\n isFocused,\n size,\n transparent,\n }),\n showColorSwatch ? \"pr-12\" : \"pr-3\",\n \"pl-3\"\n )}\n />\n {showColorSwatch && (\n <div\n className=\"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none\"\n style={{ width: controlStyles[size].height }}\n >\n <div\n className={twMerge(\n \"w-6 h-6 rounded border shadow-sm\",\n isValidHexColor(value)\n ? \"border-border-default\"\n : \"border-border-default bg-background-muted\"\n )}\n style={isValidHexColor(value) ? { backgroundColor: value } : undefined}\n aria-hidden=\"true\"\n >\n {!isValidHexColor(value) && (\n <div className=\"w-full h-full flex items-center justify-center\">\n <div className=\"w-3 h-3 rounded-full border-2 border-border-muted\" />\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n <div ref={setTriggerElement}>\n <Button\n variant=\"secondary\"\n size={size}\n icon=\"Palette\"\n onPress={() => setIsPickerOpen(!isPickerOpen)}\n isDisabled={isDisabled}\n className=\"flex-shrink-0\"\n >\n Pick\n </Button>\n </div>\n </div>\n </InputWrapper>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n\n {/* Color Picker Popover */}\n {isPickerOpen && triggerElement && (\n <Popover\n triggerRef={{ current: triggerElement }}\n isOpen={isPickerOpen}\n onOpenChange={setIsPickerOpen}\n placement=\"bottom end\"\n className=\"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-lg p-4\"\n >\n <div className=\"flex flex-col gap-4\">\n <HexColorPicker\n color={value || \"#000000\"}\n onChange={handlePickerChange}\n style={{ width: \"200px\", height: \"200px\" }}\n />\n <div className=\"flex items-center gap-2\">\n <div\n className=\"w-10 h-10 rounded border border-border-default shadow-sm flex-shrink-0\"\n style={{ backgroundColor: value || \"#000000\" }}\n />\n <div className=\"flex-1 text-text-body text-[length:var(--control-text-sm)] font-mono\">\n {value || \"#000000\"}\n </div>\n </div>\n </div>\n </Popover>\n )}\n </div>\n )}\n </AriaTextFieldComponent>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { ColorField } from \"@/components/ColorField\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormColorFieldProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof ColorField>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n}\n\nexport function FormColorField<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormColorFieldProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <ColorField\n {...rest}\n value={(field.value as unknown as string) ?? \"\"}\n onChange={(v) => field.onChange(v)}\n isInvalid={!!error}\n errorMessage={error}\n />\n )}\n />\n );\n}\n","import {\n Calendar as AriaCalendar,\n CalendarGridHeader as AriaCalendarGridHeader,\n CalendarProps as AriaCalendarProps,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarHeaderCell,\n DateValue,\n Heading,\n Text,\n useLocale,\n} from \"react-aria-components\";\nimport { focusRing } from \"../../utils\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\n\nfunction getCellStyles({ isSelected, isDisabled }: { isSelected: boolean; isDisabled: boolean }) {\n const baseStyles = [\n focusRing,\n \"w-9 h-9 text-sm cursor-default rounded-sm flex items-center justify-center forced-color-adjust-none font-semibold\",\n ];\n\n if (isDisabled) {\n baseStyles.push(\"text-text-disabled forced-colors:text-[GrayText]\");\n } else if (isSelected) {\n baseStyles.push(\n \"bg-action-default text-text-onPrimary invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]\"\n );\n } else {\n baseStyles.push(\"text-text-body hover:bg-background-hover pressed:bg-background-selected\");\n }\n\n return baseStyles.join(\" \");\n}\n\n/**\n * Calendar\n *\n * Single-date calendar primitive with Edges styling.\n */\nexport interface CalendarProps<T extends DateValue>\n extends Omit<AriaCalendarProps<T>, \"visibleDuration\"> {\n errorMessage?: string;\n}\n\nexport function Calendar<T extends DateValue>({ errorMessage, ...props }: CalendarProps<T>) {\n return (\n <AriaCalendar {...props}>\n <CalendarHeader />\n <CalendarGrid className=\"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0\">\n <CalendarGridHeader />\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n date={date}\n className={({ isSelected, isDisabled }) =>\n `${getCellStyles({ isSelected, isDisabled })} border-0`\n }\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n {errorMessage && (\n <Text slot=\"errorMessage\" className=\"text-sm text-red-600\">\n {errorMessage}\n </Text>\n )}\n </AriaCalendar>\n );\n}\n\nexport function CalendarHeader() {\n const { direction } = useLocale();\n\n const buttonSize = 18;\n\n return (\n <header className=\"flex w-full items-center gap-1 px-1 pb-4\">\n <Button variant=\"icon\" slot=\"previous\" className=\"pl-0\">\n {direction === \"rtl\" ? (\n <Icon name=\"CaretRight\" aria-hidden size={buttonSize} />\n ) : (\n <Icon name=\"CaretLeft\" aria-hidden size={buttonSize} />\n )}\n </Button>\n <Heading className=\"text-md mx-2 flex-1 text-center font-semibold text-zinc-900 dark:text-zinc-200\" />\n <Button variant=\"icon\" slot=\"next\" className=\"pr-0\">\n {direction === \"rtl\" ? (\n <Icon name=\"CaretLeft\" aria-hidden size={buttonSize} />\n ) : (\n <Icon name=\"CaretRight\" aria-hidden size={buttonSize} />\n )}\n </Button>\n </header>\n );\n}\n\nexport function CalendarGridHeader() {\n return (\n <AriaCalendarGridHeader>\n {(day) => (\n <CalendarHeaderCell className=\"text-xs font-semibold text-text-caption\">\n {day}\n </CalendarHeaderCell>\n )}\n </AriaCalendarGridHeader>\n );\n}\n","\"use client\";\nimport { useState } from \"react\";\nimport {\n DateField as AriaDateField,\n DateFieldProps as AriaDateFieldProps,\n DateInput as AriaDateInput,\n DateInputProps,\n DateSegment,\n DateValue,\n Dialog,\n DialogTrigger,\n Popover,\n ValidationResult,\n} from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport { Button } from \"../Button\";\nimport { Calendar } from \"../Calendar\";\nimport {\n BaseInputProps,\n Description,\n FieldError,\n getInputStateStyles,\n InputWrapper,\n Label,\n} from \"../Field\";\nimport { Icon } from \"../Icon\";\n\n/**\n * DateField\n *\n * A segmented date input with optional calendar popup. Matches the API and styling\n * of TextField for consistency across form controls.\n */\nexport interface DateFieldProps<T extends DateValue>\n extends Omit<AriaDateFieldProps<T>, \"isRequired\" | \"size\" | \"className\">,\n Omit<BaseInputProps, \"transparent\" | \"isClearable\" | \"onClear\"> {\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n placeholder?: string;\n tooltip?: string;\n isRequired?: boolean;\n className?: string;\n validationResult?: ValidationResult;\n /**\n * Whether to show a calendar button for date selection\n * @default true\n */\n showCalendar?: boolean;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default true\n */\n reserveErrorSpace?: boolean;\n}\n\n/**\n * Renders an Edges DateField with label, description, validation states,\n * and optional calendar picker.\n */\nexport function DateField<T extends DateValue>({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n isDisabled,\n isInvalid,\n showCalendar = true,\n reserveErrorSpace = true,\n validationResult,\n className,\n ...props\n}: DateFieldProps<T>) {\n const [isCalendarOpen, setIsCalendarOpen] = useState(false);\n\n const handleCalendarSelect = (date: DateValue | null) => {\n if (props.onChange && date) {\n // @ts-expect-error - Complex type mapping between DateValue and MappedDateValue<T>\n props.onChange(date);\n }\n setIsCalendarOpen(false);\n };\n\n return (\n <AriaDateField\n {...props}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isInvalid={isInvalid}\n className={composeTailwindRenderProps(className, \"flex flex-col gap-1\")}\n >\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={isRequired}>\n {label}\n </Label>\n )}\n\n <InputWrapper>\n <div className=\"relative w-full\">\n <DateInput\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n hasCalendar={showCalendar}\n />\n {showCalendar && !isDisabled && (\n <DialogTrigger isOpen={isCalendarOpen} onOpenChange={setIsCalendarOpen}>\n <Button\n variant=\"unstyled\"\n className=\"absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center rounded hover:bg-background-hover text-text-muted hover:text-text-body transition-colors\"\n aria-label=\"Open calendar\"\n >\n <Icon name=\"Calendar\" size={18} />\n </Button>\n <Popover className=\"bg-background-surface rounded-lg border border-border-default shadow-xl\">\n <Dialog className=\"p-4 outline-none\">\n <Calendar\n value={props.value}\n onChange={handleCalendarSelect}\n minValue={props.minValue}\n maxValue={props.maxValue}\n isDisabled={isDisabled}\n isReadOnly={props.isReadOnly}\n isDateUnavailable={props.isDateUnavailable}\n />\n </Dialog>\n </Popover>\n </DialogTrigger>\n )}\n </div>\n </InputWrapper>\n\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </AriaDateField>\n );\n}\n\nfunction getSegmentStyles({\n isPlaceholder,\n isDisabled,\n size = \"md\",\n}: {\n isPlaceholder?: boolean;\n isDisabled?: boolean;\n size?: Size;\n}) {\n // Size styles with mobile font-size fix\n // iOS Safari zooms in on inputs with font-size < 16px when focused.\n // On mobile, we use text-base (16px) for sm/md sizes to prevent auto-zoom.\n // On desktop (md: breakpoint), we restore the original smaller sizes.\n const sizeStyles: Record<Size, string> = {\n sm: \"text-base md:text-xs\",\n md: \"text-base md:text-sm\",\n lg: \"text-base\",\n xl: \"text-lg\",\n };\n\n return twMerge(\n // Base\n \"inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors\",\n sizeStyles[size],\n // Text color\n isPlaceholder ? \"text-text-placeholder italic\" : \"text-text-body\",\n // Disabled state\n isDisabled ? \"text-text-disabled cursor-not-allowed\" : \"cursor-text\",\n // Hover/focus\n !isDisabled && \"hover:bg-background-hover\",\n \"data-[focused]:bg-background-selected data-[focused]:text-text-body\"\n );\n}\n\ninterface DateInputComponentProps extends Omit<DateInputProps, \"children\"> {\n size?: Size;\n isDisabled?: boolean;\n isInvalid?: boolean;\n hasCalendar?: boolean;\n}\n\nexport function DateInput({\n size = \"md\",\n isDisabled,\n isInvalid,\n hasCalendar,\n className,\n ...props\n}: DateInputComponentProps) {\n return (\n <AriaDateInput\n className={twMerge(\n getInputStateStyles({\n isInvalid,\n isDisabled,\n }),\n // Padding adjustments\n \"px-3 py-2 flex items-center gap-0.5 w-full\",\n hasCalendar && \"pr-10\", // Make room for calendar icon\n className as string\n )}\n {...props}\n >\n {(segment) => (\n <DateSegment\n segment={segment}\n className={getSegmentStyles({\n isPlaceholder: segment.isPlaceholder,\n isDisabled: !segment.isEditable || isDisabled,\n size,\n })}\n />\n )}\n </AriaDateInput>\n );\n}\n","import * as React from \"react\";\nimport type { DateValue } from \"react-aria-components\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { DateField } from \"@/components/DateField\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormDateFieldProps<T extends FieldValues, D extends DateValue = DateValue>\n extends Omit<React.ComponentProps<typeof DateField<D>>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: D | null;\n}\n\nexport function FormDateField<T extends FieldValues, D extends DateValue = DateValue>({\n name,\n defaultValue,\n ...rest\n}: FormDateFieldProps<T, D>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <DateField\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n {...(rest as any)}\n value={(field.value as unknown as D) ?? null}\n onChange={(v: D) => field.onChange(v)}\n isInvalid={!!error}\n errorMessage={error}\n />\n )}\n />\n );\n}\n","\"use client\";\nimport { Image as ImageIcon, Upload, X } from \"lucide-react\";\nimport { useRef, useState } from \"react\";\nimport { DropZone, FileTrigger } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Button } from \"../Button\";\n\nexport interface FileUploadProps {\n /**\n * Current file URL or preview\n */\n value?: string;\n /**\n * Callback when file is selected\n */\n onChange?: (file: File | null, url?: string) => void;\n /**\n * Callback when file URL changes (for external upload handlers)\n */\n onUrlChange?: (url: string) => void;\n /**\n * Accepted file types\n */\n accept?: string;\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n /**\n * Whether the component is disabled\n */\n isDisabled?: boolean;\n /**\n * Custom upload handler (e.g., for cloud storage)\n */\n onUpload?: (file: File) => Promise<string>;\n /**\n * Additional CSS classes\n */\n className?: string;\n /**\n * Show image preview for image files\n */\n showPreview?: boolean;\n /**\n * Placeholder text\n */\n placeholder?: string;\n}\n\n/**\n * FileUpload\n *\n * A file upload component with drag-and-drop support.\n * Supports image preview, custom upload handlers, and file validation.\n */\nexport function FileUpload({\n value,\n onChange,\n onUrlChange,\n accept = \"image/*\",\n maxSize,\n isDisabled = false,\n onUpload,\n className,\n showPreview = true,\n placeholder = \"Drop files here or click to browse\",\n}: FileUploadProps) {\n const [isDragging, setIsDragging] = useState(false);\n const [isUploading, setIsUploading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [preview, setPreview] = useState<string | undefined>(value);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const handleFile = async (file: File) => {\n setError(null);\n\n // Validate file size\n if (maxSize && file.size > maxSize) {\n setError(`File size must be less than ${(maxSize / 1024 / 1024).toFixed(2)}MB`);\n return;\n }\n\n // Handle file preview for images\n if (showPreview && file.type.startsWith(\"image/\")) {\n const reader = new FileReader();\n reader.onloadend = () => {\n setPreview(reader.result as string);\n };\n reader.readAsDataURL(file);\n }\n\n // If custom upload handler is provided, use it\n if (onUpload) {\n setIsUploading(true);\n try {\n const url = await onUpload(file);\n setPreview(url);\n onUrlChange?.(url);\n } catch (err) {\n setError(\"Failed to upload file\");\n console.error(\"Upload error:\", err);\n } finally {\n setIsUploading(false);\n }\n }\n\n onChange?.(file, preview);\n };\n\n const handleDrop = (e: any) => {\n const items = e.items;\n if (items.length > 0) {\n const item = items[0];\n if (item.kind === \"file\") {\n const file = item.getAsFile();\n if (file) {\n handleFile(file);\n }\n }\n }\n setIsDragging(false);\n };\n\n const handleRemove = () => {\n setPreview(undefined);\n setError(null);\n onChange?.(null);\n onUrlChange?.(\"\");\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n };\n\n return (\n <div className={twMerge(\"w-full\", className)}>\n <DropZone\n className={twMerge(\n \"relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors\",\n isDragging\n ? \"border-action-brand bg-action-brand/5\"\n : \"border-border-muted hover:border-border-default\",\n isDisabled && \"pointer-events-none opacity-50\",\n error && \"border-feedback-error-border bg-feedback-error-background/50\"\n )}\n onDrop={handleDrop}\n onDropEnter={() => setIsDragging(true)}\n onDropExit={() => setIsDragging(false)}\n >\n {preview ? (\n <div className=\"relative flex h-full w-full items-center justify-center p-4\">\n {showPreview && preview.startsWith(\"data:image\") ? (\n <img\n src={preview}\n alt=\"Preview\"\n className=\"max-h-48 max-w-full rounded-md object-contain\"\n />\n ) : (\n <div className=\"flex flex-col items-center gap-2\">\n <ImageIcon className=\"h-12 w-12 text-text-muted\" />\n <span className=\"text-sm text-text-muted\">File uploaded</span>\n </div>\n )}\n {!isDisabled && (\n <Button\n variant=\"icon\"\n size=\"sm\"\n onPress={handleRemove}\n className=\"absolute right-2 top-2 bg-background-surface shadow-md\"\n >\n <X className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n ) : (\n <div className=\"flex flex-col items-center gap-4 p-6\">\n <Upload className=\"h-12 w-12 text-text-muted\" />\n <div className=\"text-center\">\n <p className=\"text-sm text-text-body\">{placeholder}</p>\n <p className=\"mt-1 text-xs text-text-muted\">\n {accept === \"image/*\" ? \"PNG, JPG, GIF up to 10MB\" : `Accepts ${accept}`}\n </p>\n </div>\n <FileTrigger\n acceptedFileTypes={accept.split(\",\")}\n onSelect={(e) => {\n const files = Array.from(e || []);\n if (files.length > 0) {\n handleFile(files[0]);\n }\n }}\n >\n <Button variant=\"secondary\" size=\"sm\" isDisabled={isDisabled}>\n Choose File\n </Button>\n </FileTrigger>\n </div>\n )}\n {isUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80\">\n <div className=\"flex flex-col items-center gap-2\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-2 border-action-brand border-t-transparent\" />\n <span className=\"text-sm text-text-muted\">Uploading...</span>\n </div>\n </div>\n )}\n </DropZone>\n {error && <p className=\"mt-2 text-sm text-feedback-error-text\">{error}</p>}\n </div>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { FieldError } from \"@/components/Field\";\nimport { FileUpload } from \"@/components/FileUpload\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormFileUploadProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof FileUpload>, \"value\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n errorBelow?: boolean;\n}\n\nexport function FormFileUpload<T extends FieldValues>({\n name,\n defaultValue,\n errorBelow = true,\n ...rest\n}: FormFileUploadProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <div className=\"flex flex-col gap-1\">\n <FileUpload\n {...rest}\n value={(field.value as unknown as string) ?? \"\"}\n onChange={(_, url) => field.onChange(url || \"\")}\n />\n {errorBelow && error && <FieldError>{error}</FieldError>}\n </div>\n )}\n />\n );\n}\n","import { useId } from \"react\";\nimport {\n Button as AriaButton,\n Input as AriaInput,\n NumberField as AriaNumberField,\n NumberFieldProps as AriaNumberFieldProps,\n Group,\n ValidationResult,\n} from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport {\n BaseInputProps,\n Description,\n FieldError,\n getInputBaseStyles,\n Label,\n useInputFocus,\n} from \"../Field\";\nimport { Icon } from \"../Icon\";\n\nconst getNumberFieldStyles = (props: {\n isInvalid?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n transparent?: boolean;\n size?: Size;\n className?: string;\n}): string => {\n // Get base input styles (includes state, background, sizing, padding)\n const baseStyles = getInputBaseStyles({\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isFocused: props.isFocused,\n transparent: props.transparent,\n size: props.size,\n });\n\n // Add NumberField-specific styles\n return twMerge(\n baseStyles,\n \"pr-9\", // Space for stepper buttons\n \"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none\", // Hide native spinners\n props.className\n );\n};\n\n/**\n * NumberField\n *\n * Numeric input with stepper controls and validation.\n */\nexport interface NumberFieldProps\n extends Omit<AriaNumberFieldProps, \"size\" | \"className\">,\n BaseInputProps {\n value?: number;\n defaultValue?: number;\n onChange?: (value: number) => void;\n minValue?: number;\n maxValue?: number;\n step?: number;\n formatOptions?: Intl.NumberFormatOptions;\n id?: string;\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n tooltip?: string;\n isRequired?: boolean;\n className?: string;\n validationResult?: ValidationResult;\n /**\n * Where to display the description text\n * - \"below\": Show below the field (default)\n * - \"tooltip\": Show as a tooltip on the label icon\n * - \"inline\": Show inline with the label\n * - \"hidden\": Don't display the description\n * @default \"below\"\n */\n descriptionPlacement?: \"below\" | \"tooltip\" | \"inline\" | \"hidden\";\n}\n\nexport function NumberField({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n transparent,\n validationResult,\n reserveErrorSpace = true,\n descriptionPlacement = \"below\",\n ...props\n}: NumberFieldProps) {\n const id = useId();\n const { isFocused, handleFocus, handleBlur } = useInputFocus();\n\n return (\n <AriaNumberField\n {...props}\n id={id}\n isRequired={isRequired}\n className={composeTailwindRenderProps(props.className, \"group flex flex-col gap-1\")}\n step={props.step ?? 1}\n onChange={(value) => {\n if (typeof value === \"number\") {\n if (props.maxValue != null && value > props.maxValue) {\n props.onChange?.(props.maxValue);\n } else if (props.minValue != null && value < props.minValue) {\n props.onChange?.(props.minValue);\n } else {\n props.onChange?.(value);\n }\n }\n }}\n isInvalid={\n !!errorMessage ||\n (typeof props.value === \"number\" &&\n ((props.maxValue != null && props.value > props.maxValue) ||\n (props.minValue != null && props.value < props.minValue)))\n }\n >\n {({ isDisabled, isInvalid }) => {\n const isValueInvalid = isInvalid || !!errorMessage;\n return (\n <div className=\"flex flex-col gap-1\">\n {label && (\n <Label\n size={size}\n tooltip={tooltip}\n description={\n descriptionPlacement === \"tooltip\" || descriptionPlacement === \"inline\"\n ? description\n : undefined\n }\n descriptionPlacement={descriptionPlacement}\n isRequired={isRequired}\n htmlFor={id}\n >\n {label}\n </Label>\n )}\n <div className=\"relative\">\n <Group className=\"relative\">\n <AriaInput\n onFocus={(e) => handleFocus(e, props.onFocus)}\n onBlur={(e) => handleBlur(e, props.onBlur)}\n className={getNumberFieldStyles({\n isInvalid: isValueInvalid,\n isDisabled,\n isFocused,\n transparent,\n size,\n className: typeof props.className === \"string\" ? props.className : undefined,\n })}\n />\n <div className=\"absolute inset-y-[2px] right-[2px] flex flex-col divide-y divide-border-default border-l border-border-default overflow-hidden rounded-r-[calc(var(--control-border-radius)-2px)]\">\n <AriaButton\n slot=\"increment\"\n isDisabled={isDisabled}\n className=\"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Icon name=\"CaretUp\" size={14} />\n </AriaButton>\n <AriaButton\n slot=\"decrement\"\n isDisabled={isDisabled}\n className=\"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Icon name=\"CaretDown\" size={14} />\n </AriaButton>\n </div>\n </Group>\n </div>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {errorMessage ? (\n <FieldError size={size}>\n {typeof errorMessage === \"function\"\n ? errorMessage(validationResult!)\n : errorMessage}\n </FieldError>\n ) : description && descriptionPlacement === \"below\" ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {errorMessage ? (\n <FieldError size={size} className=\"mt-1\">\n {typeof errorMessage === \"function\"\n ? errorMessage(validationResult!)\n : errorMessage}\n </FieldError>\n ) : description && descriptionPlacement === \"below\" ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </div>\n );\n }}\n </AriaNumberField>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { NumberField } from \"@/components/NumberField\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormNumberFieldProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof NumberField>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: number;\n}\n\nexport function FormNumberField<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormNumberFieldProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <NumberField\n {...rest}\n value={typeof field.value === \"number\" ? (field.value as number) : undefined}\n onChange={(v) => field.onChange(v)}\n isInvalid={!!error}\n errorMessage={error}\n isRequired={rest.isRequired}\n />\n )}\n />\n );\n}\n","\"use client\";\n\nimport { createContext, type ReactNode, useContext } from \"react\";\nimport {\n Radio as RACRadio,\n RadioGroup as RACRadioGroup,\n RadioGroupProps as RACRadioGroupProps,\n RadioProps,\n ValidationResult,\n} from \"react-aria-components\";\nimport { composeTailwindRenderProps, focusRing } from \"../../utils\";\nimport { Description, FieldError, Label } from \"../Field\";\n\n// Context to pass variant to Radio components\nconst RadioGroupContext = createContext<{ variant: \"default\" | \"brand\" }>({ variant: \"brand\" });\n\nexport interface RadioGroupProps extends Omit<RACRadioGroupProps, \"children\"> {\n /** Label for the radio group */\n label?: string;\n /** Children elements */\n children?: ReactNode;\n /** Optional description for the radio group */\n description?: string;\n /** Error message to display when validation fails */\n errorMessage?: string | ((validation: ValidationResult) => string);\n /** Validation result object for functional errorMessage */\n validationResult?: ValidationResult;\n /**\n * Visual variant of the radio buttons\n * @default \"default\"\n */\n variant?: \"default\" | \"brand\";\n}\n\nexport function RadioGroup(props: RadioGroupProps) {\n const { variant = \"default\", ...otherProps } = props;\n return (\n <RadioGroupContext.Provider value={{ variant }}>\n <RACRadioGroup\n {...otherProps}\n className={composeTailwindRenderProps(props.className, \"group flex flex-col gap-2\")}\n >\n <Label>{props.label}</Label>\n <div className=\"flex gap-2 group-orientation-horizontal:gap-4 group-orientation-vertical:flex-col\">\n {props.children}\n </div>\n {props.description && <Description>{props.description}</Description>}\n <FieldError>\n {typeof props.errorMessage === \"function\" && props.validationResult\n ? props.errorMessage(props.validationResult)\n : typeof props.errorMessage === \"string\"\n ? props.errorMessage\n : null}\n </FieldError>\n </RACRadioGroup>\n </RadioGroupContext.Provider>\n );\n}\n\nfunction getRadioStyles({\n isSelected,\n isInvalid,\n isDisabled,\n variant = \"brand\",\n}: {\n isSelected?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n variant?: \"default\" | \"brand\";\n}) {\n const focusRingColor =\n variant === \"brand\"\n ? \"focus-visible:outline-action-brand\"\n : \"focus-visible:outline-action-default\";\n const baseClasses = [\n focusRing(),\n focusRingColor,\n \"w-5 h-5 rounded-full border-2 bg-background-surface transition-all\",\n ];\n\n if (isDisabled) {\n baseClasses.push(\"border-border-muted forced-colors:!border-[GrayText]\");\n } else if (isInvalid) {\n baseClasses.push(\n \"border-feedback-error-border group-pressed:border-feedback-error-border dark:group-pressed:border-feedback-error-border forced-colors:!border-[Mark]\"\n );\n } else if (isSelected) {\n const actionColor = variant === \"brand\" ? \"action-brand\" : \"action-default\";\n baseClasses.push(\n `border-[7px] border-${actionColor} forced-colors:!border-[Highlight] group-pressed:border-${actionColor}-hover dark:group-pressed:border-${actionColor}-hover`\n );\n } else {\n baseClasses.push(\n \"border-border-default group-pressed:border-border-focus dark:group-pressed:border-border-focus\"\n );\n }\n\n return baseClasses.join(\" \");\n}\n\nexport function Radio(props: RadioProps) {\n const { variant } = useContext(RadioGroupContext);\n return (\n <RACRadio\n {...props}\n className={composeTailwindRenderProps(\n props.className,\n \"group flex items-center gap-2 text-sm text-text-body transition disabled:text-text-muted dark:text-text-body dark:disabled:text-text-muted forced-colors:disabled:text-[GrayText]\"\n )}\n >\n {(renderProps) => (\n <>\n <div className={getRadioStyles({ ...renderProps, variant })} />\n {props.children}\n </>\n )}\n </RACRadio>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { RadioGroup } from \"@/components/RadioGroup\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormRadioGroupProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof RadioGroup>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n}\n\nexport function FormRadioGroup<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormRadioGroupProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <RadioGroup\n {...rest}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n value={field.value as any}\n onChange={(v) => field.onChange(v)}\n errorMessage={error}\n >\n {rest.children}\n </RadioGroup>\n )}\n />\n );\n}\n","import React from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\nconst sizeVariants = {\n xs: \"text-lg font-semibold\",\n sm: \"text-xl font-semibold\",\n md: \"text-2xl font-semibold\",\n lg: \"text-3xl font-semibold\",\n xl: \"text-4xl font-semibold\",\n} as const;\n\nconst heightVariants = {\n page: \"h-16 leading-[62px]\",\n} as const;\n\nexport type HeadingSize = keyof typeof sizeVariants;\nexport type HeadingHeight = keyof typeof heightVariants;\n\n/**\n * Heading\n *\n * Typography component for page/section headings with size and height options.\n */\nexport interface HeadingProps {\n tag?: React.ElementType;\n size?: HeadingSize;\n height?: HeadingHeight;\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function Heading({\n tag: Tag = \"h1\",\n size = \"lg\",\n height,\n className = \"\",\n children,\n}: HeadingProps) {\n const sizeClasses = sizeVariants[size];\n const heightClasses = height ? heightVariants[height] : \"\";\n\n return <Tag className={twMerge(sizeClasses, heightClasses, className)}>{children}</Tag>;\n}\n","import React from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Button } from \"../Button\";\nimport { Heading } from \"../Heading\";\nimport { Icon } from \"../Icon\";\n\ntype BaseDialogHeaderProps = {\n title?: string;\n onClose?: () => void;\n hideCloseIcon?: boolean;\n titleAlign?: \"left\" | \"center\";\n headerContent?: React.ReactNode;\n};\n\ntype WithBackArrow = BaseDialogHeaderProps & {\n hasBackArrow: true;\n onBack: () => void;\n};\n\ntype WithoutBackArrow = BaseDialogHeaderProps & {\n hasBackArrow?: false;\n onBack?: never;\n};\n\n/**\n * DialogHeader\n *\n * Header area for dialogs with optional back arrow.\n */\nexport type DialogHeaderProps = WithBackArrow | WithoutBackArrow;\n\nexport const DialogHeader: React.FC<DialogHeaderProps> = ({\n title,\n onClose,\n hideCloseIcon = false,\n titleAlign = \"left\",\n hasBackArrow = false,\n onBack,\n headerContent,\n}) => {\n return (\n <div\n className={twMerge(\n \"relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6\",\n title && \"border-b\",\n titleAlign === \"center\" ? \"justify-center\" : \"\"\n )}\n >\n {hasBackArrow && (\n <Button variant=\"icon\" onPress={onBack} className=\"absolute left-6\" aria-label=\"Go back\">\n <Icon name=\"CaretLeft\" data-testid=\"back-arrow\" />\n </Button>\n )}\n {headerContent || (\n <>\n {title && <Heading size=\"xs\">{title}</Heading>}\n {onClose && !hideCloseIcon && (\n <Button variant=\"icon\" onPress={onClose} aria-label=\"Close dialog\">\n <Icon name=\"X\" data-testid=\"close-button\" />\n </Button>\n )}\n </>\n )}\n </div>\n );\n};\n","import { twMerge } from \"tailwind-merge\";\n\nexport interface LoaderProps {\n /**\n * Optional className for custom styling\n */\n className?: string;\n /**\n * Size of the loader in pixels\n * @default 24\n */\n size?: number;\n /**\n * Color of the loader\n * @default \"text-action-brand\"\n */\n color?: string;\n}\n\n/**\n * Loader\n *\n * Animated loading spinner component.\n * Displays a circular spinner with customizable size and color for loading states.\n */\nexport const Loader = ({ className, size = 24, color = \"text-action-brand\" }: LoaderProps) => {\n return (\n <div\n className={twMerge(\n \"inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent\",\n color,\n className\n )}\n style={{\n width: size,\n height: size,\n }}\n role=\"status\"\n aria-label=\"loading\"\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n};\n","\"use client\";\nimport React from \"react\";\nimport type {\n TextFieldProps as AriaTextFieldProps,\n TextFieldRenderProps,\n ValidationResult,\n} from \"react-aria-components\";\nimport { TextField as AriaTextFieldComponent } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport {\n BaseInputProps,\n ClearButton,\n Description,\n FieldError,\n getInputBaseStyles,\n Input,\n InputWrapper,\n Label,\n useInputFocus,\n} from \"../Field\";\nimport { Icon } from \"../Icon/Icon\";\nimport { Loader } from \"../Loader\";\n\nconst getTextFieldStyles = (props: {\n isInvalid?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n transparent?: boolean;\n size?: Size;\n showSearchIcon?: boolean;\n isClearable?: boolean;\n hasValue?: boolean;\n isPassword?: boolean;\n className?: string;\n}): string => {\n // Get base input styles\n const baseStyles = getInputBaseStyles({\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isFocused: props.isFocused,\n transparent: props.transparent,\n size: props.size,\n });\n\n // Add TextField-specific padding styles\n const paddingStyles = [\n props.showSearchIcon ? \"pl-8\" : \"pl-3\",\n (props.isClearable && props.hasValue) || props.isPassword ? \"pr-8\" : \"pr-3\",\n ].join(\" \");\n\n return twMerge(baseStyles, paddingStyles, props.className);\n};\n\n/**\n * TextField\n *\n * A controlled or uncontrolled text input with Edges styling, label,\n * description, error messaging, and optional affordances like a search icon,\n * clear button, and password visibility toggle. Wraps\n * `react-aria-components` TextField for accessible behavior.\n */\nexport interface TextFieldProps\n extends Omit<AriaTextFieldProps, \"isRequired\" | \"size\" | \"className\">,\n BaseInputProps {\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n placeholder?: string;\n tooltip?: string;\n isRequired?: boolean;\n className?: string;\n validationResult?: ValidationResult;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default true\n */\n reserveErrorSpace?: boolean;\n /**\n * Shows a loading spinner instead of the search icon (only applicable when showSearchIcon is true)\n * @default false\n */\n isLoading?: boolean;\n /**\n * Where to display the description text\n * - \"below\": Show below the field (default)\n * - \"tooltip\": Show as a tooltip on the label icon\n * - \"inline\": Show inline with the label\n * - \"hidden\": Don't display the description\n * @default \"below\"\n */\n descriptionPlacement?: \"below\" | \"tooltip\" | \"inline\" | \"hidden\";\n}\n\n/**\n * Renders an Edges TextField with label, description, validation states and\n * optional search/clear/password affordances.\n */\nexport function TextField({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n transparent,\n showSearchIcon,\n isClearable,\n onClear,\n type,\n validationResult,\n reserveErrorSpace = true,\n isLoading = false,\n descriptionPlacement = \"below\",\n ...props\n}: TextFieldProps) {\n const [showPassword, setShowPassword] = React.useState(false);\n const { isFocused, handleFocus, handleBlur } = useInputFocus();\n const isPassword = type === \"password\";\n\n return (\n <AriaTextFieldComponent\n {...props}\n isRequired={isRequired}\n className={composeTailwindRenderProps(props.className, \"group flex flex-col\")}\n >\n {({ isDisabled, isInvalid }: TextFieldRenderProps) => (\n <div className=\"flex flex-col\">\n {label && (\n <Label\n size={size}\n tooltip={tooltip}\n description={\n descriptionPlacement === \"tooltip\" || descriptionPlacement === \"inline\"\n ? description\n : undefined\n }\n descriptionPlacement={descriptionPlacement}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n <InputWrapper>\n {showSearchIcon && (\n <div className=\"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 transform flex items-center z-10\">\n {isLoading ? (\n <Loader size={16} color=\"text-text-muted\" />\n ) : (\n <Icon\n name=\"MagnifyingGlass\"\n className={`h-4 w-4 translate-y-[0.5px] transition-colors ${\n isFocused ? \"text-action-brand\" : \"text-text-muted\"\n }`}\n />\n )}\n </div>\n )}\n <Input\n size={size}\n disabled={isDisabled}\n type={isPassword ? (showPassword ? \"text\" : \"password\") : type}\n value={props.value as string | undefined}\n defaultValue={props.defaultValue as string | undefined}\n placeholder={props.placeholder}\n onFocus={(e) => handleFocus(e, props.onFocus)}\n onBlur={(e) => handleBlur(e, props.onBlur)}\n onChange={(e) => props.onChange?.(e.target.value)}\n className={getTextFieldStyles({\n isInvalid,\n isDisabled,\n isFocused,\n size,\n transparent,\n showSearchIcon,\n isClearable,\n hasValue: !!props.value,\n isPassword,\n className: typeof props.className === \"string\" ? props.className : undefined,\n })}\n />\n {isClearable && props.value && !isDisabled && (\n <ClearButton\n onClick={() => {\n if (onClear) {\n onClear();\n } else if (props.onChange) {\n props.onChange(\"\");\n }\n }}\n size={size}\n />\n )}\n {isPassword && !isDisabled && (\n <button\n type=\"button\"\n onClick={() => setShowPassword(!showPassword)}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body\"\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <Icon\n name={showPassword ? \"EyeSlash\" : \"Eye\"}\n size={size === \"sm\" ? 16 : 20}\n className=\"text-text-body\"\n />\n </button>\n )}\n </InputWrapper>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description && descriptionPlacement === \"below\" ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description && descriptionPlacement === \"below\" ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </div>\n )}\n </AriaTextFieldComponent>\n );\n}\n","\"use client\";\nimport Link from \"@tiptap/extension-link\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport { BubbleMenu } from \"@tiptap/react/menus\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport React, { useState } from \"react\";\nimport { Modal, Dialog as RACDialog } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Button } from \"../Button\";\nimport { DialogHeader } from \"../DialogHeader\";\nimport { Icon } from \"../Icon\";\nimport { ModalBackdrop } from \"../ModalBackdrop\";\nimport { TextField } from \"../TextField\";\n\nexport interface RichTextEditorProps {\n /**\n * The initial content of the editor\n */\n initialContent?: string;\n /**\n * Callback when the content changes\n */\n onChange?: (html: string) => void;\n /**\n * Additional className to apply to the editor\n */\n className?: string;\n /**\n * Whether the editor is disabled\n */\n isDisabled?: boolean;\n /**\n * Placeholder text when editor is empty\n */\n placeholder?: string;\n /**\n * ID for the editor element for label association\n */\n id?: string;\n}\n\nconst ToolbarButton = ({\n isActive = false,\n onPress,\n children,\n}: {\n isActive?: boolean;\n onPress: () => void;\n children: React.ReactNode;\n}) => (\n <Button variant={isActive ? \"secondary\" : \"ghost\"} size=\"sm\" onPress={onPress} className=\"p-1\">\n {children}\n </Button>\n);\n\ninterface LinkDialogProps {\n initialUrl: string;\n isOpen: boolean;\n onClose: () => void;\n onSubmit: (url: string) => void;\n}\n\nfunction LinkDialog({ initialUrl, isOpen, onClose, onSubmit }: LinkDialogProps) {\n const [url, setUrl] = useState(initialUrl);\n\n React.useEffect(() => {\n setUrl(initialUrl);\n }, [initialUrl]);\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n onSubmit(url);\n onClose();\n };\n\n return (\n <ModalBackdrop isDismissable isOpen={isOpen} onOpenChange={(isOpen) => !isOpen && onClose()}>\n <Modal\n isDismissable\n className=\"flex items-center justify-center p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0\"\n >\n <RACDialog className=\"relative bg-background-surface rounded-lg shadow-xl max-w-md w-full\">\n <form onSubmit={handleSubmit}>\n <DialogHeader title=\"Insert Link\" onClose={onClose} />\n <div className=\"p-6\">\n <TextField\n label=\"URL\"\n type=\"url\"\n value={url}\n onChange={setUrl}\n autoFocus\n className=\"w-full\"\n />\n </div>\n <div className=\"flex justify-end gap-2 border-t border-border-muted p-4\">\n <Button variant=\"secondary\" onPress={onClose}>\n Cancel\n </Button>\n <Button type=\"submit\">Save</Button>\n </div>\n </form>\n </RACDialog>\n </Modal>\n </ModalBackdrop>\n );\n}\n\n/**\n * RichTextEditor\n *\n * A rich text editor with formatting capabilities including headings, bold, italic, lists, and links.\n * Built on top of TipTap/ProseMirror.\n */\nexport function RichTextEditor({\n initialContent = \"\",\n onChange,\n className,\n isDisabled = false,\n placeholder = \"Start typing...\",\n id,\n}: RichTextEditorProps) {\n const [isLinkDialogOpen, setIsLinkDialogOpen] = useState(false);\n const editor = useEditor({\n immediatelyRender: false,\n extensions: [\n StarterKit.configure({\n heading: {\n levels: [1, 2],\n },\n }),\n Link.configure({\n openOnClick: false,\n HTMLAttributes: {\n class:\n \"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer\",\n },\n }),\n ],\n content: initialContent,\n editable: !isDisabled,\n onUpdate: ({ editor }) => {\n onChange?.(editor.getHTML());\n },\n editorProps: {\n attributes: {\n class: twMerge(\n \"prose prose-sm max-w-none\",\n \"focus:outline-none\",\n \"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0\"\n ),\n },\n },\n });\n\n const handleLinkClick = () => {\n setIsLinkDialogOpen(true);\n };\n\n const handleLinkSubmit = (url: string) => {\n if (url === \"\") {\n editor?.chain().focus().unsetLink().run();\n } else {\n editor?.chain().focus().setLink({ href: url }).run();\n }\n };\n\n if (!editor) {\n return null;\n }\n\n return (\n <div\n id={id}\n data-richtexteditor\n className={twMerge(\n \"flex flex-col rounded-md border border-border-input bg-background-input\",\n \"outline-none focus-within:outline-none focus-within:border-border-input focus-within:ring-0 focus-within:shadow-none\",\n isDisabled && \"opacity-50\",\n className\n )}\n style={{ outline: \"none\" }}\n >\n {editor && (\n <>\n <BubbleMenu\n editor={editor}\n shouldShow={({ editor }) => editor.isActive(\"link\") && !isLinkDialogOpen}\n className=\"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md\"\n >\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-8 px-2\"\n onPress={() => {\n const href = editor.getAttributes(\"link\").href;\n window.open(href, \"_blank\");\n }}\n >\n <Icon name=\"ArrowSquareOut\" className=\"mr-1 h-4 w-4\" />\n Open\n </Button>\n <Button variant=\"ghost\" size=\"sm\" className=\"h-8 px-2\" onPress={handleLinkClick}>\n <Icon name=\"PencilSimple\" className=\"mr-1 h-4 w-4\" />\n Edit\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-8 px-2\"\n onPress={() => editor.chain().focus().unsetLink().run()}\n >\n <Icon name=\"X\" className=\"mr-1 h-4 w-4\" />\n Remove\n </Button>\n </BubbleMenu>\n\n <LinkDialog\n isOpen={isLinkDialogOpen}\n onClose={() => setIsLinkDialogOpen(false)}\n onSubmit={handleLinkSubmit}\n initialUrl={editor.getAttributes(\"link\").href || \"\"}\n />\n </>\n )}\n <div className=\"flex items-center gap-1 border-b border-border-input p-2\">\n <ToolbarButton\n isActive={editor.isActive(\"heading\", { level: 1 })}\n onPress={() => editor.chain().focus().toggleHeading({ level: 1 }).run()}\n >\n <span className=\"text-xs font-bold\">H1</span>\n </ToolbarButton>\n <ToolbarButton\n isActive={editor.isActive(\"heading\", { level: 2 })}\n onPress={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}\n >\n <span className=\"text-xs font-bold\">H2</span>\n </ToolbarButton>\n <ToolbarButton\n isActive={editor.isActive(\"bold\")}\n onPress={() => editor.chain().focus().toggleBold().run()}\n >\n <span className=\"text-xs font-bold\">B</span>\n </ToolbarButton>\n <ToolbarButton\n isActive={editor.isActive(\"italic\")}\n onPress={() => editor.chain().focus().toggleItalic().run()}\n >\n <span className=\"text-xs italic\">I</span>\n </ToolbarButton>\n <div className=\"mx-1 h-4 w-px bg-border-muted\" />\n <ToolbarButton\n isActive={editor.isActive(\"bulletList\")}\n onPress={() => editor.chain().focus().toggleBulletList().run()}\n >\n <Icon name=\"ListBullets\" className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n isActive={editor.isActive(\"orderedList\")}\n onPress={() => editor.chain().focus().toggleOrderedList().run()}\n >\n <Icon name=\"ListNumbers\" className=\"h-4 w-4\" />\n </ToolbarButton>\n <div className=\"mx-1 h-4 w-px bg-border-muted\" />\n <ToolbarButton isActive={editor.isActive(\"link\")} onPress={handleLinkClick}>\n <Icon name=\"PaperclipHorizontal\" className=\"h-4 w-4\" />\n </ToolbarButton>\n </div>\n <div className=\"relative min-h-[200px] w-full outline-none focus:outline-none\">\n <EditorContent\n editor={editor}\n className={twMerge(\n \"w-full p-4 outline-none focus:outline-none\",\n \"[&_.ProseMirror]:min-h-[inherit]\",\n \"[&_.ProseMirror]:outline-none [&_.ProseMirror]:focus:outline-none\",\n \"[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold\",\n \"[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold\",\n \"[&_.ProseMirror_p]:mb-2\",\n \"[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ul]:list-disc\",\n \"[&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6 [&_.ProseMirror_ol]:list-decimal\",\n \"[&_.ProseMirror_li]:mb-1\",\n \"[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic\",\n \"[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm\",\n \"[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm\",\n \"[&_.ProseMirror_hr]:border-border-muted\",\n isDisabled && \"pointer-events-none\"\n )}\n />\n {editor.isEmpty && !isDisabled && (\n <div className=\"pointer-events-none absolute left-4 top-4 text-text-muted\">\n {placeholder}\n </div>\n )}\n </div>\n </div>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { RichTextEditor } from \"@/components/RichTextEditor\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormRichTextEditorProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof RichTextEditor>, \"initialContent\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n /**\n * Label for the field\n */\n label?: string;\n /**\n * Description text shown below the field\n */\n description?: string;\n /**\n * Whether to reserve space for error messages\n * @default true\n */\n reserveErrorSpace?: boolean;\n}\n\nexport function FormRichTextEditor<T extends FieldValues>({\n name,\n defaultValue,\n label,\n description,\n reserveErrorSpace = true,\n ...rest\n}: FormRichTextEditorProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <div className=\"flex flex-col gap-1\">\n {label && (\n <label htmlFor={name} className=\"text-sm font-medium text-text-heading\">\n {label}\n </label>\n )}\n {description && <p className=\"text-sm text-text-muted\">{description}</p>}\n <RichTextEditor\n {...rest}\n id={name}\n initialContent={(field.value as unknown as string) ?? \"\"}\n onChange={(html) => field.onChange(html)}\n />\n {error && <p className=\"text-sm text-feedback-error-text\">{error}</p>}\n {reserveErrorSpace && !error && <div className=\"h-5\" />}\n </div>\n )}\n />\n );\n}\n","import * as React from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { Select } from \"@/components/Select\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormSelectProps<T extends FieldValues>\n extends Omit<\n // biome-ignore lint/suspicious/noExplicitAny: Select component typing\n React.ComponentProps<typeof Select<any>>,\n \"selectedKey\" | \"defaultSelectedKey\" | \"onSelectionChange\"\n > {\n name: FieldPath<T>;\n defaultValue?: Key | null;\n}\n\nexport function FormSelect<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormSelectProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <Select\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n {...(rest as any)}\n selectedKey={(field.value as unknown as Key) ?? null}\n onSelectionChange={(key) => field.onChange(key)}\n showErrors={!!error}\n errorMessage={error}\n />\n )}\n />\n );\n}\n","import React from \"react\";\nimport { Switch as AriaSwitch, SwitchProps as AriaSwitchProps } from \"react-aria-components\";\nimport { composeTailwindRenderProps, focusRing } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, \"children\"> {\n children: React.ReactNode;\n /**\n * Visual variant of the switch\n * @default \"default\"\n */\n variant?: \"default\" | \"brand\";\n /**\n * Size of the switch\n * @default \"md\"\n */\n size?: Size;\n}\n\n// Size configurations for track and handle\nconst sizeConfig = {\n sm: {\n track: \"h-4 w-7\",\n handle: \"h-3.5 w-3.5\",\n text: \"text-xs\",\n },\n md: {\n track: \"h-5 w-9\",\n handle: \"h-4 w-4\",\n text: \"text-sm\",\n },\n lg: {\n track: \"h-6 w-11\",\n handle: \"h-5 w-5\",\n text: \"text-base\",\n },\n xl: {\n track: \"h-7 w-14\",\n handle: \"h-6 w-6\",\n text: \"text-lg\",\n },\n} as const;\n\nfunction getTrackClassName({\n isSelected,\n isDisabled,\n variant = \"default\",\n size = \"md\",\n}: {\n isSelected: boolean;\n isDisabled: boolean;\n variant?: \"default\" | \"brand\";\n size?: Size;\n}) {\n const baseClasses =\n \"flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent\";\n const sizeClasses = sizeConfig[size].track;\n const focusRingClasses = focusRing;\n const focusRingColor =\n variant === \"brand\"\n ? \"focus-visible:outline-action-brand\"\n : \"focus-visible:outline-action-default\";\n\n let selectedClasses = \"\";\n if (isSelected) {\n if (variant === \"brand\") {\n selectedClasses =\n \"bg-action-brand forced-colors:!bg-[Highlight] group-pressed:bg-action-brand-hover\";\n } else {\n selectedClasses =\n \"bg-action-default forced-colors:!bg-[Highlight] group-pressed:bg-action-default-hover\";\n }\n } else {\n selectedClasses =\n \"bg-gray-400 dark:bg-zinc-400 group-pressed:bg-gray-500 dark:group-pressed:bg-zinc-300\";\n }\n\n const disabledClasses = isDisabled\n ? \"bg-gray-200 dark:bg-zinc-700 forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]\"\n : \"\";\n\n return [\n baseClasses,\n sizeClasses,\n focusRingClasses,\n focusRingColor,\n selectedClasses,\n disabledClasses,\n ]\n .filter(Boolean)\n .join(\" \");\n}\n\nfunction getHandleClassName({\n isSelected,\n isDisabled,\n size = \"md\",\n}: {\n isSelected: boolean;\n isDisabled: boolean;\n size?: Size;\n}) {\n const baseClasses =\n \"transform rounded-full bg-white dark:bg-zinc-900 outline-none shadow transition duration-200 ease-in-out\";\n const sizeClasses = sizeConfig[size].handle;\n const selectedClasses = isSelected ? \"translate-x-[100%]\" : \"translate-x-0\";\n const disabledClasses = isDisabled ? \"forced-colors:outline-[GrayText]\" : \"\";\n\n return [baseClasses, sizeClasses, selectedClasses, disabledClasses].filter(Boolean).join(\" \");\n}\n\n/**\n * Switch\n *\n * Toggle switch component for binary on/off states.\n * Provides an accessible alternative to checkboxes for settings and preferences.\n */\nexport function Switch({ children, variant = \"default\", size = \"md\", ...props }: SwitchProps) {\n return (\n <AriaSwitch\n {...props}\n className={composeTailwindRenderProps(\n props.className,\n `group flex items-center gap-2 ${sizeConfig[size].text} text-gray-800 transition disabled:text-gray-300 dark:text-zinc-200 dark:disabled:text-zinc-600 forced-colors:disabled:text-[GrayText]`\n )}\n >\n {(renderProps) => (\n <>\n <div className={getTrackClassName({ ...renderProps, variant, size })}>\n <span className={getHandleClassName({ ...renderProps, size })} />\n </div>\n {children}\n </>\n )}\n </AriaSwitch>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { Switch } from \"@/components/Switch\";\n\nexport interface FormSwitchProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof Switch>, \"isSelected\" | \"defaultSelected\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: boolean;\n}\n\nexport function FormSwitch<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormSwitchProps<T>) {\n const { control } = useFormContext<T>();\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <Switch {...rest} isSelected={!!field.value} onChange={(v) => field.onChange(v)}>\n {rest.children}\n </Switch>\n )}\n />\n );\n}\n","import React from \"react\";\nimport type { ValidationResult } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport {\n BaseInputProps,\n Description,\n FieldError,\n getInputBaseStyles,\n InputWrapper,\n Label,\n useInputFocus,\n} from \"../Field\";\n\nconst getTextAreaStyles = (props: {\n isInvalid?: boolean;\n isDisabled?: boolean;\n isResizable?: boolean;\n isFocused?: boolean;\n transparent?: boolean;\n size?: Size;\n className?: string;\n}): string => {\n // Get base input styles\n const baseStyles = getInputBaseStyles({\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isFocused: props.isFocused,\n transparent: props.transparent,\n size: props.size,\n });\n\n // Add TextArea-specific styles\n const textAreaStyles = `min-h-[100px] py-2 ${\n props.isDisabled ? \"resize-none\" : props.isResizable ? \"resize-y\" : \"resize-none\"\n }`;\n\n return twMerge(baseStyles, textAreaStyles, props.className);\n};\n\n/**\n * TextArea\n *\n * Multi-line text input with Edges styling, label, description, and error.\n */\nexport interface TextAreaProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"size\" | \"disabled\">,\n BaseInputProps {\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n tooltip?: string;\n size?: Size;\n isInvalid?: boolean;\n isDisabled?: boolean;\n /**\n * Allow user resizing of the textarea. Defaults to false (non-resizable).\n * When true, enables vertical resize.\n */\n isResizable?: boolean;\n validationResult?: ValidationResult;\n}\n\nexport function TextArea({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n required,\n transparent,\n isInvalid,\n isDisabled,\n isResizable = false,\n className,\n validationResult,\n reserveErrorSpace = true,\n ...props\n}: TextAreaProps) {\n const { isFocused, handleFocus, handleBlur } = useInputFocus();\n\n return (\n <div className=\"group flex flex-col\">\n <div className=\"flex flex-col\">\n {label && (\n <Label size={size} tooltip={tooltip} isRequired={required}>\n {label}\n </Label>\n )}\n <InputWrapper>\n <textarea\n {...props}\n required={required}\n onFocus={(e) => {\n // Properly handle the textarea focus event\n if (props.onFocus) {\n props.onFocus(e);\n }\n handleFocus(e as unknown as React.FocusEvent<HTMLInputElement>);\n }}\n onBlur={(e) => {\n // Properly handle the textarea blur event\n if (props.onBlur) {\n props.onBlur(e);\n }\n handleBlur(e as unknown as React.FocusEvent<HTMLInputElement>);\n }}\n className={getTextAreaStyles({\n isInvalid,\n isDisabled,\n isResizable,\n isFocused,\n size,\n transparent,\n className,\n })}\n disabled={isDisabled}\n />\n </InputWrapper>\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </div>\n </div>\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { TextArea } from \"@/components/TextArea\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormTextAreaProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof TextArea>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n}\n\nexport function FormTextArea<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormTextAreaProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <TextArea\n {...rest}\n value={(field.value as unknown as string) ?? \"\"}\n onChange={(e) => field.onChange((e.target as HTMLTextAreaElement).value)}\n onBlur={(e) => {\n field.onBlur();\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n rest.onBlur?.(e as any);\n }}\n isInvalid={!!error}\n errorMessage={error}\n required={rest.required}\n />\n )}\n />\n );\n}\n","import * as React from \"react\";\nimport type { ControllerRenderProps, FieldPath, FieldValues } from \"react-hook-form\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { TextField } from \"@/components/TextField\";\nimport { getFieldError } from \"./_helpers\";\n\nexport interface FormTextFieldProps<T extends FieldValues>\n extends Omit<React.ComponentProps<typeof TextField>, \"value\" | \"defaultValue\" | \"onChange\"> {\n name: FieldPath<T>;\n defaultValue?: string;\n}\n\nexport function FormTextField<T extends FieldValues>({\n name,\n defaultValue,\n ...rest\n}: FormTextFieldProps<T>) {\n const { control, formState } = useFormContext<T>();\n const error = getFieldError<T>(formState.errors as Record<string, unknown>, name);\n\n return (\n <Controller\n control={control}\n name={name}\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n defaultValue={defaultValue as any}\n render={({ field }: { field: ControllerRenderProps<T, typeof name> }) => (\n <TextField\n {...rest}\n value={(field.value as unknown as string) ?? \"\"}\n onChange={(v) => field.onChange(v)}\n onBlur={(e) => {\n field.onBlur();\n // biome-ignore lint/suspicious/noExplicitAny: RHF typing complexity\n rest.onBlur?.(e as any);\n }}\n isInvalid={!!error}\n errorMessage={error}\n isRequired={rest.isRequired}\n />\n )}\n />\n );\n}\n","\"use client\";\nimport {\n TimeField as AriaTimeField,\n TimeFieldProps as AriaTimeFieldProps,\n DateInput,\n DateSegment,\n TimeValue,\n ValidationResult,\n} from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\nimport { composeTailwindRenderProps } from \"../../utils\";\nimport type { Size } from \"../../utils/controlStyles\";\nimport {\n BaseInputProps,\n Description,\n FieldError,\n getInputStateStyles,\n InputWrapper,\n Label,\n} from \"../Field\";\n\n/**\n * TimeField\n *\n * A segmented time input with Edges styling. Matches the API and styling\n * of TextField and DateField for consistency across form controls.\n */\nexport interface TimeFieldProps\n extends Omit<AriaTimeFieldProps<TimeValue>, \"isRequired\" | \"size\" | \"className\">,\n Omit<BaseInputProps, \"transparent\" | \"isClearable\" | \"onClear\"> {\n label?: string;\n description?: string;\n errorMessage?: string | ((validation: ValidationResult) => string);\n placeholder?: string;\n tooltip?: string;\n isRequired?: boolean;\n className?: string;\n validationResult?: ValidationResult;\n /**\n * Whether to reserve space for error messages to prevent layout shift\n * @default true\n */\n reserveErrorSpace?: boolean;\n /**\n * Where to display the description text\n * - \"below\": Show below the field (default)\n * - \"tooltip\": Show as a tooltip on the label icon\n * - \"inline\": Show inline with the label\n * - \"hidden\": Don't display the description\n * @default \"below\"\n */\n descriptionPlacement?: \"below\" | \"tooltip\" | \"inline\" | \"hidden\";\n}\n\nfunction getSegmentStyles({\n isPlaceholder,\n isDisabled,\n size = \"md\",\n}: {\n isPlaceholder?: boolean;\n isDisabled?: boolean;\n size?: Size;\n}) {\n // Size styles with mobile font-size fix\n // iOS Safari zooms in on inputs with font-size < 16px when focused.\n // On mobile, we use text-base (16px) for sm/md sizes to prevent auto-zoom.\n // On desktop (md: breakpoint), we restore the original smaller sizes.\n const sizeStyles = {\n sm: \"text-base md:text-xs\",\n md: \"text-base md:text-sm\",\n lg: \"text-base\",\n xl: \"text-lg\",\n };\n\n return twMerge(\n // Base\n \"inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors\",\n sizeStyles[size],\n // Text color\n isPlaceholder ? \"text-text-placeholder italic\" : \"text-text-body\",\n // Disabled state\n isDisabled ? \"text-text-disabled cursor-not-allowed\" : \"cursor-text\",\n // Hover/focus\n !isDisabled && \"hover:bg-background-hover\",\n \"data-[focused]:bg-background-selected data-[focused]:text-text-body\"\n );\n}\n\n/**\n * Renders an Edges TimeField with label, description, validation states,\n * and segmented time input.\n */\nexport function TimeField({\n label,\n description,\n errorMessage,\n size = \"md\",\n tooltip,\n isRequired,\n isDisabled,\n isInvalid,\n reserveErrorSpace = true,\n validationResult,\n className,\n descriptionPlacement = \"below\",\n ...props\n}: TimeFieldProps) {\n return (\n <AriaTimeField\n {...props}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isInvalid={isInvalid}\n className={composeTailwindRenderProps(className, \"flex flex-col gap-1\")}\n >\n {label && (\n <Label\n size={size}\n tooltip={tooltip}\n description={\n descriptionPlacement === \"tooltip\" || descriptionPlacement === \"inline\"\n ? description\n : undefined\n }\n descriptionPlacement={descriptionPlacement}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n\n <InputWrapper>\n <DateInput\n className={twMerge(\n getInputStateStyles({\n isInvalid,\n isDisabled,\n }),\n // Padding and layout\n \"px-3 py-2 flex items-center gap-0.5 w-full\"\n )}\n >\n {(segment) => (\n <DateSegment\n segment={segment}\n className={getSegmentStyles({\n isPlaceholder: segment.isPlaceholder,\n isDisabled: !segment.isEditable || isDisabled,\n size,\n })}\n />\n )}\n </DateInput>\n </InputWrapper>\n\n {reserveErrorSpace ? (\n <div className=\"mt-1 min-h-[20px]\">\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size}>{errorMessage}</FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size}>{errorMessage(validationResult)}</FieldError>\n ) : description && descriptionPlacement === \"below\" ? (\n <Description size={size}>{description}</Description>\n ) : null}\n </div>\n ) : (\n <>\n {typeof errorMessage === \"string\" ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage}\n </FieldError>\n ) : typeof errorMessage === \"function\" && validationResult ? (\n <FieldError size={size} className=\"mt-1\">\n {errorMessage(validationResult)}\n </FieldError>\n ) : description && descriptionPlacement === \"below\" ? (\n <Description size={size} className=\"mt-1\">\n {description}\n </Description>\n ) : null}\n </>\n )}\n </AriaTimeField>\n );\n}\n","import { Controller, FieldValues, Path, useFormContext } from \"react-hook-form\";\nimport { TimeField, TimeFieldProps } from \"@/components/TimeField\";\n\nexport interface FormTimeFieldProps<TFieldValues extends FieldValues = FieldValues>\n extends Omit<TimeFieldProps, \"name\" | \"value\" | \"onChange\" | \"isInvalid\"> {\n name: Path<TFieldValues>;\n}\n\nexport function FormTimeField<TFieldValues extends FieldValues = FieldValues>({\n name,\n ...props\n}: FormTimeFieldProps<TFieldValues>) {\n const {\n control,\n formState: { errors },\n } = useFormContext<TFieldValues>();\n\n const error = errors[name];\n const errorMessage = error?.message as string | undefined;\n\n return (\n <Controller\n name={name}\n control={control}\n render={({ field }) => (\n <TimeField\n {...props}\n value={field.value}\n onChange={field.onChange}\n isInvalid={!!error}\n errorMessage={errorMessage}\n />\n )}\n />\n );\n}\n","import * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport interface ErrorSummaryProps {\n className?: string;\n title?: string;\n autoFocus?: boolean;\n}\n\nexport function ErrorSummary({\n className,\n title = \"Please fix the following errors:\",\n autoFocus = true,\n}: ErrorSummaryProps) {\n const { formState } = useFormContext();\n const ref = React.useRef<HTMLDivElement | null>(null);\n\n const errors = formState.errors;\n const entries = Object.entries(errors || {});\n const hasErrors = entries.length > 0;\n\n React.useEffect(() => {\n if (autoFocus && hasErrors) {\n ref.current?.focus();\n }\n }, [autoFocus, hasErrors]);\n\n if (!hasErrors) return null;\n\n const handleJump = (name: string) => {\n const selector = `[name=\"${CSS.escape(name)}\"]`;\n const el = document.querySelector<HTMLElement>(selector);\n if (el) {\n el.focus();\n el.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\n }\n };\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n tabIndex={-1}\n className={twMerge(\n \"rounded-md border border-feedback-error-border bg-feedback-error-background p-3 text-sm text-feedback-error-text\",\n className\n )}\n >\n <div className=\"font-medium\">{title}</div>\n <ul className=\"mt-2 list-disc pl-5\">\n {entries.map(([name, err]) => {\n const message = (err as { message?: string })?.message || \"Invalid value\";\n return (\n <li key={name}>\n <button\n type=\"button\"\n className=\"underline underline-offset-2\"\n onClick={() => handleJump(name)}\n >\n {message}\n </button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n","import * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\nimport { Button } from \"@/components/Button\";\n\nexport interface SubmitButtonProps extends React.ComponentProps<typeof Button> {\n formId?: string;\n disableWhenInvalid?: boolean;\n disableWhenPristine?: boolean;\n}\n\nexport function SubmitButton({\n formId,\n disableWhenInvalid,\n disableWhenPristine,\n isDisabled,\n children,\n ...rest\n}: SubmitButtonProps) {\n const { formState } = useFormContext();\n const disabled =\n isDisabled ||\n formState.isSubmitting ||\n (disableWhenInvalid && !formState.isValid) ||\n (disableWhenPristine && !formState.isDirty);\n\n return (\n <Button type=\"submit\" form={formId} isDisabled={disabled} {...rest}>\n {children}\n </Button>\n );\n}\n","\"use client\";\n\nimport React, { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\ninterface SkeletonProps {\n width?: number | string;\n height?: number | string;\n variant?: \"text\" | \"rect\" | \"circle\";\n animation?: \"pulse\" | \"wave\" | \"none\";\n gradient?: boolean;\n flex?: boolean;\n stack?: (number | string)[]; // Array of widths for stacked skeletons\n responsive?: Record<string, string | number>;\n delay?: number;\n adjustAnimationSpeedBasedOnWidth?: boolean;\n ariaLabel?: string;\n className?: string;\n \"data-testid\"?: string;\n}\n\n/**\n * Skeleton\n *\n * Loading placeholder component that mimics content structure.\n * Supports various shapes, animations, and responsive configurations for skeleton screens.\n */\nexport const Skeleton: React.FC<SkeletonProps> = ({\n width,\n height,\n variant = \"rect\",\n animation = \"pulse\",\n gradient = false,\n flex = false,\n stack,\n responsive,\n delay = 0,\n adjustAnimationSpeedBasedOnWidth = false,\n ariaLabel,\n className,\n \"data-testid\": dataTestId,\n}) => {\n const [visible, setVisible] = useState(delay === 0);\n\n useEffect(() => {\n if (delay > 0) {\n const timer = setTimeout(() => setVisible(true), delay);\n return () => clearTimeout(timer);\n }\n }, [delay]);\n\n if (!visible) return null;\n\n // Base styles\n const baseClasses = gradient\n ? \"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]\"\n : \"bg-[var(--color-skeleton-base)]\";\n\n // Adjust animation speed dynamically based on width\n const animationSpeed =\n adjustAnimationSpeedBasedOnWidth && width\n ? (() => {\n const numWidth = typeof width === \"number\" ? width : parseFloat(String(width));\n return !isNaN(numWidth) ? `animation-duration-[${Math.max(0.8, numWidth / 100)}s]` : \"\";\n })()\n : \"\";\n\n // Animation styles\n const animationClasses =\n animation === \"pulse\"\n ? `animate-pulse ${animationSpeed}`\n : animation === \"wave\"\n ? `relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${animationSpeed}`\n : \"\";\n\n // Shape-specific styles\n let shapeClasses = \"rounded-sm\";\n if (variant === \"circle\") shapeClasses = \"rounded-full\";\n if (variant === \"text\") shapeClasses = \"h-4 w-full rounded-sm\";\n\n // Dynamic layout handling\n const layoutClasses = flex ? \"flex-1 min-w-0\" : \"\";\n\n // Responsive styles\n const responsiveStyles = responsive\n ? Object.entries(responsive)\n .map(([breakpoint, value]) => `${breakpoint}:w-[${value}]`)\n .join(\" \")\n : \"\";\n\n // Stacking Multiple Skeletons\n if (stack) {\n return (\n <div className=\"space-y-2\" data-testid={dataTestId}>\n {stack.map((lineWidth, index) => (\n <div\n key={index}\n className={twMerge(\n baseClasses,\n animationClasses,\n shapeClasses,\n layoutClasses,\n responsiveStyles,\n className\n )}\n style={{\n width: lineWidth,\n height,\n }}\n />\n ))}\n </div>\n );\n }\n\n return (\n <div\n className={twMerge(\n baseClasses,\n animationClasses,\n shapeClasses,\n layoutClasses,\n responsiveStyles,\n className\n )}\n style={{\n width,\n height,\n }}\n role=\"presentation\"\n aria-hidden={!ariaLabel}\n aria-label={ariaLabel ?? undefined}\n data-testid={dataTestId}\n />\n );\n};\n\ninterface SkeletonGroupProps {\n count?: number;\n children: React.ReactNode;\n className?: string;\n \"data-testid\"?: string;\n}\n\nexport const SkeletonGroup: React.FC<SkeletonGroupProps> = ({\n count = 1,\n children,\n className,\n \"data-testid\": dataTestId,\n}) => {\n return (\n <div className={className} data-testid={dataTestId}>\n {Array.from({ length: count }).map((_, index) => (\n <div key={index}>{children}</div>\n ))}\n </div>\n );\n};\n","import React from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Heading } from \"../Heading\";\nimport { Skeleton } from \"../Skeleton\";\n\n/**\n * Card - Enterprise surface container component\n *\n * A flexible, composable card component following enterprise design system best practices.\n * Supports modular content sections with consistent styling and accessibility.\n *\n * Usage:\n * ```tsx\n * <Card variant=\"outlined\" size=\"md\">\n * <Card.Header\n * title=\"Card Title\"\n * subtitle=\"Optional subtitle\"\n * actions={<Button variant=\"ghost\" icon=\"MoreHorizontal\" />}\n * />\n * <Card.Media src=\"image.jpg\" alt=\"Description\" />\n * <Card.Content>\n * <p>Main content goes here</p>\n * </Card.Content>\n * <Card.Footer>\n * <Button variant=\"brand\">Action</Button>\n * </Card.Footer>\n * </Card>\n * ```\n */\n\n// ——————————————————————————————————————————\n// Types\n// ——————————————————————————————————————————\n\nexport type CardVariant = \"outlined\" | \"elevated\" | \"filled\" | \"ghost\";\nexport interface CardProps {\n variant?: CardVariant;\n className?: string;\n children?: React.ReactNode;\n isLoading?: boolean;\n}\n\nexport interface CardHeaderProps {\n title?: React.ReactNode;\n subtitle?: React.ReactNode;\n actions?: React.ReactNode;\n className?: string;\n isLoading?: boolean;\n}\n\nexport interface CardMediaProps {\n src?: string;\n alt?: string;\n aspectRatio?: \"square\" | \"video\" | \"wide\" | \"auto\";\n className?: string;\n children?: React.ReactNode;\n isLoading?: boolean;\n}\n\nexport interface CardContentProps {\n className?: string;\n children?: React.ReactNode;\n isLoading?: boolean;\n}\n\nexport interface CardFooterProps {\n className?: string;\n children?: React.ReactNode;\n align?: \"start\" | \"end\" | \"center\" | \"between\";\n isLoading?: boolean;\n}\n\n// ——————————————————————————————————————————\n// Styles\n// ——————————————————————————————————————————\n\nconst cardVariantStyles: Record<CardVariant, string> = {\n outlined: \"bg-background-surface border border-border-default\",\n elevated: \"bg-background-surface border-0 shadow-md\",\n filled: \"bg-background-muted border-0\",\n ghost: \"bg-transparent border-0 shadow-none\",\n};\n\nconst cardBaseStyles = \"rounded-lg\";\n\nconst aspectRatioStyles = {\n square: \"aspect-square\",\n video: \"aspect-video\",\n wide: \"aspect-[2/1]\",\n auto: \"\",\n};\n\nconst footerAlignStyles = {\n start: \"justify-start\",\n end: \"justify-end\",\n center: \"justify-center\",\n between: \"justify-between\",\n};\n\n// ——————————————————————————————————————————\n// Main Card Component\n// ——————————————————————————————————————————\n\nexport function Card({ variant = \"outlined\", className, children, isLoading = false }: CardProps) {\n return (\n <div\n className={twMerge(\n \"w-full overflow-hidden\",\n cardVariantStyles[variant],\n cardBaseStyles,\n className\n )}\n data-testid=\"card\"\n >\n {isLoading ? (\n // Skeleton fills the card completely - respects height set on card\n <Skeleton width=\"100%\" height=\"100%\" className=\"rounded-none\" />\n ) : (\n children\n )}\n </div>\n );\n}\n\n// ——————————————————————————————————————————\n// Card Header\n// ——————————————————————————————————————————\n\nexport function CardHeader({\n title,\n subtitle,\n actions,\n className,\n isLoading = false,\n}: CardHeaderProps) {\n if (isLoading) {\n return (\n <div className={twMerge(\"p-6 pb-4\", className)}>\n <div className=\"flex justify-between items-start mb-1\">\n <Skeleton width={120} height={20} />\n <Skeleton width={24} height={24} />\n </div>\n {subtitle && <Skeleton width={200} height={16} />}\n </div>\n );\n }\n\n if (!title && !subtitle && !actions) {\n return null;\n }\n\n return (\n <div className={twMerge(\"p-6 pb-4\", className)}>\n <div className=\"flex justify-between items-start gap-4\">\n <div className=\"min-w-0 flex-1\">\n {title && (\n <div className=\"mb-1\">\n {typeof title === \"string\" ? (\n <Heading tag=\"h3\" size=\"sm\" className=\"text-text-heading\">\n {title}\n </Heading>\n ) : (\n title\n )}\n </div>\n )}\n {subtitle && <div className=\"text-sm text-text-muted\">{subtitle}</div>}\n </div>\n {actions && <div className=\"flex-shrink-0\">{actions}</div>}\n </div>\n </div>\n );\n}\n\n// ——————————————————————————————————————————\n// Card Media\n// ——————————————————————————————————————————\n\nexport function CardMedia({\n src,\n alt,\n aspectRatio = \"auto\",\n className,\n children,\n isLoading = false,\n}: CardMediaProps) {\n if (isLoading) {\n return (\n <div className={twMerge(\"bg-background-muted\", aspectRatioStyles[aspectRatio], className)}>\n <Skeleton width=\"100%\" height=\"100%\" />\n </div>\n );\n }\n\n if (children) {\n return (\n <div className={twMerge(\"overflow-hidden\", aspectRatioStyles[aspectRatio], className)}>\n {children}\n </div>\n );\n }\n\n if (!src) {\n return null;\n }\n\n return (\n <div className={twMerge(\"overflow-hidden\", aspectRatioStyles[aspectRatio], className)}>\n <img src={src} alt={alt || \"\"} className=\"w-full h-full object-cover\" loading=\"lazy\" />\n </div>\n );\n}\n\n// ——————————————————————————————————————————\n// Card Content\n// ——————————————————————————————————————————\n\nexport function CardContent({ className, children, isLoading = false }: CardContentProps) {\n // Extract padding classes from className - if any padding class is set, respect it\n const hasPadding = className?.match(/p(?:t|b|l|r|x|y)?-(?:\\d+(?:\\.\\d+)?|px|\\[.+?\\])/);\n const defaultPadding = hasPadding ? \"\" : \"px-6 py-4\";\n\n if (isLoading) {\n return (\n <div className={twMerge(defaultPadding, className)}>\n <div className=\"space-y-2\">\n <Skeleton width=\"100%\" height={16} />\n <Skeleton width=\"80%\" height={16} />\n <Skeleton width=\"60%\" height={16} />\n </div>\n </div>\n );\n }\n\n if (!children) {\n return null;\n }\n\n return <div className={twMerge(\"px-6 py-4 text-text-body\", className)}>{children}</div>;\n}\n\n// ——————————————————————————————————————————\n// Card Footer\n// ——————————————————————————————————————————\n\nexport function CardFooter({\n className,\n children,\n align = \"end\",\n isLoading = false,\n}: CardFooterProps) {\n if (isLoading) {\n return (\n <div className={twMerge(\"px-6 py-4 flex gap-2 justify-end\", className)}>\n <Skeleton width={80} height={32} />\n <Skeleton width={60} height={32} />\n </div>\n );\n }\n\n if (!children) {\n return null;\n }\n\n return (\n <div\n className={twMerge(\"px-6 py-4 flex items-center gap-2\", footerAlignStyles[align], className)}\n >\n {children}\n </div>\n );\n}\n\n// ——————————————————————————————————————————\n// Compound Component API\n// ——————————————————————————————————————————\n\nCard.Header = CardHeader;\nCard.Media = CardMedia;\nCard.Content = CardContent;\nCard.Footer = CardFooter;\n","import * as React from \"react\";\nimport { useFieldArray, useFormContext } from \"react-hook-form\";\nimport { Button } from \"@/components/Button\";\nimport { Card, CardContent, CardHeader } from \"@/components/Card\";\n\nexport interface FieldArrayListProps<TFieldValues> {\n name: string;\n getItemTitle?: (index: number) => string;\n renderItem: (index: number) => React.ReactNode;\n onAdd?: () => Partial<TFieldValues[keyof TFieldValues]>;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: Generic constraint for RHF\nexport function FieldArrayList<TFieldValues extends Record<string, any>>({\n name,\n getItemTitle,\n renderItem,\n onAdd,\n}: FieldArrayListProps<TFieldValues>) {\n const { control } = useFormContext<TFieldValues>();\n // biome-ignore lint/suspicious/noExplicitAny: RHF FieldArray typing complexity\n const { fields, append, remove, swap } = useFieldArray({ control, name: name as any });\n\n return (\n <div className=\"flex flex-col gap-3\">\n {fields.map((field, index) => (\n <Card key={field.id}>\n <CardHeader\n title={getItemTitle ? getItemTitle(index) : `Item ${index + 1}`}\n actions={\n <div className=\"flex gap-2\">\n {index > 0 && (\n <Button size=\"sm\" variant=\"secondary\" onPress={() => swap(index, index - 1)}>\n Up\n </Button>\n )}\n {index < fields.length - 1 && (\n <Button size=\"sm\" variant=\"secondary\" onPress={() => swap(index, index + 1)}>\n Down\n </Button>\n )}\n <Button size=\"sm\" variant=\"secondary\" onPress={() => remove(index)}>\n Remove\n </Button>\n </div>\n }\n />\n <CardContent>{renderItem(index)}</CardContent>\n </Card>\n ))}\n <div>\n {/* biome-ignore lint/suspicious/noExplicitAny: RHF FieldArray append typing */}\n <Button variant=\"secondary\" onPress={() => append((onAdd?.() || {}) as unknown as any)}>\n Add item\n </Button>\n </div>\n </div>\n );\n}\n","import { FormProps, Form as RACForm } from \"react-aria-components\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Form\n *\n * Accessibility-first form wrapper with consistent spacing.\n * Defaults to ARIA validation to use custom error styling instead of native browser tooltips.\n */\nexport function Form(props: FormProps) {\n return (\n <RACForm\n validationBehavior=\"aria\"\n {...props}\n className={twMerge(\"flex flex-col gap-6\", props.className)}\n />\n );\n}\n","export function focusFirstError(formEl: HTMLFormElement) {\n // Prefer elements explicitly marked invalid\n const invalidEl =\n formEl.querySelector<HTMLElement>(\n \"[aria-invalid='true'], .aria-invalid, [data-invalid='true']\"\n ) ||\n // Fallback: any input/select/textarea with aria-invalid\n formEl.querySelector<HTMLElement>(\n \"input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']\"\n ) ||\n // Last resort: first input/select/textarea\n formEl.querySelector<HTMLElement>(\"input, select, textarea\");\n\n if (invalidEl) {\n invalidEl.focus({ preventScroll: false });\n if (invalidEl instanceof HTMLElement) {\n invalidEl.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\n }\n }\n}\n","import * as React from \"react\";\nimport type { FieldValues, SubmitErrorHandler, SubmitHandler, UseFormProps } from \"react-hook-form\";\nimport { FormProvider as RHFProvider, useForm } from \"react-hook-form\";\nimport { Form } from \"@/components/Form\";\nimport { focusFirstError } from \"./utils/focusFirstError\";\n\nexport interface FormProviderProps<TFieldValues extends FieldValues = FieldValues>\n extends Omit<UseFormProps<TFieldValues>, \"values\"> {\n id?: string;\n onSubmit: SubmitHandler<TFieldValues>;\n onInvalid?: SubmitErrorHandler<TFieldValues>;\n children: React.ReactNode;\n /**\n * If true, automatically focuses and scrolls the first invalid field on submit.\n * @default true\n */\n shouldFocusError?: boolean;\n /** Additional className applied to underlying Form */\n className?: string;\n}\n\nexport function FormProvider<TFieldValues extends FieldValues = FieldValues>({\n id,\n onSubmit,\n onInvalid,\n children,\n shouldFocusError = true,\n className,\n ...formOptions\n}: FormProviderProps<TFieldValues>) {\n const methods = useForm<TFieldValues>(formOptions);\n\n const handleInvalid: SubmitErrorHandler<TFieldValues> = (errors, evt) => {\n if (shouldFocusError && id) {\n // Find form by ID and focus first error\n const form = document.getElementById(id) as HTMLFormElement | null;\n if (form) {\n focusFirstError(form);\n }\n }\n onInvalid?.(errors, evt);\n };\n\n return (\n <RHFProvider {...methods}>\n <Form id={id} className={className} onSubmit={methods.handleSubmit(onSubmit, handleInvalid)}>\n {children}\n </Form>\n </RHFProvider>\n );\n}\n","import { twMerge } from \"tailwind-merge\";\nimport { Button } from \"@/components/Button\";\n\nexport interface SaveBarProps {\n formId?: string;\n show: boolean;\n isSubmitting?: boolean;\n onCancel?: () => void;\n primaryLabel?: string;\n secondaryLabel?: string;\n className?: string;\n}\n\nexport function SaveBar({\n formId,\n show,\n isSubmitting,\n onCancel,\n primaryLabel = \"Save changes\",\n secondaryLabel = \"Cancel\",\n className,\n}: SaveBarProps) {\n if (!show) return null;\n\n return (\n <div\n className={twMerge(\n \"fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70\",\n className\n )}\n >\n <div className=\"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3\">\n <div className=\"text-sm text-text-muted\">You have unsaved changes</div>\n <div className=\"flex gap-2\">\n <Button variant=\"secondary\" onPress={onCancel}>\n {secondaryLabel}\n </Button>\n <Button type=\"submit\" form={formId} isDisabled={!!isSubmitting}>\n {isSubmitting ? \"Saving...\" : primaryLabel}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n","import { useFormContext } from \"react-hook-form\";\nimport { SaveBar } from \"@/form/SaveBar\";\n\nexport interface FormSaveBarProps {\n formId?: string;\n onCancel?: () => void;\n primaryLabel?: string;\n secondaryLabel?: string;\n className?: string;\n}\n\nexport function FormSaveBar({\n formId,\n onCancel,\n primaryLabel,\n secondaryLabel,\n className,\n}: FormSaveBarProps) {\n const { formState } = useFormContext();\n return (\n <SaveBar\n formId={formId}\n show={formState.isDirty}\n isSubmitting={formState.isSubmitting}\n onCancel={onCancel}\n primaryLabel={primaryLabel}\n secondaryLabel={secondaryLabel}\n className={className}\n />\n );\n}\n","import * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\n\n/**\n * When the form has submit errors, scroll to the first one.\n */\nexport function useScrollIntoViewOnError(enabled: boolean = true) {\n const { formState } = useFormContext();\n\n React.useEffect(() => {\n if (!enabled) return;\n if (!formState.isSubmitted) return;\n if (!formState.errors || Object.keys(formState.errors).length === 0) return;\n\n const el =\n document.querySelector<HTMLElement>(\n \"[aria-invalid='true'], .aria-invalid, [data-invalid='true']\"\n ) ||\n document.querySelector<HTMLElement>(\n \"input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']\"\n );\n if (el) {\n el.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\n }\n }, [enabled, formState.isSubmitted, formState.errors]);\n}\n","import * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\n\nexport interface UseAutoSaveOptions<TValues> {\n delayMs?: number;\n onAutoSave: (values: TValues) => Promise<void> | void;\n}\n\nexport function useAutoSave<TValues extends Record<string, unknown>>({\n delayMs = 800,\n onAutoSave,\n}: UseAutoSaveOptions<TValues>) {\n const { watch, formState, getValues } = useFormContext<TValues>();\n const timeoutRef = React.useRef<number | undefined>(undefined);\n\n React.useEffect(() => {\n const subscription = watch(() => {\n if (!formState.isDirty) return;\n if (timeoutRef.current) window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(async () => {\n const values = getValues();\n await onAutoSave(values);\n }, delayMs);\n });\n return () => {\n subscription.unsubscribe();\n if (timeoutRef.current) window.clearTimeout(timeoutRef.current);\n };\n }, [watch, formState.isDirty, getValues, delayMs, onAutoSave]);\n}\n"]}
|