@nebutra/ui 0.2.2 → 2.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.
Files changed (43) hide show
  1. package/dist/animate-in-BlvjVh2S.d.ts +250 -0
  2. package/dist/{canonical-CrO71UPO.d.ts → canonical-Bf4czR2u.d.ts} +225 -211
  3. package/dist/chat/index.d.ts +1 -0
  4. package/dist/chat/index.js +3 -0
  5. package/dist/chat/index.js.map +1 -0
  6. package/dist/components/index.d.ts +58 -123
  7. package/dist/components/index.js +504 -203
  8. package/dist/components/index.js.map +1 -1
  9. package/dist/editorial/index.d.ts +404 -0
  10. package/dist/editorial/index.js +868 -0
  11. package/dist/editorial/index.js.map +1 -0
  12. package/dist/icons/index.d.ts +1 -0
  13. package/dist/layout/index.d.ts +2 -2
  14. package/dist/layout/index.js +116 -26
  15. package/dist/layout/index.js.map +1 -1
  16. package/dist/layouts/index.d.ts +80 -2
  17. package/dist/layouts/index.js +13 -11
  18. package/dist/layouts/index.js.map +1 -1
  19. package/dist/patterns/index.d.ts +4 -5
  20. package/dist/patterns/index.js +221 -106
  21. package/dist/patterns/index.js.map +1 -1
  22. package/dist/primitives/canonical.d.ts +4 -3
  23. package/dist/primitives/canonical.js +609 -197
  24. package/dist/primitives/canonical.js.map +1 -1
  25. package/dist/primitives/index.d.ts +213 -21
  26. package/dist/primitives/index.js +2209 -1317
  27. package/dist/primitives/index.js.map +1 -1
  28. package/dist/tailwind.preset.d.ts +2 -2
  29. package/dist/tailwind.preset.js +1 -1
  30. package/dist/tailwind.preset.js.map +1 -1
  31. package/dist/typography/fonts.css +21 -26
  32. package/dist/typography/index.d.ts +4 -4
  33. package/dist/typography/index.js +1 -1
  34. package/dist/typography/index.js.map +1 -1
  35. package/dist/utils/auth-surfaces.d.ts +33 -0
  36. package/dist/utils/auth-surfaces.js +9 -0
  37. package/dist/utils/auth-surfaces.js.map +1 -0
  38. package/dist/utils/index.d.ts +33 -5
  39. package/dist/utils/index.js +15 -3
  40. package/dist/utils/index.js.map +1 -1
  41. package/package.json +43 -9
  42. package/src/styles/sources.css +10 -0
  43. package/src/typography/fonts.css +21 -26
