@annondeveloper/ui-kit 0.1.0 → 0.2.1

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 (67) hide show
  1. package/README.md +1463 -127
  2. package/dist/{chunk-5OKSXPWK.js → chunk-2DWZVHZS.js} +2 -2
  3. package/dist/chunk-2DWZVHZS.js.map +1 -0
  4. package/dist/form.d.ts +6 -6
  5. package/dist/form.js +2 -3
  6. package/dist/form.js.map +1 -1
  7. package/dist/index.d.ts +510 -52
  8. package/dist/index.js +2996 -15
  9. package/dist/index.js.map +1 -1
  10. package/dist/{select-nnBJUO8U.d.ts → select-B2wXqqSM.d.ts} +2 -2
  11. package/package.json +24 -26
  12. package/src/components/animated-counter.tsx +8 -5
  13. package/src/components/avatar.tsx +2 -1
  14. package/src/components/badge.tsx +3 -2
  15. package/src/components/button.tsx +3 -2
  16. package/src/components/card.tsx +13 -12
  17. package/src/components/checkbox.tsx +3 -2
  18. package/src/components/color-input.tsx +427 -0
  19. package/src/components/command-bar.tsx +435 -0
  20. package/src/components/confidence-bar.tsx +115 -0
  21. package/src/components/confirm-dialog.tsx +2 -1
  22. package/src/components/copy-block.tsx +224 -0
  23. package/src/components/data-table.tsx +9 -13
  24. package/src/components/diff-viewer.tsx +340 -0
  25. package/src/components/dropdown-menu.tsx +2 -1
  26. package/src/components/empty-state.tsx +2 -1
  27. package/src/components/filter-pill.tsx +2 -1
  28. package/src/components/form-input.tsx +5 -4
  29. package/src/components/heatmap-calendar.tsx +218 -0
  30. package/src/components/infinite-scroll.tsx +248 -0
  31. package/src/components/kanban-column.tsx +198 -0
  32. package/src/components/live-feed.tsx +222 -0
  33. package/src/components/log-viewer.tsx +4 -1
  34. package/src/components/metric-card.tsx +2 -1
  35. package/src/components/notification-stack.tsx +233 -0
  36. package/src/components/pipeline-stage.tsx +2 -1
  37. package/src/components/popover.tsx +2 -1
  38. package/src/components/port-status-grid.tsx +2 -1
  39. package/src/components/progress.tsx +2 -1
  40. package/src/components/radio-group.tsx +2 -1
  41. package/src/components/realtime-value.tsx +283 -0
  42. package/src/components/select.tsx +2 -1
  43. package/src/components/severity-timeline.tsx +2 -1
  44. package/src/components/sheet.tsx +2 -1
  45. package/src/components/skeleton.tsx +4 -3
  46. package/src/components/slider.tsx +2 -1
  47. package/src/components/smart-table.tsx +383 -0
  48. package/src/components/sortable-list.tsx +272 -0
  49. package/src/components/sparkline.tsx +2 -1
  50. package/src/components/status-badge.tsx +2 -1
  51. package/src/components/status-pulse.tsx +2 -1
  52. package/src/components/step-wizard.tsx +380 -0
  53. package/src/components/streaming-text.tsx +160 -0
  54. package/src/components/success-checkmark.tsx +2 -1
  55. package/src/components/tabs.tsx +2 -1
  56. package/src/components/threshold-gauge.tsx +2 -1
  57. package/src/components/time-range-selector.tsx +2 -1
  58. package/src/components/toast.tsx +2 -1
  59. package/src/components/toggle-switch.tsx +2 -1
  60. package/src/components/tooltip.tsx +2 -1
  61. package/src/components/truncated-text.tsx +2 -1
  62. package/src/components/typing-indicator.tsx +123 -0
  63. package/src/components/uptime-tracker.tsx +2 -1
  64. package/src/components/utilization-bar.tsx +2 -1
  65. package/src/theme.css +6 -0
  66. package/src/utils.ts +1 -1
  67. package/dist/chunk-5OKSXPWK.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
 
