@oussemasahbeni/keycloakify-login-shadcn 250004.0.7 → 250004.0.9
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/keycloak-theme/components/langauges.tsx +1 -1
- package/keycloak-theme/components/theme-toggle.tsx +0 -1
- package/keycloak-theme/components/ui/alert.tsx +69 -62
- package/keycloak-theme/components/ui/button.tsx +44 -39
- package/keycloak-theme/components/ui/card.tsx +59 -45
- package/keycloak-theme/components/ui/checkbox.tsx +24 -23
- package/keycloak-theme/components/ui/dropdown-menu.tsx +233 -168
- package/keycloak-theme/components/ui/field.tsx +50 -48
- package/keycloak-theme/components/ui/input-otp.tsx +55 -49
- package/keycloak-theme/components/ui/input.tsx +18 -22
- package/keycloak-theme/components/ui/label.tsx +19 -21
- package/keycloak-theme/components/ui/radio-group.tsx +27 -26
- package/keycloak-theme/components/ui/select.tsx +169 -122
- package/keycloak-theme/components/ui/separator.tsx +23 -24
- package/keycloak-theme/components/ui/tooltip.tsx +53 -24
- package/keycloak-theme/login/KcPage.tsx +2 -5
- package/keycloak-theme/login/components/LogoutOtherSessions.tsx +3 -5
- package/keycloak-theme/login/components/PasswordWrapper.tsx +4 -4
- package/keycloak-theme/login/components/Template/Template.tsx +110 -58
- package/keycloak-theme/login/components/UserProfileFormFields/AddRemoveButtonsMultiValuedAttribute.tsx +7 -3
- package/keycloak-theme/login/components/UserProfileFormFields/FieldErrors.tsx +8 -4
- package/keycloak-theme/login/components/UserProfileFormFields/GroupLabel.tsx +33 -14
- package/keycloak-theme/login/components/UserProfileFormFields/InputFieldByType.tsx +9 -2
- package/keycloak-theme/login/components/UserProfileFormFields/InputLabel.tsx +0 -1
- package/keycloak-theme/login/components/UserProfileFormFields/InputTag.tsx +25 -8
- package/keycloak-theme/login/components/UserProfileFormFields/InputTagSelects.tsx +30 -16
- package/keycloak-theme/login/components/UserProfileFormFields/SelectTag.tsx +32 -11
- package/keycloak-theme/login/components/UserProfileFormFields/TextareaTag.tsx +19 -7
- package/keycloak-theme/login/components/UserProfileFormFields/UserProfileFormFields.tsx +11 -5
- package/keycloak-theme/login/index.css +3 -20
- package/keycloak-theme/login/mocks/KcPageStory.tsx +6 -2
- package/keycloak-theme/login/pages/PageIndex.tsx +0 -4
- package/keycloak-theme/login/pages/code/Page.stories.tsx +4 -5
- package/keycloak-theme/login/pages/code/Page.tsx +6 -6
- package/keycloak-theme/login/pages/delete-account-confirm/Page.stories.tsx +0 -2
- package/keycloak-theme/login/pages/delete-account-confirm/Page.tsx +3 -6
- package/keycloak-theme/login/pages/delete-credential/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/delete-credential/Page.tsx +11 -6
- package/keycloak-theme/login/pages/error/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/error/Page.tsx +13 -12
- package/keycloak-theme/login/pages/frontchannel-logout/Page.tsx +2 -4
- package/keycloak-theme/login/pages/idp-review-user-profile/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/idp-review-user-profile/Page.tsx +2 -5
- package/keycloak-theme/login/pages/info/Page.tsx +8 -6
- package/keycloak-theme/login/pages/link-idp-action/Page.tsx +5 -3
- package/keycloak-theme/login/pages/login/Form.tsx +36 -38
- package/keycloak-theme/login/pages/login/Page.stories.tsx +4 -3
- package/keycloak-theme/login/pages/login/Page.tsx +0 -1
- package/keycloak-theme/login/pages/login/SocialProviders.tsx +14 -23
- package/keycloak-theme/login/pages/login/providers/github.svg +4 -3
- package/keycloak-theme/login/pages/login/providers/x.svg +4 -3
- package/keycloak-theme/login/pages/login/useProviderLogos.tsx +2 -3
- package/keycloak-theme/login/pages/login-config-totp/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-config-totp/Page.tsx +25 -12
- package/keycloak-theme/login/pages/login-idp-link-confirm/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-idp-link-confirm/Page.tsx +4 -7
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.tsx +4 -7
- package/keycloak-theme/login/pages/login-idp-link-email/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-idp-link-email/Page.tsx +4 -7
- package/keycloak-theme/login/pages/login-oauth-grant/Page.tsx +21 -11
- package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.tsx +5 -7
- package/keycloak-theme/login/pages/login-otp/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-otp/Page.tsx +35 -26
- package/keycloak-theme/login/pages/login-page-expired/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-page-expired/Page.tsx +4 -6
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.tsx +153 -96
- package/keycloak-theme/login/pages/login-password/Page.tsx +14 -15
- package/keycloak-theme/login/pages/login-password/useScript.tsx +0 -1
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.tsx +5 -8
- package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.tsx +2 -3
- package/keycloak-theme/login/pages/login-reset-otp/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-reset-otp/Page.tsx +3 -4
- package/keycloak-theme/login/pages/login-reset-password/Form.tsx +5 -6
- package/keycloak-theme/login/pages/login-reset-password/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-reset-password/Page.tsx +3 -3
- package/keycloak-theme/login/pages/login-update-password/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-update-password/Page.tsx +5 -7
- package/keycloak-theme/login/pages/login-update-profile/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-update-profile/Page.tsx +6 -7
- package/keycloak-theme/login/pages/login-username/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-username/Page.tsx +6 -6
- package/keycloak-theme/login/pages/login-verify-email/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-verify-email/Page.tsx +3 -4
- package/keycloak-theme/login/pages/login-x509-info/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/login-x509-info/Page.tsx +3 -6
- package/keycloak-theme/login/pages/logout-confirm/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/logout-confirm/Page.tsx +3 -6
- package/keycloak-theme/login/pages/register/Form.tsx +8 -7
- package/keycloak-theme/login/pages/register/Page.stories.tsx +17 -8
- package/keycloak-theme/login/pages/register/TermsAcceptance.tsx +6 -7
- package/keycloak-theme/login/pages/saml-post-form/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/saml-post-form/Page.tsx +4 -6
- package/keycloak-theme/login/pages/select-authenticator/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/select-authenticator/Page.tsx +3 -6
- package/keycloak-theme/login/pages/select-organization/Page.tsx +5 -8
- package/keycloak-theme/login/pages/terms/Page.tsx +1 -3
- package/keycloak-theme/login/pages/update-email/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/update-email/Page.tsx +6 -7
- package/keycloak-theme/login/pages/webauthn-authenticate/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/webauthn-authenticate/Page.tsx +50 -46
- package/keycloak-theme/login/pages/webauthn-error/Page.stories.tsx +2 -5
- package/keycloak-theme/login/pages/webauthn-error/Page.tsx +3 -6
- package/keycloak-theme/login/pages/webauthn-register/Page.stories.tsx +0 -1
- package/keycloak-theme/login/pages/webauthn-register/Page.tsx +4 -4
- package/keycloak-theme/login/styleLevelCustomization.tsx +5 -6
- package/keycloak-theme/public/site.webmanifest +11 -1
- package/package.json +2 -2
|
@@ -1,46 +1,55 @@
|
|
|
1
|
-
import { OTPInput, OTPInputContext } from "input-otp"
|
|
2
|
-
import {
|
|
3
|
-
import * as React from "react"
|
|
1
|
+
import { OTPInput, OTPInputContext } from "input-otp"
|
|
2
|
+
import { MinusIcon } from "lucide-react"
|
|
3
|
+
import * as React from "react"
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)
|
|
21
|
-
|
|
7
|
+
function InputOTP({
|
|
8
|
+
className,
|
|
9
|
+
containerClassName,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof OTPInput> & {
|
|
12
|
+
containerClassName?: string
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<OTPInput
|
|
16
|
+
data-slot="input-otp"
|
|
17
|
+
containerClassName={cn(
|
|
18
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
19
|
+
containerClassName
|
|
20
|
+
)}
|
|
21
|
+
className={cn("disabled:cursor-not-allowed", className)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
data-slot="input-otp-group"
|
|
31
|
+
className={cn("flex items-center", className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
30
36
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
function InputOTPSlot({
|
|
38
|
+
index,
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: React.ComponentProps<"div"> & {
|
|
42
|
+
index: number
|
|
43
|
+
}) {
|
|
44
|
+
const inputOTPContext = React.useContext(OTPInputContext)
|
|
45
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
|
|
37
46
|
|
|
38
47
|
return (
|
|
39
48
|
<div
|
|
40
|
-
|
|
49
|
+
data-slot="input-otp-slot"
|
|
50
|
+
data-active={isActive}
|
|
41
51
|
className={cn(
|
|
42
|
-
"relative flex h-9 w-9 items-center justify-center border-y border-r
|
|
43
|
-
isActive && "z-10 ring-1 ring-ring",
|
|
52
|
+
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
|
44
53
|
className
|
|
45
54
|
)}
|
|
46
55
|
{...props}
|
|
@@ -48,23 +57,20 @@ const InputOTPSlot = React.forwardRef<
|
|
|
48
57
|
{char}
|
|
49
58
|
{hasFakeCaret && (
|
|
50
59
|
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
|
51
|
-
<div className="
|
|
60
|
+
<div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
|
|
52
61
|
</div>
|
|
53
62
|
)}
|
|
54
63
|
</div>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
InputOTPSlot.displayName = "InputOTPSlot";
|
|
64
|
+
)
|
|
65
|
+
}
|
|
58
66
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
));
|
|
67
|
-
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
67
|
+
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
|
|
68
|
+
return (
|
|
69
|
+
<div data-slot="input-otp-separator" role="separator" {...props}>
|
|
70
|
+
<MinusIcon />
|
|
71
|
+
</div>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
68
74
|
|
|
69
|
-
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot }
|
|
75
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot }
|
|
70
76
|
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
Input.displayName = "Input";
|
|
23
|
-
|
|
24
|
-
export { Input };
|
|
5
|
+
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
6
|
+
return (
|
|
7
|
+
<input
|
|
8
|
+
type={type}
|
|
9
|
+
data-slot="input"
|
|
10
|
+
className={cn(
|
|
11
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
13
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
25
20
|
|
|
21
|
+
export { Input }
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
2
|
-
import
|
|
3
|
-
import * as React from "react";
|
|
1
|
+
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
2
|
+
import * as React from "react"
|
|
4
3
|
|
|
5
|
-
import { cn } from
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
6
5
|
|
|
7
|
-
const labelVariants = cva(
|
|
8
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
9
|
-
);
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
function Label({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
11
|
+
return (
|
|
12
|
+
<LabelPrimitive.Root
|
|
13
|
+
data-slot="label"
|
|
14
|
+
className={cn(
|
|
15
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
25
22
|
|
|
23
|
+
export { Label }
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
2
|
-
import {
|
|
3
|
-
import * as React from "react"
|
|
1
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
2
|
+
import { CircleIcon } from "lucide-react"
|
|
3
|
+
import * as React from "react"
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
|
|
8
|
+
function RadioGroup({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
11
12
|
return (
|
|
12
13
|
<RadioGroupPrimitive.Root
|
|
13
|
-
|
|
14
|
+
data-slot="radio-group"
|
|
15
|
+
className={cn("grid gap-3", className)}
|
|
14
16
|
{...props}
|
|
15
|
-
ref={ref}
|
|
16
17
|
/>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
function RadioGroupItem({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
25
25
|
return (
|
|
26
26
|
<RadioGroupPrimitive.Item
|
|
27
|
-
|
|
27
|
+
data-slot="radio-group-item"
|
|
28
28
|
className={cn(
|
|
29
|
-
"aspect-square
|
|
29
|
+
"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
30
30
|
className
|
|
31
31
|
)}
|
|
32
32
|
{...props}
|
|
33
33
|
>
|
|
34
|
-
<RadioGroupPrimitive.Indicator
|
|
35
|
-
|
|
34
|
+
<RadioGroupPrimitive.Indicator
|
|
35
|
+
data-slot="radio-group-indicator"
|
|
36
|
+
className="relative flex items-center justify-center"
|
|
37
|
+
>
|
|
38
|
+
<CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
|
|
36
39
|
</RadioGroupPrimitive.Indicator>
|
|
37
40
|
</RadioGroupPrimitive.Item>
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
41
|
-
|
|
42
|
-
export { RadioGroup, RadioGroupItem };
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
43
|
|
|
44
|
+
export { RadioGroup, RadioGroupItem }
|
|
@@ -1,142 +1,189 @@
|
|
|
1
|
-
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
2
|
-
import {
|
|
3
|
-
import * as React from "react"
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
2
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
3
|
+
import * as React from "react"
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function Select({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
10
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
11
|
+
}
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
function SelectGroup({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
16
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
17
|
+
}
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
function SelectValue({
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
22
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
23
|
+
}
|
|
12
24
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{children}
|
|
26
|
-
<SelectPrimitive.Icon asChild>
|
|
27
|
-
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
28
|
-
</SelectPrimitive.Icon>
|
|
29
|
-
</SelectPrimitive.Trigger>
|
|
30
|
-
));
|
|
31
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
32
|
-
|
|
33
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
34
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
35
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
36
|
-
>(({ className, ...props }, ref) => (
|
|
37
|
-
<SelectPrimitive.ScrollUpButton
|
|
38
|
-
ref={ref}
|
|
39
|
-
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
40
|
-
{...props}
|
|
41
|
-
>
|
|
42
|
-
<ChevronUp className="h-4 w-4" />
|
|
43
|
-
</SelectPrimitive.ScrollUpButton>
|
|
44
|
-
));
|
|
45
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
46
|
-
|
|
47
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
48
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
49
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
50
|
-
>(({ className, ...props }, ref) => (
|
|
51
|
-
<SelectPrimitive.ScrollDownButton
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
>
|
|
56
|
-
<ChevronDown className="h-4 w-4" />
|
|
57
|
-
</SelectPrimitive.ScrollDownButton>
|
|
58
|
-
));
|
|
59
|
-
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
60
|
-
|
|
61
|
-
const SelectContent = React.forwardRef<
|
|
62
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
63
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
64
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
65
|
-
<SelectPrimitive.Portal>
|
|
66
|
-
<SelectPrimitive.Content
|
|
67
|
-
ref={ref}
|
|
25
|
+
function SelectTrigger({
|
|
26
|
+
className,
|
|
27
|
+
size = "default",
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
31
|
+
size?: "sm" | "default"
|
|
32
|
+
}) {
|
|
33
|
+
return (
|
|
34
|
+
<SelectPrimitive.Trigger
|
|
35
|
+
data-slot="select-trigger"
|
|
36
|
+
data-size={size}
|
|
68
37
|
className={cn(
|
|
69
|
-
"
|
|
70
|
-
position === "popper" &&
|
|
71
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
38
|
+
"border-input data-placeholder:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
72
39
|
className
|
|
73
40
|
)}
|
|
74
|
-
position={position}
|
|
75
41
|
{...props}
|
|
76
42
|
>
|
|
77
|
-
|
|
78
|
-
<SelectPrimitive.
|
|
43
|
+
{children}
|
|
44
|
+
<SelectPrimitive.Icon asChild>
|
|
45
|
+
<ChevronDownIcon className="size-4 opacity-50" />
|
|
46
|
+
</SelectPrimitive.Icon>
|
|
47
|
+
</SelectPrimitive.Trigger>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function SelectContent({
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
position = "popper",
|
|
55
|
+
align = "center",
|
|
56
|
+
...props
|
|
57
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
58
|
+
return (
|
|
59
|
+
<SelectPrimitive.Portal>
|
|
60
|
+
<SelectPrimitive.Content
|
|
61
|
+
data-slot="select-content"
|
|
79
62
|
className={cn(
|
|
80
|
-
"
|
|
63
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
81
64
|
position === "popper" &&
|
|
82
|
-
"
|
|
65
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
66
|
+
className
|
|
83
67
|
)}
|
|
68
|
+
position={position}
|
|
69
|
+
align={align}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
<SelectScrollUpButton />
|
|
73
|
+
<SelectPrimitive.Viewport
|
|
74
|
+
className={cn(
|
|
75
|
+
"p-1",
|
|
76
|
+
position === "popper" &&
|
|
77
|
+
"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"
|
|
78
|
+
)}
|
|
79
|
+
>
|
|
80
|
+
{children}
|
|
81
|
+
</SelectPrimitive.Viewport>
|
|
82
|
+
<SelectScrollDownButton />
|
|
83
|
+
</SelectPrimitive.Content>
|
|
84
|
+
</SelectPrimitive.Portal>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function SelectLabel({
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
92
|
+
return (
|
|
93
|
+
<SelectPrimitive.Label
|
|
94
|
+
data-slot="select-label"
|
|
95
|
+
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function SelectItem({
|
|
102
|
+
className,
|
|
103
|
+
children,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
106
|
+
return (
|
|
107
|
+
<SelectPrimitive.Item
|
|
108
|
+
data-slot="select-item"
|
|
109
|
+
className={cn(
|
|
110
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
>
|
|
115
|
+
<span
|
|
116
|
+
data-slot="select-item-indicator"
|
|
117
|
+
className="absolute right-2 flex size-3.5 items-center justify-center"
|
|
84
118
|
>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
119
|
+
<SelectPrimitive.ItemIndicator>
|
|
120
|
+
<CheckIcon className="size-4" />
|
|
121
|
+
</SelectPrimitive.ItemIndicator>
|
|
122
|
+
</span>
|
|
123
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
124
|
+
</SelectPrimitive.Item>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
92
127
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
128
|
+
function SelectSeparator({
|
|
129
|
+
className,
|
|
130
|
+
...props
|
|
131
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
132
|
+
return (
|
|
133
|
+
<SelectPrimitive.Separator
|
|
134
|
+
data-slot="select-separator"
|
|
135
|
+
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
136
|
+
{...props}
|
|
137
|
+
/>
|
|
138
|
+
)
|
|
139
|
+
}
|
|
104
140
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
123
|
-
</SelectPrimitive.Item>
|
|
124
|
-
));
|
|
125
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
141
|
+
function SelectScrollUpButton({
|
|
142
|
+
className,
|
|
143
|
+
...props
|
|
144
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
145
|
+
return (
|
|
146
|
+
<SelectPrimitive.ScrollUpButton
|
|
147
|
+
data-slot="select-scroll-up-button"
|
|
148
|
+
className={cn(
|
|
149
|
+
"flex cursor-default items-center justify-center py-1",
|
|
150
|
+
className
|
|
151
|
+
)}
|
|
152
|
+
{...props}
|
|
153
|
+
>
|
|
154
|
+
<ChevronUpIcon className="size-4" />
|
|
155
|
+
</SelectPrimitive.ScrollUpButton>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
126
158
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
159
|
+
function SelectScrollDownButton({
|
|
160
|
+
className,
|
|
161
|
+
...props
|
|
162
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
163
|
+
return (
|
|
164
|
+
<SelectPrimitive.ScrollDownButton
|
|
165
|
+
data-slot="select-scroll-down-button"
|
|
166
|
+
className={cn(
|
|
167
|
+
"flex cursor-default items-center justify-center py-1",
|
|
168
|
+
className
|
|
169
|
+
)}
|
|
170
|
+
{...props}
|
|
171
|
+
>
|
|
172
|
+
<ChevronDownIcon className="size-4" />
|
|
173
|
+
</SelectPrimitive.ScrollDownButton>
|
|
174
|
+
)
|
|
175
|
+
}
|
|
138
176
|
|
|
139
177
|
export {
|
|
140
|
-
Select,
|
|
141
|
-
|
|
178
|
+
Select,
|
|
179
|
+
SelectContent,
|
|
180
|
+
SelectGroup,
|
|
181
|
+
SelectItem,
|
|
182
|
+
SelectLabel,
|
|
183
|
+
SelectScrollDownButton,
|
|
184
|
+
SelectScrollUpButton,
|
|
185
|
+
SelectSeparator,
|
|
186
|
+
SelectTrigger,
|
|
187
|
+
SelectValue
|
|
188
|
+
}
|
|
142
189
|
|