sunpeak 0.7.9 → 0.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +7 -10
  2. package/bin/commands/deploy.mjs +25 -9
  3. package/bin/commands/push.mjs +19 -14
  4. package/bin/sunpeak.js +16 -0
  5. package/dist/index.cjs +6 -0
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.js +6 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/mcp/entry.cjs +1 -1
  10. package/dist/mcp/entry.js +1 -1
  11. package/dist/mcp/index.cjs +1 -1
  12. package/dist/mcp/index.js +1 -1
  13. package/dist/server-CziiHU7V.cjs +5066 -0
  14. package/dist/server-CziiHU7V.cjs.map +1 -0
  15. package/dist/server-D8kyzuiq.js +5067 -0
  16. package/dist/server-D8kyzuiq.js.map +1 -0
  17. package/dist/style.css +1 -1
  18. package/package.json +17 -17
  19. package/template/dist/albums.js +4 -4
  20. package/template/dist/albums.json +1 -1
  21. package/template/dist/carousel.js +8 -8
  22. package/template/dist/carousel.json +1 -1
  23. package/template/dist/counter.js +4 -4
  24. package/template/dist/counter.json +1 -1
  25. package/template/dist/map.js +4 -4
  26. package/template/dist/map.json +1 -1
  27. package/template/node_modules/.bin/tsx +2 -2
  28. package/template/node_modules/.bin/vite +2 -2
  29. package/template/node_modules/.bin/vitest +2 -2
  30. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Avatar.js +7 -7
  31. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Avatar.js.map +1 -1
  32. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js +6 -6
  33. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Checkbox.js +6 -6
  34. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Checkbox.js.map +1 -1
  35. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Icon.js +3 -3
  36. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Input.js +3 -3
  37. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js +8 -8
  38. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js.map +1 -1
  39. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js +20 -20
  40. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js.map +1 -1
  41. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js +5 -5
  42. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js.map +1 -1
  43. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_theme.js +2 -2
  44. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_theme.js.map +1 -1
  45. package/template/node_modules/.vite/deps/_metadata.json +56 -56
  46. package/template/node_modules/.vite/deps/{chunk-CQ3GYAYB.js → chunk-2DZGWGIP.js} +5 -5
  47. package/template/node_modules/.vite/deps/{chunk-CQ3GYAYB.js.map → chunk-2DZGWGIP.js.map} +1 -1
  48. package/template/node_modules/.vite/deps/{chunk-4TLBUCVB.js → chunk-BUOVMFCD.js} +6 -6
  49. package/template/node_modules/.vite/deps/{chunk-4TLBUCVB.js.map → chunk-BUOVMFCD.js.map} +2 -2
  50. package/template/node_modules/.vite/deps/{chunk-BAG6OO6S.js → chunk-DYQDWJMS.js} +5 -5
  51. package/template/node_modules/.vite/deps/{chunk-BAG6OO6S.js.map → chunk-DYQDWJMS.js.map} +1 -1
  52. package/template/node_modules/.vite/deps/{chunk-YOJ6QPGS.js → chunk-JAGHY6H6.js} +3 -3
  53. package/template/node_modules/.vite/deps/{chunk-YOJ6QPGS.js.map → chunk-JAGHY6H6.js.map} +1 -1
  54. package/template/node_modules/.vite/deps/{chunk-PTVT3RFX.js → chunk-JGVISENQ.js} +6 -6
  55. package/template/node_modules/.vite/deps/{chunk-PTVT3RFX.js.map → chunk-JGVISENQ.js.map} +1 -1
  56. package/template/node_modules/.vite/deps/{chunk-LR7NKCX5.js → chunk-N6DVYEXK.js} +38 -38
  57. package/template/node_modules/.vite/deps/{chunk-LR7NKCX5.js.map → chunk-N6DVYEXK.js.map} +1 -1
  58. package/template/node_modules/.vite/deps/{chunk-SGWD4VEU.js → chunk-TSEQUROC.js} +113 -107
  59. package/template/node_modules/.vite/deps/chunk-TSEQUROC.js.map +7 -0
  60. package/template/node_modules/.vite/deps/{chunk-XB525PXG.js → chunk-UM3ZGDFR.js} +747 -747
  61. package/template/node_modules/.vite/deps/{chunk-XB525PXG.js.map → chunk-UM3ZGDFR.js.map} +1 -1
  62. package/template/node_modules/.vite/deps/{chunk-KFGKZMLK.js → chunk-XZTIOEPG.js} +7 -7
  63. package/template/node_modules/.vite/deps/{chunk-KFGKZMLK.js.map → chunk-XZTIOEPG.js.map} +2 -2
  64. package/template/node_modules/.vite/deps/embla-carousel-react.js +3 -3
  65. package/template/node_modules/.vite/deps/embla-carousel-react.js.map +1 -1
  66. package/template/node_modules/.vite/deps/react-dom.js +2 -2
  67. package/template/node_modules/.vite/deps/react-dom_client.js +11 -11
  68. package/template/node_modules/.vite/deps/react-dom_client.js.map +2 -2
  69. package/template/node_modules/.vite/deps/react.js +1 -1
  70. package/template/node_modules/.vite/deps/react_jsx-dev-runtime.js +5 -5
  71. package/template/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -1
  72. package/template/node_modules/.vite/deps/react_jsx-runtime.js +2 -2
  73. package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  74. package/template/package.json +11 -11
  75. package/dist/server-BOYwNazb.cjs +0 -930
  76. package/dist/server-BOYwNazb.cjs.map +0 -1
  77. package/dist/server-C6vMGV6H.js +0 -931
  78. package/dist/server-C6vMGV6H.js.map +0 -1
  79. package/template/node_modules/.vite/deps/chunk-SGWD4VEU.js.map +0 -7
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Select/Select.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/hooks/useEscCloseStack.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/hooks/useLatestValue.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/SelectControl/SelectControl.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Tooltip/CopyTooltip.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Tooltip/Tooltip.tsx"],
3
+ "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/src/components/Select/Select.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/src/hooks/useEscCloseStack.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/src/hooks/useLatestValue.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/src/components/SelectControl/SelectControl.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/src/components/Tooltip/CopyTooltip.tsx", "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/src/components/Tooltip/Tooltip.tsx"],
4
4
  "sourcesContent": ["\"use client\"\n\nimport clsx from \"clsx\"\nimport { Popover } from \"radix-ui\"\nimport React, {\n createContext,\n type ReactNode,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { preventDefaultHandler, toCssVariables, waitForAnimationFrame } from \"../../lib/helpers\"\nimport { Check, Info, Search } from \"../Icon\"\nimport { Input } from \"../Input\"\nimport { SelectControl, type SelectControlProps } from \"../SelectControl\"\nimport { Tooltip } from \"../Tooltip\"\nimport { TransitionGroup } from \"../Transition\"\nimport s from \"./Select.module.css\"\n\nexport type Option<T extends string = string> = {\n value: T\n label: string\n /** Disable the option */\n disabled?: boolean\n /** Displayed as secondary text below the option `label` */\n description?: React.ReactNode\n tooltip?: {\n content: React.ReactNode\n maxWidth?: number\n }\n}\n\nexport type OptionGroup<T extends Option> = {\n label: string\n options: T[]\n optionsLimit?: {\n label: string\n limit: number\n }\n}\n\nexport type Options<T extends Option> = T[] | OptionGroup<T>[]\n\ntype CallbackWithOption<T extends Option> = (option: T) => void\ntype CallbackWithOptions<T extends Option> = (options: T[]) => void\ntype CallbackWithActionId = (actionId: string) => void\ntype SearchPredicate<T extends Option> = (option: T, searchTerm: string) => boolean\n\ntype Action = {\n /** Unique ID to identify the action with */\n id: string\n /** Label display for the action */\n label: string\n /** Icon displayed to the left of the action */\n Icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>\n /** Custom class applied to the action container */\n className?: string\n /** Callback invoked when the action is pressed */\n onSelect: CallbackWithActionId\n}\n\ntype Actions = Action[]\n\nexport type PopoverSide = \"top\" | \"bottom\"\nexport type PopoverAlign = \"start\" | \"center\" | \"end\"\n\ntype SingleSelectProps<T extends Option> = {\n /**\n * Determines if the select should support multiple selection\n * @default false\n */\n multiple?: false\n value: string\n onChange: CallbackWithOption<T>\n /**\n * Customize the rendered output of the trigger\n * NOTE: Must be passed as a stable reference, not created inline.\n */\n TriggerView?: React.FC<T>\n}\n\ntype MultiSelectTriggerViewProps<T extends Option> = {\n values: T[]\n selectedAll: boolean\n}\n\ntype MultiSelectProps<T extends Option> = {\n /**\n * Determines if the select should support multiple selection\n * @default false\n */\n multiple: true\n value: string[]\n onChange: CallbackWithOptions<T>\n /**\n * Customize the rendered output of the trigger\n * NOTE: Must be passed as a stable reference, not created line.\n */\n TriggerView?: React.FC<MultiSelectTriggerViewProps<T>>\n}\n\nexport type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectProps<T>) & {\n options: Options<T> // Should be passed as a stable reference\n /**\n * Disables the select visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Allows the select to be targeted with htmlFor\n */\n id?: string\n /**\n * Marks the select as a required field when using native form submission\n */\n required?: boolean\n /**\n * Creates the ability to query the value with `[name=\"${name}\"]`\n */\n name?: string\n /**\n * Placeholder text for the select\n * @default Select...\n */\n placeholder?: string\n /**\n * Placeholder text for the select while loading. Behaves exactly like `placeholder`, and `value` will be shown if provided.\n * @default Loading...\n */\n loadingPlaceholder?: string\n /**\n * Displays loading indicator on top of button contents\n * @default false\n */\n loading?: boolean\n /**\n * Style variant for the select trigger\n * @default outline\n */\n variant?: SelectControlProps[\"variant\"]\n /**\n * Determines if the select trigger should be a fully rounded pill shape\n * @default false\n */\n pill?: boolean\n /**\n * Controls size of the select trigger, and several other aspects of trigger styling.\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n * @default md\n */\n size?: SelectControlProps[\"size\"]\n /**\n * Icon displayed in the far right of the select trigger\n * @default dropdown\n */\n dropdownIconType?: SelectControlProps[\"dropdownIconType\"]\n /**\n * Actions to display below the options list.\n */\n actions?: Actions // Memoized by length, don't assume dynamic changes are supported\n /** Custom class applied to option containers */\n optionClassName?: string\n /**\n * Customize the rendered output of individual options\n * NOTE: Must be passed as a stable reference, not created line.\n */\n OptionView?: React.FC<T>\n /** Icon displayed at the start of the select trigger */\n TriggerStartIcon?: SelectControlProps[\"StartIcon\"]\n /**\n * Custom class applied to the select trigger\n */\n triggerClassName?: string // If consumers need deep customization of the trigger\n /**\n * Applies a negative margin using the current gutter to optically align the trigger\n * with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Display a clear action that allows the select to be unset.\n * @default false\n */\n clearable?: boolean\n /**\n * Extends select to 100% of available width.\n * @default true\n */\n block?: boolean\n /**\n * The preferred side of the trigger to render against when open. Will be reversed when collisions occur.\n * @default bottom\n */\n side?: PopoverSide\n /**\n * The preferred alignment against the trigger. May change when collisions occur.\n * @default center\n */\n align?: PopoverAlign\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: number\n /**\n * Prevents collision detection in the custom menu. Use with caution.\n * @default true\n */\n avoidCollisions?: boolean\n /**\n * Set the width of the custom select menu\n * @default auto\n */\n listWidth?: number | \"auto\"\n /**\n * Defines the `min-width` property of the custom select menu, in pixels.\n * @default auto\n */\n listMinWidth?: number | \"auto\"\n /**\n * Defines the `max-width` property of the custom select menu, in pixels.\n * @default auto\n */\n listMaxWidth?: number | \"auto\"\n /** Predicate used to filter searches */\n searchPredicate?: SearchPredicate<T>\n /** Placeholder of the search input */\n searchPlaceholder?: string\n /**\n * Message displayed when search results are empty. Can be a simple string, or custom JSX.\n */\n searchEmptyMessage?: ReactNode\n}\n\ntype SingleSelectContextValue<T extends Option> = {\n multiple: false\n value: string\n TriggerView: React.FC<T>\n}\n\ntype MultiSelectContextValue<T extends Option> = {\n multiple: true\n value: string[]\n TriggerView: React.FC<MultiSelectTriggerViewProps<T>>\n}\n\ntype SelectContextValue<T extends Option> = (\n | SingleSelectContextValue<T>\n | MultiSelectContextValue<T>\n) & {\n triggerId: string\n // Props\n name?: string\n id?: string\n required?: boolean\n options: Options<T>\n disabled: boolean\n variant: SelectControlProps[\"variant\"]\n pill: boolean\n size: SelectControlProps[\"size\"]\n dropdownIconType: SelectControlProps[\"dropdownIconType\"]\n loading: boolean\n clearable: boolean\n placeholder: string\n loadingPlaceholder: string\n searchEmptyMessage: ReactNode\n searchPlaceholder: string\n TriggerStartIcon?: SelectControlProps[\"StartIcon\"]\n triggerClassName?: string\n opticallyAlign?: \"start\" | \"end\"\n optionClassName?: string\n OptionView: React.FC<T>\n actions: Actions\n onActionSelect: CallbackWithActionId\n block: boolean\n side: PopoverSide\n align: PopoverAlign\n alignOffset: number\n avoidCollisions: boolean\n listWidth?: number | \"auto\" // Default when not passed is to match the width of the trigger\n listMinWidth: number | \"auto\"\n listMaxWidth?: number | \"auto\"\n // References\n onSelectRef: React.MutableRefObject<(option: T, removeOption?: boolean) => void>\n searchPredicateRef: React.MutableRefObject<SearchPredicate<T>>\n // Derived\n searchable: boolean\n}\n\nconst SelectContext = createContext<SelectContextValue<Option> | null>(null)\n\nconst useSelectContext = () => {\n const context = use(SelectContext)\n\n if (!context) {\n throw new Error(\"Select components must be wrapped in <Select />\")\n }\n\n return context\n}\n\nconst DefaultOptionView = ({ label }: { label: string }) => <>{label}</>\nconst DefaultSingleTriggerView = ({ label }: { label: string }) => <>{label}</>\nconst DefaultMultiTriggerView = <T extends Option>({\n values,\n selectedAll,\n}: MultiSelectTriggerViewProps<T>) => {\n const displayValue = selectedAll\n ? \"All selected\"\n : values.length === 0\n ? // NOTE: Zero length is impossible - an empty option with `placeholder` is always returned\n \"Select...\"\n : values.length === 1\n ? values[0].label\n : `${values.length} selected`\n\n return <>{displayValue}</>\n}\n\nexport const Select = <T extends Option>(props: SelectProps<T>) => {\n const {\n id,\n required,\n value,\n name,\n multiple,\n variant = \"outline\",\n size = \"md\",\n dropdownIconType = \"dropdown\",\n loading = false,\n clearable = false,\n disabled = false,\n placeholder = \"Select...\",\n loadingPlaceholder = \"Loading...\",\n pill = true,\n listWidth,\n options,\n actions: propActions = [],\n side = \"bottom\",\n avoidCollisions = true,\n onChange,\n optionClassName,\n OptionView = DefaultOptionView,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n TriggerView: TriggerViewFromProps,\n searchPlaceholder = \"\",\n searchPredicate = defaultSearchPredicate,\n searchEmptyMessage = \"No results found.\",\n listMaxWidth = \"auto\",\n } = props\n // Block default is dynamic, based on `variant`\n const block = props.block ?? variant !== \"ghost\"\n // Align default is dynamic, based on `block`\n const align = props.align ?? (block ? \"center\" : \"start\")\n const alignOffset = props.alignOffset ?? (align === \"center\" ? 0 : -5)\n // Default to \"auto\" for block selects and 300 for inline selects.\n const listMinWidth = props.listMinWidth ?? (block ? \"auto\" : 300)\n\n // Create stable, mutable references to avoid memoization requirements from consumers\n const onSelectRef = useLatestValue((selectedOption: T, removeOption?: boolean) => {\n if (multiple) {\n // When clearing values, the value is an\n if (!selectedOption.value) {\n onChange([])\n return\n }\n\n if (removeOption) {\n const nextValues = value.filter((v) => v !== selectedOption.value)\n const currentSelectedOptions = getOptionsByValues(options, nextValues)\n onChange(currentSelectedOptions)\n } else {\n const currentSelectedOptions = getOptionsByValues(options, value)\n onChange(currentSelectedOptions.concat(selectedOption))\n }\n } else {\n onChange(selectedOption)\n }\n })\n\n const searchPredicateRef = useRef<SearchPredicate<T>>(searchPredicate)\n searchPredicateRef.current = searchPredicate\n\n // It should be exceedingly uncommon to change actions dynamically, and they are unlikely to be a stable array reference from consumers\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally limiting when this stable value changes to length of actions\n const actions = useMemo<Actions>(() => propActions, [propActions.length])\n // We need to ensure that when action callbacks are called, we have fresh function references, even if the other action details did not change.\n const propActionsRef = useRef<Actions>(propActions)\n propActionsRef.current = propActions\n const onActionSelect = useCallback<CallbackWithActionId>((actionId: string) => {\n propActionsRef.current.find((a) => a.id === actionId)?.onSelect(actionId)\n }, [])\n\n // Determine when custom selects should be used\n const optionsCount = useMemo(\n () =>\n isOptionGroupArray(options)\n ? options.reduce((acc: number, group) => {\n return acc + group.options.length\n }, 0)\n : options.length,\n [options],\n )\n\n // Using ID for DOM selection instead of passing around and merging a ref. Pick your poison.\n const internalTriggerId = useId()\n const triggerId = `select-trigger-${internalTriggerId}`\n\n // Locking down searchable count to a single value. Could make this customizable in the future, but would want guardrails.\n const searchable = optionsCount > 15\n\n // Narrow known values for context\n const dynamicContextProps = useMemo<\n SingleSelectContextValue<T> | MultiSelectContextValue<T>\n >(() => {\n if (multiple) {\n return {\n multiple: true,\n value: value as string[],\n TriggerView: TriggerViewFromProps ?? DefaultMultiTriggerView,\n }\n }\n\n return {\n multiple: false,\n value: value as string,\n TriggerView: TriggerViewFromProps ?? DefaultSingleTriggerView,\n }\n }, [multiple, value, TriggerViewFromProps])\n\n const store = useMemo<SelectContextValue<T>>(\n () => ({\n ...dynamicContextProps,\n triggerId,\n id,\n // Forward props\n name,\n required,\n options,\n placeholder,\n loadingPlaceholder,\n loading,\n clearable,\n variant,\n pill,\n size,\n dropdownIconType,\n block,\n align,\n alignOffset,\n side,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n searchPlaceholder,\n searchEmptyMessage,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n optionClassName,\n OptionView,\n actions,\n onActionSelect,\n onSelectRef,\n searchPredicateRef,\n // Derived state\n searchable,\n disabled,\n }),\n [\n dynamicContextProps,\n triggerId,\n id,\n required,\n name,\n options,\n placeholder,\n loadingPlaceholder,\n loading,\n clearable,\n variant,\n pill,\n size,\n dropdownIconType,\n block,\n align,\n alignOffset,\n side,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n searchPlaceholder,\n searchEmptyMessage,\n TriggerStartIcon,\n triggerClassName,\n opticallyAlign,\n optionClassName,\n OptionView,\n actions,\n onActionSelect,\n onSelectRef,\n searchable,\n disabled,\n ],\n )\n\n return (\n // NOTE: Cannot peacefully coerce SelectContextValue into a generic, so casting to any here.\n // This is safe because `store` is strongly typed above.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n <SelectContext.Provider value={store as any}>\n <CustomSelect />\n </SelectContext.Provider>\n )\n}\n\n// ============================================================\n// Trigger\n// ============================================================\ntype SelectTriggerProps = {\n onOpenChange?: (maybeNextState?: boolean) => void\n tabIndex?: number\n [\"aria-hidden\"]?: \"false\" | \"true\"\n ref?: React.Ref<HTMLButtonElement | null>\n}\n\nexport const SelectTrigger = (props: SelectTriggerProps) => {\n const {\n triggerId,\n id,\n required,\n value,\n multiple,\n options,\n loading,\n disabled,\n clearable,\n name,\n variant,\n pill,\n size,\n dropdownIconType,\n placeholder,\n loadingPlaceholder,\n block,\n opticallyAlign,\n triggerClassName,\n TriggerStartIcon,\n TriggerView,\n onSelectRef,\n } = useSelectContext()\n const {\n onOpenChange,\n // pass along props from Radix\n ...restProps\n } = props\n const firstValue = multiple ? value[0] : value\n const placeholderValue = loading ? loadingPlaceholder : placeholder\n\n const selectedItem = useMemo<Option>(\n () =>\n getOptionByValue(options, firstValue) || {\n value: \"\",\n label: placeholderValue,\n },\n [firstValue, options, placeholderValue],\n )\n const hasSelectedValue = multiple ? value.length > 0 : !!value\n const isPlaceholder = loading || !hasSelectedValue\n\n const typeahead = useMemo(() => createTypeahead(), [])\n\n const multipleTriggerViewProps = useMemo<MultiSelectTriggerViewProps<Option>>(() => {\n if (!multiple) {\n return { values: [], selectedAll: false }\n }\n\n const currentSelectedOptions = getOptionsByValues(options, value)\n const flatOptions = options.flatMap((o) => (\"options\" in o ? o.options : o))\n\n return {\n values: currentSelectedOptions.length\n ? currentSelectedOptions\n : [\n {\n value: \"\",\n label: placeholderValue,\n },\n ],\n selectedAll: flatOptions.length <= value.length,\n }\n }, [multiple, options, value, placeholderValue])\n\n const handleKeyDown = (evt: React.KeyboardEvent<HTMLButtonElement>) => {\n const key = evt.key\n\n // If not a command, check for typeahead\n // NOTE: Typeahead not supported in multi-select\n if (!multiple && isValidTypeaheadChar(key)) {\n const currentTypeaheadValue = typeahead(key)\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value\n // NOTE: We don't look at current highlighted value as a means to start the search\n const firstMatchingOption = getTypeaheadOption(options, currentTypeaheadValue, firstValue)\n\n if (firstMatchingOption) {\n onSelectRef.current(firstMatchingOption)\n }\n }\n }\n\n const handleClearClick = () => {\n onSelectRef.current({ value: \"\", label: \"\" })\n // Ensure open state is closed\n onOpenChange?.(false)\n }\n\n return (\n <SelectControl\n id={triggerId}\n className={triggerClassName}\n selected={!isPlaceholder}\n variant={variant}\n pill={pill}\n block={block}\n size={size}\n disabled={disabled}\n loading={loading}\n StartIcon={TriggerStartIcon}\n opticallyAlign={opticallyAlign}\n dropdownIconType={dropdownIconType}\n onClearClick={clearable ? handleClearClick : undefined}\n onInteract={onOpenChange}\n onKeyDown={handleKeyDown}\n {...restProps}\n >\n {multiple ? <TriggerView {...multipleTriggerViewProps} /> : <TriggerView {...selectedItem} />}\n {(name || id) && (\n <input\n id={id}\n name={name}\n value={firstValue}\n tabIndex={-1}\n onFocus={() => {\n document.getElementById(triggerId)?.focus()\n }}\n // keep react from complaining - don't make this readOnly because that\n // prevents the value from being required\n onChange={() => {}}\n required={required}\n className=\"sr-only w-full h-0 left-0 bottom-0 pointer-events-none\"\n aria-hidden=\"true\"\n />\n )}\n </SelectControl>\n )\n}\n\n// ============================================================\n// Custom Select\n// ============================================================\nconst CustomSelect = () => {\n const {\n triggerId,\n loading,\n side,\n align,\n alignOffset,\n avoidCollisions,\n listWidth,\n listMinWidth,\n listMaxWidth,\n } = useSelectContext()\n const [open, setOpen] = useState<boolean>(false)\n const selectContentRef = useRef<HTMLDivElement>(null)\n\n const handleOpenChange = (maybeNextState?: boolean) => {\n // Toggle the current state when called without a specific state\n const nextState = maybeNextState === undefined ? !open : maybeNextState\n setOpen(nextState)\n\n // When we're closing, manage focus back to trigger manually\n if (!nextState) {\n // Wait until the next tick to determine if another element has become focused\n setTimeout(() => {\n // This should never happen because TransitionGroup should keep the select content in the DOM long\n // enough for this callback to run. However, in the event that the ref is null, not focusing is safer.\n if (!selectContentRef.current) {\n return\n }\n\n const activeElement = document.activeElement\n\n // Don't restore focus to the trigger if focus has moved outside of the select menu\n if (activeElement && !selectContentRef.current.contains(activeElement)) {\n return\n }\n\n document.getElementById(triggerId)?.focus()\n })\n }\n }\n\n useEscCloseStack(open, () => {\n handleOpenChange(false)\n })\n\n return (\n <Popover.Root\n open={open}\n onOpenChange={(nextState) => {\n // Prevent opening while loading\n if (loading && nextState) {\n return\n }\n\n handleOpenChange(nextState)\n }}\n modal={false}\n >\n <Popover.Trigger asChild>\n <SelectTrigger onOpenChange={handleOpenChange} />\n </Popover.Trigger>\n <Popover.Portal forceMount>\n <TransitionGroup\n className={s.Menu}\n enterDuration={350}\n exitDuration={200}\n disableAnimations\n >\n {open && (\n <Popover.Content\n key=\"dropdown\"\n ref={selectContentRef}\n forceMount\n className={s.MenuList}\n side={side}\n sideOffset={5}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={{ bottom: 30, top: 30 }}\n // Prevent Radix auto focus so we can handle our own from within <CustomSelectMenu />\n onOpenAutoFocus={preventDefaultHandler}\n // Radix waits until the animation completes before directing focus, which is janky.\n onCloseAutoFocus={preventDefaultHandler}\n onEscapeKeyDown={preventDefaultHandler}\n style={toCssVariables({\n \"select-list-width\": listWidth,\n \"select-list-min-width\": listMinWidth,\n \"select-list-max-width\": listMaxWidth,\n })}\n >\n <CustomSelectMenu onOpenChange={handleOpenChange} />\n </Popover.Content>\n )}\n </TransitionGroup>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\ntype CustomSelectMenuContextValue = {\n valueRef: React.RefObject<string | null>\n listId: string\n requestCloseRef: React.RefObject<() => void | null>\n listRef: React.RefObject<HTMLDivElement | null>\n // Highlighting\n highlightedValue: string\n setHighlightedValue: React.Dispatch<React.SetStateAction<string>>\n // Search\n searchTerm: string\n setSearchTerm: React.Dispatch<React.SetStateAction<string>>\n searchInputRef: React.RefObject<HTMLInputElement | null>\n}\n\nconst CustomSelectMenuContext = createContext<CustomSelectMenuContextValue | null>(null)\n\nconst useCustomSelectMenuContext = () => {\n const context = use(CustomSelectMenuContext)\n\n if (!context) {\n throw new Error(\"CustomSelectMenu components must be wrapped in <CustomSelectMenu />\")\n }\n\n return context\n}\n\ntype CustomSelectMenuProps = {\n onOpenChange: (maybeNextState?: boolean) => void\n}\n\nconst CustomSelectMenu = ({ onOpenChange }: CustomSelectMenuProps) => {\n const { multiple, value, options, searchable, searchPredicateRef } = useSelectContext()\n const requestCloseRef = useRef<() => void>(() => onOpenChange(false))\n const menuRef = useRef<HTMLDivElement>(null)\n const listRef = useRef<HTMLDivElement>(null)\n const searchInputRef = useRef<HTMLInputElement>(null)\n const [searchTerm, setSearchTerm] = useState(\"\")\n const [highlightedValue, setHighlightedValue] = useState<string>(() => {\n const selectedValue = multiple ? value[0] : value\n return (selectedValue || getFirstValidOption(options)?.value) ?? \"\"\n })\n const typeahead = useMemo(() => createTypeahead(), [])\n const internalListId = useId()\n const listId = `select-list-${internalListId}`\n\n // Lock `value` for a given open to prevent janky change during close animation\n // NOTE: This ref has no use in MultiSelect cases, set to empty string as a no-op\n const valueRef = useRef<string>(multiple ? \"\" : value)\n\n // Trim and lowercase search value\n const literalSearchTerm = useMemo(() => searchTerm.trim().toLocaleLowerCase(), [searchTerm])\n const filteredOptions = useMemo(\n () => filterOptions(options, literalSearchTerm, searchPredicateRef.current),\n [options, literalSearchTerm, searchPredicateRef],\n )\n const firstOption = useMemo(() => getFirstValidOption(filteredOptions), [filteredOptions])\n\n // Regrettable requirement for running an effect *after* mount\n const isMountStableRef = useRef<boolean>(false)\n\n const handleKeyDown = (evt: React.KeyboardEvent) => {\n const key = evt.key\n const firstValue = multiple ? value[0] : value\n const targetValue = highlightedValue || firstOption?.value || firstValue\n const isFocusedInSearch = document.activeElement === searchInputRef.current\n\n const menuElement = menuRef.current\n\n // Should be generally impossible for menuRef.current to not exist\n // unless we've unmounted and manage to fire this handler.\n if (!menuElement) {\n return\n }\n\n const triggerHighlightedOption = () => {\n const pointerUpEvent = new PointerEvent(\"pointerup\", {\n bubbles: true,\n cancelable: true,\n pointerType: \"mouse\",\n })\n\n // Find the current highlighted option\n const selectedOption = findOptionByValue(highlightedValue, menuElement)\n selectedOption?.dispatchEvent(pointerUpEvent)\n }\n\n const highlightOption = (val: string, element: Element) => {\n setHighlightedValue(val)\n element.scrollIntoView({ block: \"nearest\" })\n }\n\n const highlightSelectedOrFirstOption = () => {\n // Attempt to move highlight to selected item\n const maybeFirstValue = multiple ? value[0] : value\n\n if (maybeFirstValue) {\n const selectedElement = findOptionByValue(maybeFirstValue, menuElement)\n\n if (selectedElement) {\n highlightOption(maybeFirstValue, selectedElement)\n return\n }\n }\n\n // If value isn't set, or the selected node wasn't found in the DOM,\n // attempt to move focus to the first valid option.\n const firstValidOption = getFirstValidOption(options)\n\n if (firstValidOption) {\n const firstValidOptionElement = findOptionByValue(firstValidOption.value, menuElement)\n if (firstValidOptionElement) {\n highlightOption(firstValidOption.value, firstValidOptionElement)\n }\n }\n }\n\n // Commands\n switch (key) {\n case \"ArrowDown\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!highlightedValue || !findOptionByValue(highlightedValue, menuElement)) {\n // Attempt to move highlight to selected item\n highlightSelectedOrFirstOption()\n\n // Short-circuit because we have no highlighted value to advance from\n return\n }\n\n // Otherwise, move to the next option\n const nextElement = findNextOption(highlightedValue, menuElement)\n const nextValue = nextElement?.getAttribute(\"data-option-id\")\n if (nextElement && nextValue) {\n highlightOption(nextValue, nextElement)\n }\n\n return\n }\n case \"ArrowUp\": {\n evt.preventDefault()\n\n // If there's no highlighted value, or the highlighted value is not in the DOM\n if (!highlightedValue || !findOptionByValue(highlightedValue, menuElement)) {\n // Attempt to move highlight to selected item\n highlightSelectedOrFirstOption()\n\n // Short-circuit because we have no highlighted value to advance from\n return\n }\n\n const previousElement = findPreviousOption(targetValue, menuElement)\n const previousValue = previousElement?.getAttribute(\"data-option-id\")\n if (previousElement && previousValue) {\n highlightOption(previousValue, previousElement)\n }\n\n return\n }\n case \"Enter\":\n // Prevent default enter behavior from the search input, if present\n evt.preventDefault()\n\n // Send a pointerDown event into the currently highlighted option\n triggerHighlightedOption()\n\n return\n case \" \":\n // Allow spaces in search, and don't treat as enter\n // if there is a valid literalSearchTerm.\n if (literalSearchTerm && isFocusedInSearch) {\n return\n }\n\n // Prevent space from entering search input\n evt.preventDefault()\n\n // Send a pointerDown event into the currently highlighted option\n triggerHighlightedOption()\n\n return\n default:\n break\n }\n\n // If not a command, check for typeahead\n if (isValidTypeaheadChar(key)) {\n // Skip typeahead logic when we're focused in the search input\n if (isFocusedInSearch) {\n return\n }\n\n // Extend the current typeahead and get the latest value\n const currentTypeaheadValue = typeahead(key)\n\n // Stop other listeners from reacting\n evt.stopPropagation()\n\n // Attempt to filter options based on the value, starting at the highlighted value\n const firstMatchingOption = getTypeaheadOption(\n options,\n currentTypeaheadValue,\n highlightedValue,\n )\n\n if (firstMatchingOption) {\n const matchedNode = findOptionByValue(firstMatchingOption.value, menuElement)\n\n // Only change the highlight if we found the actual node\n if (matchedNode) {\n setHighlightedValue(firstMatchingOption.value)\n // Ensure the newly highlighted option is scrolled into view\n matchedNode.scrollIntoView({ block: \"nearest\" })\n }\n }\n }\n }\n\n const store = useMemo(\n () => ({\n valueRef,\n listId,\n highlightedValue,\n setHighlightedValue,\n requestCloseRef,\n searchTerm,\n setSearchTerm,\n searchInputRef,\n listRef,\n }),\n [listId, highlightedValue, setHighlightedValue, searchTerm, setSearchTerm],\n )\n\n // On mount behavior\n useEffect(() => {\n // Ensure initial highlighted option is in view\n // NOTE: Allowing for a render frame ensures content is positioned correctly before scrolling it into view.\n waitForAnimationFrame(() => {\n if (!menuRef.current) {\n return\n }\n\n // Ensure the highlighted option is in view\n const currentOption = findOptionByValue(highlightedValue, menuRef.current)\n // Scroll the selected item into view, and its bottom edge.\n currentOption?.scrollIntoView({ block: \"center\" })\n })\n\n // Send initial focus to the menu container or search input, to capture key events\n const autoFocusTarget = searchInputRef.current || menuRef.current\n autoFocusTarget?.focus({ preventScroll: true })\n\n // Required for <StrictMode>, because we need to unset this token\n // when the hooks are re-run. It's an imperative effect that we need to manage.\n return () => {\n isMountStableRef.current = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally an onMount effect\n }, [])\n\n // On search behavior\n useLayoutEffect(() => {\n // This effect will run on mount, but we want to skip it.\n // The on mount effect is responsible for handling mount behavior,\n // but this effect is specifically responsible for handling search changes\n if (!isMountStableRef.current) {\n isMountStableRef.current = true\n return\n }\n\n // Impossible while mounted, list ref will exist\n if (!listRef.current) {\n return\n }\n\n // Reset scroll position to the top\n listRef.current.scrollTop = 0\n\n // Highlight first item in the list\n const maybeFirstOption = getFirstValidOption(filteredOptions)\n if (maybeFirstOption) setHighlightedValue(maybeFirstOption.value)\n }, [filteredOptions])\n\n return (\n <CustomSelectMenuContext value={store}>\n <div id={listId} className={s.MenuInner} onKeyDown={handleKeyDown} ref={menuRef} tabIndex={0}>\n {searchable && <CustomSelectSearch value={searchTerm} onChange={setSearchTerm} />}\n <CustomSelectList filteredOptions={filteredOptions} />\n <CustomSelectActions />\n </div>\n </CustomSelectMenuContext>\n )\n}\n\ntype CustomSelectSearchProps = {\n value: string\n onChange: (nextSearchTerm: string) => void\n}\n\nconst CustomSelectSearch = ({ value, onChange }: CustomSelectSearchProps) => {\n const { searchPlaceholder } = useSelectContext()\n const { listId, searchInputRef } = useCustomSelectMenuContext()\n\n const handleChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\n onChange(evt.target.value)\n }\n\n return (\n <div className={s.Search}>\n <Input\n startAdornment={<Search width={16} height={16} className=\"fill-secondary\" />}\n ref={searchInputRef}\n value={value}\n placeholder={searchPlaceholder}\n onChange={handleChange}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n aria-autocomplete=\"list\"\n role=\"combobox\"\n aria-controls={listId}\n aria-expanded\n />\n </div>\n )\n}\n\nconst isOptionGroup = <T extends Option>(\n mixedOption: T | OptionGroup<T>,\n): mixedOption is OptionGroup<T> => {\n return \"options\" in mixedOption\n}\n\nconst isOptionGroupArray = <T extends Option>(arr: Options<T>): arr is OptionGroup<T>[] => {\n return arr[0] && isOptionGroup(arr[0])\n}\n\nconst HARD_OPTIONS_LIMIT = 300\n\nconst CustomSelectList = <T extends Option>({\n filteredOptions,\n}: {\n filteredOptions: Options<T>\n}) => {\n const { searchEmptyMessage } = useSelectContext()\n const { listRef } = useCustomSelectMenuContext()\n\n if (!filteredOptions.length) {\n return typeof searchEmptyMessage === \"string\" ? (\n <p className={s.SearchEmpty} data-text-only>\n {searchEmptyMessage}\n </p>\n ) : (\n <div className={s.SearchEmpty}>{searchEmptyMessage}</div>\n )\n }\n\n // We hard limit within groups, so at this level we will only limit flat arrays\n const isGrouped = isOptionGroupArray(filteredOptions)\n const hasHardLimit = !isGrouped && filteredOptions.length > HARD_OPTIONS_LIMIT\n\n const options = isGrouped\n ? filteredOptions.map((group) => <CustomSelectGroup key={group.label} {...group} />)\n : filteredOptions\n .slice(0, HARD_OPTIONS_LIMIT)\n .map((option) => <CustomSelectOption key={option.value} {...option} />)\n\n return (\n <div className={s.OptionsList} ref={listRef}>\n {options}\n {hasHardLimit && (\n <CustomSelectHardLimit numHidden={filteredOptions.length - HARD_OPTIONS_LIMIT} />\n )}\n </div>\n )\n}\n\nconst DEFAULT_OPTIONS_LIMIT = {\n limit: 100,\n label: \"Show all\",\n}\n\nconst CustomSelectGroup = <T extends Option>({\n label,\n options,\n optionsLimit = DEFAULT_OPTIONS_LIMIT,\n}: OptionGroup<T>) => {\n const groupId = useId()\n const { searchTerm, setHighlightedValue } = useCustomSelectMenuContext()\n const [limitExpanded, setLimitExpanded] = useState<boolean>(false)\n\n const hasExpandableLimit = optionsLimit.limit < options.length && !searchTerm && !limitExpanded\n const hasHardLimit = HARD_OPTIONS_LIMIT < options.length && !hasExpandableLimit\n\n let maybeLimitedOptions = options\n if (hasExpandableLimit) {\n maybeLimitedOptions = options.slice(0, optionsLimit.limit)\n } else if (hasHardLimit) {\n maybeLimitedOptions = options.slice(0, HARD_OPTIONS_LIMIT)\n }\n\n const handleLimitExpanded = () => {\n // Expand options\n setLimitExpanded(true)\n\n // Set highlight to the first option from the newly expanded list\n setHighlightedValue(options[optionsLimit.limit].value)\n }\n\n return (\n // NOTE: Important for crawling that groups are flat\n <>\n <div className={s.OptionGroupHeading}>\n <div className={s.OptionIndicatorSlot} />\n {label}\n </div>\n {maybeLimitedOptions.map((limitedOptions) => (\n <CustomSelectOption key={limitedOptions.value} {...limitedOptions} />\n ))}\n {hasExpandableLimit && (\n <CustomSelectExpandableLimit\n value={`group-limit-${groupId}`}\n label={optionsLimit.label}\n onPointerUp={handleLimitExpanded}\n />\n )}\n {hasHardLimit && <CustomSelectHardLimit numHidden={options.length - HARD_OPTIONS_LIMIT} />}\n </>\n )\n}\n\ntype CustomSelectHardLimitProps = {\n numHidden: number\n}\n\nconst CustomSelectHardLimit = ({ numHidden }: CustomSelectHardLimitProps) => {\n return (\n <div className={s.OptionHardLimitHeading}>\n <div className={s.OptionIndicatorSlot} />\n {`…and ${numHidden.toLocaleString()} more options. Use search to refine results further.`}\n </div>\n )\n}\n\ntype CustomSelectExpandableLimitProps = {\n value: string\n label: string\n onPointerUp: () => void\n}\n\nconst CustomSelectExpandableLimit = ({\n value,\n label,\n onPointerUp,\n}: CustomSelectExpandableLimitProps) => {\n const { highlightedValue, setHighlightedValue } = useCustomSelectMenuContext()\n\n const isHighlighted = value === highlightedValue\n\n const handlePointerMove = () => {\n if (isHighlighted) {\n return\n }\n\n setHighlightedValue(value)\n }\n\n const handlePointerLeave = () => {\n setHighlightedValue((currentHighlightedValue) => {\n // If the current value is not this one, don't do anything\n // Otherwise, clear the value, removing the active highlight on the menu.\n return currentHighlightedValue !== value ? currentHighlightedValue : \"\"\n })\n }\n\n // This component acts a LOT like an Option, but has enough bespoke behavior\n // that it cannot literally be one. We copy the important parts of Option for\n // keyboard navigation, UX, etc.\n return (\n <div\n className={clsx(s.Option, s.OptionsLimit)}\n data-option-id={value}\n data-highlight={isHighlighted ? \"\" : undefined}\n role=\"option\"\n aria-selected={isHighlighted}\n onPointerUp={onPointerUp}\n onPointerMove={handlePointerMove}\n onPointerLeave={handlePointerLeave}\n >\n <div className={clsx(s.PressableInner, s.OptionInner)}>\n <div className={s.OptionIndicatorSlot} />\n {label}\n </div>\n </div>\n )\n}\n\nconst INTERNAL_DOM_SELECTION_DATA_ATTR = \"data-option-id\"\n\nconst CustomSelectOption = (option: Option) => {\n const {\n optionClassName,\n OptionView,\n value: propsValue,\n multiple,\n onSelectRef,\n } = useSelectContext()\n const { valueRef, requestCloseRef, highlightedValue, setHighlightedValue } =\n useCustomSelectMenuContext()\n const { value, disabled, tooltip } = option\n\n // NOTE: SingleSelect mode looks at the ref instead of the live `propValue` intentionally\n // to avoid selecting the item as the select closes.\n const currentValue = valueRef.current\n const isSelected = multiple ? propsValue.includes(value) : value === currentValue\n const isHighlighted = value === highlightedValue\n\n const handlePointerUp = () => {\n if (multiple) {\n // Trigger the change ref, optionally as a remove\n onSelectRef.current(option, isSelected)\n } else {\n // Trigger the change ref\n onSelectRef.current(option)\n // Request the dropdown to close\n requestCloseRef.current?.()\n }\n }\n\n const handlePointerMove = () => {\n if (isHighlighted) {\n return\n }\n\n setHighlightedValue(value)\n }\n\n const handlePointerLeave = () => {\n setHighlightedValue((currentHighlightedValue) => {\n // If the current value is not this one, don't do anything\n // Otherwise, clear the value, removing the active highlight on the menu.\n return currentHighlightedValue !== value ? currentHighlightedValue : \"\"\n })\n }\n\n return (\n <div\n className={clsx(s.Option, optionClassName)}\n data-highlight={isHighlighted ? \"\" : undefined}\n role=\"option\"\n aria-selected={isHighlighted}\n data-selected={isSelected ? \"\" : undefined}\n // Internal attribute for selecting DOM nodes\n {...{ [INTERNAL_DOM_SELECTION_DATA_ATTR]: value }}\n // Allow options to behave like a native select, when you can open and select an item in a single click\n onPointerUp={disabled ? undefined : handlePointerUp}\n // Pointer move allows us to prevent contention from keyboard presses and a still mouse\n // which does trigger events like onMouseEnter, creating weird battles with mouse and keyboard focus.\n onPointerMove={disabled ? undefined : handlePointerMove}\n onPointerLeave={disabled ? undefined : handlePointerLeave}\n aria-disabled={disabled}\n data-disabled={disabled ? \"\" : undefined}\n >\n <div className={s.PressableInner}>\n <div className={s.OptionInner}>\n <div className={s.OptionIndicatorSlot}>\n {isSelected && <Check className={s.OptionCheck} />}\n </div>\n <OptionView {...option} />\n {tooltip && (\n <Tooltip content={tooltip.content} maxWidth={tooltip.maxWidth} side=\"right\">\n <Info />\n </Tooltip>\n )}\n </div>\n {option.description && (\n <div className={s.OptionInner}>\n <div className={s.OptionIndicatorSlot} />\n {option.description}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nconst CustomSelectActions = () => {\n const { actions } = useSelectContext()\n\n if (actions.length === 0) {\n return null\n }\n\n return (\n <div className={s.ActionsContainer}>\n {actions.map((action) => (\n <CustomSelectAction key={action.id} {...action} />\n ))}\n </div>\n )\n}\n\nconst CustomSelectAction = ({ id, label, Icon, className }: Action) => {\n const { onActionSelect } = useSelectContext()\n const { requestCloseRef } = useCustomSelectMenuContext()\n\n const handleKeyDown = (evt: React.KeyboardEvent<HTMLDivElement>) => {\n const key = evt.key\n\n switch (key) {\n case \"Tab\":\n // Allow tabbing to pass propagation as normal,\n // which bubbles up to the focus trap of Radix Popover\n break\n case \"Enter\":\n case \" \":\n evt.stopPropagation()\n handlePointerUp()\n break\n default:\n evt.stopPropagation()\n }\n }\n\n const handlePointerUp = () => {\n // Trigger the action's through our context helper, not the method on this action (it may be a stale reference)\n onActionSelect(id)\n // Request to close the dropdown\n requestCloseRef.current?.()\n }\n\n return (\n <div className={s.Action} onPointerUp={handlePointerUp} onKeyDown={handleKeyDown} tabIndex={0}>\n <div className={clsx(s.ActionInner, className)}>\n {Icon && <Icon role=\"presentation\" />}\n {label}\n </div>\n </div>\n )\n}\n\n// ============================================================\n// Utilities\n// ============================================================\nconst defaultSearchPredicate = (option: Option, searchTerm: string) =>\n option.label.toLowerCase().includes(searchTerm)\n\nconst filterOptions = <T extends Option>(\n options: Options<T>,\n searchTerm: string,\n searchIterator: SearchPredicate<T>,\n): Options<T> => {\n const searchValue = searchTerm.trim().toLocaleLowerCase()\n\n if (!searchValue) {\n return options\n }\n\n const filterOption = (option: T): boolean => searchIterator(option, searchValue)\n\n if (isOptionGroupArray(options)) {\n return options.reduce((acc, group) => {\n const filtered = group.options.filter(filterOption)\n\n if (filtered.length) {\n acc.push({\n ...group,\n options: filtered,\n })\n }\n return acc\n }, [] as OptionGroup<T>[])\n } else {\n return options.reduce((acc, option) => {\n if (filterOption(option)) acc.push(option)\n return acc\n }, [] as T[])\n }\n}\n\nconst getFirstValidOption = <T extends Option>(options: Options<T>): T | undefined => {\n if (!options.length) {\n return undefined\n }\n\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const firstNonDisabled = opt.options.find((i) => !i.disabled)\n if (firstNonDisabled) {\n found = firstNonDisabled\n break\n }\n } else {\n if (!opt.disabled) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\nconst getOptionByValue = <T extends Option>(options: Options<T>, value: string): T | undefined => {\n let found: T | undefined\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.find((i) => i.value === value)\n if (exists) {\n found = exists\n break\n }\n } else {\n if (opt.value === value) {\n found = opt\n break\n }\n }\n }\n\n return found\n}\n\nconst getOptionsByValues = <T extends Option>(options: Options<T>, values: string[]): T[] => {\n let found: T[] = []\n const lookup = new Set(values)\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n const exists = opt.options.filter((i) => lookup.has(i.value))\n found = found.concat(exists)\n } else {\n if (lookup.has(opt.value)) {\n found.push(opt)\n }\n }\n }\n\n return found\n}\n\nconst MAX_DOM_CRAWLS = 40\n\nconst findOptionByValue = (currentValue: string, container: HTMLElement) =>\n container.querySelector(`[data-option-id=\"${currentValue}\"]`)\n\nconst isValidOptionNode = (node: Element) => node.matches(\"[data-option-id]:not([data-disabled])\")\n\nconst findNextOption = (currentValue: string, container: HTMLElement) => {\n const currentOption = findOptionByValue(currentValue, container)\n\n let nextNode = currentOption?.nextElementSibling\n let maxSteps = 0\n\n while (nextNode && maxSteps < MAX_DOM_CRAWLS) {\n if (isValidOptionNode(nextNode)) {\n return nextNode\n }\n\n nextNode = nextNode.nextElementSibling\n maxSteps += 1\n }\n}\n\nconst findPreviousOption = (currentValue: string, container: HTMLElement) => {\n const currentOption = findOptionByValue(currentValue, container)\n\n let nextNode = currentOption?.previousElementSibling\n let maxSteps = 0\n\n while (nextNode && maxSteps < MAX_DOM_CRAWLS) {\n if (isValidOptionNode(nextNode)) {\n return nextNode\n }\n\n nextNode = nextNode.previousElementSibling\n maxSteps += 1\n }\n}\n\nconst createTypeahead = () => {\n let currentValue: string = \"\"\n let timeoutId: ReturnType<typeof setTimeout>\n\n return (char: string) => {\n // Searching is case-insensitive\n char = char.toLowerCase()\n\n // Add the new character to the current value\n currentValue += char\n\n // Clear the previous timeout if there was one\n if (timeoutId) clearTimeout(timeoutId)\n\n // Reset the value after a brief delay\n timeoutId = setTimeout(() => {\n currentValue = \"\"\n }, 500)\n\n // When a user is typing the same value, like \"llll\", assume they are cycling through items starting with \"l\"\n // We continue to build up the string in case another letter is typed, and then release the full value.\n // For example, if the user types \"ooog\", it will return \"o\", until \"g\" is typed, and then return the \"ooog\".\n const isCycling = char.repeat(currentValue.length) === currentValue\n\n // Return the typeahead value\n return isCycling ? char : currentValue\n }\n}\n\nconst isValidTypeaheadChar = (char: string): boolean => /^[a-zA-Z0-9]$/.test(char)\n\nconst getTypeaheadOption = <T extends Option>(\n options: Options<T>,\n typeaheadValue: string,\n currentHighlightValue?: string,\n): T | undefined => {\n // Ensure options actually exist\n if (!options.length) {\n return undefined\n }\n\n let matchBeforeHighlight: T | undefined\n let matchAfterHighlight: T | undefined\n // If we' aren't provided a highlighted value, start from the top (e.g., act like it's found)\n let foundHighlightedValue: boolean = !currentHighlightValue\n\n const optionValidAndMatches = ({ disabled, label, value }: T) => {\n // Side effect of looping\n if (value === currentHighlightValue) {\n foundHighlightedValue = true\n // Don't return highlighted value\n return false\n }\n\n return !disabled && label.toLowerCase().startsWith(typeaheadValue)\n }\n\n for (const opt of options) {\n if (isOptionGroup(opt)) {\n for (const option of opt.options) {\n if (optionValidAndMatches(option)) {\n if (foundHighlightedValue) {\n matchAfterHighlight = option\n // We're done after we've found an after match\n break\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || option\n }\n }\n }\n } else {\n if (optionValidAndMatches(opt)) {\n if (foundHighlightedValue) {\n matchAfterHighlight = opt\n // We're done after we've found an after match\n break\n } else {\n // Keep the first found \"before\" match\n matchBeforeHighlight = matchBeforeHighlight || opt\n }\n }\n }\n }\n\n return matchAfterHighlight || matchBeforeHighlight\n}\n", "import { useEffect, useId } from \"react\"\nimport { useLatestValue } from \"./useLatestValue\"\n\ntype Handler = {\n id: string\n callback: React.MutableRefObject<() => void>\n}\n\nlet handlers: Handler[] = []\nlet listenerBound = false\n\nconst handleKeyDown = (evt: KeyboardEvent) => {\n if (evt.key === \"Escape\") {\n // Attempt to call the first handler in the stack, if it exists\n const [firstHandler] = handlers\n\n if (firstHandler) {\n evt.preventDefault()\n firstHandler.callback.current?.()\n }\n }\n}\n\nconst managerListener = () => {\n if (handlers.length > 0 && !listenerBound) {\n document.body.addEventListener(\"keydown\", handleKeyDown)\n listenerBound = true\n } else if (handlers.length === 0 && listenerBound) {\n document.body.removeEventListener(\"keydown\", handleKeyDown)\n listenerBound = false\n }\n}\n\nconst registerHandler = (handler: Handler) => {\n handlers.unshift(handler)\n managerListener()\n}\n\nconst unregisterHandler = ({ id }: Handler) => {\n handlers = handlers.filter((h) => h.id !== id)\n managerListener()\n}\n\nexport const useEscCloseStack = (listening: boolean, cb: () => void) => {\n const id = useId()\n const latestCallback = useLatestValue(cb)\n\n useEffect(() => {\n if (!listening) {\n return\n }\n\n const handler = { id, callback: latestCallback }\n registerHandler(handler)\n\n return () => unregisterHandler(handler)\n }, [id, listening, latestCallback])\n}\n", "import { useRef } from \"react\"\n\nexport function useLatestValue<T>(value: T) {\n const ref = useRef(value)\n ref.current = value\n return ref\n}\n", "\"use client\"\n\nimport clsx from \"clsx\"\nimport { useRef, type ReactNode } from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\nimport { handlePressableMouseEnter } from \"../../lib/helpers\"\nimport type { ControlSize, Variants } from \"../../types\"\nimport { Button } from \"../Button\"\nimport { ChevronDownVector, DropdownVector, X } from \"../Icon\"\nimport { LoadingIndicator } from \"../Indicator\"\nimport s from \"./SelectControl.module.css\"\n\nexport type DropdownIconType = \"chevronDown\" | \"dropdown\" | \"none\"\n\nexport type SelectControlProps = Omit<React.HTMLAttributes<HTMLSpanElement>, \"onClick\"> & {\n /**\n * Style variant for the Button\n * @default fill\n */\n variant?: Variants<\"soft\" | \"outline\" | \"ghost\">\n /**\n * Determines if the control should be a fully rounded pill shape\n * @default false\n */\n pill?: boolean\n /**\n * Extends the control to 100% of available width.\n * @default true\n */\n block?: boolean\n /**\n * Applies a negative margin using the current gutter to optically align the control\n * with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Disables the control visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Visually indicates that the control is in an invalid state\n * @default false\n */\n invalid?: boolean\n /**\n * Indicates that the control is selected. An unselected state will display placeholder styles.\n * @default false\n */\n selected?: boolean\n /**\n * Display a clear action that allows the select to be unset.\n * @default false\n */\n onClearClick?: () => void\n /**\n * Primary handler for when the control is selected with pointer or keyboard events\n */\n onInteract?: () => void\n /**\n * Determines size of the size and spacing of the control.\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n * @default md\n */\n size?: ControlSize\n /**\n * Displays loading indicator on top of button contents\n * @default false\n */\n loading?: boolean\n /**\n * Icon displayed in the far right of the select trigger\n * @default dropdown\n */\n dropdownIconType?: DropdownIconType\n /** Icon displayed at the start of the control */\n StartIcon?: React.ComponentType<React.SVGProps<SVGSVGElement>>\n /** Custom class applied to the control element */\n className?: string\n /** Content rendered for the control */\n children: ReactNode\n ref?: React.Ref<HTMLSpanElement | null>\n}\n\nexport const SelectControl = ({\n ref,\n onPointerDown,\n onKeyDown,\n onPointerEnter,\n onInteract,\n invalid,\n disabled,\n children,\n className,\n variant = \"outline\",\n size = \"md\",\n block,\n opticallyAlign,\n pill = true,\n loading,\n onClearClick,\n selected = false,\n StartIcon,\n dropdownIconType = \"dropdown\",\n ...restProps\n}: SelectControlProps) => {\n const controlRef = useRef<HTMLSpanElement>(null)\n const clearable = !!onClearClick\n const showClearAction = clearable && selected && !loading && !disabled\n const hasDropdownIcon = dropdownIconType && dropdownIconType !== \"none\" && !loading\n const hasAnyTertiaryIndicator = showClearAction || loading || hasDropdownIcon\n const isInteractive = !loading && !disabled\n\n // Act like a <button> and fire the click handler on keyboard actions\n const handleKeyDown = (evt: React.KeyboardEvent<HTMLSpanElement>) => {\n switch (evt.key) {\n // NOTE: \"Enter\" does not open selects, as it may be an attempt to submit a form\n case \"ArrowDown\":\n case \"ArrowUp\":\n case \" \":\n evt.stopPropagation()\n evt.preventDefault()\n\n if (onInteract) {\n onInteract()\n } else {\n // Otherwise, send a synthetic trigger event to Radix (presumably)\n controlRef.current?.dispatchEvent(\n new PointerEvent(\"pointerdown\", {\n bubbles: true,\n cancelable: true,\n pointerType: \"mouse\", // mimic mouse interaction\n }),\n )\n }\n break\n case \"Enter\":\n // NOTE: \"Enter\" does not open selects, as it may be an attempt to submit a form\n break\n default:\n // Allow all other key presses through\n onKeyDown?.(evt)\n }\n }\n\n const handlePointerDown = (evt: React.PointerEvent<HTMLSpanElement>) => {\n // Don't trigger on right clicks\n if (evt.button === 2) {\n return\n }\n\n // Prevent focus from entering the click target of the select\n // so that focus correctly moves into the menu.\n evt.stopPropagation()\n\n if (onInteract) {\n evt.preventDefault()\n onInteract()\n } else {\n // NOTE: cannot preventDefault() here, for radix\n onPointerDown?.(evt)\n // @ts-expect-error -- `onClick` can only be present if Radix is trying to spread it.\n // An example would be `<Popover>`, but we specifically open this component on `onPointerDown`.\n // Trigger the handler, assuming that `onPointerDown` is not going to be responsible for opening.\n restProps.onClick?.(evt)\n }\n }\n\n return (\n // Intentionally not using <button> and rebuilding the semantics\n <span\n ref={mergeRefs([controlRef, ref])}\n className={clsx(s.SelectControl, className)}\n // Recreate <button> semantics\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onPointerEnter={(evt: React.PointerEvent<HTMLAnchorElement>) => {\n handlePressableMouseEnter(evt)\n onPointerEnter?.(evt)\n }}\n onPointerDown={isInteractive ? handlePointerDown : undefined}\n onKeyDown={isInteractive ? handleKeyDown : undefined}\n data-variant={variant}\n data-block={block ? \"\" : undefined}\n data-pill={pill ? \"\" : undefined}\n data-size={size}\n data-optically-align={opticallyAlign}\n aria-busy={loading ? \"true\" : undefined}\n data-selected={selected}\n data-loading={loading ? \"\" : undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n aria-disabled={disabled}\n {...restProps}\n // Ignore onClick handler from Radix, because we use onPointerDown to mimic a native select\n onClick={undefined}\n >\n {StartIcon && <StartIcon className={s.StartIcon} />}\n <span className={s.TriggerText}>{children}</span>\n {hasAnyTertiaryIndicator && (\n <div className={s.IndicatorWrapper}>\n {showClearAction && (\n <Button\n aria-label=\"Clear current value\"\n className={s.Clear}\n onPointerDown={(evt: React.PointerEvent<HTMLButtonElement>) => {\n // Prevent pointerDown on trigger from being captured\n evt.stopPropagation()\n }}\n onClick={(evt) => {\n evt.stopPropagation()\n evt.preventDefault()\n onClearClick()\n }}\n color=\"secondary\"\n variant={hasDropdownIcon ? \"ghost\" : \"solid\"}\n // Mostly custom sizing through variables\n size=\"3xs\"\n uniform\n pill={pill}\n data-only-child={!hasDropdownIcon ? \"\" : undefined}\n >\n <X />\n </Button>\n )}\n {loading && <LoadingIndicator className={s.LoadingIndicator} />}\n {/* Using raw SVG canvases (opposed to fixed icon canvases) led to less pixelation. */}\n {hasDropdownIcon && <DropdownIcon iconType={dropdownIconType} />}\n </div>\n )}\n </span>\n )\n}\n\ntype DropdownIconProps = {\n iconType: Omit<DropdownIconType, \"none\">\n}\n\nexport const DropdownIcon = ({ iconType }: DropdownIconProps) => {\n return iconType === \"chevronDown\" ? (\n <ChevronDownVector className={clsx(s.DropdownIcon, s.DropdownIconChevron)} />\n ) : (\n <DropdownVector className={s.DropdownIcon} />\n )\n}\n", "\"use client\"\n\nimport { Tooltip as RadixTooltip } from \"radix-ui\"\nimport { useRef, useState } from \"react\"\nimport { copyText } from \"../../lib/copyToClipboard\"\nimport { Check, Copy } from \"../Icon\"\nimport { Tooltip } from \"./Tooltip\"\n\nexport type CopyTooltipProps = {\n children: React.ReactNode\n /** Value to copy to the clipboard */\n copyValue: string\n /**\n * Delay of when the tooltip is shown from first interaction, in milliseconds.\n * @default 150\n */\n openDelay?: number\n /**\n * The preferred alignment against the trigger. May change when collisions occur.\n * @default center\n */\n align?: RadixTooltip.TooltipContentProps[\"align\"]\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: RadixTooltip.TooltipContentProps[\"alignOffset\"]\n /**\n * The preferred side of the trigger to render against when open. Will be reversed when collisions occur.\n * @default top\n */\n side?: RadixTooltip.TooltipContentProps[\"side\"]\n /**\n * The distance in pixels from the trigger.\n * @default 5\n */\n sideOffset?: RadixTooltip.TooltipContentProps[\"sideOffset\"]\n}\n\nexport const CopyTooltip = ({\n children,\n copyValue,\n openDelay = 150,\n align = \"center\",\n alignOffset = 0,\n side = \"top\",\n sideOffset = 5,\n}: CopyTooltipProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const [copied, setCopied] = useState<boolean>(false)\n const copiedTimerRef = useRef<ReturnType<typeof setTimeout>>(undefined)\n\n const copy = () => {\n setCopied(true)\n\n // Not currently revealing the slight async nature of this operation,\n // nor indicating the failure state.\n copyText(copyValue)\n\n // Persist the copied state for a second, then close\n copiedTimerRef.current = setTimeout(() => {\n setOpen(false)\n }, 1000)\n }\n\n const handleOpenChange = (nextState: boolean) => {\n // When opening, ensure timer and copied state are cleared\n if (nextState) {\n clearTimeout(copiedTimerRef.current)\n setCopied(false)\n }\n\n setOpen(nextState)\n }\n\n return (\n <Tooltip.Root\n open={open}\n onOpenChange={handleOpenChange}\n delayDuration={openDelay}\n disableHoverableContent={false}\n >\n <Tooltip.Trigger\n onPointerDown={(evt) => {\n // Prevent tooltip listeners from closing\n evt.preventDefault()\n evt.stopPropagation()\n\n // Copy the value\n copy()\n }}\n // Prevent default behavior of closing on click from this handler\n onClick={(evt) => {\n evt.preventDefault()\n evt.stopPropagation()\n }}\n >\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content\n compact\n clickable={!copied}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n collisionPadding={15}\n onEscapeKeyDown={() => setOpen(false)}\n onPointerDown={copy}\n >\n {copied ? (\n // The <Check /> SVG canvas whitespace is larger than copy, so we use a smaller flexbox gap\n <div className=\"flex items-center gap-0.5\">\n <Check /> Copied!\n </div>\n ) : (\n <div className=\"flex items-center gap-1\">\n <Copy /> Copy\n </div>\n )}\n </Tooltip.Content>\n </Tooltip.Root>\n )\n}\n", "\"use client\"\n\nimport clsx from \"clsx\"\nimport { Tooltip as RadixTooltip, Slot } from \"radix-ui\"\nimport { useState, type MouseEventHandler, type PointerEventHandler } from \"react\"\nimport { useTimeout } from \"usehooks-ts\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { preventDefaultHandler } from \"../../lib/helpers\"\nimport s from \"./Tooltip.module.css\"\n\nexport type TooltipProps = {\n children: React.ReactNode\n /**\n * The content of the tooltip. If `null`, the tooltip will not render.\n */\n content: React.ReactNode\n /**\n * Defines the `max-width` of the tooltip content. `\"none\"` creates a single-line, naturally sized tooltip.\n * @default 300\n */\n maxWidth?: number | \"none\"\n /**\n * Forces the tooltip to remain open or closed\n */\n forceOpen?: boolean\n /**\n * Delay of when the tooltip is shown from first interaction, in milliseconds.\n * @default 150\n */\n openDelay?: number\n /** Indicates that the tooltip has interactive content, and should remain open when hovered. */\n interactive?: boolean\n /**\n * Short, 1-3 word tooltips, stylized inversely from normal tooltips\n */\n compact?: boolean\n /**\n * Prevents the tooltip from closing when the trigger is clicked right after opening\n * @default false\n */\n preventUnintentionalClickToClose?: true\n /**\n * The preferred alignment against the trigger. May change when collisions occur.\n * @default center\n */\n align?: RadixTooltip.TooltipContentProps[\"align\"]\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n * @default 0\n */\n alignOffset?: RadixTooltip.TooltipContentProps[\"alignOffset\"]\n /**\n * The preferred side of the trigger to render against when open. Will be reversed when collisions occur.\n * @default top\n */\n side?: RadixTooltip.TooltipContentProps[\"side\"]\n /**\n * The distance in pixels from the trigger.\n * @default 5\n */\n sideOffset?: RadixTooltip.TooltipContentProps[\"sideOffset\"]\n /**\n * Gutter sizing inside the tooltip content\n * @default md\n */\n gutterSize?: \"sm\" | \"md\" | \"lg\"\n /** Ref for the tooltip */\n ref?: React.Ref<HTMLDivElement | null>\n onPointerDown?: PointerEventHandler\n onClick?: MouseEventHandler\n /** Optional class name to apply to the tooltip content */\n contentClassName?: string\n}\n\nexport const Tooltip = (props: TooltipProps) => {\n const {\n ref: forwardedRef,\n children,\n content,\n forceOpen = content === null ? false : undefined,\n maxWidth = 300,\n openDelay = 150,\n interactive = false,\n compact = false,\n preventUnintentionalClickToClose,\n align,\n alignOffset = 0,\n side,\n sideOffset = 5,\n gutterSize = \"md\",\n contentClassName,\n onPointerDown,\n onClick,\n ...restProps\n } = props\n const [visible, setVisible] = useState<boolean>(false)\n const [temporarilyPreventClickToClose, setTemporarilyPreventClickToClose] =\n useState<boolean>(false)\n useTimeout(\n () => setTemporarilyPreventClickToClose(false),\n temporarilyPreventClickToClose ? 400 : null,\n )\n const open = forceOpen ?? visible\n\n const handleOpenChange = (nextState: boolean) => {\n // When forceOpen is passed, don't manage internal state\n if (typeof forceOpen === \"boolean\") return\n\n setVisible(nextState)\n\n if (preventUnintentionalClickToClose) {\n setTemporarilyPreventClickToClose(nextState)\n }\n }\n\n const maybePreventClickClose = (evt: React.MouseEvent) => {\n if (preventUnintentionalClickToClose && temporarilyPreventClickToClose) {\n // Prevents tooltip listeners from closing\n evt.preventDefault()\n evt.stopPropagation()\n }\n }\n\n return (\n <Root\n open={open}\n delayDuration={openDelay}\n onOpenChange={handleOpenChange}\n disableHoverableContent={!interactive}\n >\n <RadixTooltip.Trigger asChild>\n <Slot.Root\n {...restProps}\n ref={forwardedRef}\n onPointerDown={(evt) => {\n maybePreventClickClose(evt)\n onPointerDown?.(evt)\n }}\n onClick={(evt) => {\n maybePreventClickClose(evt)\n onClick?.(evt)\n }}\n >\n {children}\n </Slot.Root>\n </RadixTooltip.Trigger>\n <Content\n maxWidth={maxWidth}\n compact={compact}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n gutterSize={gutterSize}\n className={contentClassName}\n >\n {content}\n </Content>\n </Root>\n )\n}\n\nconst Root = ({\n children,\n open,\n onOpenChange,\n ...restProps\n}: RadixTooltip.TooltipProps & {\n open: boolean\n onOpenChange: (nextState: boolean) => void\n}) => {\n useEscCloseStack(open, () => {\n onOpenChange(false)\n })\n\n return (\n <RadixTooltip.Provider>\n <RadixTooltip.Root open={open} onOpenChange={onOpenChange} {...restProps}>\n {children}\n </RadixTooltip.Root>\n </RadixTooltip.Provider>\n )\n}\n\ntype TooltipContentProps = RadixTooltip.TooltipContentProps & {\n children: React.ReactNode\n /**\n * Defines the `max-width` of the tooltip content. `\"none\"` creates a single-line, naturally sized tooltip.\n * @default 300\n */\n maxWidth?: number | \"none\"\n /**\n * Short, 1-3 word tooltips, stylized inversely from normal tooltips\n */\n compact?: boolean\n /**\n * Gutter sizing inside the tooltip content\n * @default md\n */\n gutterSize?: \"sm\" | \"md\" | \"lg\"\n /** Determines if the tooltip content should respond to click events */\n clickable?: boolean\n}\n\nexport const Content = ({\n children,\n maxWidth = 300,\n compact = false,\n clickable = undefined,\n alignOffset = 0,\n sideOffset = 5,\n gutterSize = \"md\",\n className,\n style,\n ...restProps\n}: TooltipContentProps) => {\n return (\n <RadixTooltip.Portal>\n <RadixTooltip.Content\n {...restProps}\n className={clsx(s.Tooltip, className)}\n data-compact={compact}\n data-clickable={clickable}\n data-gutter-size={gutterSize}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n collisionPadding={15}\n hideWhenDetached\n style={{\n ...style,\n maxWidth,\n }}\n onEscapeKeyDown={preventDefaultHandler}\n >\n {children}\n </RadixTooltip.Content>\n </RadixTooltip.Portal>\n )\n}\n\ntype TooltipTriggerProps = RadixTooltip.TooltipTriggerProps & {\n /**\n * Determines if `tabindex=0` is applied to the trigger\n * @default true\n */\n focusable?: boolean\n /**\n * Optional class name to apply to the trigger\n */\n className?: string\n /** Ref for the trigger */\n ref?: React.Ref<HTMLSpanElement | null>\n}\n\nexport const Trigger = ({\n children,\n asChild = true,\n ...restProps\n}: RadixTooltip.TooltipTriggerProps) => {\n return (\n <RadixTooltip.Trigger asChild={asChild} {...restProps}>\n {children}\n </RadixTooltip.Trigger>\n )\n}\n\n// Optional wrapper for tooltip trigger, if the visual content isn't already accessible or with built-in visual indications\nexport const TriggerDecorator = (props: TooltipTriggerProps) => {\n const { children, className, focusable = true, ref, ...restProps } = props\n const isPlainText = typeof children === \"string\"\n\n return (\n <Slot.Root\n ref={ref}\n {...restProps}\n className={clsx(s.TriggerDecorator, className)}\n tabIndex={focusable ? 0 : undefined}\n >\n {isPlainText ? <span>{children}</span> : children}\n </Slot.Root>\n )\n}\n\n// Building advanced tooltip behaviors can be achieved by using the\n// composed components, and wiring up bespoke behaviors.\nTooltip.Root = Root\nTooltip.Content = Content\nTooltip.Trigger = Trigger\n// Basic <Tooltip> usage can be done with the component directly,\n// without requiring controlled component composition.\n// <TriggerDecorator> is a helper component that creates an accessible trigger with a visual effect\nTooltip.TriggerDecorator = TriggerDecorator\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,gBAWO;;;ACfP,IAAAC,gBAAiC;;;ACAjC,mBAAuB;AAEjB,SAAU,eAAkB,OAAQ;AACxC,QAAM,UAAM,qBAAO,KAAK;AACxB,MAAI,UAAU;AACd,SAAO;AACT;;;ADEA,IAAI,WAAsB,CAAA;AAC1B,IAAI,gBAAgB;AAEpB,IAAM,gBAAgB,CAAC,QAAsB;AAX7C;AAYE,MAAI,IAAI,QA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"_jsxs", "_jsx", "import_react", "import_react", "s", "_jsxs", "_jsx", "dist_exports", "s", "_jsx", "_Fragment", "o", "handleKeyDown", "_jsxs", "dist_exports"]
@@ -3,25 +3,25 @@ import {
3
3
  } from "./chunk-QPJAV452.js";
4
4
  import {
5
5
  toCssVariables
6
- } from "./chunk-BAG6OO6S.js";
6
+ } from "./chunk-DYQDWJMS.js";
7
7
  import "./chunk-EGRHWZRV.js";
