sunpeak 0.5.12 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/sunpeak.js +11 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/style.css +6 -0
- package/package.json +1 -1
- package/template/_gitignore +47 -0
- package/template/dist/chatgpt/albums.js +49 -0
- package/template/dist/chatgpt/carousel.js +49 -0
- package/template/dist/chatgpt/counter.js +49 -0
- package/template/node_modules/.bin/eslint +21 -0
- package/template/node_modules/.bin/eslint-config-prettier +21 -0
- package/template/node_modules/.bin/nodemon +21 -0
- package/template/node_modules/.bin/prettier +21 -0
- package/template/node_modules/.bin/sunpeak +21 -0
- package/template/node_modules/.bin/ts-node +21 -0
- package/template/node_modules/.bin/ts-node-cwd +21 -0
- package/template/node_modules/.bin/ts-node-esm +21 -0
- package/template/node_modules/.bin/ts-node-script +21 -0
- package/template/node_modules/.bin/ts-node-transpile-only +21 -0
- package/template/node_modules/.bin/ts-script +21 -0
- package/template/node_modules/.bin/tsc +21 -0
- package/template/node_modules/.bin/tsserver +21 -0
- package/template/node_modules/.bin/tsx +21 -0
- package/template/node_modules/.bin/vite +21 -0
- package/template/node_modules/.bin/vitest +21 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js +20 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Checkbox.js +33 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Checkbox.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Icon.js +1498 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Icon.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Input.js +13 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Input.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js +103 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js +1019 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js +95 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_theme.js +45 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_theme.js.map +7 -0
- package/template/node_modules/.vite/deps/_metadata.json +151 -0
- package/template/node_modules/.vite/deps/chunk-4TLBUCVB.js +1004 -0
- package/template/node_modules/.vite/deps/chunk-4TLBUCVB.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-BAG6OO6S.js +115 -0
- package/template/node_modules/.vite/deps/chunk-BAG6OO6S.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-CNYJBM5F.js +21 -0
- package/template/node_modules/.vite/deps/chunk-CNYJBM5F.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-CQ3GYAYB.js +112 -0
- package/template/node_modules/.vite/deps/chunk-CQ3GYAYB.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-EGRHWZRV.js +1 -0
- package/template/node_modules/.vite/deps/chunk-EGRHWZRV.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-EVJ3DVH5.js +628 -0
- package/template/node_modules/.vite/deps/chunk-EVJ3DVH5.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-ILHRZGIS.js +46 -0
- package/template/node_modules/.vite/deps/chunk-ILHRZGIS.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-KFGKZMLK.js +280 -0
- package/template/node_modules/.vite/deps/chunk-KFGKZMLK.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-PTVT3RFX.js +292 -0
- package/template/node_modules/.vite/deps/chunk-PTVT3RFX.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-QPJAV452.js +13 -0
- package/template/node_modules/.vite/deps/chunk-QPJAV452.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-SGWD4VEU.js +15195 -0
- package/template/node_modules/.vite/deps/chunk-SGWD4VEU.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-XB525PXG.js +4480 -0
- package/template/node_modules/.vite/deps/chunk-XB525PXG.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-YOJ6QPGS.js +231 -0
- package/template/node_modules/.vite/deps/chunk-YOJ6QPGS.js.map +7 -0
- package/template/node_modules/.vite/deps/clsx.js +10 -0
- package/template/node_modules/.vite/deps/clsx.js.map +7 -0
- package/template/node_modules/.vite/deps/embla-carousel-react.js +1712 -0
- package/template/node_modules/.vite/deps/embla-carousel-react.js.map +7 -0
- package/template/node_modules/.vite/deps/embla-carousel-wheel-gestures.js +589 -0
- package/template/node_modules/.vite/deps/embla-carousel-wheel-gestures.js.map +7 -0
- package/template/node_modules/.vite/deps/package.json +3 -0
- package/template/node_modules/.vite/deps/react-dom.js +7 -0
- package/template/node_modules/.vite/deps/react-dom.js.map +7 -0
- package/template/node_modules/.vite/deps/react-dom_client.js +20217 -0
- package/template/node_modules/.vite/deps/react-dom_client.js.map +7 -0
- package/template/node_modules/.vite/deps/react.js +6 -0
- package/template/node_modules/.vite/deps/react.js.map +7 -0
- package/template/node_modules/.vite/deps/react_jsx-dev-runtime.js +278 -0
- package/template/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/template/node_modules/.vite/deps/react_jsx-runtime.js +7 -0
- package/template/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
- package/template/node_modules/.vite/deps/tailwind-merge.js +3095 -0
- package/template/node_modules/.vite/deps/tailwind-merge.js.map +7 -0
- package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- /package/template/{.prettierignore → _prettierignore} +0 -0
- /package/template/{.prettierrc → _prettierrc} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
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/Button/Button.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/lib/renderHelpers.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/AppsSDKUIProvider/internal.ts", "../../../../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/AppsSDKUIProvider/AppsSDKUIContext.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/Indicator/CircularProgress.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/useSimulatedProgress.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/Indicator/LoadingDots.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/Indicator/LoadingIndicator.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/Transition/TransitionGroup.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/Transition/getDisableAnimations.ts", "../../../../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/Transition/shared.ts", "../../../../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/Transition/transitionReducer.ts", "../../../../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/Button/CopyButton.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/lib/copyToClipboard.ts", "../../../../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/Transition/Animate.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/Transition/AnimateLayout.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/Transition/AnimateLayoutGroup.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/Transition/SlotTransitionGroup.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n type ButtonHTMLAttributes,\n type ComponentProps,\n type ComponentType,\n type MouseEventHandler,\n type ReactNode,\n useCallback,\n} from \"react\"\nimport { handlePressableMouseEnter } from \"../../lib/helpers\"\nimport { wrapTextNodeSiblings } from \"../../lib/renderHelpers\"\nimport { type ControlSize, type SemanticColors, type Sizes, type Variants } from \"../../types\"\nimport { useLinkComponent } from \"../AppsSDKUIProvider/internal\"\nimport { LoadingIndicator } from \"../Indicator\"\nimport { TransitionGroup } from \"../Transition/TransitionGroup\"\nimport s from \"./Button.module.css\"\n\ntype CommonProps = {\n /**\n * Color for the button\n * @default secondary\n */\n color: SemanticColors<\n \"primary\" | \"secondary\" | \"danger\" | \"success\" | \"info\" | \"discovery\" | \"caution\" | \"warning\"\n >\n /**\n * Style variant for the Button\n * @default \"solid\"\n */\n variant?: Variants<\"solid\" | \"soft\" | \"outline\" | \"ghost\">\n /**\n * Determines if the button should be a fully rounded pill shape\n * @default false\n */\n pill?: boolean\n /**\n * Disables the button visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Controls the visual tone when the button is disabled. \"relaxed\" will use a default cursor instead of not-allowed.\n */\n disabledTone?: \"relaxed\"\n /**\n * Determines if the button should take up 100% of available width\n * @default false\n */\n block?: boolean\n /**\n * Applies a negative margin using the current gutter to optically align the button\n * with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Controls size of the button, specifically height, but also includes defaults for `gutterSize`, `iconSize`, `font-size`, etc.\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 * Controls the size of icons within the button, defaults to value from `size`.\n *\n * | xs | sm | md | lg | xl | 2xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `14px` | `16px` | `18px` | `20px` | `22px` | `24px` |\n */\n iconSize?: Sizes<\"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\">\n /**\n * Controls gutter on the edges of the button, defaults to value from `size`.\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `4px` | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` |\n */\n gutterSize?: Sizes<\"3xs\" | \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">\n /** Custom class applied to the Button element */\n className?: string\n /** Content rendered inside of the Button */\n children: React.ReactNode\n}\n\nexport type ButtonProps = CommonProps & {\n /**\n * Determines if the button should have matching width and height, based on the `size`.\n * @default false\n */\n uniform?: boolean\n /**\n * Displays selected styles on the button, varying by `variant\n * @default false\n */\n selected?: boolean\n /**\n * Displays loading indicator on top of button contents\n * @default false\n */\n loading?: boolean\n /**\n * Determines whether the button should be made inert, without introducing visual change.\n * @default false\n */\n inert?: boolean\n /** Ref for the button */\n ref?: React.Ref<HTMLButtonElement | null>\n} & ButtonHTMLAttributes<HTMLButtonElement>\n\nexport const Button = (props: ButtonProps) => {\n const {\n type = \"button\",\n color = \"primary\",\n variant = \"solid\",\n pill = true,\n uniform = false,\n size = \"md\",\n iconSize,\n gutterSize,\n loading,\n selected,\n block,\n opticallyAlign,\n children,\n className,\n onClick,\n disabled,\n disabledTone,\n // Defaults to `loading` state\n inert = loading,\n ...restProps\n } = props\n\n const isInert = disabled || inert\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = useCallback(\n (e) => {\n if (disabled) {\n return\n }\n onClick?.(e)\n },\n [onClick, disabled],\n )\n\n return (\n <button\n type={type}\n className={clsx(s.Button, className)}\n data-color={color}\n data-variant={variant}\n data-pill={pill ? \"\" : undefined}\n data-uniform={uniform ? \"\" : undefined}\n data-size={size}\n data-gutter-size={gutterSize}\n data-icon-size={iconSize}\n data-loading={loading ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n data-block={block ? \"\" : undefined}\n data-optically-align={opticallyAlign}\n onPointerEnter={handlePressableMouseEnter}\n // Non-visual, accessible disablement\n // NOTE: Do not use literal `inert` because that is incorrect semantically\n disabled={isInert}\n aria-disabled={isInert}\n tabIndex={isInert ? -1 : undefined}\n // Visual disablement\n data-disabled={disabled ? \"\" : undefined}\n data-disabled-tone={disabled ? disabledTone : undefined}\n onClick={handleClick}\n {...restProps}\n >\n <TransitionGroup className={s.ButtonLoader} enterDuration={250} exitDuration={150}>\n {loading && <LoadingIndicator key=\"loader\" />}\n </TransitionGroup>\n <span className={s.ButtonInner}>{wrapTextNodeSiblings(children)}</span>\n </button>\n )\n}\n\ntype ButtonLink = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends ComponentType<any> | \"a\" = AppsSDKUI.LinkComponent,\n>(\n props: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> &\n CommonProps & {\n /**\n * Explicity specify that the link is an external link. This should be\n * automatically detected based on the URL, but in some cases (e.g.\n * my-app://foo) you may want to explicitly set this.\n */\n external?: boolean\n /**\n * Override the default component used for the link. This is useful for\n * using a routing library, or SSR rendering.\n * purposes.\n *\n * @default 'a'\n */\n as?: T\n } & ComponentProps<T>,\n) => ReactNode\n\nexport const ButtonLink = ((\n props: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> &\n CommonProps & {\n href?: string\n to?: string\n external?: boolean\n as?: AppsSDKUI.LinkComponent\n },\n) => {\n const {\n color = \"primary\",\n variant = \"solid\",\n pill = true,\n size = \"md\",\n gutterSize,\n iconSize,\n external,\n block,\n opticallyAlign,\n children,\n className,\n disabled,\n disabledTone,\n onClick,\n onPointerEnter,\n as: OverrideComponent,\n href,\n to,\n ...restProps\n } = props\n\n const isExternal = external ?? /^https?:\\/\\//.test(href ?? to ?? \"\")\n const DefaultComponent = useLinkComponent()\n const LinkComponent = OverrideComponent || (isExternal ? \"a\" : DefaultComponent)\n\n const sharedProps = {\n \"className\": clsx(s.Button, className),\n disabled,\n \"aria-disabled\": disabled,\n \"tabIndex\": disabled ? -1 : undefined,\n // Visual disablement (inert not supported in links, always applied)\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-disabled-tone\": disabled ? disabledTone : undefined,\n \"data-color\": color,\n \"data-variant\": variant,\n \"data-pill\": pill ? \"\" : undefined,\n \"data-block\": block ? \"\" : undefined,\n \"data-optically-align\": opticallyAlign,\n \"data-size\": size,\n \"data-gutter-size\": gutterSize,\n \"data-icon-size\": iconSize,\n \"onClick\": disabled ? undefined : onClick,\n \"onPointerEnter\": (evt: React.PointerEvent<HTMLAnchorElement>) => {\n handlePressableMouseEnter(evt)\n onPointerEnter?.(evt)\n },\n }\n\n if (disabled) {\n // Don't thread down stuff that isn't valid for a span - just keep the event handlers\n const eventProps = Object.fromEntries(\n Object.entries(restProps).filter(\n ([key, value]) => key.startsWith(\"on\") && typeof value === \"function\",\n ),\n )\n return (\n <span role=\"link\" {...sharedProps} {...eventProps}>\n <span className={s.ButtonInner}>{wrapTextNodeSiblings(children)}</span>\n </span>\n )\n }\n\n const linkProps = {\n ...(isExternal\n ? { target: \"_blank\", rel: \"noopener noreferrer\", href: href ?? to }\n : { href, to }),\n ...sharedProps,\n ...restProps,\n }\n\n return (\n <LinkComponent {...linkProps}>\n <span className={s.ButtonInner}>{wrapTextNodeSiblings(children)}</span>\n </LinkComponent>\n )\n}) as ButtonLink\n", "import { Children, cloneElement, isValidElement, type ReactElement, type ReactNode } from \"react\"\n\nconst flattenTextNodes = (children: ReactNode): ReactNode[] => {\n const nodes = Children.toArray(children)\n const result: ReactNode[] = []\n let buffer = \"\"\n\n const flush = () => {\n if (buffer !== \"\") {\n result.push(buffer)\n buffer = \"\"\n }\n }\n\n for (const node of nodes) {\n if (node == null || typeof node === \"boolean\") {\n continue\n }\n\n if (typeof node === \"string\" || typeof node === \"number\") {\n buffer += String(node)\n continue\n }\n\n // Boundary encountered: output any accumulated text, then the node\n flush()\n result.push(node)\n }\n\n flush()\n return result\n}\n\n// Helper to wrap text node siblings of other elements in a tag,\n// which enables sibling selectors to behave as expected for certain conditions\nexport const wrapTextNodeSiblings = (children: ReactNode): ReactNode => {\n const flattenedChildren = flattenTextNodes(children)\n const childrenCount = Children.count(flattenedChildren)\n\n return Children.map(flattenedChildren, (child) => {\n if (typeof child === \"string\" && !!child.trim()) {\n // Children with no siblings can immediately return\n if (childrenCount <= 1) {\n return child\n }\n\n // Wrap text nodes that have siblings\n return <span>{child}</span>\n }\n\n // For valid elements, recursively render to capture wrapped children\n if (isValidElement(child)) {\n const element = child as ReactElement<{ children?: ReactNode }>\n const { children: innerChildren, ...restProps } = element.props\n\n if (innerChildren != null) {\n return cloneElement(element, restProps, wrapTextNodeSiblings(innerChildren))\n }\n\n return element\n }\n\n return child\n })\n}\n", "\"use client\"\n\nimport { useContext } from \"react\"\nimport { AppsSDKUIContext } from \"./AppsSDKUIContext\"\n\nexport function useLinkComponent() {\n const context = useContext(AppsSDKUIContext)\n return context?.linkComponent ?? \"a\"\n}\n", "\"use client\"\n\nimport { type ComponentType, createContext, type ForwardRefExoticComponent } from \"react\"\n\ntype AppsSDKUIContextValue = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n linkComponent: ComponentType<any> | ForwardRefExoticComponent<any> | \"a\"\n}\n\nexport const AppsSDKUIContext = createContext<AppsSDKUIContextValue | null>(null)\n", "\"use client\"\n\nimport clsx from \"clsx\"\nimport { useState, type ComponentProps } from \"react\"\nimport { useSimulatedProgress } from \"../../hooks/useSimulatedProgress\"\n\nimport { toCssVariables } from \"../../lib/helpers\"\nimport s from \"./CircularProgress.module.css\"\n\nexport type CircularProgressProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n /**\n * Maximum duration to use for simulated upload progress in ms\n * @default 15000\n */\n maxDuration?: number\n /**\n * Sets the progress to full and resolves the simulated timer\n * @default false\n */\n done?: boolean\n /**\n * Sets the progress to full and resolves the simulated timer\n * @default false\n */\n progress?: number\n /** Size of the indicator, in pixels\n * @default 28px\n */\n size?: number | string\n /** Stroke width of the indicator, in pixels, between 1 and 4\n * @default 2\n */\n strokeWidth?: number\n /** Color of the active progress track (stroke) */\n trackActiveColor?: string\n /** Color of the base track (background stroke) */\n trackColor?: string\n}\n\nexport const CircularProgress = ({\n maxDuration = 15000, // 15 seconds\n done = false,\n className,\n progress: propProgress,\n size,\n strokeWidth,\n trackActiveColor,\n trackColor,\n style,\n ...restProps\n}: CircularProgressProps) => {\n const [currentTime] = useState(new Date())\n const simulatedProgressDone = propProgress !== undefined || done\n const simulatedProgress = useSimulatedProgress(+currentTime, maxDuration, simulatedProgressDone)\n const progress = propProgress ?? simulatedProgress\n\n return (\n <div\n {...restProps}\n className={clsx(s.Container, className)}\n style={\n style ||\n toCssVariables({\n \"circular-progress-size\": size,\n \"circular-progress-stroke\": strokeWidth ? Math.min(4, strokeWidth) : undefined,\n \"circular-progress-track-active-color\": trackActiveColor,\n \"circular-progress-track-color\": trackColor,\n })\n }\n >\n <svg viewBox=\"0 0 20 20\" className={s.Track} data-no-autosize>\n <circle cx=\"10\" cy=\"10\" r=\"8\" fill=\"none\" />\n </svg>\n <svg\n viewBox=\"0 0 20 20\"\n className={s.TrackProgress}\n style={{\n strokeDashoffset: 50 - 50 * (progress / 100),\n }}\n data-no-autosize\n >\n <circle cx=\"10\" cy=\"10\" r=\"8\" fill=\"none\" />\n </svg>\n </div>\n )\n}\n", "import { useState } from \"react\"\nimport { useInterval } from \"usehooks-ts\"\n\n/**\n * Deterministically returns a progress value between 0 and 100 that decays as it approaches 100,\n * based on a maximum duration and the elapsed time.\n *\n * @param maxTime - The maximum duration (in ms) after which the progress will be 100\n * @param elapsedTime - The elapsed time (in ms) since the start time\n * @returns The simulated progress percentage\n */\nexport function getSimulatedProgress(maxTime: number, elapsedTime: number) {\n // Parameters\n const P_max = 99.9 // Maximum percentage to approach (less than 100%)\n const P1 = 35 // Percentage at which the rate slows down\n const initialRate = (3 * 100) / maxTime // Initial rate (% per second)\n const t1 = P1 / initialRate // Time when progress reaches P1\n\n let percentage\n\n if (elapsedTime <= t1) {\n // **Phase 1:** Linear increase at the start to show consistency in progress\n percentage = initialRate * elapsedTime\n } else {\n // **Phase 2:** Progress slows down, approaching P_max\n const k = 4 // Controls how quickly progress approaches P_max\n const remainingTime = maxTime - t1\n const timeSinceT1 = elapsedTime - t1\n const exponent = -k * (timeSinceT1 / remainingTime)\n percentage = P1 + (P_max - P1) * (1 - Math.exp(exponent))\n }\n\n // Ensure the percentage does not exceed P_max\n return Math.min(percentage, P_max)\n}\n\n/**\n * Returns a number that will increase over time, decaying as it approaches 100,\n * withouth ever reaching the end.\n *\n * @param startAt - The time at which the progress started\n * @param maxDuration - The maximum duration (in ms) after which the progress will be 100\n * @param completed - Sets progress to 100% immediately\n */\nexport const useSimulatedProgress = (startAt: number, maxDuration: number, completed?: boolean) => {\n const elapsedStartTime = +new Date() - startAt\n const [progress, setProgress] = useState(getSimulatedProgress(maxDuration, elapsedStartTime))\n\n const incrementProgress = () => {\n const elapsedTime = +new Date() - startAt\n const newProgress =\n elapsedTime >= maxDuration ? 100 : getSimulatedProgress(maxDuration, elapsedTime)\n setProgress(newProgress)\n }\n\n useInterval(incrementProgress, completed ? null : 100)\n\n return completed ? 100 : progress\n}\n", "import clsx from \"clsx\"\nimport type { ComponentProps } from \"react\"\nimport s from \"./LoadingDots.module.css\"\n\nexport type LoadingDotsProps = Omit<ComponentProps<\"div\">, \"children\">\n\nexport const LoadingDots = ({ className, ...restProps }: LoadingDotsProps) => {\n return (\n <div className={clsx(s.LoadingDots, className)} {...restProps}>\n <div className={s.Dot} />\n <div className={s.Dot} />\n <div className={s.Dot} />\n </div>\n )\n}\n", "import clsx from \"clsx\"\nimport type { ComponentProps } from \"react\"\nimport { toCssVariables } from \"../../lib/helpers\"\nimport s from \"./LoadingIndicator.module.css\"\n\nexport type LoadingIndicatorProps = {\n /** Classname applied to the indicator */\n className?: string\n /** Size of the indicator, in pixels\n * @default 1em\n */\n size?: number | string\n /** Stroke width of the indicator, in pixels\n * @default 2\n */\n strokeWidth?: number\n} & Omit<ComponentProps<\"div\">, \"children\">\n\nexport const LoadingIndicator = ({\n className,\n size,\n strokeWidth,\n style,\n ...restProps\n}: LoadingIndicatorProps) => {\n return (\n <div\n {...restProps}\n className={clsx(s.LoadingIndicator, className)}\n style={\n style ||\n toCssVariables({\n \"indicator-size\": size,\n \"indicator-stroke\": strokeWidth,\n })\n }\n />\n )\n}\n", "\"use client\"\n\nimport React, {\n Children,\n useCallback,\n useEffect,\n useLayoutEffect,\n useReducer,\n useRef,\n useState,\n type CSSProperties,\n} from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\n\nimport { waitForAnimationFrame } from \"../../lib/helpers\"\n\nimport clsx from \"clsx\"\nimport { useTimeout } from \"usehooks-ts\"\nimport getDisableAnimations from \"./getDisableAnimations\"\nimport {\n assertSingleChildWhenRef,\n ChildrenWithKeys,\n computeNextRenderChildren,\n noop,\n useChildCallback,\n type CallbackType,\n type ReactElementWithKey,\n type TransitionGroupChildCallbacks,\n} from \"./shared\"\nimport s from \"./TransitionGroup.module.css\"\nimport { getInitialTransitionState, transitionReducer } from \"./transitionReducer\"\n\ntype TransitionGroupChildProps = {\n as: \"div\" | \"span\"\n children: React.ReactNode\n className?: string\n transitionId?: string\n style?: CSSProperties\n preventMountTransition?: boolean\n shouldRender: boolean\n enterDuration: number\n exitDuration: number\n enterMountDelay?: number\n removeChild: () => void\n ref?: React.Ref<unknown>\n} & TransitionGroupChildCallbacks\n\nconst TransitionGroupChildInner = ({\n ref: forwardedRef,\n as: TagName,\n children,\n className,\n transitionId,\n style,\n preventMountTransition,\n shouldRender,\n enterDuration,\n exitDuration,\n removeChild,\n onEnter,\n onEnterActive,\n onEnterComplete,\n onExit,\n onExitActive,\n onExitComplete,\n}: TransitionGroupChildProps) => {\n const [state, dispatch] = useReducer(\n transitionReducer,\n getInitialTransitionState(preventMountTransition || false),\n )\n // Allow a child to prevent mount transition, but still experience\n // future enter transition events, when applicable.\n const preventedMountTransition = useRef<boolean>(false)\n const elementRef = useRef<HTMLDivElement | null>(null)\n // Duration values should not affect hook re-renders, so we create refs for them\n const enterDurationRef = useRef<number>(enterDuration)\n enterDurationRef.current = enterDuration\n const exitDurationRef = useRef<number>(exitDuration)\n exitDurationRef.current = exitDuration\n\n const lastCallbackRef = useRef<CallbackType>(null)\n const triggerCallback = useCallback(\n (callbackType: CallbackType) => {\n const element = elementRef.current\n\n if (!element || callbackType === lastCallbackRef.current) {\n return\n }\n\n lastCallbackRef.current = callbackType\n\n switch (callbackType) {\n case \"enter\":\n onEnter(element)\n break\n case \"enter-active\":\n onEnterActive(element)\n break\n case \"enter-complete\":\n onEnterComplete(element)\n break\n case \"exit\":\n onExit(element)\n break\n case \"exit-active\":\n onExitActive(element)\n break\n case \"exit-complete\":\n onExitComplete(element)\n break\n default:\n callbackType satisfies never\n break\n }\n },\n [onEnter, onEnterActive, onEnterComplete, onExit, onExitActive, onExitComplete],\n )\n\n React.useLayoutEffect(() => {\n // Exit transition\n if (!shouldRender) {\n let exitTimeout: number | undefined\n\n dispatch({ type: \"exit-before\" })\n triggerCallback(\"exit\")\n\n const cancelAnimationFrame = waitForAnimationFrame(() => {\n dispatch({ type: \"exit-active\" })\n triggerCallback(\"exit-active\")\n\n exitTimeout = window.setTimeout(() => {\n triggerCallback(\"exit-complete\")\n removeChild()\n }, exitDurationRef.current)\n })\n\n return () => {\n cancelAnimationFrame()\n if (exitTimeout !== undefined) clearTimeout(exitTimeout)\n }\n }\n\n // Enter transition\n\n // Check if we need to prevent this specific entering cycle\n if (preventMountTransition && !preventedMountTransition.current) {\n // Mark initial transition as prevented and short-circuit.\n preventedMountTransition.current = true\n return\n }\n\n let enterTimeout: number | undefined\n\n dispatch({ type: \"enter-before\" })\n triggerCallback(\"enter\")\n\n const cancelAnimationFrame = waitForAnimationFrame(() => {\n dispatch({ type: \"enter-active\" })\n triggerCallback(\"enter-active\")\n\n enterTimeout = window.setTimeout(() => {\n dispatch({ type: \"done\" })\n triggerCallback(\"enter-complete\")\n }, enterDurationRef.current)\n })\n\n return () => {\n cancelAnimationFrame()\n if (enterTimeout !== undefined) clearTimeout(enterTimeout)\n }\n }, [\n shouldRender,\n // This value is immutable after <TransitionGroup> is created, and does not change on re-renders.\n preventMountTransition,\n removeChild,\n triggerCallback,\n ])\n\n useEffect(() => {\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 preventedMountTransition.current = false\n }\n }, [])\n\n return (\n <TagName\n ref={mergeRefs([elementRef, forwardedRef])}\n className={clsx(className, s.TransitionGroupChild)}\n data-transition-id={transitionId}\n style={style}\n data-entering={state.enter ? \"\" : undefined}\n data-entering-active={state.enterActive ? \"\" : undefined}\n data-exiting={state.exit ? \"\" : undefined}\n data-exiting-active={state.exitActive ? \"\" : undefined}\n data-interrupted={state.interrupted ? \"\" : undefined}\n >\n {children}\n </TagName>\n )\n}\n\nconst TransitionGroupChild = (props: TransitionGroupChildProps) => {\n // Don't spread these out of props - pass all props to inner child\n const { enterMountDelay, preventMountTransition } = props\n // Mount gating occurs when enterMountDelay exists, and isn't initial mount\n // Otherwise, this flag is a no-op and the TransitionChild mounts normally.\n const mountDelay = !preventMountTransition && enterMountDelay != null ? enterMountDelay : null\n const [mounted, setMounted] = useState(mountDelay == null)\n useTimeout(() => setMounted(true), mounted ? null : mountDelay)\n\n return mounted ? <TransitionGroupChildInner {...props} /> : null\n}\n\nexport type TransitionGroupProps = {\n /** Components controlled by TransitionGroup rendering */\n children: React.ReactNode\n /** Determines the tag used by wrapping elements */\n as?: \"div\" | \"span\"\n /** Class passed to wrapping elements */\n className?: string\n /** Identifier passed to wrapping elements as `[data-transition-id]` */\n transitionId?: string\n /** Determines the amount of time that the enter state is applied during mounting */\n enterDuration?: number\n /** Determines the amount of time that the exit state is applied before unmounting */\n exitDuration?: number\n /**\n * Determines if children should have an enter transition applied during mounting of the TransitionGroup.\n * @default true\n */\n preventInitialTransition?: boolean\n /** Delay in MS to wait before mounting a child. `null` for no delay (default). */\n enterMountDelay?: number\n /** Render children changes immediately, bypassing transition timings */\n disableAnimations?: boolean\n /** Determines how new children are added to the children array */\n insertMethod?: \"append\" | \"prepend\"\n /** Styles applied to wrapping elements */\n style?: CSSProperties\n /** Ref for the TransitionGroup */\n ref?: React.Ref<unknown>\n} & Partial<TransitionGroupChildCallbacks>\n\ntype RenderChild = {\n component: ReactElementWithKey\n shouldRender: boolean\n preventMountTransition?: boolean\n removeChild: () => void\n} & TransitionGroupChildCallbacks\n\nexport const TransitionGroup = (props: TransitionGroupProps) => {\n const {\n ref: forwardedRef,\n as: TagName = \"span\",\n children,\n className,\n transitionId,\n style,\n enterDuration = 0,\n exitDuration = 0,\n preventInitialTransition = true,\n enterMountDelay,\n insertMethod = \"append\",\n disableAnimations = getDisableAnimations(),\n } = props\n // Create stable, mutable references for all callbacks\n const onEnter = useChildCallback(props.onEnter ?? noop)\n const onEnterActive = useChildCallback(props.onEnterActive ?? noop)\n const onEnterComplete = useChildCallback(props.onEnterComplete ?? noop)\n const onExit = useChildCallback(props.onExit ?? noop)\n const onExitActive = useChildCallback(props.onExitActive ?? noop)\n const onExitComplete = useChildCallback(props.onExitComplete ?? noop)\n\n // Ensure all children are provided with keys.\n // Cannot reliably use Children.toArray() because `key` is processed: https://reactjs.org/docs/react-api.html#reactchildrentoarray\n Children.forEach(children, (child) => {\n // @ts-expect-error - We know `key` might not exist on certain types, that's why we're checking\n if (child && !child.key) {\n throw new Error(\"Child elements of <TransitionGroup /> must include a `key`\")\n }\n })\n\n const createDefaultRenderChildProps = useCallback(\n (child: ReactElementWithKey): RenderChild => ({\n component: child,\n shouldRender: true,\n removeChild: () => {\n setRenderChildren((currentRenderChildren) =>\n currentRenderChildren.filter((c) => child.key !== c.component.key),\n )\n },\n onEnter,\n onEnterActive,\n onEnterComplete,\n onExit,\n onExitActive,\n onExitComplete,\n }),\n [onEnter, onEnterActive, onEnterComplete, onExit, onExitActive, onExitComplete],\n )\n\n const [renderChildren, setRenderChildren] = useState<RenderChild[]>((): RenderChild[] => {\n return ChildrenWithKeys(children).map((child) => ({\n ...createDefaultRenderChildProps(child),\n // Lock this value to whatever the value was on initial render of the TransitionGroup.\n // It doesn't make sense to change this once it is mounted.\n preventMountTransition: preventInitialTransition,\n }))\n })\n\n useLayoutEffect(() => {\n setRenderChildren((currentRenderChildren): RenderChild[] => {\n const propChildrenArray = ChildrenWithKeys(children)\n return computeNextRenderChildren(\n propChildrenArray,\n currentRenderChildren,\n createDefaultRenderChildProps,\n insertMethod,\n )\n })\n }, [children, insertMethod, createDefaultRenderChildProps])\n\n // Prevent mistakes with forwardRef() by ensuring single child usage within the group.\n assertSingleChildWhenRef(\"TransitionGroup\", forwardedRef, Children.count(children))\n\n if (disableAnimations) {\n return (\n <>\n {Children.map(children, (child) => (\n <TagName\n // @ts-expect-error -- TS is not happy about this forwardedRef, but it's fine.\n ref={forwardedRef}\n className={className}\n style={style}\n data-transition-id={transitionId}\n >\n {child}\n </TagName>\n ))}\n </>\n )\n }\n\n return (\n <>\n {renderChildren.map(({ component, ...restProps }) => (\n <TransitionGroupChild\n key={component.key}\n {...restProps}\n as={TagName}\n className={className}\n transitionId={transitionId}\n enterDuration={enterDuration}\n exitDuration={exitDuration}\n enterMountDelay={enterMountDelay}\n style={style}\n ref={forwardedRef}\n >\n {component}\n </TransitionGroupChild>\n ))}\n </>\n )\n}\n", "import { isTest } from \"../../lib/constants\"\n\n// By default, all tests will treat <TransitionGroup> as `disableAnimations={true}`,\n// removing the need to be aware of misc. async animations happening across tests.\n// We could add support for things like `prefers-reduced-motion` in the future here as well.\nexport default () => isTest\n", "import React, { Children, useCallback, useRef } from \"react\"\nimport { isDev, isTest } from \"../../lib/constants\"\n\nexport type TransitionDefinition = {\n opacity?: number\n /** The horizontal translation value in pixels */\n x?: number\n /** The horizontal vertical value in pixels */\n y?: number\n /** The opacity value ranging from 0 to 1. */\n scale?: number\n rotate?: number | string\n skewX?: number | string\n skewY?: number | string\n blur?: number\n duration?: number\n delay?: number\n timingFunction?: string\n}\n\nexport type InitialTransitionDefinition = Omit<\n TransitionDefinition,\n \"duration\" | \"delay\" | \"timingFunction\"\n>\n\nexport type LayoutTransitionDefinition = {\n duration?: number\n delay?: number\n timingFunction?: string\n}\n\nexport type CallbackType =\n | \"enter\"\n | \"enter-active\"\n | \"enter-complete\"\n | \"exit\"\n | \"exit-active\"\n | \"exit-complete\"\n\n// Transition callbacks and types shared across implementations\nexport type TransitionGroupChildCallback = (element: HTMLDivElement) => void\n\nexport type TransitionGroupChildCallbacks = {\n /** Callback fired when an enter animation is staged (e.g., component mounted to the DOM) */\n onEnter: TransitionGroupChildCallback\n /** Callback fired when an enter animation starts */\n onEnterActive: TransitionGroupChildCallback\n /** Callback fired when an enter animation completes */\n onEnterComplete: TransitionGroupChildCallback\n /** Callback fired when an exit animation is staged */\n onExit: TransitionGroupChildCallback\n /** Callback fired when an exit animation starts */\n onExitActive: TransitionGroupChildCallback\n /** Callback fired when an exit animation completes (e.g., component unmounted from the DOM) */\n onExitComplete: TransitionGroupChildCallback\n}\n\nexport const NonNullChildren = (children: React.ReactNode) =>\n Children.toArray(children).filter((child) => child !== null && child !== undefined)\n\n// Shared keyed-children and transition helpers\nexport interface ReactElementWithKey extends React.ReactElement {\n key: string\n}\n\nexport const ChildrenWithKeys = (\n children: React.ReactNode,\n shouldThrow: boolean = false,\n componentName: string = \"TransitionGroup\",\n): ReactElementWithKey[] => {\n const validChildren: ReactElementWithKey[] = []\n Children.forEach(children, (child) => {\n if (child && typeof child === \"object\" && \"key\" in child && !!child.key) {\n // @ts-expect-error -- The above conditional is enough coercion that the component is valid\n validChildren.push(child)\n } else if (shouldThrow) {\n throw new Error(`Child elements of <${componentName} /> must include a \\`key\\``)\n }\n })\n return validChildren\n}\n\nexport const noop = () => {}\n\nexport const useChildCallback = (cb: (el: HTMLDivElement) => void) => {\n const ref = useRef(cb)\n ref.current = cb\n return useCallback<(el: HTMLDivElement) => void>((element) => ref.current(element), [])\n}\n\nexport type InsertMethod = \"append\" | \"prepend\"\n\nexport function computeNextRenderChildren<\n RenderChild extends { component: ReactElementWithKey; shouldRender: boolean },\n>(\n propChildrenArray: ReactElementWithKey[],\n currentRenderChildren: RenderChild[],\n createDefaultRenderChildProps: (child: ReactElementWithKey) => RenderChild,\n insertMethod: InsertMethod,\n): RenderChild[] {\n const propChildKeyMap = propChildrenArray.reduce<Record<string, number>>(\n (acc, child) => ({ ...acc, [child.key]: 1 }),\n {},\n )\n const currentRenderChildKeyMap = currentRenderChildren.reduce<Record<string, number>>(\n (acc, child) => ({ ...acc, [child.component.key]: 1 }),\n {},\n )\n\n const newRenderChildren: RenderChild[] = propChildrenArray\n .filter((propChild) => !currentRenderChildKeyMap[propChild.key])\n .map(createDefaultRenderChildProps)\n\n const updatedCurrentChildren: RenderChild[] = currentRenderChildren.map((childProps) => ({\n ...childProps,\n component:\n propChildrenArray.find(({ key }) => key === childProps.component.key) || childProps.component,\n shouldRender: !!propChildKeyMap[childProps.component.key],\n }))\n\n return insertMethod === \"append\"\n ? updatedCurrentChildren.concat(newRenderChildren)\n : newRenderChildren.concat(updatedCurrentChildren)\n}\n\nexport function assertSingleChildWhenRef(\n componentName: string,\n ref: React.Ref<unknown> | undefined,\n childrenCount: number,\n): void {\n if ((isTest || isDev) && ref && childrenCount > 1) {\n throw new Error(`Cannot use forwardRef with multiple children in <${componentName} />`)\n }\n}\n", "export type TransitionState = {\n enter: boolean\n enterActive: boolean\n exit: boolean\n exitActive: boolean\n interrupted: boolean\n}\n\nexport type TransitionStateAction =\n | { type: \"enter-before\" }\n | { type: \"enter-active\" }\n | { type: \"exit-before\" }\n | { type: \"exit-active\" }\n | { type: \"done\" }\n\nexport const RESTING_TRANSITION_STATE: TransitionState = {\n enter: false,\n enterActive: false,\n exit: false,\n exitActive: false,\n interrupted: false,\n}\n\nexport const getInitialTransitionState = (preventMountTransition: boolean): TransitionState => ({\n ...RESTING_TRANSITION_STATE,\n enter: !preventMountTransition,\n})\n\nexport const transitionReducer = (\n state: TransitionState,\n action: TransitionStateAction,\n): TransitionState => {\n switch (action.type) {\n case \"enter-before\":\n return {\n enter: true,\n enterActive: false,\n exit: false,\n exitActive: false,\n interrupted: state.interrupted || state.exit,\n }\n case \"enter-active\":\n return {\n enter: true,\n enterActive: true,\n exit: false,\n exitActive: false,\n interrupted: false,\n }\n case \"exit-before\":\n return {\n enter: false,\n enterActive: false,\n exit: true,\n exitActive: false,\n interrupted: state.interrupted || state.enter,\n }\n case \"exit-active\":\n return {\n enter: false,\n enterActive: false,\n exit: true,\n exitActive: true,\n interrupted: false,\n }\n case \"done\":\n default:\n return RESTING_TRANSITION_STATE\n }\n}\n", "\"use client\"\n\nimport { useEffect, useRef, useState, type MouseEvent } from \"react\"\nimport { copyToClipboard, type ClipboardContent } from \"../../lib/copyToClipboard\"\nimport { Check, Copy } from \"../Icon\"\nimport { Animate } from \"../Transition\"\nimport { Button, type ButtonProps } from \"./Button\"\n\nexport type CopyButtonProps = {\n copyValue: string | ClipboardContent | (() => string) | (() => ClipboardContent)\n children?: React.ReactNode | ((props: { copied: boolean }) => React.ReactNode)\n} & Omit<ButtonProps, \"children\">\n\nexport const CopyButton = ({ children, copyValue, onClick, ...restProps }: CopyButtonProps) => {\n const [copied, setCopied] = useState<boolean>(false)\n const copiedTimeout = useRef<number | null>(null)\n\n const handleClick = (evt: MouseEvent<HTMLButtonElement>) => {\n // No-op when copied is true\n if (copied) {\n return\n }\n\n setCopied(true)\n onClick?.(evt)\n\n // Copy content to clipboard\n // NOTE: Failures are a silent no-op\n copyToClipboard(typeof copyValue === \"function\" ? copyValue() : copyValue)\n\n copiedTimeout.current = window.setTimeout(() => {\n setCopied(false)\n }, 1300)\n }\n\n useEffect(() => {\n return () => {\n if (copiedTimeout.current) clearTimeout(copiedTimeout.current)\n }\n }, [])\n\n return (\n <Button {...restProps} onClick={handleClick}>\n <Animate\n className=\"w-[var(--button-icon-size)] h-[var(--button-icon-size)]\"\n initial={{ scale: 0.6 }}\n enter={{ scale: 1, delay: 150, duration: 300 }}\n exit={{ scale: 0.6, duration: 150 }}\n forceCompositeLayer\n >\n {copied ? <Check key=\"copied-icon\" /> : <Copy key=\"copy-icon\" />}\n </Animate>\n {typeof children === \"function\" ? children({ copied }) : children}\n </Button>\n )\n}\n", "export type ClipboardContent = {\n \"text/plain\"?: string\n \"image/png\"?: Blob\n \"image/jpeg\"?: Blob\n \"image/webp\"?: Blob\n}\n\nconst supportsRichClipboard = (): boolean =>\n typeof ClipboardItem !== \"undefined\" && !!navigator.clipboard?.write\n\n// Convert ClipboardContent to { [mime]: Blob } for ClipboardItem\nexport function toClipboardItem(content: ClipboardContent): ClipboardItem {\n const { \"text/plain\": text, ...rest } = content\n return new ClipboardItem({\n ...rest,\n ...(text ? { \"text/plain\": new Blob([text], { type: \"text/plain\" }) } : null),\n })\n}\n\n/**\n * Utility for copying rich content in a cross-browser way\n *\n * @param {string | ClipboardContent} content\n * @param {HTMLElement} container - Fallback text copy method requires appending a textarea\n * to the DOM and focusing it. If you don't want to shift focus out of the currently\n * focused container (e.g. a popover) you can specify a custom container to append\n * the textarea to keep focus in that container. This need for this edge case is\n * exceedingly rare as navigator.clipboard.writeText support expands.\n * @returns - A promise that resolves to true if the copy was successful, false otherwise.\n */\nexport async function copyToClipboard(\n content: string | ClipboardContent,\n container: HTMLElement = document.body,\n): Promise<boolean> {\n if (typeof content === \"string\") {\n return copyText(content, container)\n }\n\n try {\n if (supportsRichClipboard()) {\n await navigator.clipboard.write([toClipboardItem(content)])\n return true\n }\n\n // Fallback: if we have plain text, at least copy that.\n if (content[\"text/plain\"]) {\n return copyText(content[\"text/plain\"], container)\n }\n\n return false\n } catch (error) {\n return false\n }\n}\n\n/**\n * Utility for copying plaintext in a cross-browser way\n *\n * @param {string} text\n * @param {HTMLElement} container - Fallback text copy method requires appending a textarea\n * to the DOM and focusing it. If you don't want to shift focus out of the currently\n * focused container (e.g. a popover) you can specify a custom container to append\n * the textarea to keep focus in that container. This need for this edge case is\n * exceedingly rare as navigator.clipboard.writeText support expands.\n * @returns - A promise that resolves to true if the copy was successful, false otherwise.\n */\nexport async function copyText(\n text: string,\n container: HTMLElement = document.body,\n): Promise<boolean> {\n if (navigator.clipboard) {\n try {\n // Try to use the navigator.clipboard method first\n await navigator.clipboard.writeText(text)\n return true\n } catch (error) {\n // If that doesn't work, we continue on to the fallback\n // method below\n }\n }\n\n // Fallback method\n const textArea = document.createElement(\"textarea\")\n textArea.value = text\n\n // Avoid visibility/interaction\n textArea.style.position = \"fixed\"\n textArea.style.top = \"0\"\n textArea.style.left = \"0\"\n textArea.style.opacity = \"0\"\n\n container.appendChild(textArea)\n textArea.focus()\n textArea.select()\n\n let succeeded = false\n try {\n succeeded = document.execCommand(\"copy\")\n } catch (error) {\n // Ignore\n }\n container.removeChild(textArea)\n return succeeded\n}\n", "\"use client\"\n\nimport clsx from \"clsx\"\nimport { TransitionGroup, type TransitionGroupProps } from \"./TransitionGroup\"\n\nimport { type CSSProperties } from \"react\"\nimport {\n toCssVariables,\n toFilterProperty,\n toMsDurationProperty,\n toOpacityProperty,\n toTransformProperty,\n} from \"../../lib/helpers\"\nimport s from \"./Animate.module.css\"\nimport { type InitialTransitionDefinition, type TransitionDefinition } from \"./shared\"\n\nexport type AnimateProps = Pick<\n TransitionGroupProps,\n \"as\" | \"children\" | \"className\" | \"insertMethod\" | \"preventInitialTransition\"\n> & {\n /** Class applied to the inner TransitionGroup */\n transitionClassName?: string\n /** Styles applied to the enter transition */\n enter?: TransitionDefinition\n /** Styles applied to the exit transition */\n exit?: TransitionDefinition\n /** Styles applied before the enter transition occurs */\n initial?: InitialTransitionDefinition\n /**\n * Determines how transition states are positioned\n * @default absolute\n */\n transitionPosition?: \"absolute\" | \"static\"\n /**\n * Applies `will-change` to force animating elements to composite layers. Use with caution!\n * @default false\n */\n forceCompositeLayer?: boolean\n}\n\nexport const Animate = (props: AnimateProps) => {\n const {\n as: TagName = \"span\",\n className,\n children,\n preventInitialTransition,\n insertMethod,\n transitionClassName,\n transitionPosition = \"absolute\",\n } = props\n const { enterTotalDuration, exitTotalDuration, variables } = getAnimationProperties(props)\n\n return (\n <TagName\n className={clsx(\"block\", transitionPosition === \"absolute\" && \"relative\", className)}\n data-transition-position={transitionPosition}\n style={variables}\n >\n <TransitionGroup\n as={TagName}\n className={clsx(s.TransitionItem, transitionClassName)}\n enterDuration={enterTotalDuration}\n exitDuration={exitTotalDuration}\n insertMethod={insertMethod}\n preventInitialTransition={preventInitialTransition}\n >\n {children}\n </TransitionGroup>\n </TagName>\n )\n}\n\n// Keep in sync with default values in Animate.module.css\nconst DEFAULT_ENTER_DURATION_MS_EASE = 400\nconst DEFAULT_ENTER_DURATION_MS_CUBIC = 500\nconst DEFAULT_EXIT_DURATION_MS_EASE = 200\nconst DEFAULT_EXIT_DURATION_MS_CUBIC = 300\n\nfunction getAnimationProperties({\n initial: initial,\n enter: enter,\n exit: exit,\n forceCompositeLayer,\n}: AnimateProps): {\n enterTotalDuration: number\n exitTotalDuration: number\n variables: CSSProperties\n} {\n // Dynamically inspect if we're transitioning transform properties, and apply cubic curves and timings as defaults\n const initialTransform = toTransformProperty(initial)\n const enterTransform = toTransformProperty(enter)\n const exitTransform = toTransformProperty(exit)\n const isCubicTransition = [initialTransform, exitTransform, enterTransform].some(\n (t) => t !== \"none\",\n )\n const enterDuration =\n enter?.duration ??\n (isCubicTransition ? DEFAULT_ENTER_DURATION_MS_CUBIC : DEFAULT_ENTER_DURATION_MS_EASE)\n const enterTimingFunction =\n enter?.timingFunction ?? (isCubicTransition ? \"var(--cubic-enter)\" : \"ease\")\n const exitDuration =\n exit?.duration ??\n (isCubicTransition ? DEFAULT_EXIT_DURATION_MS_CUBIC : DEFAULT_EXIT_DURATION_MS_EASE)\n const exitTimingFunction =\n exit?.timingFunction ?? (isCubicTransition ? \"var(--cubic-exit)\" : \"ease\")\n\n // Generate variable overrides from props\n const variables = toCssVariables({\n \"tg-will-change\": forceCompositeLayer ? \"transform, opacity\" : \"auto\",\n \"tg-enter-opacity\": toOpacityProperty(enter?.opacity ?? 1),\n \"tg-enter-transform\": enterTransform,\n \"tg-enter-filter\": toFilterProperty(enter),\n \"tg-enter-duration\": toMsDurationProperty(enterDuration),\n \"tg-enter-delay\": toMsDurationProperty(enter?.delay ?? 0),\n \"tg-enter-timing-function\": enterTimingFunction,\n \"tg-exit-opacity\": toOpacityProperty(exit?.opacity ?? 0),\n \"tg-exit-transform\": exitTransform,\n \"tg-exit-filter\": toFilterProperty(exit),\n \"tg-exit-duration\": toMsDurationProperty(exitDuration),\n \"tg-exit-delay\": toMsDurationProperty(exit?.delay ?? 0),\n \"tg-exit-timing-function\": exitTimingFunction,\n \"tg-initial-opacity\": toOpacityProperty(initial?.opacity ?? exit?.opacity ?? 0),\n \"tg-initial-transform\": initialTransform === \"none\" ? exitTransform : initialTransform,\n \"tg-initial-filter\": toFilterProperty(initial ?? exit ?? {}),\n } satisfies Record<string, string>)\n\n const enterTotalDuration = (enter?.delay ?? 0) + enterDuration\n const exitTotalDuration = (exit?.delay ?? 0) + exitDuration\n\n return { enterTotalDuration, exitTotalDuration, variables }\n}\n", "\"use client\"\n\nimport clsx from \"clsx\"\nimport { useRef, type CSSProperties } from \"react\"\nimport {\n toCssVariables,\n toFilterProperty,\n toMsDurationProperty,\n toOpacityProperty,\n toTransformProperty,\n waitForAnimationFrame,\n} from \"../../lib/helpers\"\nimport s from \"./AnimateLayout.module.css\"\nimport { TransitionGroup, type TransitionGroupProps } from \"./TransitionGroup\"\nimport {\n type InitialTransitionDefinition,\n type LayoutTransitionDefinition,\n type TransitionDefinition,\n} from \"./shared\"\n\nexport type AnimateLayoutProps = Pick<\n TransitionGroupProps,\n \"as\" | \"children\" | \"className\" | \"insertMethod\" | \"preventInitialTransition\"\n> & {\n /**\n * Determines if `overflow: hidden` is applied to the wrapper element\n * @default false\n */\n hideOverflow?: boolean\n /**\n * Determines which side of the container the items will pin to during enter/exit\n * @default \"start\"\n */\n itemAnchor?: \"start\" | \"end\"\n /**\n * Determines which property will be animated during transitions\n * @default \"height\"\n */\n dimension?: \"width\" | \"height\"\n layoutEnter?: LayoutTransitionDefinition\n layoutExit?: LayoutTransitionDefinition\n layoutMove?: LayoutTransitionDefinition\n\n enter?: TransitionDefinition\n exit?: TransitionDefinition\n initial?: InitialTransitionDefinition\n /** Class applied to the inner TransitionGroup */\n transitionClassName?: string\n /**\n * Applies `will-change` to force animating elements to composite layers. Use with caution!\n * @default false\n */\n forceCompositeLayer?: boolean\n}\n\nexport const AnimateLayout = (props: AnimateLayoutProps) => {\n const {\n as: TagName = \"span\",\n children,\n transitionClassName,\n insertMethod,\n className,\n hideOverflow = false,\n // An initial height animation will almost never be correct. Consider carefully when overriding.\n preventInitialTransition = true,\n itemAnchor = \"start\",\n dimension = \"height\",\n } = props\n const containerRef = useRef<HTMLDivElement | null>(null)\n const captainRef = useRef<HTMLDivElement | null>(null)\n const exitTimestampRef = useRef<number | null>(null)\n\n const { enterTotalDuration, exitTotalDuration, variables } = getAnimationProperties(props)\n\n const handleEnter = (element: HTMLDivElement) => {\n const container = containerRef.current\n\n if (!container) {\n return\n }\n\n // If handleExit() was called >50ms ago, consider this a \"move\" and don't touch \"interrupted\" state\n const justExited = exitTimestampRef.current && Date.now() - exitTimestampRef.current < 50\n\n const anotherCaptain = !!captainRef.current\n // Look at me, I'm the captain now\n captainRef.current = element\n\n // Recent exits are a near guarantee we are \"moving\" states\n container.dataset.direction = justExited || anotherCaptain ? \"move\" : \"in\"\n\n // If we just exited, don't touch the interrupted state. Exit just set it with the correct state of things\n if (!justExited) {\n container.dataset.interrupted = String(!!container.style[dimension])\n }\n\n const clientRect = container.getBoundingClientRect()\n container.style[dimension] = `${clientRect[dimension]}px`\n }\n\n const handleEnterActive = (element: HTMLDivElement) => {\n const container = containerRef.current\n\n if (!container) {\n return\n }\n\n // ~Impossible to not be the captain at this point, but check anyway.\n const amICaptain = captainRef.current === element\n if (!amICaptain) {\n return\n }\n\n // IMPORTANT: Use clientHeight/clientWidth to measure children, in case they have scale() applied\n const value = dimension === \"width\" ? element.clientWidth : element.clientHeight\n container.style[dimension] = `${value}px`\n }\n\n const handleEnterComplete = (element: HTMLDivElement) => {\n const container = containerRef.current\n\n // Wait for the next tick, to ensure React has cleared `[data-entering*]` state from the DOM\n // Without this, it's possible that we release the height from the container\n // before the children in the DOM are naturally positioned (non-absolute).\n waitForAnimationFrame(() => {\n const amICaptain = captainRef.current === element\n if (!container || !amICaptain) {\n return\n }\n\n // Restore natural height to the DOM node\n container.style[dimension] = \"\"\n })\n }\n\n const handleExit = (element: HTMLDivElement) => {\n const container = containerRef.current\n const amICaptain = !captainRef.current || captainRef.current === element\n\n if (!container || !amICaptain) {\n return\n }\n\n // o7\n captainRef.current = null\n exitTimestampRef.current = Date.now()\n\n container.dataset.direction = \"out\"\n container.dataset.interrupted = String(!!container.style[dimension])\n\n const clientRect = container.getBoundingClientRect()\n container.style[dimension] = `${clientRect[dimension]}px`\n }\n\n const handleExitActive = (_element: HTMLDivElement) => {\n const container = containerRef.current\n const newCaptainExists = !!captainRef.current\n\n // If another component has become the captain, exit early\n if (!container || newCaptainExists) {\n return\n }\n\n // Animate to zero layout\n container.style[dimension] = \"0\"\n }\n\n const handleExitComplete = (_element: HTMLDivElement) => {\n // Wait for the next tick, to ensure React has cleared `[data-exiting*]` state from the DOM\n waitForAnimationFrame(() => {\n const container = containerRef.current\n const newCaptainExists = !!captainRef.current\n\n // If another component has become the captain, exit early\n if (!container || newCaptainExists) {\n return\n }\n\n // Restore natural height to the DOM node\n container.style[dimension] = \"\"\n })\n }\n\n return (\n <TagName\n ref={containerRef}\n className={clsx(s.Layout, className)}\n style={variables}\n data-item-anchor={itemAnchor}\n data-clip={hideOverflow}\n data-dimension={dimension}\n >\n <TransitionGroup\n as={TagName}\n className={clsx(s.TransitionItem, transitionClassName)}\n insertMethod={insertMethod}\n enterDuration={enterTotalDuration}\n exitDuration={exitTotalDuration}\n preventInitialTransition={preventInitialTransition}\n onEnter={handleEnter}\n onEnterActive={handleEnterActive}\n onEnterComplete={handleEnterComplete}\n onExit={handleExit}\n onExitActive={handleExitActive}\n onExitComplete={handleExitComplete}\n >\n {children}\n </TransitionGroup>\n </TagName>\n )\n}\n\n// Keep in sync with default values in AnimateLayout.module.css\nconst DEFAULT_LAYOUT_ENTER_DURATION_MS = 300\nconst DEFAULT_LAYOUT_ENTER_DELAY_MS = 0\nconst DEFAULT_LAYOUT_EXIT_DURATION_MS = 300\nconst DEFAULT_LAYOUT_EXIT_DELAY_MS = 0\nconst DEFAULT_LAYOUT_MOVE_DURATION_MS = 300\nconst DEFAULT_LAYOUT_MOVE_DELAY_MS = 0\nconst DEFAULT_ENTER_DURATION_MS_EASE = 300\nconst DEFAULT_ENTER_DURATION_MS_CUBIC = 300\nconst DEFAULT_ENTER_DELAY_MS = 100\nconst DEFAULT_EXIT_DURATION_MS_EASE = 200\nconst DEFAULT_EXIT_DURATION_MS_CUBIC = 200\nconst DEFAULT_EXIT_DELAY_MS = 0\n\nfunction getAnimationProperties({\n initial,\n enter,\n exit,\n forceCompositeLayer,\n layoutEnter,\n layoutExit,\n layoutMove,\n}: AnimateLayoutProps): {\n enterTotalDuration: number\n exitTotalDuration: number\n variables: CSSProperties\n} {\n // Dynamically inspect if we're transitioning transform properties, and apply cubic curves and timings as defaults\n const initialTransform = toTransformProperty(initial)\n const enterTransform = toTransformProperty(enter)\n const exitTransform = toTransformProperty(exit)\n const isCubicTransition = [initialTransform, exitTransform, enterTransform].some(\n (t) => t !== \"none\",\n )\n const enterDuration =\n enter?.duration ??\n (isCubicTransition ? DEFAULT_ENTER_DURATION_MS_CUBIC : DEFAULT_ENTER_DURATION_MS_EASE)\n const enterTimingFunction =\n enter?.timingFunction ?? (isCubicTransition ? \"var(--cubic-enter)\" : \"ease\")\n const exitDuration =\n exit?.duration ??\n (isCubicTransition ? DEFAULT_EXIT_DURATION_MS_CUBIC : DEFAULT_EXIT_DURATION_MS_EASE)\n const exitTimingFunction =\n exit?.timingFunction ?? (isCubicTransition ? \"var(--cubic-exit)\" : \"ease\")\n\n // Generate variable overrides from props\n const variables = toCssVariables({\n \"tg-will-change\": forceCompositeLayer ? \"transform, opacity\" : \"auto\",\n \"tg-enter-opacity\": toOpacityProperty(enter?.opacity ?? 1),\n \"tg-enter-transform\": enterTransform,\n \"tg-enter-filter\": toFilterProperty(enter),\n \"tg-enter-duration\": toMsDurationProperty(enterDuration),\n \"tg-enter-delay\": toMsDurationProperty(enter?.delay ?? DEFAULT_ENTER_DELAY_MS),\n \"tg-enter-timing-function\": enterTimingFunction,\n \"tg-exit-opacity\": toOpacityProperty(exit?.opacity ?? 0),\n \"tg-exit-transform\": exitTransform,\n \"tg-exit-filter\": toFilterProperty(exit ?? {}),\n \"tg-exit-duration\": toMsDurationProperty(exitDuration),\n \"tg-exit-delay\": toMsDurationProperty(exit?.delay ?? DEFAULT_EXIT_DELAY_MS),\n \"tg-exit-timing-function\": exitTimingFunction,\n \"tg-initial-opacity\": toOpacityProperty(initial?.opacity ?? exit?.opacity ?? 0),\n \"tg-initial-transform\": initialTransform === \"none\" ? exitTransform : initialTransform,\n \"tg-initial-filter\": toFilterProperty(initial ?? exit ?? {}),\n \"tg-layout-enter-duration\": toMsDurationProperty(\n layoutEnter?.duration ?? DEFAULT_LAYOUT_ENTER_DURATION_MS,\n ),\n \"tg-layout-enter-delay\": toMsDurationProperty(\n layoutEnter?.delay ?? DEFAULT_LAYOUT_ENTER_DELAY_MS,\n ),\n \"tg-layout-enter-timing-function\": layoutEnter?.timingFunction ?? \"var(--cubic-move)\",\n \"tg-layout-exit-duration\": toMsDurationProperty(\n layoutExit?.duration ?? DEFAULT_LAYOUT_EXIT_DURATION_MS,\n ),\n \"tg-layout-exit-delay\": toMsDurationProperty(layoutExit?.delay ?? DEFAULT_LAYOUT_EXIT_DELAY_MS),\n \"tg-layout-exit-timing-function\": layoutExit?.timingFunction ?? \"var(--cubic-move)\",\n \"tg-layout-move-duration\": toMsDurationProperty(\n layoutMove?.duration ?? DEFAULT_LAYOUT_MOVE_DURATION_MS,\n ),\n \"tg-layout-move-delay\": toMsDurationProperty(layoutMove?.delay ?? DEFAULT_LAYOUT_MOVE_DELAY_MS),\n \"tg-layout-move-timing-function\": layoutMove?.timingFunction ?? \"var(--cubic-move)\",\n } satisfies Record<string, string>)\n\n const enterTotalDuration =\n (enter?.delay ?? DEFAULT_ENTER_DELAY_MS) + (enterDuration ?? DEFAULT_ENTER_DURATION_MS_EASE)\n const exitTotalDuration =\n (exit?.delay ?? DEFAULT_EXIT_DELAY_MS) + (exitDuration ?? DEFAULT_EXIT_DURATION_MS_EASE)\n const layoutEnterTotalDuration =\n (layoutEnter?.delay ?? DEFAULT_LAYOUT_ENTER_DELAY_MS) +\n (layoutEnter?.duration ?? DEFAULT_LAYOUT_ENTER_DURATION_MS)\n const layoutExitTotalDuration =\n (layoutExit?.delay ?? DEFAULT_LAYOUT_EXIT_DELAY_MS) +\n (layoutExit?.duration ?? DEFAULT_LAYOUT_EXIT_DURATION_MS)\n const layoutMoveTotalDuration =\n (layoutMove?.delay ?? DEFAULT_LAYOUT_MOVE_DELAY_MS) +\n (layoutMove?.duration ?? DEFAULT_LAYOUT_MOVE_DURATION_MS)\n\n return {\n // In order for us to release layout dimensions (e.g., height) to the natural DOM state,\n // we must ensure the behaviors from the TransitionGroup callbacks are synced with the outer layout `transitions`.\n // Setting TransitionGroup timing to the max of these durations is the simplest approach.\n // In practice, these should only vary by about 50-200ms at most; imperceivable to end-users.\n enterTotalDuration: Math.max(\n enterTotalDuration,\n layoutEnterTotalDuration,\n layoutMoveTotalDuration,\n ),\n exitTotalDuration: Math.max(\n exitTotalDuration,\n layoutExitTotalDuration,\n layoutMoveTotalDuration,\n ),\n variables,\n }\n}\n", "\"use client\"\n\nimport { TransitionGroup, type TransitionGroupProps } from \"./TransitionGroup\"\n\nimport clsx from \"clsx\"\nimport { type CSSProperties } from \"react\"\nimport {\n toCssVariables,\n toFilterProperty,\n toMsDurationProperty,\n toOpacityProperty,\n toTransformProperty,\n waitForAnimationFrame,\n} from \"../../lib/helpers\"\nimport s from \"./AnimateLayoutGroup.module.css\"\nimport {\n type InitialTransitionDefinition,\n type LayoutTransitionDefinition,\n NonNullChildren,\n type TransitionDefinition,\n} from \"./shared\"\n\nexport type AnimateLayoutGroupProps = Pick<\n TransitionGroupProps,\n \"as\" | \"children\" | \"className\" | \"insertMethod\" | \"preventInitialTransition\"\n> & {\n /**\n * Determines if `overflow: hidden` is applied to the wrapper element\n * @default false\n */\n hideOverflow?: boolean\n /**\n * Determines which side of the container the items will pin to during enter/exit\n * @default \"start\"\n */\n itemAnchor?: \"start\" | \"end\"\n /**\n * Determines which property will be animated during transitions\n * @default \"height\"\n */\n dimension?: \"width\" | \"height\"\n layoutEnter?: LayoutTransitionDefinition\n layoutExit?: LayoutTransitionDefinition\n layoutMove?: LayoutTransitionDefinition\n\n enter?: TransitionDefinition\n exit?: TransitionDefinition\n initial?: InitialTransitionDefinition\n /** Class applied to the inner TransitionGroup */\n transitionClassName?: string\n /**\n * Applies `will-change` to force animating elements to composite layers. Use with caution!\n * @default false\n */\n forceCompositeLayer?: boolean\n}\n\nexport const AnimateLayoutGroup = (props: AnimateLayoutGroupProps) => {\n const {\n as: TagName = \"span\",\n children,\n className,\n transitionClassName,\n dimension = \"height\",\n } = props\n const { enterTotalDuration, exitTotalDuration, variables } = getAnimationProperties(props)\n\n const handleEnter = (element: HTMLDivElement) => {\n // Stage zero layout\n element.style[dimension] = \"0\"\n }\n\n const handleEnterActive = (element: HTMLDivElement) => {\n waitForAnimationFrame(() => {\n // Animate to target height\n // IMPORTANT: Use clientHeight/clientWidth to measure children, in case they have scale() applied\n const value =\n dimension === \"width\"\n ? element.firstElementChild?.clientWidth\n : element.firstElementChild?.clientHeight\n\n element.style[dimension] = `${value ?? 0}px`\n })\n }\n\n const handleEnterComplete = (element: HTMLDivElement) => {\n waitForAnimationFrame(() => {\n // Restore natural layout to the DOM node\n element.style[dimension] = \"\"\n })\n }\n\n const handleExit = (element: HTMLDivElement) => {\n element.style[dimension] = `${element.getBoundingClientRect()[dimension]}px`\n }\n\n const handleExitActive = (element: HTMLDivElement) => {\n waitForAnimationFrame(() => {\n // Animate to zero layout\n element.style[dimension] = \"0\"\n })\n }\n\n return (\n <TransitionGroup\n as={TagName}\n className={clsx(s.LayoutItem, className)}\n style={variables}\n // Adding 32ms to timers because of the additional waitForAnimationFrame() calls\n enterDuration={enterTotalDuration + 32}\n exitDuration={exitTotalDuration + 32}\n onEnter={handleEnter}\n onEnterActive={handleEnterActive}\n onEnterComplete={handleEnterComplete}\n onExit={handleExit}\n onExitActive={handleExitActive}\n >\n {NonNullChildren(children).map((child) => (\n // Ensure any falsy child.key value is sent specifically as `undefined`.\n // This ensures that key is not misinterpreted as a string 'null', 'false', etc.\n <TagName\n className={clsx(s.TransitionItem, transitionClassName)}\n // @ts-expect-error Pass-through the validation of `key` to <TransitionGroup>\n key={child.key || undefined}\n data-dimension={dimension}\n >\n {child}\n </TagName>\n ))}\n </TransitionGroup>\n )\n}\n\n// Keep in sync with default values in AnimateLayout.module.css\nconst DEFAULT_LAYOUT_ENTER_DURATION_MS = 300\nconst DEFAULT_LAYOUT_ENTER_DELAY_MS = 0\nconst DEFAULT_LAYOUT_EXIT_DURATION_MS = 300\nconst DEFAULT_LAYOUT_EXIT_DELAY_MS = 50\nconst DEFAULT_LAYOUT_MOVE_DURATION_MS = 300\nconst DEFAULT_LAYOUT_MOVE_DELAY_MS = 0\nconst DEFAULT_ENTER_DURATION_MS_EASE = 400\nconst DEFAULT_ENTER_DURATION_MS_CUBIC = 400\nconst DEFAULT_ENTER_DELAY_MS = 150\nconst DEFAULT_EXIT_DURATION_MS_EASE = 200\nconst DEFAULT_EXIT_DURATION_MS_CUBIC = 300\nconst DEFAULT_EXIT_DELAY_MS = 0\n\nfunction getAnimationProperties({\n initial,\n enter,\n exit,\n forceCompositeLayer,\n layoutEnter,\n layoutExit,\n layoutMove,\n}: AnimateLayoutGroupProps): {\n enterTotalDuration: number\n exitTotalDuration: number\n variables: CSSProperties\n} {\n // Dynamically inspect if we're transitioning transform properties, and apply cubic curves and timings as defaults\n const initialTransform = toTransformProperty(initial)\n const enterTransform = toTransformProperty(enter)\n const exitTransform = toTransformProperty(exit)\n const isCubicTransition = [initialTransform, exitTransform, enterTransform].some(\n (t) => t !== \"none\",\n )\n const enterDuration =\n enter?.duration ??\n (isCubicTransition ? DEFAULT_ENTER_DURATION_MS_CUBIC : DEFAULT_ENTER_DURATION_MS_EASE)\n const enterTimingFunction =\n enter?.timingFunction ?? (isCubicTransition ? \"var(--cubic-enter)\" : \"ease\")\n const exitDuration =\n exit?.duration ??\n (isCubicTransition ? DEFAULT_EXIT_DURATION_MS_CUBIC : DEFAULT_EXIT_DURATION_MS_EASE)\n const exitTimingFunction =\n exit?.timingFunction ?? (isCubicTransition ? \"var(--cubic-exit)\" : \"ease\")\n\n // Generate variable overrides from props\n const variables = toCssVariables({\n \"tg-will-change\": forceCompositeLayer ? \"transform, opacity\" : \"auto\",\n \"tg-enter-opacity\": toOpacityProperty(enter?.opacity ?? 1),\n \"tg-enter-transform\": enterTransform,\n \"tg-enter-filter\": toFilterProperty(enter ?? {}),\n \"tg-enter-duration\": toMsDurationProperty(enterDuration),\n \"tg-enter-delay\": toMsDurationProperty(enter?.delay ?? DEFAULT_ENTER_DELAY_MS),\n \"tg-enter-timing-function\": enterTimingFunction,\n \"tg-exit-opacity\": toOpacityProperty(exit?.opacity ?? 0),\n \"tg-exit-transform\": exitTransform,\n \"tg-exit-filter\": toFilterProperty(exit ?? {}),\n \"tg-exit-duration\": toMsDurationProperty(exitDuration),\n \"tg-exit-delay\": toMsDurationProperty(exit?.delay ?? DEFAULT_EXIT_DELAY_MS),\n \"tg-exit-timing-function\": exitTimingFunction,\n \"tg-initial-opacity\": toOpacityProperty(initial?.opacity ?? exit?.opacity ?? 0),\n \"tg-initial-transform\": initialTransform === \"none\" ? exitTransform : initialTransform,\n \"tg-initial-filter\": toFilterProperty(initial ?? exit ?? {}),\n \"tg-layout-enter-duration\": toMsDurationProperty(\n layoutEnter?.duration ?? DEFAULT_LAYOUT_ENTER_DURATION_MS,\n ),\n \"tg-layout-enter-delay\": toMsDurationProperty(\n layoutEnter?.delay ?? DEFAULT_LAYOUT_ENTER_DELAY_MS,\n ),\n \"tg-layout-enter-timing-function\": layoutEnter?.timingFunction ?? \"var(--cubic-move)\",\n \"tg-layout-exit-duration\": toMsDurationProperty(\n layoutExit?.duration ?? DEFAULT_LAYOUT_EXIT_DURATION_MS,\n ),\n \"tg-layout-exit-delay\": toMsDurationProperty(layoutExit?.delay ?? DEFAULT_LAYOUT_EXIT_DELAY_MS),\n \"tg-layout-exit-timing-function\": layoutExit?.timingFunction ?? \"var(--cubic-move)\",\n \"tg-layout-move-duration\": toMsDurationProperty(\n layoutMove?.duration ?? DEFAULT_LAYOUT_MOVE_DURATION_MS,\n ),\n \"tg-layout-move-delay\": toMsDurationProperty(\n layoutMove?.delay ?? DEFAULT_LAYOUT_MOVE_DURATION_MS,\n ),\n \"tg-layout-move-timing-function\": layoutMove?.timingFunction ?? \"var(--cubic-move)\",\n } satisfies Record<string, string>)\n\n const enterTotalDuration =\n (enter?.delay ?? DEFAULT_ENTER_DELAY_MS) + (enterDuration ?? DEFAULT_ENTER_DURATION_MS_EASE)\n const exitTotalDuration =\n (exit?.delay ?? DEFAULT_EXIT_DELAY_MS) + (exitDuration ?? DEFAULT_EXIT_DURATION_MS_EASE)\n const layoutEnterTotalDuration =\n (layoutEnter?.delay ?? DEFAULT_LAYOUT_ENTER_DELAY_MS) +\n (layoutEnter?.duration ?? DEFAULT_LAYOUT_ENTER_DURATION_MS)\n const layoutExitTotalDuration =\n (layoutExit?.delay ?? DEFAULT_LAYOUT_EXIT_DELAY_MS) +\n (layoutExit?.duration ?? DEFAULT_LAYOUT_EXIT_DURATION_MS)\n const layoutMoveTotalDuration =\n (layoutMove?.delay ?? DEFAULT_LAYOUT_MOVE_DELAY_MS) +\n (layoutMove?.duration ?? DEFAULT_LAYOUT_MOVE_DURATION_MS)\n\n return {\n // In order for us to release layout dimensions (e.g., height) to the natural DOM state,\n // we must ensure the behaviors from the TransitionGroup callbacks are synced with the outer layout `transitions`.\n // Setting TransitionGroup timing to the max of these durations is the simplest approach.\n // In practice, these should only vary by about 50-200ms at most; imperceivable to end-users.\n enterTotalDuration: Math.max(\n enterTotalDuration,\n layoutEnterTotalDuration,\n layoutMoveTotalDuration,\n ),\n exitTotalDuration: Math.max(\n exitTotalDuration,\n layoutExitTotalDuration,\n layoutMoveTotalDuration,\n ),\n variables,\n }\n}\n", "\"use client\"\n\nimport React, {\n Children,\n useCallback,\n useEffect,\n useLayoutEffect,\n useReducer,\n useRef,\n useState,\n} from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\n\nimport { waitForAnimationFrame } from \"../../lib/helpers\"\n\n// (no-op) clsx removed: className is not managed at group-level for slotted children\nimport { useTimeout } from \"usehooks-ts\"\nimport getDisableAnimations from \"./getDisableAnimations\"\nimport {\n assertSingleChildWhenRef,\n ChildrenWithKeys,\n computeNextRenderChildren,\n noop,\n useChildCallback,\n type CallbackType,\n type ReactElementWithKey,\n type TransitionGroupChildCallbacks,\n} from \"./shared\"\nimport { getInitialTransitionState, transitionReducer } from \"./transitionReducer\"\n\ntype SlotTransitionGroupChildProps = {\n component: ReactElementWithKey\n preventMountTransition?: boolean\n shouldRender: boolean\n enterDuration: number\n exitDuration: number\n enterMountDelay?: number\n removeChild: () => void\n ref?: React.Ref<unknown>\n} & TransitionGroupChildCallbacks\n\nconst SlotTransitionGroupChildInner = ({\n ref,\n component,\n preventMountTransition,\n shouldRender,\n enterDuration,\n exitDuration,\n removeChild,\n onEnter,\n onEnterActive,\n onEnterComplete,\n onExit,\n onExitActive,\n onExitComplete,\n}: SlotTransitionGroupChildProps) => {\n const [state, dispatch] = useReducer(\n transitionReducer,\n getInitialTransitionState(preventMountTransition || false),\n )\n const preventedMountTransition = useRef<boolean>(false)\n const elementRef = useRef<HTMLDivElement | null>(null)\n const enterDurationRef = useRef<number>(enterDuration)\n enterDurationRef.current = enterDuration\n const exitDurationRef = useRef<number>(exitDuration)\n exitDurationRef.current = exitDuration\n\n const lastCallbackRef = useRef<CallbackType>(null as unknown as CallbackType)\n const triggerCallback = useCallback(\n (callbackType: CallbackType) => {\n const element = elementRef.current\n if (!element || callbackType === lastCallbackRef.current) {\n return\n }\n lastCallbackRef.current = callbackType\n switch (callbackType) {\n case \"enter\":\n onEnter(element)\n break\n case \"enter-active\":\n onEnterActive(element)\n break\n case \"enter-complete\":\n onEnterComplete(element)\n break\n case \"exit\":\n onExit(element)\n break\n case \"exit-active\":\n onExitActive(element)\n break\n case \"exit-complete\":\n onExitComplete(element)\n break\n default:\n callbackType satisfies never\n break\n }\n },\n [onEnter, onEnterActive, onEnterComplete, onExit, onExitActive, onExitComplete],\n )\n\n /**\n * IMPORTANT: `useLayoutEffect()` is used here to avoid race conditions between new SlotTransitionGroupChild components.\n */\n useLayoutEffect(() => {\n // Exit transition\n if (!shouldRender) {\n let exitTimeout: number | undefined\n\n dispatch({ type: \"exit-before\" })\n triggerCallback(\"exit\")\n\n const cancelAnimationFrame = waitForAnimationFrame(() => {\n dispatch({ type: \"exit-active\" })\n triggerCallback(\"exit-active\")\n\n exitTimeout = window.setTimeout(() => {\n triggerCallback(\"exit-complete\")\n removeChild()\n }, exitDurationRef.current)\n })\n\n return () => {\n cancelAnimationFrame()\n if (exitTimeout !== undefined) clearTimeout(exitTimeout)\n }\n }\n\n // Enter transition\n\n // Check if we need to prevent this specific entering cycle\n if (preventMountTransition && !preventedMountTransition.current) {\n // Mark initial transition as prevented and short-circuit.\n preventedMountTransition.current = true\n return\n }\n\n let enterTimeout: number | undefined\n\n dispatch({ type: \"enter-before\" })\n triggerCallback(\"enter\")\n\n const cancelAnimationFrame = waitForAnimationFrame(() => {\n dispatch({ type: \"enter-active\" })\n triggerCallback(\"enter-active\")\n\n enterTimeout = window.setTimeout(() => {\n dispatch({ type: \"done\" })\n triggerCallback(\"enter-complete\")\n }, enterDurationRef.current)\n })\n\n return () => {\n cancelAnimationFrame()\n if (enterTimeout !== undefined) clearTimeout(enterTimeout)\n }\n }, [\n shouldRender,\n // This value is immutable after <SlotTransitionGroup> is created, and does not change on re-renders.\n preventMountTransition,\n removeChild,\n triggerCallback,\n ])\n\n useEffect(() => {\n // Required for <StrictMode>\n return () => {\n preventedMountTransition.current = false\n }\n }, [])\n\n const original = component\n\n const mergedRef = mergeRefs<unknown>([\n elementRef as unknown as React.Ref<unknown>,\n ref as unknown as React.Ref<unknown>,\n ((original as unknown as { ref?: React.Ref<unknown> }).ref ?? null) as React.Ref<unknown>,\n ])\n\n const nextProps = {\n \"data-entering\": state.enter ? \"\" : undefined,\n \"data-entering-active\": state.enterActive ? \"\" : undefined,\n \"data-exiting\": state.exit ? \"\" : undefined,\n \"data-exiting-active\": state.exitActive ? \"\" : undefined,\n \"data-interrupted\": state.interrupted ? \"\" : undefined,\n \"ref\": mergedRef,\n }\n\n return React.isValidElement(original) ? React.cloneElement(original, nextProps) : null\n}\n\nconst SlotTransitionGroupChild = (props: SlotTransitionGroupChildProps) => {\n const { enterMountDelay, preventMountTransition } = props\n const mountDelay = !preventMountTransition && enterMountDelay != null ? enterMountDelay : null\n const [mounted, setMounted] = useState(mountDelay == null)\n useTimeout(() => setMounted(true), mounted ? null : mountDelay)\n\n return mounted ? <SlotTransitionGroupChildInner {...props} /> : null\n}\n\nexport type SlotTransitionGroupProps = {\n /** Components controlled by SlotTransitionGroup rendering */\n children: React.ReactNode\n /** Determines the amount of time that the enter state is applied during mounting */\n enterDuration?: number\n /** Determines the amount of time that the exit state is applied before unmounting */\n exitDuration?: number\n /**\n * Determines if children should have an enter transition applied during mounting of the group.\n * @default true\n */\n preventInitialTransition?: boolean\n /** Delay in MS to wait before mounting a child. `null` for no delay (default). */\n enterMountDelay?: number\n /** Render children changes immediately, bypassing transition timings */\n disableAnimations?: boolean\n /** Determines how new children are added to the children array */\n insertMethod?: \"append\" | \"prepend\"\n /** Ref for the SlotTransitionGroup (applied to the single child when possible) */\n ref?: React.Ref<unknown>\n} & Partial<TransitionGroupChildCallbacks>\n\ntype RenderChild = {\n component: ReactElementWithKey\n shouldRender: boolean\n preventMountTransition?: boolean\n removeChild: () => void\n} & TransitionGroupChildCallbacks\n\nexport const SlotTransitionGroup = (props: SlotTransitionGroupProps) => {\n const {\n ref,\n children,\n enterDuration = 0,\n exitDuration = 0,\n preventInitialTransition = true,\n enterMountDelay,\n insertMethod = \"append\",\n disableAnimations = getDisableAnimations(),\n } = props\n\n // Create stable, mutable references for all callbacks\n const onEnter = useChildCallback(props.onEnter ?? noop)\n const onEnterActive = useChildCallback(props.onEnterActive ?? noop)\n const onEnterComplete = useChildCallback(props.onEnterComplete ?? noop)\n const onExit = useChildCallback(props.onExit ?? noop)\n const onExitActive = useChildCallback(props.onExitActive ?? noop)\n const onExitComplete = useChildCallback(props.onExitComplete ?? noop)\n\n // Ensure all children are provided with keys.\n Children.forEach(children, (child) => {\n // @ts-expect-error - We know `key` might not exist on certain types, that's why we're checking\n if (child && !child.key) {\n throw new Error(\"Child elements of <SlotTransitionGroup /> must include a `key`\")\n }\n })\n\n const createDefaultRenderChildProps = useCallback(\n (child: ReactElementWithKey): RenderChild => ({\n component: child,\n shouldRender: true,\n removeChild: () => {\n setRenderChildren((currentRenderChildren) =>\n currentRenderChildren.filter((c) => child.key !== c.component.key),\n )\n },\n onEnter,\n onEnterActive,\n onEnterComplete,\n onExit,\n onExitActive,\n onExitComplete,\n }),\n [onEnter, onEnterActive, onEnterComplete, onExit, onExitActive, onExitComplete],\n )\n\n const [renderChildren, setRenderChildren] = useState<RenderChild[]>((): RenderChild[] => {\n return ChildrenWithKeys(children).map((child) => ({\n ...createDefaultRenderChildProps(child),\n // Lock this value to whatever the value was on initial render of the group.\n preventMountTransition: preventInitialTransition,\n }))\n })\n\n // IMPORTANT: useLayoutEffect is required to satisfy render timings for prop updates to input elements\n useLayoutEffect(() => {\n setRenderChildren((currentRenderChildren): RenderChild[] => {\n const propChildrenArray = ChildrenWithKeys(children, false, \"SlotTransitionGroup\")\n return computeNextRenderChildren(\n propChildrenArray,\n currentRenderChildren,\n createDefaultRenderChildProps,\n insertMethod,\n )\n })\n }, [children, insertMethod, createDefaultRenderChildProps])\n\n // Prevent mistakes with forwardRef() by ensuring single child usage within the group.\n assertSingleChildWhenRef(\"SlotTransitionGroup\", ref, Children.count(children))\n\n if (disableAnimations) {\n // Fast path: when animations are disabled and no ref is provided, render children as-is.\n if (!ref) {\n return <>{children}</>\n }\n\n // If a ref is provided, attach it to the (single) child by cloning.\n return (\n <>\n {Children.map(children, (child) => {\n if (!React.isValidElement(child)) return child\n const original = child as ReactElementWithKey\n const merged = mergeRefs<unknown>([\n ref as unknown as React.Ref<unknown>,\n ((original as unknown as { ref?: React.Ref<unknown> }).ref ??\n null) as React.Ref<unknown>,\n ])\n const nextProps = { ref: merged }\n return React.cloneElement(original, nextProps)\n })}\n </>\n )\n }\n\n return (\n <>\n {renderChildren.map(({ component, ...restProps }) => (\n <SlotTransitionGroupChild\n key={component.key}\n {...restProps}\n component={component}\n enterDuration={enterDuration}\n exitDuration={exitDuration}\n enterMountDelay={enterMountDelay}\n ref={ref}\n />\n ))}\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,gBAOO;;;;ACVP,mBAA0F;AAE1F,IAAM,mBAAmB,CAAC,aAAoC;AAC5D,QAAM,QAAQ,sBAAS,QAAQ,QAAQ;AACvC,QAAM,SAAsB,CAAA;AAC5B,MAAI,SAAS;AAEb,QAAM,QAAQ,MAAK;AACjB,QAAI,WAAW,IAAI;AACjB,aAAO,KAAK,MAAM;AAClB,eAAS;IACX;EACF;AAEA,aAAW,QAAQ,OAAO;AACxB,QAAI,QAAQ,QAAQ,OAAO,SAAS,WAAW;AAC7C;IACF;AAEA,QAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AACxD,gBAAU,OAAO,IAAI;AACrB;IACF;AAGA,UAAK;AACL,WAAO,KAAK,IAAI;EAClB;AAEA,QAAK;AACL,SAAO;AACT;AAIO,IAAM,uBAAuB,CAAC,aAAkC;AACrE,QAAM,oBAAoB,iBAAiB,QAAQ;AACnD,QAAM,gBAAgB,sBAAS,MAAM,iBAAiB;AAEtD,SAAO,sBAAS,IAAI,mBAAmB,CAAC,UAAS;AAC/C,QAAI,OAAO,UAAU,YAAY,CAAC,CAAC,MAAM,KAAI,GAAI;AAE/C,UAAI,iBAAiB,GAAG;AACtB,eAAO;MACT;AAGA,iBAAO,mBAAAC,KAAA,QAAA,EAAA,UAAO,MAAK,CAAA;IACrB;AAGA,YAAI,6BAAe,KAAK,GAAG;AACzB,YAAM,UAAU;AAChB,YAAM,EAAE,UAAU,eAAe,GAAG,UAAS,IAAK,QAAQ;AAE1D,UAAI,iBAAiB,MAAM;AACzB,mBAAO,2BAAa,SAAS,WAAW,qBAAqB,aAAa,CAAC;MAC7E;AAEA,aAAO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AAuB;AAC5F,QAAM,CAAC,QAAQ,SAAS,QAAI,yBAAkB,KAAK;AACnD,QAAM,oBAAgB,uBAAsB,IAAI;AAEhD,QAAM,cAAc,CAAC,QAAsC;AAEzD,QAAI,QAAQ;AACV;IACF;AAEA,cAAU,IAAI;AACd,uCAAU;AAIV,oBAAgB,OAAO,cAAc,aAAa,UAAS,IAAK,SAAS;AAEzE,kBAAc,UAAU,OAAO,WAAW,MAAK;AAC7C,gBAAU,KAAK;IACjB,GAAG,IAAI;EACT;AAEA,gCAAU,MAAK;AACb,WAAO,MAAK;AACV,UAAI,cAAc;AAAS,qBAAa,cAAc,OAAO;IAC/D;EACF,GAAG,CAAA,CAAE;AAEL,aACE,qBAAAC,MAAC,QAAM,EAAA,GAAK,WAAW,SAAS,aAAW,UAAA,KACzC,qBAAAC,KAAC,SAAO,EACN,WAAU,2DACV,SAAS,EAAE,OAAO,IAAG,GACrB,OAAO,EAAE,OAAO,GAAG,OAAO,KAAK,UAAU,IAAG,GAC5C,MAAM,EAAE,OAAO,KAAK,UAAU,IAAG,GACjC,qBAAmB,MAAA,UAElB,aAAS,qBAAAA,KAAC,eAAK,CAAA,GAAK,aAAa,QAAM,qBAAAA,KAAC,cAAI,CAAA,GAAK,WAAW,EAAG,CAAA,GAEjE,OAAO,aAAa,aAAa,SAAS,EAAE,OAAM,CAAE,IAAI,QAAQ,EAAA,CAAA;AAGvE;",
|
|
6
|
+
"names": ["import_react", "_jsx", "import_react", "import_react", "import_react", "import_react", "s", "s", "_jsx", "import_react", "import_react", "s", "React", "cancelAnimationFrame", "_jsx", "s", "_Fragment", "s", "_jsxs", "_jsx", "import_react", "import_react", "s", "_jsx", "s", "import_react", "s", "import_react", "s", "import_react", "_jsxs", "_jsx"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
+
mod
|
|
32
|
+
));
|
|
33
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
34
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
35
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
36
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
__commonJS,
|
|
40
|
+
__export,
|
|
41
|
+
__toESM,
|
|
42
|
+
__privateGet,
|
|
43
|
+
__privateAdd,
|
|
44
|
+
__privateSet
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=chunk-ILHRZGIS.js.map
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_react
|
|
3
|
+
} from "./chunk-4TLBUCVB.js";
|
|
4
|
+
import {
|
|
5
|
+
__commonJS
|
|
6
|
+
} from "./chunk-ILHRZGIS.js";
|
|
7
|
+
|
|
8
|
+
// ../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/cjs/react-dom.development.js
|
|
9
|
+
var require_react_dom_development = __commonJS({
|
|
10
|
+
"../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/cjs/react-dom.development.js"(exports) {
|
|
11
|
+
"use strict";
|
|
12
|
+
(function() {
|
|
13
|
+
function noop() {
|
|
14
|
+
}
|
|
15
|
+
function testStringCoercion(value) {
|
|
16
|
+
return "" + value;
|
|
17
|
+
}
|
|
18
|
+
function createPortal$1(children, containerInfo, implementation) {
|
|
19
|
+
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
20
|
+
try {
|
|
21
|
+
testStringCoercion(key);
|
|
22
|
+
var JSCompiler_inline_result = false;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
JSCompiler_inline_result = true;
|
|
25
|
+
}
|
|
26
|
+
JSCompiler_inline_result && (console.error(
|
|
27
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
28
|
+
"function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"
|
|
29
|
+
), testStringCoercion(key));
|
|
30
|
+
return {
|
|
31
|
+
$$typeof: REACT_PORTAL_TYPE,
|
|
32
|
+
key: null == key ? null : "" + key,
|
|
33
|
+
children,
|
|
34
|
+
containerInfo,
|
|
35
|
+
implementation
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function getCrossOriginStringAs(as, input) {
|
|
39
|
+
if ("font" === as) return "";
|
|
40
|
+
if ("string" === typeof input)
|
|
41
|
+
return "use-credentials" === input ? input : "";
|
|
42
|
+
}
|
|
43
|
+
function getValueDescriptorExpectingObjectForWarning(thing) {
|
|
44
|
+
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"';
|
|
45
|
+
}
|
|
46
|
+
function getValueDescriptorExpectingEnumForWarning(thing) {
|
|
47
|
+
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
|
|
48
|
+
}
|
|
49
|
+
function resolveDispatcher() {
|
|
50
|
+
var dispatcher = ReactSharedInternals.H;
|
|
51
|
+
null === dispatcher && console.error(
|
|
52
|
+
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
53
|
+
);
|
|
54
|
+
return dispatcher;
|
|
55
|
+
}
|
|
56
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
57
|
+
var React = require_react(), Internals = {
|
|
58
|
+
d: {
|
|
59
|
+
f: noop,
|
|
60
|
+
r: function() {
|
|
61
|
+
throw Error(
|
|
62
|
+
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
D: noop,
|
|
66
|
+
C: noop,
|
|
67
|
+
L: noop,
|
|
68
|
+
m: noop,
|
|
69
|
+
X: noop,
|
|
70
|
+
S: noop,
|
|
71
|
+
M: noop
|
|
72
|
+
},
|
|
73
|
+
p: 0,
|
|
74
|
+
findDOMNode: null
|
|
75
|
+
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
76
|
+
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
|
77
|
+
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
|
78
|
+
);
|
|
79
|
+
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
80
|
+
exports.createPortal = function(children, container) {
|
|
81
|
+
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
82
|
+
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
|
83
|
+
throw Error("Target container is not a DOM element.");
|
|
84
|
+
return createPortal$1(children, container, null, key);
|
|
85
|
+
};
|
|
86
|
+
exports.flushSync = function(fn) {
|
|
87
|
+
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
88
|
+
try {
|
|
89
|
+
if (ReactSharedInternals.T = null, Internals.p = 2, fn)
|
|
90
|
+
return fn();
|
|
91
|
+
} finally {
|
|
92
|
+
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
|
|
93
|
+
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
exports.preconnect = function(href, options) {
|
|
98
|
+
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
|
|
99
|
+
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
|
100
|
+
getValueDescriptorExpectingEnumForWarning(options)
|
|
101
|
+
) : null != options && "string" !== typeof options.crossOrigin && console.error(
|
|
102
|
+
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
|
103
|
+
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
|
|
104
|
+
) : console.error(
|
|
105
|
+
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
106
|
+
getValueDescriptorExpectingObjectForWarning(href)
|
|
107
|
+
);
|
|
108
|
+
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
109
|
+
};
|
|
110
|
+
exports.prefetchDNS = function(href) {
|
|
111
|
+
if ("string" !== typeof href || !href)
|
|
112
|
+
console.error(
|
|
113
|
+
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
114
|
+
getValueDescriptorExpectingObjectForWarning(href)
|
|
115
|
+
);
|
|
116
|
+
else if (1 < arguments.length) {
|
|
117
|
+
var options = arguments[1];
|
|
118
|
+
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
|
|
119
|
+
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
120
|
+
getValueDescriptorExpectingEnumForWarning(options)
|
|
121
|
+
) : console.error(
|
|
122
|
+
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
123
|
+
getValueDescriptorExpectingEnumForWarning(options)
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
"string" === typeof href && Internals.d.D(href);
|
|
127
|
+
};
|
|
128
|
+
exports.preinit = function(href, options) {
|
|
129
|
+
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error(
|
|
130
|
+
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
|
131
|
+
getValueDescriptorExpectingEnumForWarning(options)
|
|
132
|
+
) : "style" !== options.as && "script" !== options.as && console.error(
|
|
133
|
+
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
|
|
134
|
+
getValueDescriptorExpectingEnumForWarning(options.as)
|
|
135
|
+
) : console.error(
|
|
136
|
+
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
137
|
+
getValueDescriptorExpectingObjectForWarning(href)
|
|
138
|
+
);
|
|
139
|
+
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
140
|
+
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
141
|
+
"style" === as ? Internals.d.S(
|
|
142
|
+
href,
|
|
143
|
+
"string" === typeof options.precedence ? options.precedence : void 0,
|
|
144
|
+
{
|
|
145
|
+
crossOrigin,
|
|
146
|
+
integrity,
|
|
147
|
+
fetchPriority
|
|
148
|
+
}
|
|
149
|
+
) : "script" === as && Internals.d.X(href, {
|
|
150
|
+
crossOrigin,
|
|
151
|
+
integrity,
|
|
152
|
+
fetchPriority,
|
|
153
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
exports.preinitModule = function(href, options) {
|
|
158
|
+
var encountered = "";
|
|
159
|
+
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
160
|
+
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
|
161
|
+
if (encountered)
|
|
162
|
+
console.error(
|
|
163
|
+
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
|
|
164
|
+
encountered
|
|
165
|
+
);
|
|
166
|
+
else
|
|
167
|
+
switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
|
168
|
+
case "script":
|
|
169
|
+
break;
|
|
170
|
+
default:
|
|
171
|
+
encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error(
|
|
172
|
+
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
|
|
173
|
+
encountered,
|
|
174
|
+
href
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
if ("string" === typeof href)
|
|
178
|
+
if ("object" === typeof options && null !== options) {
|
|
179
|
+
if (null == options.as || "script" === options.as)
|
|
180
|
+
encountered = getCrossOriginStringAs(
|
|
181
|
+
options.as,
|
|
182
|
+
options.crossOrigin
|
|
183
|
+
), Internals.d.M(href, {
|
|
184
|
+
crossOrigin: encountered,
|
|
185
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
186
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
187
|
+
});
|
|
188
|
+
} else null == options && Internals.d.M(href);
|
|
189
|
+
};
|
|
190
|
+
exports.preload = function(href, options) {
|
|
191
|
+
var encountered = "";
|
|
192
|
+
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
193
|
+
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
194
|
+
encountered && console.error(
|
|
195
|
+
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
|
196
|
+
encountered
|
|
197
|
+
);
|
|
198
|
+
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
199
|
+
encountered = options.as;
|
|
200
|
+
var crossOrigin = getCrossOriginStringAs(
|
|
201
|
+
encountered,
|
|
202
|
+
options.crossOrigin
|
|
203
|
+
);
|
|
204
|
+
Internals.d.L(href, encountered, {
|
|
205
|
+
crossOrigin,
|
|
206
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
207
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
208
|
+
type: "string" === typeof options.type ? options.type : void 0,
|
|
209
|
+
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
210
|
+
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
211
|
+
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
212
|
+
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
213
|
+
media: "string" === typeof options.media ? options.media : void 0
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
exports.preloadModule = function(href, options) {
|
|
218
|
+
var encountered = "";
|
|
219
|
+
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
220
|
+
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
221
|
+
encountered && console.error(
|
|
222
|
+
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
|
223
|
+
encountered
|
|
224
|
+
);
|
|
225
|
+
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(
|
|
226
|
+
options.as,
|
|
227
|
+
options.crossOrigin
|
|
228
|
+
), Internals.d.m(href, {
|
|
229
|
+
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
230
|
+
crossOrigin: encountered,
|
|
231
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
232
|
+
})) : Internals.d.m(href));
|
|
233
|
+
};
|
|
234
|
+
exports.requestFormReset = function(form) {
|
|
235
|
+
Internals.d.r(form);
|
|
236
|
+
};
|
|
237
|
+
exports.unstable_batchedUpdates = function(fn, a) {
|
|
238
|
+
return fn(a);
|
|
239
|
+
};
|
|
240
|
+
exports.useFormState = function(action, initialState, permalink) {
|
|
241
|
+
return resolveDispatcher().useFormState(action, initialState, permalink);
|
|
242
|
+
};
|
|
243
|
+
exports.useFormStatus = function() {
|
|
244
|
+
return resolveDispatcher().useHostTransitionStatus();
|
|
245
|
+
};
|
|
246
|
+
exports.version = "19.2.0";
|
|
247
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
248
|
+
})();
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
// ../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/index.js
|
|
253
|
+
var require_react_dom = __commonJS({
|
|
254
|
+
"../node_modules/.pnpm/react-dom@19.2.0_react@19.2.0/node_modules/react-dom/index.js"(exports, module) {
|
|
255
|
+
if (false) {
|
|
256
|
+
checkDCE();
|
|
257
|
+
module.exports = null;
|
|
258
|
+
} else {
|
|
259
|
+
module.exports = require_react_dom_development();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
export {
|
|
265
|
+
require_react_dom
|
|
266
|
+
};
|
|
267
|
+
/*! Bundled license information:
|
|
268
|
+
|
|
269
|
+
react-dom/cjs/react-dom.development.js:
|
|
270
|
+
(**
|
|
271
|
+
* @license React
|
|
272
|
+
* react-dom.development.js
|
|
273
|
+
*
|
|
274
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the MIT license found in the
|
|
277
|
+
* LICENSE file in the root directory of this source tree.
|
|
278
|
+
*)
|
|
279
|
+
*/
|
|
280
|
+
//# sourceMappingURL=chunk-KFGKZMLK.js.map
|