Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions apps/apollo-vertex/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,19 @@
}
]
},
{
"name": "share-with-uipath-checkbox",
"type": "registry:ui",
"title": "Share With UiPath Checkbox",
"description": "A labeled opt-in checkbox for sharing feedback data with UiPath — the outer-loop consent control on Platform Feedback submission surfaces.",
"registryDependencies": ["@uipath/checkbox", "@uipath/label"],
"files": [
{
"path": "registry/share-with-uipath-checkbox/share-with-uipath-checkbox.tsx",
"type": "registry:ui"
}
]
},
{
"name": "sheet",
"type": "registry:ui",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
"use client";

import { useId } from "react";

import { Checkbox } from "@/registry/checkbox/checkbox";
import { Label } from "@/registry/label/label";
import { cn } from "@/lib/utils";

type ShareWithUiPathCheckboxProps = {
/** Controlled checked state of the opt-in. */
checked: boolean;
onCheckedChange: (checked: boolean) => void;
/**
* The opt-in copy. Required so consumers plug in their own translated,
* legal-approved string (e.g. "Share feedback data with UiPath to help
* troubleshoot and improve the product").
*/
label: string;
disabled?: boolean;
/** Extra classes for the wrapper — typically spacing (e.g. `mb-3`). */
className?: string;
/** Label text size. `sm` => `text-xs`, `default` => `text-sm`. */
size?: "default" | "sm";
};

function ShareWithUiPathCheckbox({
checked,
onCheckedChange,
label,
disabled,
className,
size = "default",
}: ShareWithUiPathCheckboxProps) {
// Self-generated id keeps the label association unique even when several
// instances mount on the same page.
const id = useId();

return (
<div
data-slot="share-with-uipath-checkbox"
className={cn("flex items-center gap-2", className)}
>
<Checkbox
id={id}
checked={checked}
// Radix yields `boolean | "indeterminate"`; collapse to a plain boolean
// so consumers never have to.
onCheckedChange={(value) => onCheckedChange(value === true)}
disabled={disabled}
/>
<Label
htmlFor={id}
className={cn("font-normal", size === "sm" ? "text-xs" : "text-sm")}
>
{label}
</Label>
</div>
);
}

export { ShareWithUiPathCheckbox };
export type { ShareWithUiPathCheckboxProps };
Loading