8
8
  import {
9
9
  clsx_default
10
10
  } from "./chunk-CNYJBM5F.js";
11
11
  import {
12
12
  require_jsx_runtime
13
- } from "./chunk-PTVT3RFX.js";
13
+ } from "./chunk-JGVISENQ.js";
14
14
  import {
15
15
  require_react
16
- } from "./chunk-4TLBUCVB.js";
16
+ } from "./chunk-BUOVMFCD.js";
17
17
  import {
18
18
  __toESM
19
19
  } from "./chunk-ILHRZGIS.js";
20
20
 
21
- // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Textarea/Textarea.js
21
+ // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Textarea/Textarea.js
22
22
  var import_jsx_runtime = __toESM(require_jsx_runtime());
23
23
  var import_react = __toESM(require_react());
24
- import s from "/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Textarea/Textarea.module.css";
24
+ import s from "/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Textarea/Textarea.module.css";
25
25
  var Textarea = (props) => {
26
26
  const textAreaRef = (0, import_react.useRef)(null);
27
27
  const inputIdSuffix = (0, import_react.useId)();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/components/Textarea/Textarea.tsx"],
3
+ "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/src/components/Textarea/Textarea.tsx"],
4
4
  "sourcesContent": ["\"use client\"\n\nimport clsx from \"clsx\"\nimport { useCallback, useEffect, useId, useRef, useState } from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\nimport { toCssVariables } from \"../../lib/helpers\"\nimport { type ControlSize, type Sizes, type Variants } from \"../../types\"\nimport s from \"./Textarea.module.css\"\n\nexport type TextareaProps = {\n /**\n * Visual style of the textarea\n * @default outline\n */\n variant?: Variants<\"outline\" | \"soft\">\n /**\n * Controls the size of the textarea\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n *\n * @default md\n */\n size?: ControlSize\n /**\n * Controls gutter on the edges of the textarea, defaults to value from `size`.\n *\n * | 2xs | xs | sm | md | lg | xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` |\n */\n gutterSize?: Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">\n /**\n * Disables the textarea visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Mark the textarea as invalid\n * @default false\n */\n invalid?: boolean\n /**\n * Allow autofill extensions to appear in the textarea\n * @default false\n */\n allowAutofillExtensions?: boolean\n /**\n * Select all contents of the textarea when mounted.\n * @default false\n */\n autoSelect?: boolean\n /** Callback invoked when the textarea is autofilled by the browser */\n onAutofill?: () => void\n /**\n * Default number of rows to display\n * @default 3\n */\n rows?: number\n /**\n * Automatically adjust the height of the textarea based on its contents.\n * @default false\n */\n autoResize?: boolean\n /**\n * Maximum number of rows that can be displayed when autoResize is enabled.\n * @default Math.max(rows, 10)\n */\n maxRows?: number\n /** Ref for the textarea */\n ref?: React.Ref<HTMLTextAreaElement | null>\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"disabled\" | \"size\">\n\nexport const Textarea = (props: TextareaProps) => {\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null)\n const inputIdSuffix = useId()\n // Prevent 1Password from appearing: 1Password won't display if it thinks this field is for searching\n // Allow user to override this for connecting to labels.\n const onePasswordPreventionId = `search-ui-input-${inputIdSuffix}`\n const {\n id,\n name,\n variant = \"outline\",\n size = \"md\",\n gutterSize,\n className,\n autoComplete,\n disabled = false,\n readOnly = false,\n invalid = false,\n // Default to `true` when presence of `name`\n allowAutofillExtensions = !!name,\n onFocus,\n onBlur,\n onAnimationStart,\n onAutofill,\n autoSelect,\n rows = 3,\n maxRows,\n autoResize,\n ref,\n onChange,\n ...restProps\n } = props\n\n const [focused, setFocused] = useState<boolean>(false)\n const computedMaxRows = autoResize ? Math.max(maxRows ?? 10, rows) : rows\n\n useEffect(() => {\n if (autoSelect) {\n textAreaRef.current?.select()\n }\n }, [autoSelect])\n\n const handleAnimationStart = (evt: React.AnimationEvent<HTMLTextAreaElement>) => {\n onAnimationStart?.(evt)\n if (evt.animationName === \"native-autofill-in\") {\n onAutofill?.()\n }\n }\n\n const autosizeTextarea = useCallback(() => {\n if (!autoResize || !textAreaRef.current || computedMaxRows === undefined) return\n textAreaRef.current.style.height = \"0px\"\n const scrollHeight = textAreaRef.current.scrollHeight\n textAreaRef.current.style.height = scrollHeight + \"px\"\n }, [autoResize, computedMaxRows])\n\n // Resize if value changes outside of user input - e.g. form reset\n useEffect(() => {\n autosizeTextarea()\n }, [props.value, rows, autosizeTextarea])\n\n return (\n <div\n className={clsx(s.Container, className)}\n data-variant={variant}\n data-size={size}\n data-gutter-size={gutterSize}\n data-focused={focused}\n data-disabled={disabled ? \"\" : undefined}\n data-readonly={readOnly ? \"\" : undefined}\n data-invalid={invalid ? \"\" : undefined}\n style={toCssVariables({\n \"textarea-min-rows\": `${rows}`,\n \"textarea-max-rows\": `${computedMaxRows}`,\n })}\n >\n <textarea\n {...restProps}\n onChange={(evt) => {\n onChange?.(evt)\n autosizeTextarea()\n }}\n ref={mergeRefs([textAreaRef, ref])}\n id={id || (allowAutofillExtensions ? undefined : onePasswordPreventionId)}\n className={s.Textarea}\n name={name}\n readOnly={readOnly}\n disabled={disabled}\n rows={rows}\n onFocus={(evt) => {\n setFocused(true)\n onFocus?.(evt)\n }}\n onBlur={(evt) => {\n setFocused(false)\n onBlur?.(evt)\n }}\n onAnimationStart={handleAnimationStart}\n // Prevent LastPass and 1Password from appearing\n data-lpignore={allowAutofillExtensions ? undefined : true}\n data-1p-ignore={allowAutofillExtensions ? undefined : true}\n />\n </div>\n )\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAGA,mBAAgE;AAIhE,OAAO,OAAO;AAmEP,IAAM,WAAW,CAAC,UAAwB;AAC/C,QAAM,kBAAc,qBAAmC,IAAI;AAC3D,QAAM,oBAAgB,oBAAK;AAG3B,QAAM,0BAA0B,mBAAmB,aAAa;AAChE,QAAM;IACJ;IACA;IACA,UAAU;IACV,OAAO;IACP;IACA;IACA;IACA,WAAW;IACX,WAAW;IACX,UAAU;;IAEV,0BAA0B,CAAC,CAAC;IAC5B;IACA;IACA;IACA;IACA;IACA,OAAO;IACP;IACA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O;AACd,eAAW,KAAK;AAChB,qCAAS;EACX,GACA,kBAAkB,sBAAoB,iBAEvB,0BAA0B,SAAY,MAAI,kBACzC,0BAA0B,SAAY,KAAI,CAAA,EAC1D,CAAA;AAGR;",
6
6
  "names": ["_jsx"]
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  require_react
3
- } from "./chunk-4TLBUCVB.js";
3
+ } from "./chunk-BUOVMFCD.js";
4
4
  import {
5
5
  __toESM
6
6
  } from "./chunk-ILHRZGIS.js";
