@neoptocom/neopto-ui 0.13.0 → 1.0.0
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/dist/index.cjs +11 -8
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +11 -8
- package/dist/styles.css +1 -0
- package/package.json +1 -1
- package/src/components/Card.tsx +5 -1
- package/src/components/Input.tsx +9 -8
- package/src/stories/Card.stories.tsx +58 -0
- package/src/stories/Input.stories.tsx +5 -5
- package/src/styles/tokens.css +1 -0
package/dist/index.cjs
CHANGED
|
@@ -153,6 +153,7 @@ function Card({
|
|
|
153
153
|
style,
|
|
154
154
|
showDecorations = false,
|
|
155
155
|
variant = "default",
|
|
156
|
+
elevated = false,
|
|
156
157
|
...props
|
|
157
158
|
}) {
|
|
158
159
|
const isAppBackground = variant === "app-background";
|
|
@@ -164,7 +165,8 @@ function Card({
|
|
|
164
165
|
// Safari support
|
|
165
166
|
color: "var(--fg)",
|
|
166
167
|
overflow: "hidden",
|
|
167
|
-
transition: "background-color 0.3s ease, color 0.3s ease",
|
|
168
|
+
transition: "background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease",
|
|
169
|
+
boxShadow: elevated ? "var(--shadow-elevated)" : void 0,
|
|
168
170
|
...style,
|
|
169
171
|
// Apply position: relative by default, but allow user override via style prop
|
|
170
172
|
position: style?.position || "relative"
|
|
@@ -262,22 +264,23 @@ function Card({
|
|
|
262
264
|
}
|
|
263
265
|
var Input = React2__namespace.forwardRef(
|
|
264
266
|
({ className, disabled, variant = "default", ...props }, ref) => {
|
|
265
|
-
const
|
|
267
|
+
const isInline = variant === "inline";
|
|
266
268
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
267
269
|
"input",
|
|
268
270
|
{
|
|
269
271
|
ref,
|
|
270
272
|
disabled,
|
|
271
273
|
className: [
|
|
272
|
-
"w-full
|
|
274
|
+
"w-full bg-transparent outline-none transition-colors",
|
|
275
|
+
isInline ? "" : "h-12 px-4 rounded-full",
|
|
273
276
|
"text-sm placeholder:text-[var(--muted-fg)]",
|
|
274
|
-
!
|
|
275
|
-
disabled ? "text-[#3F424F] cursor-not-allowed" + (
|
|
277
|
+
!isInline && "border",
|
|
278
|
+
disabled ? "text-[#3F424F] cursor-not-allowed" + (isInline ? "" : " border-[#3F424F]") : [
|
|
276
279
|
"text-[var(--muted-fg)]",
|
|
277
|
-
|
|
278
|
-
|
|
280
|
+
isInline ? "" : "border-[var(--muted-fg)]",
|
|
281
|
+
isInline ? "" : "hover:border-[var(--border)]",
|
|
279
282
|
"focus:text-[var(--fg)]",
|
|
280
|
-
|
|
283
|
+
isInline ? "" : "focus:border-[var(--color-brand)]"
|
|
281
284
|
].join(" "),
|
|
282
285
|
className
|
|
283
286
|
].join(" "),
|
package/dist/index.d.cts
CHANGED
|
@@ -49,16 +49,18 @@ type CardProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
49
49
|
showDecorations?: boolean;
|
|
50
50
|
/** Card variant (default: "default") */
|
|
51
51
|
variant?: "default" | "app-background";
|
|
52
|
+
/** Apply elevated shadow effect (default: false) */
|
|
53
|
+
elevated?: boolean;
|
|
52
54
|
};
|
|
53
|
-
declare function Card({ children, className, style, showDecorations, variant, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare function Card({ children, className, style, showDecorations, variant, elevated, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
54
56
|
|
|
55
57
|
type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> & {
|
|
56
58
|
/** Input visual variant */
|
|
57
|
-
variant?: "default" | "
|
|
59
|
+
variant?: "default" | "inline";
|
|
58
60
|
};
|
|
59
61
|
declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
60
62
|
/** Input visual variant */
|
|
61
|
-
variant?: "default" | "
|
|
63
|
+
variant?: "default" | "inline";
|
|
62
64
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
63
65
|
|
|
64
66
|
type ModalProps = {
|
package/dist/index.d.ts
CHANGED
|
@@ -49,16 +49,18 @@ type CardProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
49
49
|
showDecorations?: boolean;
|
|
50
50
|
/** Card variant (default: "default") */
|
|
51
51
|
variant?: "default" | "app-background";
|
|
52
|
+
/** Apply elevated shadow effect (default: false) */
|
|
53
|
+
elevated?: boolean;
|
|
52
54
|
};
|
|
53
|
-
declare function Card({ children, className, style, showDecorations, variant, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare function Card({ children, className, style, showDecorations, variant, elevated, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
54
56
|
|
|
55
57
|
type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> & {
|
|
56
58
|
/** Input visual variant */
|
|
57
|
-
variant?: "default" | "
|
|
59
|
+
variant?: "default" | "inline";
|
|
58
60
|
};
|
|
59
61
|
declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
60
62
|
/** Input visual variant */
|
|
61
|
-
variant?: "default" | "
|
|
63
|
+
variant?: "default" | "inline";
|
|
62
64
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
63
65
|
|
|
64
66
|
type ModalProps = {
|
package/dist/index.js
CHANGED
|
@@ -132,6 +132,7 @@ function Card({
|
|
|
132
132
|
style,
|
|
133
133
|
showDecorations = false,
|
|
134
134
|
variant = "default",
|
|
135
|
+
elevated = false,
|
|
135
136
|
...props
|
|
136
137
|
}) {
|
|
137
138
|
const isAppBackground = variant === "app-background";
|
|
@@ -143,7 +144,8 @@ function Card({
|
|
|
143
144
|
// Safari support
|
|
144
145
|
color: "var(--fg)",
|
|
145
146
|
overflow: "hidden",
|
|
146
|
-
transition: "background-color 0.3s ease, color 0.3s ease",
|
|
147
|
+
transition: "background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease",
|
|
148
|
+
boxShadow: elevated ? "var(--shadow-elevated)" : void 0,
|
|
147
149
|
...style,
|
|
148
150
|
// Apply position: relative by default, but allow user override via style prop
|
|
149
151
|
position: style?.position || "relative"
|
|
@@ -241,22 +243,23 @@ function Card({
|
|
|
241
243
|
}
|
|
242
244
|
var Input = React2.forwardRef(
|
|
243
245
|
({ className, disabled, variant = "default", ...props }, ref) => {
|
|
244
|
-
const
|
|
246
|
+
const isInline = variant === "inline";
|
|
245
247
|
return /* @__PURE__ */ jsx(
|
|
246
248
|
"input",
|
|
247
249
|
{
|
|
248
250
|
ref,
|
|
249
251
|
disabled,
|
|
250
252
|
className: [
|
|
251
|
-
"w-full
|
|
253
|
+
"w-full bg-transparent outline-none transition-colors",
|
|
254
|
+
isInline ? "" : "h-12 px-4 rounded-full",
|
|
252
255
|
"text-sm placeholder:text-[var(--muted-fg)]",
|
|
253
|
-
!
|
|
254
|
-
disabled ? "text-[#3F424F] cursor-not-allowed" + (
|
|
256
|
+
!isInline && "border",
|
|
257
|
+
disabled ? "text-[#3F424F] cursor-not-allowed" + (isInline ? "" : " border-[#3F424F]") : [
|
|
255
258
|
"text-[var(--muted-fg)]",
|
|
256
|
-
|
|
257
|
-
|
|
259
|
+
isInline ? "" : "border-[var(--muted-fg)]",
|
|
260
|
+
isInline ? "" : "hover:border-[var(--border)]",
|
|
258
261
|
"focus:text-[var(--fg)]",
|
|
259
|
-
|
|
262
|
+
isInline ? "" : "focus:border-[var(--color-brand)]"
|
|
260
263
|
].join(" "),
|
|
261
264
|
className
|
|
262
265
|
].join(" "),
|
package/dist/styles.css
CHANGED
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
/* Shadows */
|
|
61
61
|
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
62
62
|
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
|
|
63
|
+
--shadow-elevated: 0 4px 4px 0 rgba(0, 0, 0, 0.25), 2px 2px 24px 0 rgba(0, 0, 0, 0.10);
|
|
63
64
|
|
|
64
65
|
/* Motion */
|
|
65
66
|
--motion-fast: 150ms;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neoptocom/neopto-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A modern React component library built with Tailwind CSS v4 and TypeScript. Features dark mode, design tokens, and comprehensive Storybook documentation. Requires Tailwind v4+.",
|
|
6
6
|
"keywords": [
|
package/src/components/Card.tsx
CHANGED
|
@@ -10,6 +10,8 @@ export type CardProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
10
10
|
showDecorations?: boolean;
|
|
11
11
|
/** Card variant (default: "default") */
|
|
12
12
|
variant?: "default" | "app-background";
|
|
13
|
+
/** Apply elevated shadow effect (default: false) */
|
|
14
|
+
elevated?: boolean;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export function Card({
|
|
@@ -18,6 +20,7 @@ export function Card({
|
|
|
18
20
|
style,
|
|
19
21
|
showDecorations = false,
|
|
20
22
|
variant = "default",
|
|
23
|
+
elevated = false,
|
|
21
24
|
...props
|
|
22
25
|
}: CardProps) {
|
|
23
26
|
const isAppBackground = variant === "app-background";
|
|
@@ -32,7 +35,8 @@ export function Card({
|
|
|
32
35
|
WebkitBackdropFilter: isAppBackground ? undefined : "blur(75px)", // Safari support
|
|
33
36
|
color: "var(--fg)",
|
|
34
37
|
overflow: "hidden",
|
|
35
|
-
transition: "background-color 0.3s ease, color 0.3s ease",
|
|
38
|
+
transition: "background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease",
|
|
39
|
+
boxShadow: elevated ? "var(--shadow-elevated)" : undefined,
|
|
36
40
|
...style,
|
|
37
41
|
// Apply position: relative by default, but allow user override via style prop
|
|
38
42
|
position: style?.position || "relative",
|
package/src/components/Input.tsx
CHANGED
|
@@ -2,29 +2,30 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
export type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> & {
|
|
4
4
|
/** Input visual variant */
|
|
5
|
-
variant?: "default" | "
|
|
5
|
+
variant?: "default" | "inline";
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
9
9
|
({ className, disabled, variant = "default", ...props }, ref) => {
|
|
10
|
-
const
|
|
10
|
+
const isInline = variant === "inline";
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<input
|
|
14
14
|
ref={ref}
|
|
15
15
|
disabled={disabled}
|
|
16
16
|
className={[
|
|
17
|
-
"w-full
|
|
17
|
+
"w-full bg-transparent outline-none transition-colors",
|
|
18
|
+
isInline ? "" : "h-12 px-4 rounded-full",
|
|
18
19
|
"text-sm placeholder:text-[var(--muted-fg)]",
|
|
19
|
-
!
|
|
20
|
+
!isInline && "border",
|
|
20
21
|
disabled
|
|
21
|
-
? "text-[#3F424F] cursor-not-allowed" + (
|
|
22
|
+
? "text-[#3F424F] cursor-not-allowed" + (isInline ? "" : " border-[#3F424F]")
|
|
22
23
|
: [
|
|
23
24
|
"text-[var(--muted-fg)]",
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
isInline ? "" : "border-[var(--muted-fg)]",
|
|
26
|
+
isInline ? "" : "hover:border-[var(--border)]",
|
|
26
27
|
"focus:text-[var(--fg)]",
|
|
27
|
-
|
|
28
|
+
isInline ? "" : "focus:border-[var(--color-brand)]"
|
|
28
29
|
].join(" "),
|
|
29
30
|
className
|
|
30
31
|
].join(" ")}
|
|
@@ -82,6 +82,64 @@ export const AppBackgroundLarge: Story = {
|
|
|
82
82
|
),
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
export const Elevated: Story = {
|
|
86
|
+
render: () => (
|
|
87
|
+
<div className="max-w-md">
|
|
88
|
+
<Card elevated>
|
|
89
|
+
<Typo variant="headline-sm" bold="semibold">Elevated Card</Typo>
|
|
90
|
+
<Typo variant="body-md" className="mt-2">
|
|
91
|
+
This card uses the elevated shadow effect for a floating appearance.
|
|
92
|
+
</Typo>
|
|
93
|
+
<div className="mt-4">
|
|
94
|
+
<Button variant="primary">Take Action</Button>
|
|
95
|
+
</div>
|
|
96
|
+
</Card>
|
|
97
|
+
</div>
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const ElevatedComparison: Story = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<div className="grid grid-cols-2 gap-6 max-w-4xl">
|
|
104
|
+
<div>
|
|
105
|
+
<Typo variant="label-lg" bold="semibold" className="mb-3">Default</Typo>
|
|
106
|
+
<Card>
|
|
107
|
+
<Typo variant="title-md" bold="semibold">Regular Card</Typo>
|
|
108
|
+
<Typo variant="body-sm" className="mt-2">
|
|
109
|
+
Standard card with glassmorphic effect, no shadow.
|
|
110
|
+
</Typo>
|
|
111
|
+
</Card>
|
|
112
|
+
</div>
|
|
113
|
+
<div>
|
|
114
|
+
<Typo variant="label-lg" bold="semibold" className="mb-3">Elevated</Typo>
|
|
115
|
+
<Card elevated>
|
|
116
|
+
<Typo variant="title-md" bold="semibold">Elevated Card</Typo>
|
|
117
|
+
<Typo variant="body-sm" className="mt-2">
|
|
118
|
+
Enhanced with elevated shadow for emphasis.
|
|
119
|
+
</Typo>
|
|
120
|
+
</Card>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
),
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const ElevatedAppBackground: Story = {
|
|
127
|
+
render: () => (
|
|
128
|
+
<div className="max-w-md">
|
|
129
|
+
<Card variant="app-background" elevated className="p-8">
|
|
130
|
+
<Typo variant="headline-sm" bold="semibold">Elevated + App Background</Typo>
|
|
131
|
+
<Typo variant="body-md" className="mt-3">
|
|
132
|
+
Combining the app-background variant with elevated shadow creates a stunning effect.
|
|
133
|
+
</Typo>
|
|
134
|
+
<div className="mt-6 flex gap-3">
|
|
135
|
+
<Button variant="primary">Primary</Button>
|
|
136
|
+
<Button variant="secondary">Secondary</Button>
|
|
137
|
+
</div>
|
|
138
|
+
</Card>
|
|
139
|
+
</div>
|
|
140
|
+
),
|
|
141
|
+
};
|
|
142
|
+
|
|
85
143
|
export const CustomPadding: Story = {
|
|
86
144
|
render: () => (
|
|
87
145
|
<div className="max-w-md space-y-4">
|
|
@@ -37,13 +37,13 @@ export const Types: Story = {
|
|
|
37
37
|
)
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export const
|
|
40
|
+
export const Inline: Story = {
|
|
41
41
|
render: () => (
|
|
42
42
|
<div className="flex flex-col gap-4 w-96">
|
|
43
|
-
<Input variant="
|
|
44
|
-
<Input variant="
|
|
45
|
-
<Input variant="
|
|
46
|
-
<Input variant="
|
|
43
|
+
<Input variant="inline" placeholder="Inline input" type="text" />
|
|
44
|
+
<Input variant="inline" placeholder="Inline email" type="email" />
|
|
45
|
+
<Input variant="inline" placeholder="Inline search..." />
|
|
46
|
+
<Input variant="inline" placeholder="Disabled inline" disabled />
|
|
47
47
|
</div>
|
|
48
48
|
)
|
|
49
49
|
};
|
package/src/styles/tokens.css
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
/* Shadows */
|
|
45
45
|
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
46
46
|
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
|
|
47
|
+
--shadow-elevated: 0 4px 4px 0 rgba(0, 0, 0, 0.25), 2px 2px 24px 0 rgba(0, 0, 0, 0.10);
|
|
47
48
|
|
|
48
49
|
/* Motion */
|
|
49
50
|
--motion-fast: 150ms;
|