@kumix/ui 0.3.3 → 0.3.5
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/components/agents/agent-activity/activity-row.d.ts +1 -1
- package/dist/components/agents/agent-activity/index.d.ts +2 -2
- package/dist/components/agents/agent-activity/index.d.ts.map +1 -1
- package/dist/components/agents/agent-activity/index.js +9 -3
- package/dist/components/agents/agent-activity/index.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +7 -39
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/motion/checkbox.d.ts +3 -1
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/checkbox.js +2 -1
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/combobox/content.d.ts +16 -0
- package/dist/components/motion/combobox/content.d.ts.map +1 -0
- package/dist/components/motion/combobox/content.js +91 -0
- package/dist/components/motion/combobox/content.js.map +1 -0
- package/dist/components/motion/combobox/context.d.ts +63 -0
- package/dist/components/motion/combobox/context.d.ts.map +1 -0
- package/dist/components/motion/combobox/context.js +235 -0
- package/dist/components/motion/combobox/context.js.map +1 -0
- package/dist/components/motion/combobox/list.d.ts +40 -0
- package/dist/components/motion/combobox/list.d.ts.map +1 -0
- package/dist/components/motion/combobox/list.js +143 -0
- package/dist/components/motion/combobox/list.js.map +1 -0
- package/dist/components/motion/combobox/trigger.d.ts +21 -0
- package/dist/components/motion/combobox/trigger.d.ts.map +1 -0
- package/dist/components/motion/combobox/trigger.js +115 -0
- package/dist/components/motion/combobox/trigger.js.map +1 -0
- package/dist/components/motion/combobox.d.ts +5 -0
- package/dist/components/motion/combobox.js +6 -0
- package/dist/components/motion/popover.d.ts.map +1 -1
- package/dist/components/motion/popover.js +22 -25
- package/dist/components/motion/popover.js.map +1 -1
- package/dist/components/motion/signup-form.d.ts +56 -0
- package/dist/components/motion/signup-form.d.ts.map +1 -0
- package/dist/components/motion/signup-form.js +337 -0
- package/dist/components/motion/signup-form.js.map +1 -0
- package/dist/components/motion/text-scramble.d.ts +17 -0
- package/dist/components/motion/text-scramble.d.ts.map +1 -0
- package/dist/components/motion/text-scramble.js +64 -0
- package/dist/components/motion/text-scramble.js.map +1 -0
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/icon-tile.d.ts +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/{types-j36vVGtZ.d.ts → types-kSZH1k8K.d.ts} +11 -1
- package/dist/{types-j36vVGtZ.d.ts.map → types-kSZH1k8K.d.ts.map} +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signup-form.js","names":[],"sources":["../../../src/components/motion/signup-form.tsx"],"sourcesContent":["\"use client\";\n\nimport { type FormEvent, type ReactNode, useCallback, useId, useMemo, useState } from \"react\";\nimport { Eye, EyeOff, Lock, Mail, User } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_LAYOUT } from \"../../lib/ease\";\nimport { StatefulButton } from \"./button\";\nimport { Checkbox } from \"./checkbox\";\nimport { Input } from \"./input\";\n\nexport type SignUpStatus = \"idle\" | \"loading\" | \"success\" | \"error\";\n\nexport type SignUpValues = {\n name: string;\n email: string;\n password: string;\n confirmPassword: string;\n terms: boolean;\n};\n\nexport type SignUpErrors = Partial<Record<keyof SignUpValues, string>>;\n\nexport type SignUpFormClassNames = {\n root?: string;\n header?: string;\n title?: string;\n description?: string;\n fields?: string;\n strength?: string;\n terms?: string;\n submit?: string;\n footer?: string;\n};\n\nexport interface SignUpFormProps {\n /** Controlled values. Omit for uncontrolled. */\n values?: SignUpValues;\n defaultValues?: Partial<SignUpValues>;\n onValuesChange?: (values: SignUpValues) => void;\n /** Called with valid values only. Return a promise to drive the button state. */\n onSubmit?: (values: SignUpValues) => void | Promise<void>;\n /** Replace the built-in rules — return a message per invalid field. */\n validate?: (values: SignUpValues) => SignUpErrors;\n /** Controlled submit state. Omit to let the form track it. */\n status?: SignUpStatus;\n /** Form-level failure message, shown above the submit button. */\n errorMessage?: string;\n title?: ReactNode;\n description?: ReactNode;\n submitLabel?: string;\n footer?: ReactNode;\n /** Show the password strength meter. */\n strengthMeter?: boolean;\n className?: string;\n classNames?: SignUpFormClassNames;\n}\n\nconst EMPTY_VALUES: SignUpValues = {\n name: \"\",\n email: \"\",\n password: \"\",\n confirmPassword: \"\",\n terms: false,\n};\n\n// Deliberately permissive. Full RFC 5322 matching is impractical in a regex and\n// rejects addresses that deliver fine; the only real check is sending mail.\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nconst MIN_PASSWORD_LENGTH = 8;\n\nconst STRENGTH_LABELS = [\"Too short\", \"Weak\", \"Fair\", \"Good\", \"Strong\"] as const;\n\nconst STRENGTH_COLORS = [\n \"bg-destructive\",\n \"bg-destructive\",\n \"bg-amber-500\",\n \"bg-amber-400\",\n \"bg-(--color-success)\",\n] as const;\n\n/**\n * Length-weighted strength score, 0-4. NIST SP 800-63B advises against\n * composition requirements and treats length as the dominant factor, so extra\n * character classes only nudge the score — they can't rescue a short password.\n * This is a heuristic for feedback, not entropy estimation; pair it with a\n * breach-list check server-side for anything real.\n */\nexport function passwordStrength(password: string): number {\n if (password.length < MIN_PASSWORD_LENGTH) return 0;\n\n let score = 1;\n if (password.length >= 12) score += 1;\n if (password.length >= 16) score += 1;\n\n const classes = [/[a-z]/, /[A-Z]/, /\\d/, /[^A-Za-z0-9]/].filter((pattern) =>\n pattern.test(password),\n ).length;\n if (classes >= 3) score += 1;\n\n return Math.min(score, 4);\n}\n\nfunction defaultValidate(values: SignUpValues): SignUpErrors {\n const errors: SignUpErrors = {};\n\n if (!values.name.trim()) {\n errors.name = \"Enter your name.\";\n }\n\n if (!values.email.trim()) {\n errors.email = \"Enter your email.\";\n } else if (!EMAIL_PATTERN.test(values.email)) {\n errors.email = \"That doesn't look like an email address.\";\n }\n\n if (!values.password) {\n errors.password = \"Choose a password.\";\n } else if (values.password.length < MIN_PASSWORD_LENGTH) {\n errors.password = `Use at least ${MIN_PASSWORD_LENGTH} characters.`;\n }\n\n if (!values.confirmPassword) {\n errors.confirmPassword = \"Confirm your password.\";\n } else if (values.confirmPassword !== values.password) {\n errors.confirmPassword = \"Passwords don't match.\";\n }\n\n if (!values.terms) {\n errors.terms = \"Accept the terms to continue.\";\n }\n\n return errors;\n}\n\nexport function SignUpForm({\n values: valuesProp,\n defaultValues,\n onValuesChange,\n onSubmit,\n validate,\n status: statusProp,\n errorMessage,\n title = \"Create your account\",\n description = \"Start building in under a minute.\",\n submitLabel = \"Create account\",\n footer,\n strengthMeter = true,\n className,\n classNames,\n}: SignUpFormProps) {\n const reduce = useReducedMotion();\n const baseId = useId();\n\n const controlled = valuesProp !== undefined;\n const [internalValues, setInternalValues] = useState<SignUpValues>({\n ...EMPTY_VALUES,\n ...defaultValues,\n });\n const values = controlled ? valuesProp : internalValues;\n\n const [internalStatus, setInternalStatus] = useState<SignUpStatus>(\"idle\");\n const status = statusProp ?? internalStatus;\n\n const [revealPassword, setRevealPassword] = useState(false);\n\n // \"Reward early, punish late\": errors are computed on every change, but a\n // field only *shows* its error once it has been blurred (or submit touched\n // everything). So a first entry is never flagged mid-typing, while a field\n // already in error clears the moment it becomes valid.\n const [touched, setTouched] = useState<Partial<Record<keyof SignUpValues, boolean>>>({});\n\n const errors = useMemo(() => (validate ?? defaultValidate)(values), [values, validate]);\n\n const setValue = useCallback(\n <K extends keyof SignUpValues>(key: K, next: SignUpValues[K]) => {\n const nextValues = { ...values, [key]: next };\n if (!controlled) {\n setInternalValues(nextValues);\n if (statusProp === undefined) {\n setInternalStatus((current) =>\n current === \"success\" || current === \"error\" ? \"idle\" : current,\n );\n }\n }\n onValuesChange?.(nextValues);\n },\n [controlled, onValuesChange, statusProp, values],\n );\n\n const touch = useCallback((key: keyof SignUpValues) => {\n setTouched((prev) => (prev[key] ? prev : { ...prev, [key]: true }));\n }, []);\n\n /** Error to render for a field — hidden until the field has been touched. */\n const shownError = (key: keyof SignUpValues) => (touched[key] ? errors[key] : undefined);\n\n /** Success check draws only once a touched field is non-empty and valid. */\n const isValid = (key: keyof SignUpValues) =>\n Boolean(touched[key]) && !errors[key] && Boolean(values[key]);\n\n const strength = passwordStrength(values.password);\n const showStrength = strengthMeter && values.password.length > 0;\n const isSubmitting = status === \"loading\";\n\n const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n setTouched({\n name: true,\n email: true,\n password: true,\n confirmPassword: true,\n terms: true,\n });\n\n if (Object.keys(errors).length > 0) return;\n if (!onSubmit) return;\n\n if (statusProp === undefined) setInternalStatus(\"loading\");\n try {\n await onSubmit(values);\n if (statusProp === undefined) setInternalStatus(\"success\");\n } catch {\n if (statusProp === undefined) setInternalStatus(\"error\");\n }\n };\n\n const termsErrorId = `${baseId}-terms-error`;\n const formErrorId = `${baseId}-form-error`;\n\n return (\n <form\n noValidate\n onSubmit={handleSubmit}\n className={cn(\n \"flex w-full max-w-sm flex-col gap-5 rounded-3xl border border-border p-6\",\n className,\n classNames?.root,\n )}\n >\n {title || description ? (\n <div className={cn(\"flex flex-col gap-1\", classNames?.header)}>\n {title ? (\n <h2\n className={cn(\n \"font-semibold text-foreground text-xl tracking-tight\",\n classNames?.title,\n )}\n >\n {title}\n </h2>\n ) : null}\n {description ? (\n <p className={cn(\"text-muted-foreground text-sm\", classNames?.description)}>\n {description}\n </p>\n ) : null}\n </div>\n ) : null}\n\n <div className={cn(\"flex flex-col gap-4\", classNames?.fields)}>\n <Input\n label=\"Name\"\n autoComplete=\"name\"\n placeholder=\"Ada Lovelace\"\n leftIcon={<User />}\n disabled={isSubmitting}\n value={values.name}\n onChange={(next) => setValue(\"name\", next)}\n onBlur={() => touch(\"name\")}\n error={shownError(\"name\")}\n success={isValid(\"name\")}\n />\n\n <Input\n label=\"Email\"\n type=\"email\"\n inputMode=\"email\"\n autoComplete=\"email\"\n placeholder=\"you@example.com\"\n leftIcon={<Mail />}\n disabled={isSubmitting}\n value={values.email}\n onChange={(next) => setValue(\"email\", next)}\n onBlur={() => touch(\"email\")}\n error={shownError(\"email\")}\n success={isValid(\"email\")}\n />\n\n <div className=\"flex flex-col gap-2\">\n <Input\n label=\"Password\"\n type={revealPassword ? \"text\" : \"password\"}\n autoComplete=\"new-password\"\n placeholder=\"At least 8 characters\"\n leftIcon={<Lock />}\n rightIcon={\n <button\n type=\"button\"\n disabled={isSubmitting}\n onClick={() => setRevealPassword((prev) => !prev)}\n aria-label={revealPassword ? \"Hide password\" : \"Show password\"}\n className=\"text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground\"\n >\n {revealPassword ? <EyeOff /> : <Eye />}\n </button>\n }\n disabled={isSubmitting}\n value={values.password}\n onChange={(next) => setValue(\"password\", next)}\n onBlur={() => touch(\"password\")}\n error={shownError(\"password\")}\n />\n\n <AnimatePresence initial={false}>\n {showStrength ? (\n <motion.div\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: -4 }}\n animate={{ opacity: 1, y: 0 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -4 }}\n transition={{ duration: 0.18, ease: EASE_OUT }}\n className={cn(\"flex flex-col gap-1.5 px-1\", classNames?.strength)}\n >\n <div className=\"flex gap-1.5\" aria-hidden>\n {[0, 1, 2, 3].map((index) => (\n <span\n key={index}\n className=\"h-1 flex-1 overflow-hidden rounded-full bg-muted-foreground/20\"\n >\n {/* scaleX rather than width — transforms only, per the\n motion conventions, and it keeps the bar off layout. */}\n <motion.span\n initial={false}\n animate={{ scaleX: index < strength ? 1 : 0 }}\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n className={cn(\n \"block h-full w-full origin-left rounded-full\",\n STRENGTH_COLORS[strength],\n )}\n />\n </span>\n ))}\n </div>\n <p aria-live=\"polite\" className=\"text-muted-foreground text-xs\">\n Password strength: {STRENGTH_LABELS[strength]}\n </p>\n </motion.div>\n ) : null}\n </AnimatePresence>\n </div>\n\n <Input\n label=\"Confirm password\"\n type={revealPassword ? \"text\" : \"password\"}\n autoComplete=\"new-password\"\n placeholder=\"Re-enter your password\"\n leftIcon={<Lock />}\n disabled={isSubmitting}\n value={values.confirmPassword}\n onChange={(next) => setValue(\"confirmPassword\", next)}\n onBlur={() => touch(\"confirmPassword\")}\n error={shownError(\"confirmPassword\")}\n success={isValid(\"confirmPassword\")}\n />\n </div>\n\n <div className={cn(\"flex flex-col gap-1.5\", classNames?.terms)}>\n <Checkbox\n checked={values.terms}\n disabled={isSubmitting}\n onCheckedChange={(next) => {\n setValue(\"terms\", next);\n touch(\"terms\");\n }}\n label=\"I agree to the Terms and Privacy Policy\"\n aria-describedby={shownError(\"terms\") ? termsErrorId : undefined}\n />\n <AnimatePresence initial={false}>\n {shownError(\"terms\") ? (\n <motion.p\n id={termsErrorId}\n role=\"alert\"\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: -4, filter: \"blur(4px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -4, filter: \"blur(4px)\" }}\n transition={{ duration: 0.2 }}\n className=\"px-1 text-destructive text-xs\"\n >\n {shownError(\"terms\")}\n </motion.p>\n ) : null}\n </AnimatePresence>\n </div>\n\n <AnimatePresence initial={false}>\n {errorMessage ? (\n <motion.p\n id={formErrorId}\n role=\"alert\"\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: -4 }}\n animate={{ opacity: 1, y: 0 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -4 }}\n transition={{ duration: 0.2 }}\n className=\"rounded-2xl border border-destructive/30 bg-destructive/10 px-3 py-2 text-destructive text-xs\"\n >\n {errorMessage}\n </motion.p>\n ) : null}\n </AnimatePresence>\n\n <StatefulButton\n type=\"submit\"\n size=\"lg\"\n state={status}\n loadingText=\"Creating account\"\n successText=\"Account created\"\n errorText=\"Try again\"\n aria-describedby={errorMessage ? formErrorId : undefined}\n className={cn(\"w-full\", classNames?.submit)}\n >\n {submitLabel}\n </StatefulButton>\n\n {footer ? (\n <div className={cn(\"text-center text-muted-foreground text-sm\", classNames?.footer)}>\n {footer}\n </div>\n ) : null}\n </form>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA2DA,MAAM,eAA6B;CACjC,MAAM;CACN,OAAO;CACP,UAAU;CACV,iBAAiB;CACjB,OAAO;AACT;AAIA,MAAM,gBAAgB;AAEtB,MAAM,sBAAsB;AAE5B,MAAM,kBAAkB;CAAC;CAAa;CAAQ;CAAQ;CAAQ;AAAQ;AAEtE,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;AACF;;;;;;;;AASA,SAAgB,iBAAiB,UAA0B;CACzD,IAAI,SAAS,SAAS,qBAAqB,OAAO;CAElD,IAAI,QAAQ;CACZ,IAAI,SAAS,UAAU,IAAI,SAAS;CACpC,IAAI,SAAS,UAAU,IAAI,SAAS;CAKpC,IAHgB;EAAC;EAAS;EAAS;EAAM;CAAc,CAAC,CAAC,QAAQ,YAC/D,QAAQ,KAAK,QAAQ,CACvB,CAAC,CAAC,UACa,GAAG,SAAS;CAE3B,OAAO,KAAK,IAAI,OAAO,CAAC;AAC1B;AAEA,SAAS,gBAAgB,QAAoC;CAC3D,MAAM,SAAuB,CAAC;CAE9B,IAAI,CAAC,OAAO,KAAK,KAAK,GACpB,OAAO,OAAO;CA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,iBAAD;KAAiB,SAAS;KACvB,UAAA,WAAW,OAAO,IACjB,oBAAC,OAAO,GAAR;MACE,IAAI;MACJ,MAAK;MACL,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;OAAI,QAAQ;MAAY;MAC5E,SAAS;OAAE,SAAS;OAAG,GAAG;OAAG,QAAQ;MAAY;MACjD,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;OAAI,QAAQ;MAAY;MACzE,YAAY,EAAE,UAAU,GAAI;MAC5B,WAAU;MAET,UAAA,WAAW,OAAO;KACX,CAAA,IACR;IACW,CAAA,CACd;;GAEL,oBAAC,iBAAD;IAAiB,SAAS;IACvB,UAAA,eACC,oBAAC,OAAO,GAAR;KACE,IAAI;KACJ,MAAK;KACL,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;MAAE,SAAS;MAAG,GAAG;KAAG;KACvD,SAAS;MAAE,SAAS;MAAG,GAAG;KAAE;KAC5B,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI;MAAE,SAAS;MAAG,GAAG;KAAG;KACpD,YAAY,EAAE,UAAU,GAAI;KAC5B,WAAU;KAET,UAAA;IACO,CAAA,IACR;GACW,CAAA;GAEjB,oBAAC,gBAAD;IACE,MAAK;IACL,MAAK;IACL,OAAO;IACP,aAAY;IACZ,aAAY;IACZ,WAAU;IACV,oBAAkB,eAAe,cAAc,KAAA;IAC/C,WAAW,GAAG,UAAU,YAAY,MAAM;IAEzC,UAAA;GACa,CAAA;GAEf,SACC,oBAAC,OAAD;IAAK,WAAW,GAAG,6CAA6C,YAAY,MAAM;IAC/E,UAAA;GACE,CAAA,IACH;EACA;;AAEV"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
//#region src/components/motion/text-scramble.d.ts
|
|
3
|
+
interface TextScrambleProps {
|
|
4
|
+
/** Final text revealed by the scramble animation. */
|
|
5
|
+
text: string;
|
|
6
|
+
/** Maximum animation duration in milliseconds. */
|
|
7
|
+
duration?: number;
|
|
8
|
+
/** Characters sampled while unresolved positions are scrambling. */
|
|
9
|
+
glyphs?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
/** Character scramble that resolves to `text` and respects reduced motion. */
|
|
14
|
+
declare function TextScramble({ text, duration, glyphs, className, style }: TextScrambleProps): import("react").JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { TextScramble, TextScrambleProps };
|
|
17
|
+
//# sourceMappingURL=text-scramble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-scramble.d.ts","names":[],"sources":["../../../src/components/motion/text-scramble.tsx"],"mappings":";;UASiB;;EAEf;;EAEA;;EAEA;EACA;EACA,QAAQ;;;iBAIM,eACd,MACA,UACA,QACA,WACA,SACC,oCAAiB,IAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { cn } from "@kumix/utils";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useReducedMotion } from "motion/react";
|
|
6
|
+
//#region src/components/motion/text-scramble.tsx
|
|
7
|
+
const DEFAULT_GLYPHS = "ABCDEFGHJKLMNPQRSTUVWXYZ0123456789#%&@$?/";
|
|
8
|
+
/** Character scramble that resolves to `text` and respects reduced motion. */
|
|
9
|
+
function TextScramble({ text, duration, glyphs = DEFAULT_GLYPHS, className, style }) {
|
|
10
|
+
const reduce = useReducedMotion() ?? false;
|
|
11
|
+
const [display, setDisplay] = useState(text);
|
|
12
|
+
const mounted = useRef(false);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!mounted.current) {
|
|
15
|
+
mounted.current = true;
|
|
16
|
+
setDisplay(text);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (reduce || !glyphs) {
|
|
20
|
+
setDisplay(text);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const characters = text.split("");
|
|
24
|
+
const startedAt = performance.now();
|
|
25
|
+
const animationDuration = duration ?? Math.min(760, Math.max(420, characters.length * 32));
|
|
26
|
+
let frame = 0;
|
|
27
|
+
let lastUpdate = 0;
|
|
28
|
+
const animate = (now) => {
|
|
29
|
+
if (now - lastUpdate >= 40) {
|
|
30
|
+
lastUpdate = now;
|
|
31
|
+
const progress = Math.min((now - startedAt) / animationDuration, 1);
|
|
32
|
+
const settled = Math.floor(progress * characters.length);
|
|
33
|
+
setDisplay(characters.map((character, index) => {
|
|
34
|
+
if (index < settled || character === " ") return character;
|
|
35
|
+
return glyphs[Math.floor(Math.random() * glyphs.length)];
|
|
36
|
+
}).join(""));
|
|
37
|
+
}
|
|
38
|
+
if (now - startedAt < animationDuration) frame = requestAnimationFrame(animate);
|
|
39
|
+
else setDisplay(text);
|
|
40
|
+
};
|
|
41
|
+
frame = requestAnimationFrame(animate);
|
|
42
|
+
return () => cancelAnimationFrame(frame);
|
|
43
|
+
}, [
|
|
44
|
+
duration,
|
|
45
|
+
glyphs,
|
|
46
|
+
reduce,
|
|
47
|
+
text
|
|
48
|
+
]);
|
|
49
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
50
|
+
className: cn("inline-block whitespace-pre", className),
|
|
51
|
+
style,
|
|
52
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
53
|
+
className: "sr-only",
|
|
54
|
+
children: text
|
|
55
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
children: reduce ? text : display
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { TextScramble };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=text-scramble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-scramble.js","names":[],"sources":["../../../src/components/motion/text-scramble.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, useEffect, useRef, useState } from \"react\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\n\nconst DEFAULT_GLYPHS = \"ABCDEFGHJKLMNPQRSTUVWXYZ0123456789#%&@$?/\";\n\nexport interface TextScrambleProps {\n /** Final text revealed by the scramble animation. */\n text: string;\n /** Maximum animation duration in milliseconds. */\n duration?: number;\n /** Characters sampled while unresolved positions are scrambling. */\n glyphs?: string;\n className?: string;\n style?: CSSProperties;\n}\n\n/** Character scramble that resolves to `text` and respects reduced motion. */\nexport function TextScramble({\n text,\n duration,\n glyphs = DEFAULT_GLYPHS,\n className,\n style,\n}: TextScrambleProps) {\n const reduce = useReducedMotion() ?? false;\n const [display, setDisplay] = useState(text);\n const mounted = useRef(false);\n\n useEffect(() => {\n if (!mounted.current) {\n mounted.current = true;\n setDisplay(text);\n return;\n }\n\n if (reduce || !glyphs) {\n setDisplay(text);\n return;\n }\n\n const characters = text.split(\"\");\n const startedAt = performance.now();\n const animationDuration = duration ?? Math.min(760, Math.max(420, characters.length * 32));\n let frame = 0;\n let lastUpdate = 0;\n\n const animate = (now: number) => {\n if (now - lastUpdate >= 40) {\n lastUpdate = now;\n const progress = Math.min((now - startedAt) / animationDuration, 1);\n const settled = Math.floor(progress * characters.length);\n setDisplay(\n characters\n .map((character, index) => {\n if (index < settled || character === \" \") return character;\n return glyphs[Math.floor(Math.random() * glyphs.length)];\n })\n .join(\"\"),\n );\n }\n\n if (now - startedAt < animationDuration) {\n frame = requestAnimationFrame(animate);\n } else {\n setDisplay(text);\n }\n };\n\n frame = requestAnimationFrame(animate);\n return () => cancelAnimationFrame(frame);\n }, [duration, glyphs, reduce, text]);\n\n return (\n <span className={cn(\"inline-block whitespace-pre\", className)} style={style}>\n <span className=\"sr-only\">{text}</span>\n <span aria-hidden=\"true\">{reduce ? text : display}</span>\n </span>\n );\n}\n"],"mappings":";;;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AY;GAAQ,UAAA,SAAS,OAAO;EAAc,CAAA,CACpD;;AAEV"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
//#region src/components/reui/alert.d.ts
|
|
3
3
|
declare const alertVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "destructive" | "
|
|
4
|
+
variant?: "default" | "destructive" | "success" | "info" | "warning" | "invert" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): import("react").JSX.Element;
|
|
7
7
|
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
3
|
//#region src/components/reui/badge.d.ts
|
|
4
4
|
declare const badgeVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "success" | "info" | "warning" | "invert" | "focus" | "primary-light" | "warning-light" | "success-light" | "info-light" | "destructive-light" | "invert-light" | "focus-light" | "primary-outline" | "warning-outline" | "success-outline" | "info-outline" | "destructive-outline" | "invert-outline" | "focus-outline" | null | undefined;
|
|
6
6
|
size?: "default" | "sm" | "xs" | "lg" | "xl" | null | undefined;
|
|
7
7
|
radius?: "default" | "full" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -13,7 +13,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
13
13
|
* :not() or !important needed
|
|
14
14
|
*/
|
|
15
15
|
declare const frameVariants: (props?: ({
|
|
16
|
-
variant?: "
|
|
16
|
+
variant?: "default" | "ghost" | "inverse" | null | undefined;
|
|
17
17
|
spacing?: "default" | "sm" | "xs" | "lg" | null | undefined;
|
|
18
18
|
stacked?: boolean | null | undefined;
|
|
19
19
|
dense?: boolean | null | undefined;
|
|
@@ -22,7 +22,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
22
22
|
* default to `text-primary`; override it to recolor without touching internals.
|
|
23
23
|
*/
|
|
24
24
|
declare const iconTileVariants: (props?: ({
|
|
25
|
-
variant?: "outline" | "
|
|
25
|
+
variant?: "outline" | "elevated" | "soft" | "solid" | "frame" | null | undefined;
|
|
26
26
|
size?: "default" | "sm" | "xs" | "lg" | "xl" | null | undefined;
|
|
27
27
|
radius?: "default" | "full" | null | undefined;
|
|
28
28
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -5,7 +5,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
5
5
|
//#region src/components/ui/attachment.d.ts
|
|
6
6
|
declare const attachmentVariants: (props?: ({
|
|
7
7
|
size?: "default" | "sm" | "xs" | null | undefined;
|
|
8
|
-
orientation?: "
|
|
8
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
declare function Attachment({ className, state, size, orientation, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
|
|
11
11
|
state?: "idle" | "uploading" | "processing" | "error" | "done";
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
3
|
//#region src/components/ui/badge.d.ts
|
|
4
4
|
declare const badgeVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
8
8
|
//#endregion
|
|
@@ -4,7 +4,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
4
4
|
//#region src/components/ui/bubble.d.ts
|
|
5
5
|
declare function BubbleGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
6
6
|
declare const bubbleVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "muted" | "tinted" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
declare function Bubble({ variant, align, className, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
10
10
|
align?: "start" | "end";
|
|
@@ -3,7 +3,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
//#region src/components/ui/button-group.d.ts
|
|
5
5
|
declare const buttonGroupVariants: (props?: ({
|
|
6
|
-
orientation?: "
|
|
6
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react").JSX.Element;
|
|
9
9
|
declare function ButtonGroupText({ className, render, ...props }: useRender.ComponentProps<"div">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -2,8 +2,8 @@ import { Button as Button$1 } from "@base-ui/react/button";
|
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
//#region src/components/ui/button.d.ts
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
6
|
-
size?: "default" | "sm" | "
|
|
5
|
+
variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "xs" | "icon" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
|
|
9
9
|
//#endregion
|
|
@@ -7,7 +7,7 @@ declare function FieldLegend({ className, variant, ...props }: React.ComponentPr
|
|
|
7
7
|
}): import("react").JSX.Element;
|
|
8
8
|
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
9
9
|
declare const fieldVariants: (props?: ({
|
|
10
|
-
orientation?: "
|
|
10
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
|
|
13
13
|
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
6
6
|
declare function ItemGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
7
7
|
declare function ItemSeparator({ className, ...props }: React$1.ComponentProps<typeof Separator>): React$1.JSX.Element;
|
|
8
8
|
declare const itemVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
10
10
|
size?: "default" | "sm" | "xs" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
declare function Item({ className, variant, size, render, ...props }: useRender.ComponentProps<"div"> & VariantProps<typeof itemVariants>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
@@ -41,7 +41,7 @@ declare function SidebarGroupContent({ className, ...props }: React$1.ComponentP
|
|
|
41
41
|
declare function SidebarMenu({ className, ...props }: React$1.ComponentProps<"ul">): React$1.JSX.Element;
|
|
42
42
|
declare function SidebarMenuItem({ className, ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
43
43
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
44
|
-
variant?: "
|
|
44
|
+
variant?: "default" | "outline" | null | undefined;
|
|
45
45
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
46
46
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
47
47
|
declare function SidebarMenuButton({ render, isActive, variant, size, tooltip, className, ...props }: useRender.ComponentProps<"button"> & React$1.ComponentProps<"button"> & {
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
3
3
|
//#region src/components/ui/toggle.d.ts
|
|
4
4
|
declare const toggleVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
6
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare function Toggle({ className, variant, size, ...props }: Toggle$1.Props & VariantProps<typeof toggleVariants>): import("react").JSX.Element;
|
|
@@ -68,6 +68,16 @@ interface AgentActivityProps {
|
|
|
68
68
|
activeLabel?: ReactNode;
|
|
69
69
|
/** Optional completed summary. Derived from the item types by default. */
|
|
70
70
|
summary?: ReactNode;
|
|
71
|
+
/** Optional renderer for the contents of the active status row. */
|
|
72
|
+
renderWorkingStatus?: (context: {
|
|
73
|
+
label: ReactNode;
|
|
74
|
+
duration: number;
|
|
75
|
+
}) => ReactNode;
|
|
76
|
+
/** Optional renderer for the contents before the built-in disclosure chevron. */
|
|
77
|
+
renderCompletedStatus?: (context: {
|
|
78
|
+
summary: ReactNode;
|
|
79
|
+
duration: number;
|
|
80
|
+
}) => ReactNode;
|
|
71
81
|
/** Maximum visible activity height before the stream begins gliding. */
|
|
72
82
|
maxHeight?: number;
|
|
73
83
|
className?: string;
|
|
@@ -75,4 +85,4 @@ interface AgentActivityProps {
|
|
|
75
85
|
}
|
|
76
86
|
//#endregion
|
|
77
87
|
export { AgentActivityStatus as a, AgentActivityTool as c, AgentStepStatus as d, AgentTraceKind as f, AgentActivitySearch as i, AgentActivityTrace as l, AgentActivityItem as n, AgentActivityStep as o, AgentActivityProps as r, AgentActivityText as s, AgentActivityContentType as t, AgentSearchResult as u };
|
|
78
|
-
//# sourceMappingURL=types-
|
|
88
|
+
//# sourceMappingURL=types-kSZH1k8K.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-kSZH1k8K.d.ts","names":[],"sources":["../src/components/agents/agent-activity/types.ts"],"mappings":";;KAEY;KACA;UAEK;EACf;EACA;EACA,OAAO;EACP,SAAS;EACT,OAAO;;UAGQ;EACf;EACA;EACA,SAAS;;UAGM;EACf;EACA,OAAO;EACP,SAAS;EACT;EACA,OAAO;;UAGQ;EACf;EACA;EACA,OAAO;EACP,UAAU;EACV;;UAGe;EACf;EACA;EACA;EACA,QAAQ;EACR;EACA;;KAGU;UAEK;EACf;EACA;EACA,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;;KAGG,oBACR,oBACA,oBACA,sBACA,oBACA;KAEQ,2BAA2B;UAEtB;;EAEf,OAAO;;EAEP,cAAc;;EAEd,SAAS;;EAET;;EAEA;;EAEA;;EAEA,gBAAgB;;EAEhB;;EAEA,cAAc;;EAEd,UAAU;;EAEV,uBAAuB;IAAW,OAAO;IAAW;QAAuB;;EAE3E,yBAAyB;IAAW,SAAS;IAAW;QAAuB;;EAE/E;EACA;EACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumix/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Kumix React UI kit: shadcn/ui (Base UI, base-nova) + ReUI components, Tailwind tokens, and hooks. Per-file ESM exports.",
|
|
5
5
|
"author": "Kumix Labs <hai@kumix.io>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"add:shadcn": "shadcn add --all --overwrite",
|
|
41
41
|
"add:reui": "shadcn add @reui/alert @reui/autocomplete @reui/badge @reui/data-grid @reui/date-selector @reui/event-calendar @reui/use-file-upload @reui/filters @reui/frame @reui/gantt @reui/icon-stack @reui/icon-tile @reui/kanban @reui/number-field @reui/phone-input @reui/rating @reui/scrollspy @reui/sortable @reui/stepper @reui/timeline @reui/tree --overwrite",
|
|
42
42
|
"add:beui:ai-agents": "shadcn add @beui/prompt-input @beui/todo-list @beui/code-block @beui/approval-card @beui/file-diff @beui/tool-result @beui/streaming-response @beui/image-generation @beui/tool-approval @beui/citations @beui/agent-activity @beui/reasoning-text @beui/thinking-shimmer @beui/agent-progress @beui/ai-sidebar @beui/chat-app @beui/message-bubble @beui/message @beui/message-scroller --overwrite",
|
|
43
|
-
"add:beui:components": "shadcn add @beui/marquee @beui/tabs @beui/switch @beui/input @beui/select @beui/select-morph @beui/checkbox @beui/radio @beui/bottom-sheet @beui/pull-to-refresh @beui/shared-layout-bg @beui/bounce-sidebar @beui/animated-sidebar @beui/preview-rail @beui/dock @beui/tooltip @beui/context-menu @beui/popover @beui/popover-morph @beui/morphing-modal @beui/center-morph-modal @beui/chromatic-text-reveal @beui/text-reveal @beui/text-shimmer @beui/text-cascade @beui/number-ticker @beui/animated-number @beui/animated-badge @beui/action-swap-cascade @beui/action-swap-blur @beui/action-swap-roll @beui/animated-toast-stack @beui/theme-toggle @beui/bouncy-accordion @beui/drawer @beui/smooth-scroll @beui/scroll-progress @beui/parallax @beui/scroll-to @beui/scroll-reveal @beui/range-slider @beui/range-slider-fluid @beui/range-slider-wave @beui/range-slider-bubble @beui/range-slider-ruler @beui/wheel-picker @beui/table @beui/table-editable @beui/table-async @beui/shader-background @beui/cylinder-carousel @beui/loader @beui/tilt-card @beui/button-base @beui/button-stateful @beui/button-magnetic @beui/hold-action-button @beui/slide-action-button --overwrite",
|
|
44
|
-
"add:beui:blocks": "shadcn add @beui/availability-scheduler @beui/dynamic-island @beui/command-palette @beui/expandable-action-bar @beui/overflow-actions @beui/expandable-tabs @beui/morphing-tabs @beui/swipeable-list @beui/attachment-upload @beui/file-upload @beui/otp-input @beui/bloom-menu @beui/feedback-widget @beui/not-found-glitch @beui/not-found-magnetic @beui/not-found-spotlight @beui/not-found-stacked @beui/not-found-terminal @beui/infinite-masonry @beui/notification-stack --overwrite",
|
|
43
|
+
"add:beui:components": "shadcn add @beui/marquee @beui/tabs @beui/switch @beui/input @beui/select @beui/select-morph @beui/combobox @beui/checkbox @beui/radio @beui/bottom-sheet @beui/pull-to-refresh @beui/shared-layout-bg @beui/bounce-sidebar @beui/animated-sidebar @beui/preview-rail @beui/dock @beui/tooltip @beui/context-menu @beui/popover @beui/popover-morph @beui/morphing-modal @beui/center-morph-modal @beui/chromatic-text-reveal @beui/text-reveal @beui/text-shimmer @beui/text-cascade @beui/number-ticker @beui/animated-number @beui/animated-badge @beui/action-swap-cascade @beui/action-swap-blur @beui/action-swap-roll @beui/animated-toast-stack @beui/theme-toggle @beui/bouncy-accordion @beui/drawer @beui/smooth-scroll @beui/scroll-progress @beui/parallax @beui/scroll-to @beui/scroll-reveal @beui/range-slider @beui/range-slider-fluid @beui/range-slider-wave @beui/range-slider-bubble @beui/range-slider-ruler @beui/wheel-picker @beui/table @beui/table-editable @beui/table-async @beui/shader-background @beui/cylinder-carousel @beui/loader @beui/tilt-card @beui/button-base @beui/button-stateful @beui/button-magnetic @beui/hold-action-button @beui/slide-action-button --overwrite",
|
|
44
|
+
"add:beui:blocks": "shadcn add @beui/availability-scheduler @beui/dynamic-island @beui/command-palette @beui/expandable-action-bar @beui/overflow-actions @beui/expandable-tabs @beui/morphing-tabs @beui/swipeable-list @beui/attachment-upload @beui/file-upload @beui/otp-input @beui/signup-form @beui/bloom-menu @beui/feedback-widget @beui/not-found-glitch @beui/not-found-magnetic @beui/not-found-spotlight @beui/not-found-stacked @beui/not-found-terminal @beui/infinite-masonry @beui/notification-stack --overwrite",
|
|
45
45
|
"add:beui": "bun run add:beui:ai-agents && bun run add:beui:components && bun run add:beui:blocks"
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/kumixlabs/ui",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"@headless-tree/core": "^1.7.0",
|
|
82
82
|
"@kumix/tsconfig": "^0.1.0",
|
|
83
83
|
"@kumix/utils": "^0.1.3",
|
|
84
|
-
"@paper-design/shaders-react": "^0.0.
|
|
84
|
+
"@paper-design/shaders-react": "^0.0.80",
|
|
85
85
|
"@shadcn/react": "^0.3.0",
|
|
86
|
-
"@tanstack/react-table": "^9.1.
|
|
86
|
+
"@tanstack/react-table": "^9.1.2",
|
|
87
87
|
"@tanstack/react-virtual": "^3.14.9",
|
|
88
88
|
"@types/react": "^19.2.18",
|
|
89
89
|
"class-variance-authority": "^0.7.1",
|
|
@@ -93,15 +93,15 @@
|
|
|
93
93
|
"embla-carousel-react": "^8.6.0",
|
|
94
94
|
"input-otp": "^1.4.2",
|
|
95
95
|
"lenis": "^1.3.26",
|
|
96
|
-
"lucide-react": "^1.
|
|
97
|
-
"motion": "^13.
|
|
96
|
+
"lucide-react": "^1.31.0",
|
|
97
|
+
"motion": "^13.1.0",
|
|
98
98
|
"next-themes": "^0.4.6",
|
|
99
99
|
"react": "^19.2.8",
|
|
100
100
|
"react-day-picker": "^10.0.1",
|
|
101
101
|
"react-phone-number-input": "^3.4.17",
|
|
102
102
|
"react-resizable-panels": "^4.12.2",
|
|
103
103
|
"recharts": "3.10.1",
|
|
104
|
-
"shiki": "^4.4.
|
|
104
|
+
"shiki": "^4.4.3",
|
|
105
105
|
"tailwind-merge": "^3.6.0",
|
|
106
106
|
"tsdown": "^0.22.14",
|
|
107
107
|
"typescript": "6.0.3"
|