7
7
 
8
- // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/lib/theme.js
8
+ // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/lib/theme.js
9
9
  var import_react = __toESM(require_react());
10
10
  function useDocumentTheme() {
11
11
  const [theme, setTheme] = (0, import_react.useState)(getDocumentTheme);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/src/lib/theme.tsx"],
3
+ "sources": ["../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/src/lib/theme.tsx"],
4
4
  "sourcesContent": ["import { useEffect, useState } from \"react\"\n\nexport type DocumentTheme = \"light\" | \"dark\"\n\nexport function useDocumentTheme() {\n const [theme, setTheme] = useState<\"dark\" | \"light\">(getDocumentTheme)\n\n useEffect(() => {\n const observer = new MutationObserver(() => {\n setTheme(getDocumentTheme())\n })\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-theme\", \"class\"],\n characterData: false,\n childList: false,\n subtree: false,\n })\n\n return () => observer.disconnect()\n })\n\n return theme\n}\n\nexport function getDocumentTheme() {\n const theme = document.documentElement.getAttribute(\"data-theme\")\n\n if (theme === \"dark\" || theme === \"light\") {\n return theme\n }\n\n const darkMode = document.documentElement.classList.contains(\"dark\")\n\n return darkMode ? \"dark\" : \"light\"\n}\n\nexport function applyDocumentTheme(theme: \"light\" | \"dark\") {\n const htmlTag = document.documentElement\n htmlTag.setAttribute(\"data-theme\", theme)\n htmlTag.style.colorScheme = theme\n}\n"],
5
5
  "mappings": ";;;;;;;;AAAA,mBAAoC;AAI9B,SAAU,mBAAgB;AAC9B,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAA2B,gBAAgB;AAErE,8BAAU,MAAK;AACb,UAAM,WAAW,IAAI,iBAAiB,MAAK;AACzC,eAAS,iBAAgB,CAAE;IAC7B,CAAC;AAED,aAAS,QAAQ,SAAS,iBAAiB;MACzC,YAAY;MACZ,iBAAiB,CAAC,cAAc,OAAO;MACvC,eAAe;MACf,WAAW;MACX,SAAS;KACV;AAED,WAAO,MAAM,SAAS,WAAU;EAClC,CAAC;AAED,SAAO;AACT;AAEM,SAAU,mBAAgB;AAC9B,QAAM,QAAQ,SAAS,gBAAgB,aAAa,YAAY;AAEhE,MAAI,UAAU,UAAU,UAAU,SAAS;AACzC,WAAO;EACT;AAEA,QAAM,WAAW,SAAS,gBAAgB,UAAU,SAAS,MAAM;AAEnE,SAAO,WAAW,SAAS;AAC7B;AAEM,SAAU,mBAAmB,OAAuB;AACxD,QAAM,UAAU,SAAS;AACzB,UAAQ,aAAa,cAAc,KAAK;AACxC,UAAQ,MAAM,cAAc;AAC9B;",
6
6
  "names": []
@@ -1,160 +1,160 @@
1
1
  {
2
- "hash": "dae09673",
3
- "configHash": "851f7cb4",
4
- "lockfileHash": "6a28c6f3",
5
- "browserHash": "8381547e",
2
+ "hash": "2f940a3d",
3
+ "configHash": "f56e5903",
4
+ "lockfileHash": "bdba07c2",
5
+ "browserHash": "0bd02dfa",
6
6
  "optimized": {
7
7
  "react": {
8
- "src": "../../../../node_modules/.pnpm/react@19.2.0/node_modules/react/index.js",
8
+ "src": "../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js",
9
9
  "file": "react.js",
10
- "fileHash": "34de8f5c",
10
+ "fileHash": "8c524d9b",
11
11
  "needsInterop": true
12
12
  },
13
13
  "react-dom": {
14
- "src": "../../../../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/index.js",
14
+ "src": "../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js",
15
15
  "file": "react-dom.js",
16
- "fileHash": "25345a12",
16
+ "fileHash": "8eeb19ea",
17
17
  "needsInterop": true
18
18
  },
19
19
  "react/jsx-dev-runtime": {
20
- "src": "../../../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-dev-runtime.js",
20
+ "src": "../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-dev-runtime.js",
21
21
  "file": "react_jsx-dev-runtime.js",
22
- "fileHash": "d70cf82d",
22
+ "fileHash": "dda2010f",
23
23
  "needsInterop": true
24
24
  },
25
25
  "react/jsx-runtime": {
26
- "src": "../../../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js",
26
+ "src": "../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js",
27
27
  "file": "react_jsx-runtime.js",
28
- "fileHash": "e558722d",
28
+ "fileHash": "f7248748",
29
29
  "needsInterop": true
30
30
  },
31
31
  "@openai/apps-sdk-ui/components/Avatar": {
32
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Avatar/index.js",
32
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Avatar/index.js",
33
33
  "file": "@openai_apps-sdk-ui_components_Avatar.js",
34
- "fileHash": "42d8a2ca",
34
+ "fileHash": "f388143b",
35
35
  "needsInterop": false
36
36
  },
37
37
  "@openai/apps-sdk-ui/components/Button": {
38
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Button/index.js",
38
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Button/index.js",
39
39
  "file": "@openai_apps-sdk-ui_components_Button.js",
40
- "fileHash": "3a859716",
40
+ "fileHash": "0ea38e70",
41
41
  "needsInterop": false
42
42
  },
43
43
  "@openai/apps-sdk-ui/components/Checkbox": {
44
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Checkbox/index.js",
44
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Checkbox/index.js",
45
45
  "file": "@openai_apps-sdk-ui_components_Checkbox.js",
46
- "fileHash": "023fd696",
46
+ "fileHash": "e240ec98",
47
47
  "needsInterop": false
48
48
  },
49
49
  "@openai/apps-sdk-ui/components/Icon": {
50
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Icon/index.js",
50
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Icon/index.js",
51
51
  "file": "@openai_apps-sdk-ui_components_Icon.js",
52
- "fileHash": "b28344ea",
52
+ "fileHash": "d32785b8",
53
53
  "needsInterop": false
54
54
  },
55
55
  "@openai/apps-sdk-ui/components/Input": {
56
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/index.js",
56
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/index.js",
57
57
  "file": "@openai_apps-sdk-ui_components_Input.js",
58
- "fileHash": "1f7a8a17",
58
+ "fileHash": "347dbcfc",
59
59
  "needsInterop": false
60
60
  },
61
61
  "@openai/apps-sdk-ui/components/SegmentedControl": {
62
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/SegmentedControl/index.js",
62
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/SegmentedControl/index.js",
63
63
  "file": "@openai_apps-sdk-ui_components_SegmentedControl.js",
64
- "fileHash": "6dbcfe0b",
64
+ "fileHash": "b4e29624",
65
65
  "needsInterop": false
66
66
  },
67
67
  "@openai/apps-sdk-ui/components/Select": {
68
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Select/index.js",
68
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Select/index.js",
69
69
  "file": "@openai_apps-sdk-ui_components_Select.js",
70
- "fileHash": "df124076",
70
+ "fileHash": "54b9002d",
71
71
  "needsInterop": false
72
72
  },
73
73
  "@openai/apps-sdk-ui/components/Textarea": {
74
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Textarea/index.js",
74
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Textarea/index.js",
75
75
  "file": "@openai_apps-sdk-ui_components_Textarea.js",
76
- "fileHash": "c3d4fd40",
76
+ "fileHash": "c2845cba",
77
77
  "needsInterop": false
78
78
  },
79
79
  "@openai/apps-sdk-ui/theme": {
80
- "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/lib/theme.js",
80
+ "src": "../../../../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/lib/theme.js",
81
81
  "file": "@openai_apps-sdk-ui_theme.js",
82
- "fileHash": "bf2b8101",
82
+ "fileHash": "be140575",
83
83
  "needsInterop": false
84
84
  },
85
85
  "clsx": {
86
86
  "src": "../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs",
87
87
  "file": "clsx.js",
88
- "fileHash": "8e45b38a",
88
+ "fileHash": "6a6afb72",
89
89
  "needsInterop": false
90
90
  },
91
91
  "embla-carousel-react": {
92
- "src": "../../../../node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.0/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js",
92
+ "src": "../../../../node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.3/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js",
93
93
  "file": "embla-carousel-react.js",
94
- "fileHash": "e02c407d",
94
+ "fileHash": "74aac8d0",
95
95
  "needsInterop": false
96
96
  },
97
97
  "embla-carousel-wheel-gestures": {
98
98
  "src": "../../../../node_modules/.pnpm/embla-carousel-wheel-gestures@8.1.0_embla-carousel@8.6.0/node_modules/embla-carousel-wheel-gestures/dist/embla-carousel-wheel-gestures.esm.js",
99
99
  "file": "embla-carousel-wheel-gestures.js",
100
- "fileHash": "995231f5",
100
+ "fileHash": "b9d0faec",
101
101
  "needsInterop": false
102
102
  },
103
103
  "mapbox-gl": {
104
104
  "src": "../../../../node_modules/.pnpm/mapbox-gl@3.17.0/node_modules/mapbox-gl/dist/mapbox-gl.js",
105
105
  "file": "mapbox-gl.js",
106
- "fileHash": "ea0e6ce4",
106
+ "fileHash": "36999890",
107
107
  "needsInterop": true
108
108
  },
109
109
  "react-dom/client": {
110
- "src": "../../../../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/client.js",
110
+ "src": "../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js",
111
111
  "file": "react-dom_client.js",
112
- "fileHash": "bb56d10f",
112
+ "fileHash": "652a2f21",
113
113
  "needsInterop": true
114
114
  },
115
115
  "tailwind-merge": {
116
116
  "src": "../../../../node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs",
117
117
  "file": "tailwind-merge.js",
118
- "fileHash": "866233cc",
118
+ "fileHash": "723987a7",
119
119
  "needsInterop": false
120
120
  }
121
121
  },
122
122
  "chunks": {
123
- "chunk-CQ3GYAYB": {
124
- "file": "chunk-CQ3GYAYB.js"
123
+ "chunk-2DZGWGIP": {
124
+ "file": "chunk-2DZGWGIP.js"
125
125
  },
126
- "chunk-LR7NKCX5": {
127
- "file": "chunk-LR7NKCX5.js"
126
+ "chunk-N6DVYEXK": {
127
+ "file": "chunk-N6DVYEXK.js"
128
128
  },
129
- "chunk-YOJ6QPGS": {
130
- "file": "chunk-YOJ6QPGS.js"
129
+ "chunk-JAGHY6H6": {
130
+ "file": "chunk-JAGHY6H6.js"
131
131
  },
132
132
  "chunk-QPJAV452": {
133
133
  "file": "chunk-QPJAV452.js"
134
134
  },
135
- "chunk-BAG6OO6S": {
136
- "file": "chunk-BAG6OO6S.js"
135
+ "chunk-DYQDWJMS": {
136
+ "file": "chunk-DYQDWJMS.js"
137
137
  },
138
138
  "chunk-EGRHWZRV": {
139
139
  "file": "chunk-EGRHWZRV.js"
140
140
  },
141
- "chunk-SGWD4VEU": {
142
- "file": "chunk-SGWD4VEU.js"
141
+ "chunk-TSEQUROC": {
142
+ "file": "chunk-TSEQUROC.js"
143
143
  },
144
- "chunk-KFGKZMLK": {
145
- "file": "chunk-KFGKZMLK.js"
144
+ "chunk-XZTIOEPG": {
145
+ "file": "chunk-XZTIOEPG.js"
146
146
  },
147
147
  "chunk-CNYJBM5F": {
148
148
  "file": "chunk-CNYJBM5F.js"
149
149
  },
150
- "chunk-XB525PXG": {
151
- "file": "chunk-XB525PXG.js"
150
+ "chunk-UM3ZGDFR": {
151
+ "file": "chunk-UM3ZGDFR.js"
152
152
  },
153
- "chunk-PTVT3RFX": {
154
- "file": "chunk-PTVT3RFX.js"
153
+ "chunk-JGVISENQ": {
154
+ "file": "chunk-JGVISENQ.js"
155
155
  },
156
- "chunk-4TLBUCVB": {
157
- "file": "chunk-4TLBUCVB.js"
156
+ "chunk-BUOVMFCD": {
157
+ "file": "chunk-BUOVMFCD.js"
158
158
  },
159
159
  "chunk-ILHRZGIS": {
160
160
  "file": "chunk-ILHRZGIS.js"
@@ -6,18 +6,18 @@ import {
6
6
  } from "./chunk-CNYJBM5F.js";
7
7
  import {
8
8
  require_jsx_runtime
9
- } from "./chunk-PTVT3RFX.js";
9
+ } from "./chunk-JGVISENQ.js";
10
10
  import {
11
11
  require_react
12
- } from "./chunk-4TLBUCVB.js";
12
+ } from "./chunk-BUOVMFCD.js";
13
13
  import {
14
14
  __toESM
15
15
  } from "./chunk-ILHRZGIS.js";
16
16
 
17
- // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/Input.js
17
+ // ../node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/Input.js
18
18
  var import_jsx_runtime = __toESM(require_jsx_runtime());
19
19
  var import_react = __toESM(require_react());
20
- import s from "/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/@openai+apps-sdk-ui@0.2.0_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._60630c8dcc43ec213b3e346c9e26579b/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/Input.module.css";
20
+ import s from "/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/@openai+apps-sdk-ui@0.2.1_@types+react-dom@19.2.3_@types+react@19.2.7__@types+react@19._90324f97b7190ccfdbe40a9e8bef3385/node_modules/@openai/apps-sdk-ui/dist/es/components/Input/Input.module.css";
21
21
  var Input = (props) => {
22
22
  const inputRef = (0, import_react.useRef)(null);
23
23
  const inputIdSuffix = (0, import_react.useId)();
@@ -109,4 +109,4 @@ var Input = (props) => {
109
109
  export {
110
110
  Input
111
111
  };
112
- //# sourceMappingURL=chunk-CQ3GYAYB.js.map
112
+ //# sourceMappingURL=chunk-2DZGWGIP.js.map