Skip to content

Commit bcbf852

Browse files
committed
Merge branch 'arshavir/enforce-unique-passkey-pubkeys' of github.com:dfinity/internet-identity into arshavir/enforce-unique-passkey-pubkeys
2 parents 25bef66 + f9630d6 commit bcbf852

File tree

27 files changed

+978
-239
lines changed

27 files changed

+978
-239
lines changed

src/frontend/src/lib/app.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ body {
1313
html {
1414
background-color: var(--color-bg-primary);
1515
-webkit-font-smoothing: antialiased;
16+
color-scheme: light dark;
1617
}
1718

1819
button:not(:disabled),

src/frontend/src/lib/components/ui/Avatar.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import type { HTMLAttributes } from "svelte/elements";
33
4-
type Size = "sm" | "md" | "lg" | "xl";
4+
type Size = "xs" | "sm" | "md" | "lg" | "xl";
55
66
type Props = HTMLAttributes<HTMLDivElement> & { size?: Size };
77
@@ -13,6 +13,7 @@
1313
class={[
1414
"bg-bg-secondary border-border-secondary text-fg-disabled flex shrink-0 items-center justify-center rounded-full border font-semibold",
1515
{
16+
xs: "size-6 text-xs",
1617
sm: "size-8 text-sm",
1718
md: "size-10 text-sm",
1819
lg: "size-12 text-base",

src/frontend/src/lib/components/ui/Dialog.svelte

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { onMount } from "svelte";
33
import { scale, fly } from "svelte/transition";
4-
import type { HTMLAttributes } from "svelte/elements";
4+
import type { ClassValue, HTMLAttributes } from "svelte/elements";
55
import { nonNullish } from "@dfinity/utils";
66
import { XIcon } from "@lucide/svelte";
77
import { t } from "$lib/stores/locale.store";
@@ -11,6 +11,7 @@
1111
closeOnOutsideClick?: boolean;
1212
showCloseButton?: boolean;
1313
backdrop?: boolean;
14+
contentClass?: ClassValue | null;
1415
};
1516
1617
const {
@@ -20,6 +21,7 @@
2021
closeOnOutsideClick = nonNullish(onClose),
2122
showCloseButton = nonNullish(onClose),
2223
backdrop = true,
24+
contentClass,
2325
...props
2426
}: Props = $props();
2527
@@ -67,16 +69,30 @@
6769
const preventScroll = (event: TouchEvent) => {
6870
event.preventDefault();
6971
};
72+
const findScrollableParent = (target: HTMLElement): HTMLElement => {
73+
let scrollableParent = target;
74+
while (scrollableParent && scrollableParent !== contentRef) {
75+
if (scrollableParent === contentRef) {
76+
break;
77+
}
78+
if (scrollableParent.scrollHeight > scrollableParent.clientHeight) {
79+
return scrollableParent;
80+
}
81+
scrollableParent = scrollableParent.parentElement as HTMLElement;
82+
}
83+
return contentRef;
84+
};
7085
let lastY = 0;
7186
const touchScrollStart = (event: TouchEvent) => {
7287
lastY = event.touches[0].clientY;
7388
};
7489
const touchScrollMove = (event: TouchEvent) => {
90+
const scrollTarget = findScrollableParent(event.target as HTMLElement);
7591
const y = event.touches[0].clientY;
7692
const dy = y - lastY;
7793
lastY = y;
78-
contentRef.scrollTo({
79-
top: contentRef.scrollTop - dy,
94+
scrollTarget.scrollTo({
95+
top: scrollTarget.scrollTop - dy,
8096
behavior: "instant",
8197
});
8298
};
@@ -151,17 +167,22 @@
151167
>
152168
<!-- Non-interactive element to render dark-mode bottom sheet border gradient -->
153169
<div
154-
class="from-border-secondary pointer-events-none absolute top-0 right-0 left-0 z-0 hidden rounded-t-2xl bg-gradient-to-b to-transparent p-[1px] max-sm:dark:block"
155-
>
156-
<div class="bg-bg-primary_alt h-24 rounded-t-2xl"></div>
157-
</div>
170+
class={[
171+
"from-border-secondary pointer-events-none absolute top-0 right-0 left-0 z-1 hidden h-24 rounded-t-2xl bg-gradient-to-b to-transparent p-[1px] max-sm:dark:block",
172+
// Use a mask to only show the gradient on the border area, and prevent it from overlapping with the dialog content.
173+
"![mask-composite:exclude] [mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)]",
174+
]}
175+
></div>
158176
<div class="flex flex-1 flex-col">
159177
<div
160178
bind:this={contentRef}
161179
class="relative max-h-[var(--max-content-height)] overflow-y-auto"
162180
>
163181
<div
164-
class="flex flex-1 shrink-0 flex-col px-4 pt-4 pb-4 sm:px-6 sm:pt-6 sm:pb-8"
182+
class={[
183+
"flex flex-1 shrink-0 flex-col px-4 pt-4 pb-4 sm:px-6 sm:pt-6 sm:pb-8",
184+
contentClass,
185+
]}
165186
>
166187
{@render children?.()}
167188
{#if showCloseButton && nonNullish(onClose)}

0 commit comments

Comments
 (0)