@neoptocom/neopto-ui 0.4.0 → 0.5.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/CONSUMER_SETUP.md +55 -36
- package/README.md +25 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -1
- package/scripts/init.mjs +200 -0
- package/src/assets/agent-neopto-dark.svg +9 -0
- package/src/assets/agent-neopto.svg +9 -0
- package/src/components/Autocomplete.tsx +279 -0
- package/src/components/Avatar.tsx +83 -0
- package/src/components/AvatarGroup.tsx +53 -0
- package/src/components/Button.tsx +51 -0
- package/src/components/Chat/AnimatedBgCircle.tsx +51 -0
- package/src/components/Chat/AnimatedBgRectangle.tsx +55 -0
- package/src/components/Chat/ChatButton.tsx +132 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/Chip.tsx +38 -0
- package/src/components/Counter.tsx +69 -0
- package/src/components/Icon.tsx +48 -0
- package/src/components/IconButton.tsx +89 -0
- package/src/components/Input.tsx +29 -0
- package/src/components/Modal.tsx +83 -0
- package/src/components/Search.tsx +244 -0
- package/src/components/Skeleton.tsx +29 -0
- package/src/components/Typo.tsx +93 -0
- package/src/index.ts +31 -0
- package/src/stories/Autocomplete.stories.tsx +41 -0
- package/src/stories/Avatar.stories.tsx +38 -0
- package/src/stories/AvatarGroup.stories.tsx +46 -0
- package/src/stories/Button.stories.tsx +103 -0
- package/src/stories/ChatButton.stories.tsx +94 -0
- package/src/stories/Chip.stories.tsx +36 -0
- package/src/stories/Counter.stories.tsx +35 -0
- package/src/stories/Icon.stories.tsx +34 -0
- package/src/stories/IconButton.stories.tsx +116 -0
- package/src/stories/Input.stories.tsx +38 -0
- package/src/stories/Search.stories.tsx +228 -0
- package/src/stories/Skeleton.stories.tsx +43 -0
- package/src/stories/Typo.stories.tsx +66 -0
- package/src/styles/library.css +35 -0
- package/src/styles/tailwind.css +36 -0
- package/src/styles/tokens.css +72 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Typo, { type TypoVariant, type TypoWeight } from "../components/Typo";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Typo> = {
|
|
5
|
+
title: "Components/Typo",
|
|
6
|
+
component: Typo,
|
|
7
|
+
args: {
|
|
8
|
+
children: "The quick brown fox jumps over the lazy dog",
|
|
9
|
+
variant: "body-md" as TypoVariant,
|
|
10
|
+
bold: "normal" as TypoWeight,
|
|
11
|
+
muted: false
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
variant: {
|
|
15
|
+
control: "select",
|
|
16
|
+
options: [
|
|
17
|
+
"display-lg","display-md","display-sm",
|
|
18
|
+
"headline-lg","headline-md","headline-sm",
|
|
19
|
+
"title-lg","title-md","title-sm",
|
|
20
|
+
"label-lg","label-md","label-sm",
|
|
21
|
+
"body-lg","body-md","body-sm",
|
|
22
|
+
"button"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
bold: {
|
|
26
|
+
control: "radio",
|
|
27
|
+
options: ["normal","medium","semibold","bold"]
|
|
28
|
+
},
|
|
29
|
+
muted: { control: "boolean" },
|
|
30
|
+
as: { control: false }
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export default meta;
|
|
34
|
+
type Story = StoryObj<typeof Typo>;
|
|
35
|
+
|
|
36
|
+
export const Playground: Story = {};
|
|
37
|
+
|
|
38
|
+
export const Matrix: Story = {
|
|
39
|
+
render: () => {
|
|
40
|
+
const variants: TypoVariant[] = [
|
|
41
|
+
"display-lg","display-md","display-sm",
|
|
42
|
+
"headline-lg","headline-md","headline-sm",
|
|
43
|
+
"title-lg","title-md","title-sm",
|
|
44
|
+
"label-lg","label-md","label-sm",
|
|
45
|
+
"body-lg","body-md","body-sm",
|
|
46
|
+
"button"
|
|
47
|
+
];
|
|
48
|
+
const weights: TypoWeight[] = ["normal","medium","semibold","bold"];
|
|
49
|
+
return (
|
|
50
|
+
<div className="grid grid-cols-1 gap-4">
|
|
51
|
+
{variants.map(v => (
|
|
52
|
+
<div key={v} className="flex flex-col gap-1">
|
|
53
|
+
<div className="text-sm">{v}</div>
|
|
54
|
+
<div className="flex flex-wrap gap-6">
|
|
55
|
+
{weights.map(w => (
|
|
56
|
+
<Typo key={w} variant={v} bold={w}>
|
|
57
|
+
The quick brown fox — {w}
|
|
58
|
+
</Typo>
|
|
59
|
+
))}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
))}
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* Build-only CSS for publishing the lib (no Preflight/reset) */
|
|
2
|
+
@import "tailwindcss/utilities";
|
|
3
|
+
@import "./tokens.css";
|
|
4
|
+
|
|
5
|
+
/* Scan only your library sources to keep the CSS tiny */
|
|
6
|
+
@source "../components/**/*.{ts,tsx}";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/* Material Symbols Font */
|
|
10
|
+
@font-face {
|
|
11
|
+
font-family: 'Material Symbols Rounded';
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 100 700;
|
|
14
|
+
src: url(https://fonts.gstatic.com/s/materialsymbolsrounded/v272/sykg-zNym6YjUruM-QrEh7-nyTnjDwKNJ_190FjzaqkNCeE.woff2) format('woff2');
|
|
15
|
+
font-display: swap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.material-symbols-rounded {
|
|
19
|
+
font-family: 'Material Symbols Rounded';
|
|
20
|
+
font-style: normal;
|
|
21
|
+
font-weight: 300;
|
|
22
|
+
font-size: 24px;
|
|
23
|
+
line-height: 1;
|
|
24
|
+
letter-spacing: normal;
|
|
25
|
+
text-transform: none;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
vertical-align: middle;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
-webkit-font-smoothing: antialiased;
|
|
30
|
+
color: inherit;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.btn { @apply inline-flex items-center justify-center gap-2 rounded-[--radius-lg] px-4 py-2 text-sm font-medium transition; }
|
|
34
|
+
.btn-outline { @apply border border-[--color-brand] text-[--color-brand] bg-[--surface] hover:bg-[--color-brand]/10; }
|
|
35
|
+
.btn-primary { @apply bg-[--color-brand] text-white hover:opacity-90 active:opacity-80; }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* Tailwind v4+ core */
|
|
2
|
+
@import "tailwindcss";
|
|
3
|
+
@import "./tokens.css";
|
|
4
|
+
|
|
5
|
+
/* Ensure Tailwind scans your source & story files */
|
|
6
|
+
@source "../**/*.{ts,tsx,mdx}";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/* Material Symbols Font */
|
|
10
|
+
@font-face {
|
|
11
|
+
font-family: 'Material Symbols Rounded';
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 100 700;
|
|
14
|
+
src: url(https://fonts.gstatic.com/s/materialsymbolsrounded/v272/sykg-zNym6YjUruM-QrEh7-nyTnjDwKNJ_190FjzaqkNCeE.woff2) format('woff2');
|
|
15
|
+
font-display: swap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.material-symbols-rounded {
|
|
19
|
+
font-family: 'Material Symbols Rounded';
|
|
20
|
+
font-style: normal;
|
|
21
|
+
font-weight: 300;
|
|
22
|
+
font-size: 24px;
|
|
23
|
+
line-height: 1;
|
|
24
|
+
letter-spacing: normal;
|
|
25
|
+
text-transform: none;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
vertical-align: middle;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
-webkit-font-smoothing: antialiased;
|
|
30
|
+
color: inherit;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Optional shared utility classes used by some components */
|
|
34
|
+
.btn { @apply inline-flex items-center justify-center gap-2 rounded-[--radius-lg] px-4 py-2 text-sm font-medium transition; }
|
|
35
|
+
.btn-primary { @apply bg-[--color-brand] text-white hover:opacity-90 active:opacity-80; }
|
|
36
|
+
.btn-outline { @apply border border-[--color-brand] text-[--color-brand] bg-[--surface] hover:bg-[--color-brand]/10; }
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* Design Tokens - Manually maintained */
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--font-display: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
|
|
5
|
+
--font-body: 'Roboto', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
|
|
6
|
+
--font-sans: var(--font-body, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif);
|
|
7
|
+
--color-brand: #22A9CB;
|
|
8
|
+
--radius-sm: 0.25rem;
|
|
9
|
+
--radius-md: 0.375rem;
|
|
10
|
+
--radius-lg: 0.5rem;
|
|
11
|
+
--radius-xl: 0.75rem;
|
|
12
|
+
--radius-2xl: 1.875rem;
|
|
13
|
+
--bg: #F3F4F6;
|
|
14
|
+
--surface: #FFFFFF;
|
|
15
|
+
--fg: #242832;
|
|
16
|
+
--muted: #E5E7EB;
|
|
17
|
+
--muted-fg: #6B7280;
|
|
18
|
+
--border: #E5E7EB;
|
|
19
|
+
--success: #13B59F;
|
|
20
|
+
--warning: #D79C2C;
|
|
21
|
+
--destructive: #E03737;
|
|
22
|
+
--info: #0E91B2;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:root {
|
|
26
|
+
--font-display: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
|
|
27
|
+
--font-body: 'Roboto', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
|
|
28
|
+
--font-sans: var(--font-body, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif);
|
|
29
|
+
--color-brand: #22A9CB;
|
|
30
|
+
--radius-sm: 0.25rem;
|
|
31
|
+
--radius-md: 0.375rem;
|
|
32
|
+
--radius-lg: 0.5rem;
|
|
33
|
+
--radius-xl: 0.75rem;
|
|
34
|
+
--radius-2xl: 1.875rem;
|
|
35
|
+
--bg: #F3F4F6;
|
|
36
|
+
--surface: #FFFFFF;
|
|
37
|
+
--fg: #242832;
|
|
38
|
+
--muted: #E5E7EB;
|
|
39
|
+
--muted-fg: #6B7280;
|
|
40
|
+
--border: #E5E7EB;
|
|
41
|
+
--success: #13B59F;
|
|
42
|
+
--warning: #D79C2C;
|
|
43
|
+
--destructive: #E03737;
|
|
44
|
+
--info: #0E91B2;
|
|
45
|
+
|
|
46
|
+
/* Shadows */
|
|
47
|
+
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
48
|
+
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
|
|
49
|
+
|
|
50
|
+
/* Motion */
|
|
51
|
+
--motion-fast: 150ms;
|
|
52
|
+
--motion-base: 200ms;
|
|
53
|
+
--easing-standard: cubic-bezier(0.2, 0.0, 0, 1);
|
|
54
|
+
|
|
55
|
+
/* Component-specific */
|
|
56
|
+
--chat-button-gradient: linear-gradient(to bottom, #FFF, #D4D4D4);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.dark {
|
|
60
|
+
color-scheme: dark;
|
|
61
|
+
--bg: #242832;
|
|
62
|
+
--surface: #2E303B;
|
|
63
|
+
--fg: #E4E7EC;
|
|
64
|
+
--muted: #3F424F;
|
|
65
|
+
--muted-fg: #9D9EA2;
|
|
66
|
+
--border: #5C5E68;
|
|
67
|
+
--success: #00C8AC;
|
|
68
|
+
--warning: #CEB25E;
|
|
69
|
+
--destructive: #CE645E;
|
|
70
|
+
--info: #5ABDCC;
|
|
71
|
+
--chat-button-gradient: linear-gradient(to bottom, #1A3645, #040404);
|
|
72
|
+
}
|