@@ -0,0 +1,250 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as framer_motion from 'framer-motion';
3
+ import * as React from 'react';
4
+
5
+ declare const PRESETS: {
6
+ /** 涌现 — materialize from the cloud (default) */
7
+ readonly emerge: {
8
+ readonly initial: {
9
+ readonly opacity: 0;
10
+ readonly transform: "translateY(16px)";
11
+ readonly filter: "blur(6px)";
12
+ };
13
+ readonly animate: {
14
+ readonly opacity: 1;
15
+ readonly transform: "translateY(0px)";
16
+ readonly filter: "blur(0px)";
17
+ };
18
+ readonly exit: {
19
+ readonly opacity: 0;
20
+ readonly transform: "translateY(-8px)";
21
+ readonly filter: "blur(4px)";
22
+ readonly transition: {
23
+ readonly duration: 0.2;
24
+ readonly ease: readonly [0.16, 1, 0.3, 1];
25
+ };
26
+ };
27
+ readonly transition: {
28
+ readonly duration: 0.5;
29
+ readonly ease: readonly [0.16, 1, 0.3, 1];
30
+ };
31
+ };
32
+ /** 流动 — stream horizontally */
33
+ readonly flow: {
34
+ readonly initial: {
35
+ readonly opacity: 0;
36
+ readonly transform: "translateX(-20px)";
37
+ };
38
+ readonly animate: {
39
+ readonly opacity: 1;
40
+ readonly transform: "translateX(0px)";
41
+ };
42
+ readonly exit: {
43
+ readonly opacity: 0;
44
+ readonly transform: "translateX(20px)";
45
+ readonly transition: {
46
+ readonly duration: 0.2;
47
+ readonly ease: readonly [0.16, 1, 0.3, 1];
48
+ };
49
+ };
50
+ readonly transition: {
51
+ readonly duration: 0.3;
52
+ readonly ease: readonly [0.16, 1, 0.3, 1];
53
+ };
54
+ };
55
+ /** Simple fade */
56
+ readonly fade: {
57
+ readonly initial: {
58
+ readonly opacity: 0;
59
+ };
60
+ readonly animate: {
61
+ readonly opacity: 1;
62
+ };
63
+ readonly exit: {
64
+ readonly opacity: 0;
65
+ };
66
+ readonly transition: {
67
+ readonly duration: 0.3;
68
+ };
69
+ };
70
+ /** Fade + rise */
71
+ readonly fadeUp: framer_motion.Variants | undefined;
72
+ /** Scale in */
73
+ readonly scale: framer_motion.Variants | undefined;
74
+ /**
75
+ * Keyed content swap — short, symmetric, blur-softened. Rises in, sinks out.
76
+ * Shorter and shallower than `emerge` on purpose: a swap replaces content the
77
+ * reader is already looking at, so it must resolve inside the reveal rail.
78
+ * Pair with `AnimateSwap`.
79
+ */
80
+ readonly swap: {
81
+ readonly initial: {
82
+ readonly opacity: 0;
83
+ readonly transform: "translateY(10px)";
84
+ readonly filter: "blur(4px)";
85
+ };
86
+ readonly animate: {
87
+ readonly opacity: 1;
88
+ readonly transform: "translateY(0px)";
89
+ readonly filter: "blur(0px)";
90
+ };
91
+ readonly exit: {
92
+ readonly opacity: 0;
93
+ readonly transform: "translateY(-10px)";
94
+ readonly filter: "blur(4px)";
95
+ };
96
+ readonly transition: {
97
+ readonly duration: number;
98
+ };
99
+ };
100
+ /** Off-canvas panel entering from the right edge (drawer, sheet). */
101
+ readonly slideFromRight: {
102
+ readonly initial: {
103
+ readonly transform: "translateX(100%)";
104
+ };
105
+ readonly animate: {
106
+ readonly transform: "translateX(0%)";
107
+ };
108
+ readonly exit: {
109
+ readonly transform: "translateX(100%)";
110
+ };
111
+ readonly transition: {
112
+ readonly type: "spring";
113
+ readonly stiffness: 200;
114
+ readonly damping: 24;
115
+ readonly mass: 1;
116
+ };
117
+ };
118
+ /** Off-canvas panel entering from the left edge. */
119
+ readonly slideFromLeft: {
120
+ readonly initial: {
121
+ readonly transform: "translateX(-100%)";
122
+ };
123
+ readonly animate: {
124
+ readonly transform: "translateX(0%)";
125
+ };
126
+ readonly exit: {
127
+ readonly transform: "translateX(-100%)";
128
+ };
129
+ readonly transition: {
130
+ readonly type: "spring";
131
+ readonly stiffness: 200;
132
+ readonly damping: 24;
133
+ readonly mass: 1;
134
+ };
135
+ };
136
+ /** Off-canvas panel entering from the top edge (banner, command bar). */
137
+ readonly slideFromTop: {
138
+ readonly initial: {
139
+ readonly transform: "translateY(-100%)";
140
+ };
141
+ readonly animate: {
142
+ readonly transform: "translateY(0%)";
143
+ };
144
+ readonly exit: {
145
+ readonly transform: "translateY(-100%)";
146
+ };
147
+ readonly transition: {
148
+ readonly type: "spring";
149
+ readonly stiffness: 200;
150
+ readonly damping: 24;
151
+ readonly mass: 1;
152
+ };
153
+ };
154
+ /** Off-canvas panel entering from the bottom edge (mobile action sheet). */
155
+ readonly slideFromBottom: {
156
+ readonly initial: {
157
+ readonly transform: "translateY(100%)";
158
+ };
159
+ readonly animate: {
160
+ readonly transform: "translateY(0%)";
161
+ };
162
+ readonly exit: {
163
+ readonly transform: "translateY(100%)";
164
+ };
165
+ readonly transition: {
166
+ readonly type: "spring";
167
+ readonly stiffness: 200;
168
+ readonly damping: 24;
169
+ readonly mass: 1;
170
+ };
171
+ };
172
+ };
173
+ type Preset = keyof typeof PRESETS;
174
+ /**
175
+ * DOM attributes forwarded to the underlying element.
176
+ *
177
+ * Without this, anything needing `role`, `aria-*`, `onClick` or `onKeyDown` —
178
+ * every dialog, drawer and tabpanel — has to drop out of `AnimateIn` and
179
+ * hand-roll its own `m.div`, which is how reduced-motion branching and raw
180
+ * duration numbers keep reappearing at call sites.
181
+ *
182
+ * The four drag/animation handlers are omitted because framer-motion redefines
183
+ * them with incompatible signatures. `style` is omitted because framer's
184
+ * `MotionStyle` rejects `undefined` under `exactOptionalPropertyTypes`, and an
185
+ * animated element's static styling belongs in `className` anyway.
186
+ */
187
+ type ForwardedDivProps = Omit<React.ComponentPropsWithoutRef<"div">, "children" | "className" | "style" | "onAnimationStart" | "onDrag" | "onDragStart" | "onDragEnd">;
188
+ interface AnimateInProps extends ForwardedDivProps {
189
+ /** Optional: a purely decorative animated surface (a backdrop) has no content. */
190
+ children?: React.ReactNode;
191
+ preset?: Preset;
192
+ delay?: number;
193
+ duration?: number;
194
+ /** Trigger when enters viewport instead of immediately */
195
+ inView?: boolean;
196
+ className?: string;
197
+ }
198
+ /**
199
+ * AnimateIn — wraps any content in a branded entrance animation.
200
+ *
201
+ * Respects `prefers-reduced-motion` by fading only (no translate/blur).
202
+ *
203
+ * @example
204
+ * <AnimateIn preset="emerge" delay={0.1}>
205
+ * <Card>...</Card>
206
+ * </AnimateIn>
207
+ */
208
+ declare function AnimateIn(props: AnimateInProps): react_jsx_runtime.JSX.Element;
209
+ interface AnimateSwapProps extends AnimateInProps {
210
+ /**
211
+ * Identity of the content currently rendered. When it changes, the outgoing
212
+ * content plays its exit and is fully unmounted before the incoming content
213
+ * enters (`AnimatePresence mode="wait"`).
214
+ */
215
+ swapKey: React.Key;
216
+ }
217
+ /**
218
+ * AnimateSwap — swap one piece of content for another, one at a time.
219
+ *
220
+ * `AnimateIn` can only animate an entrance: it has no `AnimatePresence`, so its
221
+ * `exit` never plays and a keyed replacement cross-fades on top of itself. Any
222
+ * tab panel, step body or filtered result set therefore had to hand-roll
223
+ * `AnimatePresence mode="wait"` plus a raw `m.div`. This is that pattern, once.
224
+ *
225
+ * Reduced motion is inherited from `AnimateIn`: opacity only, no travel, no blur.
226
+ *
227
+ * @example
228
+ * <AnimateSwap swapKey={activeTab} preset="swap" role="tabpanel">
229
+ * {panelFor(activeTab)}
230
+ * </AnimateSwap>
231
+ */
232
+ declare function AnimateSwap(props: AnimateSwapProps): react_jsx_runtime.JSX.Element;
233
+ interface AnimateInGroupProps {
234
+ children: React.ReactNode;
235
+ stagger?: "fast" | "normal" | "slow";
236
+ preset?: Preset;
237
+ inView?: boolean;
238
+ className?: string;
239
+ }
240
+ /**
241
+ * AnimateInGroup — staggered container. Each direct child animates in sequence.
242
+ *
243
+ * @example
244
+ * <AnimateInGroup stagger="normal" inView>
245
+ * {items.map(item => <AnimateIn key={item.id} preset="fadeUp">{item}</AnimateIn>)}
246
+ * </AnimateInGroup>
247
+ */
248
+ declare function AnimateInGroup(props: AnimateInGroupProps): react_jsx_runtime.JSX.Element;
249
+
250
+ export { AnimateIn as A, AnimateInGroup as a, type AnimateInGroupProps as b, type AnimateInProps as c, AnimateSwap as d, type AnimateSwapProps as e };