@payfit/unity-components
Version:
51 lines (50 loc) • 1.76 kB
JavaScript
import { Tooltip as e } from "../../../../../core/components/tooltip/Tooltip.js";
import { Text as t } from "../../../../../core/components/text/Text.js";
import { SelectListOption as n } from "../../../../../core/components/select-list/parts/SelectListOption.js";
import { useAIStructuredInputAnswersContext as r } from "./AIStructuredInputAnswers.context.js";
import { forwardRef as i } from "react";
import { uyTv as a } from "@payfit/unity-themes";
import { jsx as o } from "react/jsx-runtime";
//#region src/modules/ai-kit/components/ai-structured-input/parts/AIStructuredInputAnswer.tsx
var s = a({ slots: {
option: [
"uy:px-125 uy:py-125 uy:rounded-150",
"uy:data-[hinted=true]:bg-surface-neutral-selected",
"uy:motion-safe:transition-[background-color,scale] uy:motion-safe:duration-150",
"uy:motion-safe:data-[pressed]:scale-[0.99]"
],
numberBullet: [
"uy:flex uy:size-300 uy:shrink-0 uy:items-center uy:justify-center",
"uy:rounded-circle uy:bg-surface-neutral-lowest-hover",
"uy:typography-body-strong uy:text-content-neutral"
]
} });
function c({ id: i, number: a, children: c, textValue: l, className: u, isHinted: d, ...f }, p) {
let m = r(), { option: h, numberBullet: g } = s();
return /* @__PURE__ */ o(n, {
ref: p,
id: i,
...f,
isHinted: d ?? m?.hintedAnswerId === i,
className: h({ className: u }),
textValue: l ?? c,
prefixElement: /* @__PURE__ */ o("span", {
className: g(),
"aria-hidden": "true",
children: a
}),
children: /* @__PURE__ */ o(e, {
title: c,
children: /* @__PURE__ */ o(t, {
variant: "body",
isTruncated: !0,
children: c
})
})
});
}
var l = i(c);
l.displayName = "AIStructuredInputAnswer";
var u = l;
//#endregion
export { u as AIStructuredInputAnswer };