Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Add password button/modal

Tim Wilsonc679ee2ebf30
diff --git a/apps/web/ui/modals/add-edit-link-modal-new/index.tsx b/apps/web/ui/modals/add-edit-link-modal-new/index.tsx
index f5cc270dbc..e67e2fce75 100644
--- a/apps/web/ui/modals/add-edit-link-modal-new/index.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal-new/index.tsx
@@ -48,6 +48,7 @@ import { toast } from "sonner";
import { mutate } from "swr";
import { useDebounce } from "use-debounce";
import { LinkPreview } from "./link-preview";
+import { usePasswordModal } from "./password-modal";
import { QRCodePreview } from "./qr-code-preview";
import { TogglesDropdown, TogglesList } from "./toggles";
import { useMetatags } from "./use-metatags";
@@ -199,260 +200,270 @@ function AddEditLinkModalInner({
[data.key, data.domain],
);
+ const { PasswordModal, PasswordButton } = usePasswordModal();
+
return (
- <Modal
- showModal={showAddEditLinkModal}
- setShowModal={setShowAddEditLinkModal}
- className="max-w-screen-lg"
- preventDefaultClose={homepageDemo ? false : true}
- onClose={() => {
- if (searchParams.has("newLink"))
- queryParams({
- del: ["newLink", "newLinkDomain"],
- });
- }}
- >
- <LinkModalContext.Provider
- value={{
- workspaceId,
- workspacePlan: plan,
- workspaceLogo: logo ?? undefined,
- conversionEnabled: conversionEnabled,
- generatingMetatags,
+ <>
+ <PasswordModal />
+ <Modal
+ showModal={showAddEditLinkModal}
+ setShowModal={setShowAddEditLinkModal}
+ className="max-w-screen-lg"
+ preventDefaultClose={homepageDemo ? false : true}
+ onClose={() => {
+ if (searchParams.has("newLink"))
+ queryParams({
+ del: ["newLink", "newLinkDomain"],
+ });
}}
>
- <form
- onSubmit={handleSubmit(async (data) => {
- // @ts-ignore – exclude extra attributes from `data` object before sending to API
- const { user, tags, tagId, ...rest } = data;
- const bodyData = {
- ...rest,
- // Map tags to tagIds
- tagIds: tags.map(({ id }) => id),
- };
-
- try {
- const res = await fetch(endpoint.url, {
- method: endpoint.method,
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify(bodyData),
- });
-
- if (res.status === 200) {
- await mutate(
- (key) =>
- typeof key === "string" && key.startsWith("/api/links"),
- undefined,
- { revalidate: true },
- );
- const data = await res.json();
- posthog.capture(props ? "link_updated" : "link_created", data);
-
- // copy shortlink to clipboard when adding a new link
- if (!props) {
- try {
- await navigator.clipboard.writeText(data.shortLink);
- toast.success("Copied shortlink to clipboard!");
- } catch (e) {
- console.error(
- "Failed to automatically copy shortlink to clipboard.",
- e,
- );
- toast.success("Successfully created link!");
- }
- } else toast.success("Successfully updated shortlink!");
-
- setShowAddEditLinkModal(false);
- } else {
- const { error } = await res.json();
-
- if (error) {
- if (error.message.includes("Upgrade to")) {
- toast.custom(() => (
- <UpgradeRequiredToast
- title={`You've discovered a ${nextPlan.name} feature!`}
- message={error.message}
- />
- ));
- } else {
- toast.error(error.message);
- }
- const message = error.message.toLowerCase();
+ <LinkModalContext.Provider
+ value={{
+ workspaceId,
+ workspacePlan: plan,
+ workspaceLogo: logo ?? undefined,
+ conversionEnabled: conversionEnabled,
+ generatingMetatags,
+ }}
+ >
+ <form
+ onSubmit={handleSubmit(async (data) => {
+ // @ts-ignore – exclude extra attributes from `data` object before sending to API
+ const { user, tags, tagId, ...rest } = data;
+ const bodyData = {
+ ...rest,
+ // Map tags to tagIds
+ tagIds: tags.map(({ id }) => id),
+ };
+
+ try {
+ const res = await fetch(endpoint.url, {
+ method: endpoint.method,
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(bodyData),
+ });
+
+ if (res.status === 200) {
+ await mutate(
+ (key) =>
+ typeof key === "string" && key.startsWith("/api/links"),
+ undefined,
+ { revalidate: true },
+ );
+ const data = await res.json();
+ posthog.capture(
+ props ? "link_updated" : "link_created",
+ data,
+ );
+
+ // copy shortlink to clipboard when adding a new link
+ if (!props) {
+ try {
+ await navigator.clipboard.writeText(data.shortLink);
+ toast.success("Copied shortlink to clipboard!");
+ } catch (e) {
+ console.error(
+ "Failed to automatically copy shortlink to clipboard.",
+ e,
+ );
+ toast.success("Successfully created link!");
+ }
+ } else toast.success("Successfully updated shortlink!");
- if (message.includes("key"))
- setError("key", { message: error.message });
- else if (message.includes("url"))
- setError("url", { message: error.message });
- else setError("root", { message: "Failed to save link" });
+ setShowAddEditLinkModal(false);
} else {
- setError("root", { message: "Failed to save link" });
- toast.error("Failed to save link");
+ const { error } = await res.json();
+
+ if (error) {
+ if (error.message.includes("Upgrade to")) {
+ toast.custom(() => (
+ <UpgradeRequiredToast
+ title={`You've discovered a ${nextPlan.name} feature!`}
+ message={error.message}
+ />
+ ));
+ } else {
+ toast.error(error.message);
+ }
+ const message = error.message.toLowerCase();
+
+ if (message.includes("key"))
+ setError("key", { message: error.message });
+ else if (message.includes("url"))
+ setError("url", { message: error.message });
+ else setError("root", { message: "Failed to save link" });
+ } else {
+ setError("root", { message: "Failed to save link" });
+ toast.error("Failed to save link");
+ }
}
+ } catch (e) {
+ setError("root", { message: "Failed to save link" });
+ console.error("Failed to save link", e);
+ toast.error("Failed to save link");
}
- } catch (e) {
- setError("root", { message: "Failed to save link" });
- console.error("Failed to save link", e);
- toast.error("Failed to save link");
- }
- })}
- >
- <div className="flex items-center justify-between px-6 py-4">
- <div className="flex items-center gap-4">
- <LinkLogo apexDomain={getApexDomain(debouncedUrl)} />
- <h3 className="!mt-0 max-w-sm truncate text-lg font-medium">
- {props ? `Edit ${shortLink}` : "Create new link"}
- </h3>
- </div>
- {!homepageDemo && (
- <button
- type="button"
- onClick={() => {
- setShowAddEditLinkModal(false);
- if (searchParams.has("newLink")) {
- queryParams({
- del: ["newLink"],
- });
- }
- }}
- className="group hidden rounded-full p-2 text-gray-500 transition-all duration-75 hover:bg-gray-100 focus:outline-none active:bg-gray-200 md:block"
- >
- <X className="h-5 w-5" />
- </button>
- )}
- </div>
-
- <div
- className={cn(
- "grid w-full gap-y-6 max-md:overflow-auto md:grid-cols-[2fr_1fr]",
- "max-md:max-h-[calc(100dvh-200px)] max-md:min-h-[min(510px,_calc(100dvh-200px))]",
- "md:[&>div]:max-h-[calc(100dvh-200px)] md:[&>div]:min-h-[min(510px,_calc(100dvh-200px))]",
- )}
+ })}
>
- <div className="scrollbar-hide px-6 md:overflow-auto">
- <div className="flex min-h-full flex-col gap-8 py-4">
- <Controller
- name="url"
- control={control}
- render={({ field }) => (
- <DestinationUrlInput
+ <div className="flex items-center justify-between px-6 py-4">
+ <div className="flex items-center gap-4">
+ <LinkLogo apexDomain={getApexDomain(debouncedUrl)} />
+ <h3 className="!mt-0 max-w-sm truncate text-lg font-medium">
+ {props ? `Edit ${shortLink}` : "Create new link"}
+ </h3>
+ </div>
+ {!homepageDemo && (
+ <button
+ type="button"
+ onClick={() => {
+ setShowAddEditLinkModal(false);
+ if (searchParams.has("newLink")) {
+ queryParams({
+ del: ["newLink"],
+ });
+ }
+ }}
+ className="group hidden rounded-full p-2 text-gray-500 transition-all duration-75 hover:bg-gray-100 focus:outline-none active:bg-gray-200 md:block"
+ >
+ <X className="h-5 w-5" />
+ </button>
+ )}
+ </div>
+
+ <div
+ className={cn(
+ "grid w-full gap-y-6 max-md:overflow-auto md:grid-cols-[2fr_1fr]",
+ "max-md:max-h-[calc(100dvh-200px)] max-md:min-h-[min(510px,_calc(100dvh-200px))]",
+ "md:[&>div]:max-h-[calc(100dvh-200px)] md:[&>div]:min-h-[min(510px,_calc(100dvh-200px))]",
+ )}
+ >
+ <div className="scrollbar-hide px-6 md:overflow-auto">
+ <div className="flex min-h-full flex-col gap-8 py-4">
+ <Controller
+ name="url"
+ control={control}
+ render={({ field }) => (
+ <DestinationUrlInput
+ domain={domain}
+ _key={key}
+ value={field.value}
+ domains={domains}
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
+ clearErrors("url");
+ field.onChange(e.target.value);
+ }}
+ required={key !== "_root"}
+ error={errors.url?.message || undefined}
+ showEnterToSubmit={false}
+ />
+ )}
+ />
+
+ {key !== "_root" && (
+ <ShortLinkInput
+ ref={keyRef}
domain={domain}
_key={key}
- value={field.value}
- domains={domains}
- onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
- clearErrors("url");
- field.onChange(e.target.value);
+ existingLinkProps={props}
+ error={errors.key?.message || undefined}
+ onChange={(d) => {
+ clearErrors("key");
+ if (d.domain !== undefined)
+ setValue("domain", d.domain);
+ if (d.key !== undefined) setValue("key", d.key);
}}
- required={key !== "_root"}
- error={errors.url?.message || undefined}
- showEnterToSubmit={false}
+ data={data}
+ saving={isSubmitting || isSubmitSuccessful}
+ loading={loading}
+ domains={domains}
/>
)}
- />
- {key !== "_root" && (
- <ShortLinkInput
- ref={keyRef}
- domain={domain}
- _key={key}
- existingLinkProps={props}
- error={errors.key?.message || undefined}
- onChange={(d) => {
- clearErrors("key");
- if (d.domain !== undefined) setValue("domain", d.domain);
- if (d.key !== undefined) setValue("key", d.key);
- }}
- data={data}
- saving={isSubmitting || isSubmitSuccessful}
- loading={loading}
- domains={domains}
- />
- )}
-
- <UTMBuilder />
-
- <div>
- <div className="flex items-center gap-2">
- <label
- htmlFor="comments"
- className="block text-sm font-medium text-gray-700"
- >
- Comments
- </label>
- <InfoTooltip
- content={
- <SimpleTooltipContent
- title="Use comments to add context to your short links – for you and your team."
- cta="Learn more."
- href="https://dub.co/help/article/link-comments"
+ <UTMBuilder />
+
+ <div>
+ <div className="flex items-center gap-2">
+ <label
+ htmlFor="comments"
+ className="block text-sm font-medium text-gray-700"
+ >
+ Comments
+ </label>
+ <InfoTooltip
+ content={
+ <SimpleTooltipContent
+ title="Use comments to add context to your short links – for you and your team."
+ cta="Learn more."
+ href="https://dub.co/help/article/link-comments"
+ />
+ }
+ />
+ </div>
+ <Controller
+ name="comments"
+ control={control}
+ render={({ field }) => (
+ <TextareaAutosize
+ id="comments"
+ name="comments"
+ minRows={3}
+ className="mt-2 block w-full rounded-md border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
+ placeholder="Add comments"
+ value={field.value ?? ""}
+ onChange={(e) => field.onChange(e.target.value)}
/>
- }
+ )}
/>
</div>
- <Controller
- name="comments"
- control={control}
- render={({ field }) => (
- <TextareaAutosize
- id="comments"
- name="comments"
- minRows={3}
- className="mt-2 block w-full rounded-md border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
- placeholder="Add comments"
- value={field.value ?? ""}
- onChange={(e) => field.onChange(e.target.value)}
- />
- )}
- />
- </div>
- <div className="flex grow flex-col justify-end">
- <TogglesList />
+ <div className="flex grow flex-col justify-end">
+ <TogglesList />
+ </div>
</div>
</div>
- </div>
- <div className="scrollbar-hide px-6 md:overflow-auto md:pl-0 md:pr-4">
- <div className="relative">
- <div className="absolute inset-0 rounded-xl border border-gray-200 bg-gray-50 [mask-image:linear-gradient(to_bottom,black,transparent)]"></div>
- <div className="relative flex flex-col gap-6 p-4">
- <QRCodePreview />
- <LinkPreview />
+ <div className="scrollbar-hide px-6 md:overflow-auto md:pl-0 md:pr-4">
+ <div className="relative">
+ <div className="absolute inset-0 rounded-xl border border-gray-200 bg-gray-50 [mask-image:linear-gradient(to_bottom,black,transparent)]"></div>
+ <div className="relative flex flex-col gap-6 p-4">
+ <QRCodePreview />
+ <LinkPreview />
+ </div>
</div>
</div>
</div>
- </div>
- <div className="flex items-center justify-between border-t border-gray-100 bg-gray-50 p-4">
- <div className="flex items-center gap-2">
- <TogglesDropdown />
+ <div className="flex items-center justify-between border-t border-gray-100 bg-gray-50 p-4">
+ <div className="flex items-center gap-2">
+ <PasswordButton />
+ <TogglesDropdown />
+ </div>
+ {homepageDemo ? (
+ <Button
+ disabledTooltip="This is a demo link. You can't edit it."
+ text="Save changes"
+ className="h-8 w-fit"
+ />
+ ) : (
+ <Button
+ type="submit"
+ disabled={saveDisabled}
+ loading={isSubmitting || isSubmitSuccessful}
+ text={
+ <span className="flex items-center gap-2">
+ {props ? "Save changes" : "Create link"}
+ <div className="rounded border border-white/20 p-1">
+ <ArrowTurnLeft className="size-3.5" />
+ </div>
+ </span>
+ }
+ className="h-8 w-fit pl-2.5 pr-1.5"
+ />
+ )}
</div>
- {homepageDemo ? (
- <Button
- disabledTooltip="This is a demo link. You can't edit it."
- text="Save changes"
- className="h-8 w-fit"
- />
- ) : (
- <Button
- type="submit"
- disabled={saveDisabled}
- loading={isSubmitting || isSubmitSuccessful}
- text={
- <span className="flex items-center gap-2">
- {props ? "Save changes" : "Create link"}
- <div className="rounded border border-white/20 p-1">
- <ArrowTurnLeft className="size-3.5" />
- </div>
- </span>
- }
- className="h-8 w-fit pl-2.5 pr-1.5"
- />
- )}
- </div>
- </form>
- </LinkModalContext.Provider>
- </Modal>
+ </form>
+ </LinkModalContext.Provider>
+ </Modal>
+ </>
);
}
diff --git a/apps/web/ui/modals/add-edit-link-modal-new/password-modal.tsx b/apps/web/ui/modals/add-edit-link-modal-new/password-modal.tsx
new file mode 100644
index 0000000000..a3211e14f8
--- /dev/null
+++ b/apps/web/ui/modals/add-edit-link-modal-new/password-modal.tsx
@@ -0,0 +1,235 @@
+import { ProBadgeTooltip } from "@/ui/shared/pro-badge-tooltip";
+import {
+ Button,
+ ButtonTooltip,
+ Modal,
+ SimpleTooltipContent,
+ Tooltip,
+ useKeyboardShortcut,
+ useMediaQuery,
+} from "@dub/ui";
+import { Eye, EyeSlash, InputPassword, Shuffle } from "@dub/ui/src/icons";
+import { cn, nanoid } from "@dub/utils";
+import {
+ Dispatch,
+ SetStateAction,
+ useCallback,
+ useMemo,
+ useState,
+} from "react";
+import { useForm, useFormContext } from "react-hook-form";
+import { LinkFormData } from ".";
+
+function PasswordModal({
+ showPasswordModal,
+ setShowPasswordModal,
+}: {
+ showPasswordModal: boolean;
+ setShowPasswordModal: Dispatch<SetStateAction<boolean>>;
+}) {
+ const { isMobile } = useMediaQuery();
+
+ const {
+ watch: watchParent,
+ getValues: getValuesParent,
+ setValue: setValueParent,
+ } = useFormContext<LinkFormData>();
+
+ const {
+ register,
+ setValue,
+ reset,
+ formState: { errors },
+ handleSubmit,
+ } = useForm<Pick<LinkFormData, "password">>({
+ values: {
+ password: getValuesParent("password"),
+ },
+ });
+
+ const passwordParent = watchParent("password");
+
+ const [showPassword, setShowPassword] = useState(false);
+
+ return (
+ <>
+ <Modal
+ showModal={showPasswordModal}
+ setShowModal={setShowPasswordModal}
+ className="max-w-md"
+ >
+ <form
+ className="px-5 py-4"
+ onSubmit={handleSubmit((data) => {
+ setValueParent("password", data.password);
+ setShowPasswordModal(false);
+ })}
+ >
+ <div className="flex items-center justify-between">
+ <h3 className="text-lg font-medium">Link Password</h3>
+ <div className="max-md:hidden">
+ <Tooltip
+ content={
+ <div className="px-2 py-1 text-xs text-gray-700">
+ Press{" "}
+ <strong className="font-medium text-gray-950">P</strong> to
+ open this quickly
+ </div>
+ }
+ side="right"
+ >
+ <kbd className="flex size-6 cursor-default items-center justify-center rounded-md border border-gray-200 font-sans text-xs text-gray-950">
+ P
+ </kbd>
+ </Tooltip>
+ </div>
+ </div>
+
+ <div className="mt-6">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center gap-2">
+ <span className="block text-sm font-medium text-gray-700">
+ Password
+ </span>
+ <ProBadgeTooltip
+ content={
+ <SimpleTooltipContent
+ title="Restrict access to your short links by encrypting it with a password."
+ cta="Learn more."
+ href="https://dub.co/help/article/password-protected-links"
+ />
+ }
+ />
+ </div>
+ <div className="flex items-center gap-2">
+ <ButtonTooltip
+ className="text-gray-500 transition-colors hover:text-gray-800"
+ tooltipContent={
+ showPassword ? "Hide password" : "Reveal password"
+ }
+ onClick={() => setShowPassword((s) => !s)}
+ >
+ {showPassword ? (
+ <EyeSlash className="size-4" />
+ ) : (
+ <Eye className="size-4" />
+ )}
+ </ButtonTooltip>
+ <ButtonTooltip
+ className="text-gray-500 transition-colors hover:text-gray-800"
+ tooltipContent="Generate a random password"
+ onClick={() => {
+ setValue("password", nanoid(24));
+ }}
+ >
+ <Shuffle className="size-4" />
+ </ButtonTooltip>
+ </div>
+ </div>
+ <div className="mt-2 rounded-md shadow-sm">
+ <input
+ type={showPassword ? "text" : "password"}
+ autoFocus={!isMobile}
+ placeholder="Create password"
+ className={`${
+ errors.password
+ ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"
+ : "border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:ring-gray-500"
+ } block w-full rounded-md focus:outline-none sm:text-sm`}
+ {...register("password", {
+ required: !passwordParent,
+ })}
+ />
+ </div>
+ </div>
+
+ <div className="mt-6 flex items-center justify-between">
+ <div>
+ {Boolean(passwordParent) && (
+ <button
+ type="button"
+ className="text-xs font-medium text-gray-700 transition-colors hover:text-gray-950"
+ onClick={() => {
+ setValueParent("password", null);
+ setShowPasswordModal(false);
+ }}
+ >
+ Remove password
+ </button>
+ )}
+ </div>
+ <div className="flex items-center gap-2">
+ <Button
+ type="button"
+ variant="secondary"
+ text="Cancel"
+ className="h-9 w-fit"
+ onClick={() => {
+ reset();
+ setShowPasswordModal(false);
+ }}
+ />
+ <Button
+ type="submit"
+ variant="primary"
+ text={passwordParent ? "Save" : "Add password"}
+ className="h-9 w-fit"
+ />
+ </div>
+ </div>
+ </form>
+ </Modal>
+ </>
+ );
+}
+
+function PasswordButton({
+ setShowPasswordModal,
+}: {
+ setShowPasswordModal: Dispatch<SetStateAction<boolean>>;
+}) {
+ const { watch } = useFormContext<LinkFormData>();
+ const password = watch("password");
+
+ useKeyboardShortcut("p", () => setShowPasswordModal(true), {
+ modal: true,
+ });
+
+ return (
+ <Button
+ variant="secondary"
+ text={password ? "Protected" : "Password"}
+ icon={
+ <InputPassword className={cn("size-4", password && "text-blue-500")} />
+ }
+ className="h-9 w-fit px-2.5 font-medium text-gray-700"
+ onClick={() => setShowPasswordModal(true)}
+ />
+ );
+}
+
+export function usePasswordModal() {
+ const [showPasswordModal, setShowPasswordModal] = useState(false);
+
+ const PasswordModalCallback = useCallback(() => {
+ return (
+ <PasswordModal
+ showPasswordModal={showPasswordModal}
+ setShowPasswordModal={setShowPasswordModal}
+ />
+ );
+ }, [showPasswordModal, setShowPasswordModal]);
+
+ const PasswordButtonCallback = useCallback(() => {
+ return <PasswordButton setShowPasswordModal={setShowPasswordModal} />;
+ }, [setShowPasswordModal]);
+
+ return useMemo(
+ () => ({
+ setShowPasswordModal,
+ PasswordModal: PasswordModalCallback,
+ PasswordButton: PasswordButtonCallback,
+ }),
+ [setShowPasswordModal, PasswordModalCallback, PasswordButtonCallback],
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/eye.tsx b/packages/ui/src/icons/nucleo/eye.tsx
new file mode 100644
index 0000000000..5df48c5c0a
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/eye.tsx
@@ -0,0 +1,34 @@
+import { SVGProps } from "react";
+
+export function Eye(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g fill="currentColor">
+ <path
+ d="M2.088,10.132c-.45-.683-.45-1.582,0-2.265,1.018-1.543,3.262-4.118,6.912-4.118s5.895,2.574,6.912,4.118c.45,.683,.45,1.582,0,2.265-1.018,1.543-3.262,4.118-6.912,4.118s-5.895-2.574-6.912-4.118Z"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <circle
+ cx="9"
+ cy="9"
+ fill="none"
+ r="2.75"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.ts
index 785414832e..5aff5b758a 100644
--- a/packages/ui/src/icons/nucleo/index.ts
+++ b/packages/ui/src/icons/nucleo/index.ts
@@ -32,6 +32,7 @@ export * from "./desktop";
export * from "./dots";
export * from "./download";
export * from "./earth-position";
+export * from "./eye";
export * from "./eye-slash";
export * from "./filter-bars";
export * from "./filter2";
@@ -78,6 +79,7 @@ export * from "./robot";
export * from "./satellite-dish";
export * from "./scribble";
export * from "./shield-check";
+export * from "./shuffle";
export * from "./sliders";
export * from "./square-chart";
export * from "./square-layout-grid6";
diff --git a/packages/ui/src/icons/nucleo/shuffle.tsx b/packages/ui/src/icons/nucleo/shuffle.tsx
new file mode 100644
index 0000000000..2f38b3506a
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/shuffle.tsx
@@ -0,0 +1,56 @@
+import { SVGProps } from "react";
+
+export function Shuffle(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g fill="currentColor">
+ <path
+ d="M13.5 16L16.25 13.25L13.5 10.5"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <path
+ d="M9.147 11L10.4 12.521C10.78 12.982 11.346 13.25 11.944 13.25H16"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <path
+ d="M1.75 4.75H3.056C3.654 4.75 4.22 5.017 4.6 5.479L5.853 7"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <path
+ d="M13.5 2L16.25 4.75L13.5 7.5"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <path
+ d="M1.75 13.25H3.056C3.654 13.25 4.22 12.983 4.6 12.521L10.4 5.47799C10.78 5.01699 11.346 4.74899 11.944 4.74899H16"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ </g>
+ </svg>
+ );
+}