@modlin/ui 0.0.245 → 0.0.246
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/package.json +1 -1
- package/src/button.tsx +3 -3
- package/src/input.tsx +10 -11
- package/src/utils.ts +1 -2
- package/src/example.tsx +0 -30
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@modlin/ui",
|
|
4
4
|
"description": "A lightweight UI library built on the Suffix design system for consistent, fast, and elegant interfaces.",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.246",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
package/src/button.tsx
CHANGED
|
@@ -19,13 +19,13 @@ const size: Record<Size, string> = {
|
|
|
19
19
|
}
|
|
20
20
|
const variant: Record<Variant, string> = {
|
|
21
21
|
primary: "bg-primary disabled:bg-primary/60 hover:bg-primary/85 active:bg-primary/85 text-background",
|
|
22
|
-
secondary: "bg-secondary hover:bg-secondary/75",
|
|
22
|
+
secondary: "bg-secondary hover:bg-secondary/75 backdrop-blur-sm",
|
|
23
23
|
destructive: "bg-red hover:bg-red/85 text-white",
|
|
24
24
|
outline: cn(
|
|
25
|
-
"bg-background inset-ring inset-ring-border",
|
|
25
|
+
"bg-background/25 backdrop-blur-sm inset-ring inset-ring-border",
|
|
26
26
|
"hover:bg-secondary active:bg-secondary focus-visible:inset-ring-muted-foreground disabled:bg-background disabled:text-muted-foreground",
|
|
27
27
|
),
|
|
28
|
-
ghost: "hover:bg-secondary",
|
|
28
|
+
ghost: "hover:bg-secondary backdrop-blur-sm",
|
|
29
29
|
link: "text-primary hover:underline",
|
|
30
30
|
none: cn(),
|
|
31
31
|
// jnsa: "bg-(--purple) hover:bg-(--purple)/90 text-white",
|
package/src/input.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ChangeEvent, FocusEvent, HTMLInputAutoCompleteAttribute, InvalidEvent } from "react"
|
|
2
2
|
import type { Variant } from "./globals"
|
|
3
3
|
import { cn } from "./utils"
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ export const input_variant: Record<Variant, string> = {
|
|
|
16
16
|
),
|
|
17
17
|
secondary: cn(),
|
|
18
18
|
destructive: cn(
|
|
19
|
-
"bg-background",
|
|
19
|
+
"bg-background/25 backdrop-blur-sm",
|
|
20
20
|
"placeholder:text-muted-foreground disabled:text-disabled",
|
|
21
21
|
"inset-ring inset-ring-red/50 disabled:inset-ring-red/25 focus:inset-ring-red/75",
|
|
22
22
|
"focus:ring-4 focus:ring-red/10",
|
|
@@ -84,13 +84,12 @@ export interface InputProps {
|
|
|
84
84
|
onFocus?(event: FocusEvent<HTMLInputElement>): void
|
|
85
85
|
/** @android @ios @web */
|
|
86
86
|
onBlur?(event: BlurEvent): void
|
|
87
|
+
/** @web */
|
|
88
|
+
onInvalid?(event: InvalidEvent<HTMLInputElement>): void
|
|
87
89
|
}
|
|
88
|
-
const Input =
|
|
89
|
-
const { onChange } = props
|
|
90
|
-
|
|
90
|
+
const Input = (props: Readonly<InputProps>) => {
|
|
91
91
|
return (
|
|
92
92
|
<input
|
|
93
|
-
ref={ref}
|
|
94
93
|
type={props.type ?? "text"}
|
|
95
94
|
inputMode={props.inputMode}
|
|
96
95
|
placeholder={props.placeholder}
|
|
@@ -105,16 +104,16 @@ const Input = forwardRef<HTMLInputElement, Readonly<InputProps>>((props, ref) =>
|
|
|
105
104
|
required={props.required}
|
|
106
105
|
readOnly={props.readOnly}
|
|
107
106
|
disabled={props.disabled}
|
|
108
|
-
onChange={onChange}
|
|
109
|
-
onFocus={props.onFocus}
|
|
110
|
-
onBlur={props.onBlur}
|
|
111
|
-
onInvalid={e => e.preventDefault()}
|
|
112
107
|
id={props.id}
|
|
113
108
|
autoCapitalize={props.autoCapitalize}
|
|
114
109
|
autoComplete={props.autoComplete}
|
|
115
110
|
autoCorrect={props.autoCorrect ? "on" : "off"}
|
|
116
111
|
aria-describedby={props.describedby}
|
|
117
112
|
data-invalid={props.invalid}
|
|
113
|
+
onChange={props.onChange}
|
|
114
|
+
onFocus={props.onFocus}
|
|
115
|
+
onBlur={props.onBlur}
|
|
116
|
+
onInvalid={props.onInvalid}
|
|
118
117
|
className={cn(
|
|
119
118
|
"flex items-center w-full h-12 px-4",
|
|
120
119
|
"transition transition-duration-150 transition-[box-shadow] ease-in",
|
|
@@ -124,5 +123,5 @@ const Input = forwardRef<HTMLInputElement, Readonly<InputProps>>((props, ref) =>
|
|
|
124
123
|
)}
|
|
125
124
|
/>
|
|
126
125
|
)
|
|
127
|
-
}
|
|
126
|
+
}
|
|
128
127
|
export default Input
|
package/src/utils.ts
CHANGED
package/src/example.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Heading4 } from "./heading"
|
|
2
|
-
import Button from "./button"
|
|
3
|
-
import Input from "./input"
|
|
4
|
-
import Label from "./label"
|
|
5
|
-
import { Muted } from "./typography"
|
|
6
|
-
|
|
7
|
-
export function Example() {
|
|
8
|
-
return (
|
|
9
|
-
<div className="flex flex-1 flex-col gap-8 p-8 bg-background">
|
|
10
|
-
<header>
|
|
11
|
-
<Heading4 className="h-8">Login to your account</Heading4>
|
|
12
|
-
<Muted>Enter your email address below to login to your account</Muted>
|
|
13
|
-
</header>
|
|
14
|
-
<div className="flex flex-col gap-4">
|
|
15
|
-
<div className="flex flex-col gap-2">
|
|
16
|
-
<Label htmlFor="email">Email address</Label>
|
|
17
|
-
<Input placeholder="m@example.com" id="email" type="email" inputMode="email" autoComplete="email" autoCapitalize="none" />
|
|
18
|
-
</div>
|
|
19
|
-
<div className="flex flex-col gap-2">
|
|
20
|
-
<Label htmlFor="password">Password</Label>
|
|
21
|
-
<Input id="password" type="password" autoComplete="password" autoCapitalize="none" />
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<div className="flex flex-col gap-4">
|
|
25
|
-
<Button title="Login" haptics />
|
|
26
|
-
<Button variant="outline" title="Login with Google" haptics />
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
)
|
|
30
|
-
}
|