3
3
  interface SelectOption {
4
4
  value: string;
@@ -21,6 +21,6 @@ interface SelectProps {
21
21
  * @description A themed select dropdown built on Radix UI Select.
22
22
  * Supports dark/light mode via CSS custom property tokens.
23
23
  */
24
- declare function Select({ value, onValueChange, options, placeholder, className, disabled, }: SelectProps): react_jsx_runtime.JSX.Element;
24
+ declare function Select({ value, onValueChange, options, placeholder, className, disabled, }: SelectProps): React.JSX.Element;
25
25
 
26
26
  export { type SelectOption as S, Select as a, type SelectProps as b };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annondeveloper/ui-kit",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "A React component library with dark/light theming, built on Radix UI, Tailwind CSS v4, and Framer Motion.",
6
6
  "main": "dist/index.js",
@@ -49,7 +49,7 @@
49
49
  "react-dom": "^19.0.0",
50
50
  "react-hook-form": "^7.0.0",
51
51
  "sonner": "^2.0.0",
52
- "tailwind-merge": "^2.0.0"
52
+ "tailwind-merge": "^2.0.0 || ^3.0.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "react-hook-form": {
@@ -58,39 +58,37 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@axe-core/react": "^4.11.1",
61
- "@radix-ui/react-alert-dialog": "^1.0.0",
62
- "@radix-ui/react-dropdown-menu": "^2.0.0",
63
- "@radix-ui/react-popover": "^1.0.0",
64
- "@radix-ui/react-select": "^2.0.0",
65
- "@radix-ui/react-tooltip": "^1.0.0",
66
- "@storybook/addon-a11y": "^8.6.18",
67
- "@storybook/addon-essentials": "^8.6.14",
68
- "@storybook/blocks": "^8.6.14",
69
- "@storybook/react": "^8.6.18",
70
- "@storybook/react-vite": "^8.6.18",
71
- "@tanstack/react-table": "^8.0.0",
61
+ "@radix-ui/react-alert-dialog": "^1.1.15",
62
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
63
+ "@radix-ui/react-popover": "^1.1.15",
64
+ "@radix-ui/react-select": "^2.2.6",
65
+ "@radix-ui/react-tooltip": "^1.2.8",
66
+ "@storybook/addon-a11y": "^10.3.0",
67
+ "@storybook/react": "^10.3.0",
68
+ "@storybook/react-vite": "^10.3.0",
69
+ "@tanstack/react-table": "^8.21.3",
72
70
  "@testing-library/dom": "^10.4.1",
73
71
  "@testing-library/jest-dom": "^6.9.1",
74
72
  "@testing-library/react": "^16.3.2",
75
73
  "@testing-library/user-event": "^14.6.1",
76
74
  "@types/jest-axe": "^3.5.9",
77
- "@types/react": "^19.0.0",
78
- "@types/react-dom": "^19.0.0",
79
- "@vitejs/plugin-react": "^6.0.1",
75
+ "@types/react": "^19.2.14",
76
+ "@types/react-dom": "^19.2.3",
77
+ "@vitejs/plugin-react": "^6.0.0",
80
78
  "axe-core": "^4.11.1",
81
- "clsx": "^2.0.0",
82
- "framer-motion": "^12.0.0",
79
+ "clsx": "^2.1.1",
80
+ "framer-motion": "^12.38.0",
83
81
  "jest-axe": "^10.0.0",
84
82
  "jsdom": "^29.0.0",
85
- "lucide-react": ">=0.400.0",
86
- "react": "^19.0.0",
87
- "react-dom": "^19.0.0",
83
+ "lucide-react": ">=0.577.0",
84
+ "react": "^19.2.4",
85
+ "react-dom": "^19.2.4",
88
86
  "react-hook-form": "^7.71.2",
89
- "sonner": "^2.0.0",
90
- "storybook": "^8.6.18",
91
- "tailwind-merge": "^2.0.0",
92
- "tsup": "^8.4.0",
93
- "typescript": "^5.8.0",
87
+ "sonner": "^2.0.7",
88
+ "storybook": "^10.3.0",
89
+ "tailwind-merge": "^3.5.0",
90
+ "tsup": "^8.5.1",
91
+ "typescript": "^5.9.0",
94
92
  "vite": "^8.0.0",
95
93
  "vitest": "^4.1.0"
96
94
  },
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
 
3
+ import type React from 'react'
3
4
  import { useEffect, useRef, useState } from 'react'
4
5
  import { useReducedMotion } from 'framer-motion'
5
6
  import { cn } from '../utils'
@@ -27,16 +28,20 @@ export function AnimatedCounter({
27
28
  duration = 400,
28
29
  className,
29
30
  format,
30
- }: AnimatedCounterProps) {
31
+ }: AnimatedCounterProps): React.JSX.Element {
31
32
  const reduced = useReducedMotion()
32
33
  const prevRef = useRef(value)
33
34
  const rafRef = useRef<number | null>(null)
34
35
  const [displayed, setDisplayed] = useState(value)
36
+ const decimalPlacesRef = useRef(
37
+ Number.isInteger(value) ? 0 : (value.toString().split('.')[1]?.length ?? 1)
38
+ )
35
39
 
36
40
  useEffect(() => {
37
41
  const from = prevRef.current
38
42
  const to = value
39
43
  prevRef.current = value
44
+ decimalPlacesRef.current = Number.isInteger(to) ? 0 : (to.toString().split('.')[1]?.length ?? 1)
40
45
 
41
46
  if (reduced || from === to) {
42
47
  setDisplayed(to)
@@ -71,11 +76,9 @@ export function AnimatedCounter({
71
76
 
72
77
  const formatted = format
73
78
  ? format(displayed)
74
- : Number.isInteger(value)
79
+ : decimalPlacesRef.current === 0
75
80
  ? Math.round(displayed).toString()
76
- : displayed.toFixed(
77
- value.toString().split('.')[1]?.length ?? 1
78
- )
81
+ : displayed.toFixed(decimalPlacesRef.current)
79
82
 
80
83
  return (
81
84
  <span className={cn('tabular-nums', className)}>
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
 
3
+ import type React from 'react'
3
4
  import { useState } from 'react'
4
5
  import { cn } from '../utils'
5
6
 
@@ -55,7 +56,7 @@ export function Avatar({
55
56
  size = 'md',
56
57
  status,
57
58
  className,
58
- }: AvatarProps) {
59
+ }: AvatarProps): React.JSX.Element {
59
60
  const [imgError, setImgError] = useState(false)
60
61
  const s = sizeClasses[size]
61
62
  const initials = fallback ?? deriveInitials(alt)
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
 
3
+ import type React from 'react'
3
4
  import { cn } from '../utils'
4
5
  import type { LucideIcon } from 'lucide-react'
5
6
 
@@ -40,7 +41,7 @@ export interface BadgeProps {
40
41
  */
41
42
  export function Badge({
42
43
  children, color = 'gray', icon: Icon, size = 'sm', className,
43
- }: BadgeProps) {
44
+ }: BadgeProps): React.JSX.Element {
44
45
  return (
45
46
  <span className={cn(
46
47
  'inline-flex items-center gap-1 rounded-full font-medium whitespace-nowrap',
@@ -82,7 +83,7 @@ export interface BadgeVariantConfig<T extends string> {
82
83
  * // Usage: <SeverityBadge value="critical" />
83
84
  * ```
84
85
  */
85
- export function createBadgeVariant<T extends string>(config: BadgeVariantConfig<T>) {
86
+ export function createBadgeVariant<T extends string>(config: BadgeVariantConfig<T>): (props: { value: T; className?: string }) => React.JSX.Element {
86
87
  const { colorMap, labelMap, defaultColor = 'gray', defaultSize = 'xs' } = config
87
88
 
88
89
  return function VariantBadge({ value, className }: { value: T; className?: string }) {
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
 
3
+ import type React from 'react'
3
4
  import { forwardRef, type ButtonHTMLAttributes } from 'react'
4
5
  import { Loader2 } from 'lucide-react'
5
6
  import { cn } from '../utils'
@@ -40,8 +41,8 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
40
41
  * @description A themed button with variant, size, and loading support.
41
42
  * Uses CSS custom property tokens for dark/light mode compatibility.
42
43
  */
43
- const Button = forwardRef<HTMLButtonElement, ButtonProps>(
44
- ({ variant = 'primary', size = 'md', loading, disabled, className, children, ...props }, ref) => (
44
+ const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>> = forwardRef<HTMLButtonElement, ButtonProps>(
45
+ ({ variant = 'primary', size = 'md', loading, disabled, className, children, ...props }, ref): React.JSX.Element => (
45
46
  <button
46
47
  ref={ref}
47
48
  disabled={disabled || loading}
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
 
3
+ import type React from 'react'
3
4
  import { forwardRef, type HTMLAttributes, type ReactNode } from 'react'
4
5
  import { cn } from '../utils'
5
6
 
@@ -37,8 +38,8 @@ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
37
38
  * Use with CardHeader, CardTitle, CardDescription, CardContent, and CardFooter
38
39
  * subcomponents for semantic structure.
39
40
  */
40
- const Card = forwardRef<HTMLDivElement, CardProps>(
41
- ({ variant = 'default', padding = 'md', className, children, ...props }, ref) => (
41
+ const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> = forwardRef<HTMLDivElement, CardProps>(
42
+ ({ variant = 'default', padding = 'md', className, children, ...props }, ref): React.JSX.Element => (
42
43
  <div
43
44
  ref={ref}
44
45
  className={cn('rounded-2xl', variantClasses[variant], paddingClasses[padding], className)}
@@ -57,8 +58,8 @@ export interface CardSubProps extends HTMLAttributes<HTMLDivElement> {
57
58
  }
58
59
 
59
60
  /** Header section of a Card (flex row for title + actions). */
60
- const CardHeader = forwardRef<HTMLDivElement, CardSubProps>(
61
- ({ className, children, ...props }, ref) => (
61
+ const CardHeader: React.ForwardRefExoticComponent<CardSubProps & React.RefAttributes<HTMLDivElement>> = forwardRef<HTMLDivElement, CardSubProps>(
62
+ ({ className, children, ...props }, ref): React.JSX.Element => (
62
63
  <div
63
64
  ref={ref}
64
65
  className={cn('flex items-start justify-between gap-4', className)}
@@ -71,8 +72,8 @@ const CardHeader = forwardRef<HTMLDivElement, CardSubProps>(
71
72
  CardHeader.displayName = 'CardHeader'
72
73
 
73
74
  /** Title within a CardHeader. */
74
- const CardTitle = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement> & { children: ReactNode }>(
75
- ({ className, children, ...props }, ref) => (
75
+ const CardTitle: React.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & { children: ReactNode } & React.RefAttributes<HTMLHeadingElement>> = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement> & { children: ReactNode }>(
76
+ ({ className, children, ...props }, ref): React.JSX.Element => (
76
77
  <h3
77
78
  ref={ref}
78
79
  className={cn('text-base font-semibold text-[hsl(var(--text-primary))]', className)}
@@ -85,8 +86,8 @@ const CardTitle = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingEleme
85
86
  CardTitle.displayName = 'CardTitle'
86
87
 
87
88
  /** Description text within a CardHeader. */
88
- const CardDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement> & { children: ReactNode }>(
89
- ({ className, children, ...props }, ref) => (
89
+ const CardDescription: React.ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & { children: ReactNode } & React.RefAttributes<HTMLParagraphElement>> = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement> & { children: ReactNode }>(
90
+ ({ className, children, ...props }, ref): React.JSX.Element => (
90
91
  <p
91
92
  ref={ref}
92
93
  className={cn('text-sm text-[hsl(var(--text-secondary))]', className)}
@@ -99,8 +100,8 @@ const CardDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLPara
99
100
  CardDescription.displayName = 'CardDescription'
100
101
 
101
102
  /** Main content area of a Card. */
102
- const CardContent = forwardRef<HTMLDivElement, CardSubProps>(
103
- ({ className, children, ...props }, ref) => (
103
+ const CardContent: React.ForwardRefExoticComponent<CardSubProps & React.RefAttributes<HTMLDivElement>> = forwardRef<HTMLDivElement, CardSubProps>(
104
+ ({ className, children, ...props }, ref): React.JSX.Element => (
104
105
  <div ref={ref} className={cn('mt-4', className)} {...props}>
105
106
  {children}
106
107
  </div>
@@ -109,8 +110,8 @@ const CardContent = forwardRef<HTMLDivElement, CardSubProps>(
109
110
  CardContent.displayName = 'CardContent'
110
111
 
111
112
  /** Footer section of a Card (typically for actions). */
112
- const CardFooter = forwardRef<HTMLDivElement, CardSubProps>(
113
- ({ className, children, ...props }, ref) => (
113
+ const CardFooter: React.ForwardRefExoticComponent<CardSubProps & React.RefAttributes<HTMLDivElement>> = forwardRef<HTMLDivElement, CardSubProps>(
114
+ ({ className, children, ...props }, ref): React.JSX.Element => (
114
115
  <div
115
116
  ref={ref}
116
117
  className={cn(
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
 
3
+ import type React from 'react'
3
4
  import { forwardRef, type InputHTMLAttributes } from 'react'
4
5
  import { Check, Minus } from 'lucide-react'
5
6
  import { cn } from '../utils'
@@ -15,8 +16,8 @@ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement
15
16
  * @description A themed checkbox with indeterminate state support.
16
17
  * Uses CSS custom property tokens for dark/light mode compatibility.
17
18
  */
18
- const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
19
- ({ indeterminate, checked, size = 'md', className, ...props }, ref) => {
19
+ const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>> = forwardRef<HTMLInputElement, CheckboxProps>(
20
+ ({ indeterminate, checked, size = 'md', className, ...props }, ref): React.JSX.Element => {
20
21
  const isChecked = checked || indeterminate
21
22
  const sizeClass = size === 'sm' ? 'h-3.5 w-3.5' : 'h-4 w-4'
22
23
  const iconSize = size === 'sm' ? 'h-2.5 w-2.5' : 'h-3 w-3'