@codefast/ui 0.9.2 → 0.10.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 (188) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +3 -0
  3. package/dist/components/accordion.js +1 -1
  4. package/dist/components/alert-dialog.d.ts +1 -1
  5. package/dist/components/alert-dialog.js +2 -2
  6. package/dist/components/alert.d.ts +1 -1
  7. package/dist/components/alert.js +2 -2
  8. package/dist/components/attachment.d.ts +2 -2
  9. package/dist/components/attachment.js +3 -3
  10. package/dist/components/avatar.js +1 -1
  11. package/dist/components/badge.d.ts +1 -1
  12. package/dist/components/badge.js +1 -1
  13. package/dist/components/breadcrumb.js +3 -3
  14. package/dist/components/bubble.d.ts +1 -1
  15. package/dist/components/bubble.js +2 -2
  16. package/dist/components/button-group.d.ts +2 -2
  17. package/dist/components/button-group.js +3 -3
  18. package/dist/components/button.d.ts +1 -1
  19. package/dist/components/button.js +1 -1
  20. package/dist/components/calendar.d.ts +1 -1
  21. package/dist/components/calendar.js +3 -3
  22. package/dist/components/card.js +1 -1
  23. package/dist/components/carousel.d.ts +1 -1
  24. package/dist/components/carousel.js +17 -26
  25. package/dist/components/chart.js +1 -1
  26. package/dist/components/checkbox-cards.d.ts +1 -1
  27. package/dist/components/checkbox-cards.js +3 -3
  28. package/dist/components/checkbox-group.d.ts +1 -1
  29. package/dist/components/checkbox-group.js +2 -2
  30. package/dist/components/checkbox.js +1 -1
  31. package/dist/components/command.d.ts +8 -2
  32. package/dist/components/command.js +5 -5
  33. package/dist/components/context-menu.js +1 -1
  34. package/dist/components/dialog.d.ts +14 -2
  35. package/dist/components/dialog.js +6 -6
  36. package/dist/components/drawer.d.ts +2 -2
  37. package/dist/components/drawer.js +2 -2
  38. package/dist/components/dropdown-menu.js +1 -1
  39. package/dist/components/empty.d.ts +1 -1
  40. package/dist/components/empty.js +2 -2
  41. package/dist/components/field.d.ts +2 -2
  42. package/dist/components/field.js +4 -4
  43. package/dist/components/form.js +2 -2
  44. package/dist/components/hover-card.js +1 -1
  45. package/dist/components/input-group.d.ts +4 -4
  46. package/dist/components/input-group.js +5 -5
  47. package/dist/components/input-number.d.ts +2 -2
  48. package/dist/components/input-number.js +6 -6
  49. package/dist/components/input-otp.js +1 -1
  50. package/dist/components/input-password.d.ts +16 -3
  51. package/dist/components/input-password.js +3 -3
  52. package/dist/components/input-search.d.ts +8 -2
  53. package/dist/components/input-search.js +3 -3
  54. package/dist/components/input.js +1 -1
  55. package/dist/components/item.d.ts +2 -2
  56. package/dist/components/item.js +3 -3
  57. package/dist/components/kbd.js +1 -1
  58. package/dist/components/label.js +1 -1
  59. package/dist/components/marker.d.ts +1 -1
  60. package/dist/components/marker.js +2 -2
  61. package/dist/components/menubar.js +1 -1
  62. package/dist/components/message-scroller.d.ts +3 -3
  63. package/dist/components/message-scroller.js +3 -3
  64. package/dist/components/message.js +1 -1
  65. package/dist/components/native-select.js +1 -1
  66. package/dist/components/navigation-menu.js +2 -2
  67. package/dist/components/pagination.d.ts +2 -2
  68. package/dist/components/pagination.js +3 -3
  69. package/dist/components/popover.js +1 -1
  70. package/dist/components/progress-circle.d.ts +2 -2
  71. package/dist/components/progress-circle.js +3 -3
  72. package/dist/components/progress.d.ts +6 -1
  73. package/dist/components/progress.js +12 -4
  74. package/dist/components/radio-cards.js +2 -2
  75. package/dist/components/radio-group.js +1 -1
  76. package/dist/components/radio.js +1 -1
  77. package/dist/components/resizable.js +1 -1
  78. package/dist/components/scroll-area.d.ts +1 -1
  79. package/dist/components/scroll-area.js +2 -2
  80. package/dist/components/select.js +1 -1
  81. package/dist/components/separator.d.ts +1 -1
  82. package/dist/components/separator.js +2 -2
  83. package/dist/components/sheet.d.ts +9 -3
  84. package/dist/components/sheet.js +5 -5
  85. package/dist/components/sidebar.d.ts +19 -7
  86. package/dist/components/sidebar.js +66 -32
  87. package/dist/components/skeleton.js +1 -1
  88. package/dist/components/slider.js +1 -1
  89. package/dist/components/spinner.js +1 -1
  90. package/dist/components/switch.js +1 -1
  91. package/dist/components/table.js +1 -1
  92. package/dist/components/tabs.d.ts +1 -1
  93. package/dist/components/tabs.js +2 -2
  94. package/dist/components/textarea.js +1 -1
  95. package/dist/components/toggle-group.d.ts +2 -2
  96. package/dist/components/toggle-group.js +2 -2
  97. package/dist/components/toggle.d.ts +1 -1
  98. package/dist/components/toggle.js +1 -1
  99. package/dist/components/tooltip.js +1 -1
  100. package/dist/hooks/use-is-mobile.js +1 -1
  101. package/dist/hooks/use-media-query.d.ts +3 -3
  102. package/dist/hooks/use-media-query.js +15 -32
  103. package/dist/hooks/use-message-scroller-commands.d.ts +2 -2
  104. package/dist/hooks/use-message-scroller-commands.js +2 -2
  105. package/dist/hooks/use-message-scroller-controller.d.ts +2 -2
  106. package/dist/hooks/use-message-scroller-controller.js +4 -4
  107. package/dist/hooks/use-message-scroller-refs.d.ts +1 -1
  108. package/dist/hooks/use-message-scroller-refs.js +3 -3
  109. package/dist/index.d.ts +180 -180
  110. package/dist/index.js +93 -93
  111. package/dist/lib/message-scroller/geometry.d.ts +1 -1
  112. package/dist/lib/message-scroller/geometry.js +1 -1
  113. package/dist/lib/message-scroller/stores.d.ts +1 -1
  114. package/dist/lib/message-scroller/stores.js +1 -1
  115. package/dist/lib/message-scroller/types.d.ts +1 -1
  116. package/dist/primitives/input-number.d.ts +6 -6
  117. package/dist/primitives/input-number.js +6 -6
  118. package/dist/primitives/message-scroller.d.ts +6 -6
  119. package/dist/primitives/message-scroller.js +3 -3
  120. package/dist/variants/alert.d.ts +1 -1
  121. package/dist/variants/alert.js +1 -1
  122. package/dist/variants/attachment.d.ts +1 -1
  123. package/dist/variants/attachment.js +1 -1
  124. package/dist/variants/badge.d.ts +1 -1
  125. package/dist/variants/badge.js +1 -1
  126. package/dist/variants/bubble.d.ts +1 -1
  127. package/dist/variants/bubble.js +1 -1
  128. package/dist/variants/button-group.d.ts +1 -1
  129. package/dist/variants/button-group.js +1 -1
  130. package/dist/variants/button.d.ts +1 -1
  131. package/dist/variants/button.js +1 -1
  132. package/dist/variants/empty.d.ts +1 -1
  133. package/dist/variants/empty.js +1 -1
  134. package/dist/variants/field.d.ts +1 -1
  135. package/dist/variants/field.js +1 -1
  136. package/dist/variants/input-group.d.ts +1 -1
  137. package/dist/variants/input-group.js +1 -1
  138. package/dist/variants/item.d.ts +1 -1
  139. package/dist/variants/item.js +1 -1
  140. package/dist/variants/marker.d.ts +1 -1
  141. package/dist/variants/marker.js +1 -1
  142. package/dist/variants/navigation-menu.d.ts +1 -1
  143. package/dist/variants/navigation-menu.js +1 -1
  144. package/dist/variants/progress-circle.d.ts +1 -1
  145. package/dist/variants/progress-circle.js +1 -1
  146. package/dist/variants/scroll-area.d.ts +1 -1
  147. package/dist/variants/scroll-area.js +1 -1
  148. package/dist/variants/separator.d.ts +1 -1
  149. package/dist/variants/separator.js +1 -1
  150. package/dist/variants/sheet.d.ts +1 -1
  151. package/dist/variants/sheet.js +1 -1
  152. package/dist/variants/sidebar.d.ts +1 -1
  153. package/dist/variants/sidebar.js +1 -1
  154. package/dist/variants/tabs.d.ts +1 -1
  155. package/dist/variants/tabs.js +1 -1
  156. package/dist/variants/toggle.d.ts +1 -1
  157. package/dist/variants/toggle.js +1 -1
  158. package/package.json +8 -7
  159. package/src/css/foundation/base.css +68 -0
  160. package/src/css/foundation/motion.css +65 -0
  161. package/src/css/foundation/source.css +14 -0
  162. package/src/css/foundation/tokens.css +83 -0
  163. package/src/css/foundation/utilities.css +451 -0
  164. package/src/css/foundation/variants.css +121 -0
  165. package/src/css/preset.css +14 -0
  166. package/src/css/style.css +11 -0
  167. package/src/css/themes/amber.css +105 -0
  168. package/src/css/themes/blue.css +105 -0
  169. package/src/css/themes/cyan.css +105 -0
  170. package/src/css/themes/emerald.css +105 -0
  171. package/src/css/themes/fuchsia.css +105 -0
  172. package/src/css/themes/gray.css +105 -0
  173. package/src/css/themes/green.css +105 -0
  174. package/src/css/themes/indigo.css +105 -0
  175. package/src/css/themes/lime.css +105 -0
  176. package/src/css/themes/neutral.css +105 -0
  177. package/src/css/themes/orange.css +105 -0
  178. package/src/css/themes/pink.css +105 -0
  179. package/src/css/themes/purple.css +105 -0
  180. package/src/css/themes/red.css +105 -0
  181. package/src/css/themes/rose.css +105 -0
  182. package/src/css/themes/sky.css +105 -0
  183. package/src/css/themes/slate.css +105 -0
  184. package/src/css/themes/stone.css +105 -0
  185. package/src/css/themes/teal.css +105 -0
  186. package/src/css/themes/violet.css +105 -0
  187. package/src/css/themes/yellow.css +105 -0
  188. package/src/css/themes/zinc.css +105 -0
@@ -1,4 +1,4 @@
1
- import type { VariantProps } from "#/lib/utils";
1
+ import type { VariantProps } from "#lib/utils";
2
2
  /**
3
3
  * @since 0.3.16-canary.0
4
4
  */
@@ -1,4 +1,4 @@
1
- import { tv } from "#/lib/utils";
1
+ import { tv } from "#lib/utils";
2
2
  // ── Variant: SidebarMenuButton ───────────────────────────────────────────────────────────────────────────────────────
3
3
  /**
4
4
  * @since 0.3.16-canary.0
@@ -1,4 +1,4 @@
1
- import type { VariantProps } from "#/lib/utils";
1
+ import type { VariantProps } from "#lib/utils";
2
2
  /**
3
3
  * @since 0.3.16-canary.0
4
4
  */
@@ -1,4 +1,4 @@
1
- import { tv } from "#/lib/utils";
1
+ import { tv } from "#lib/utils";
2
2
  // ── Variant: TabsList ────────────────────────────────────────────────────────────────────────────────────────────────
3
3
  /**
4
4
  * @since 0.3.16-canary.0
@@ -1,4 +1,4 @@
1
- import type { VariantProps } from "#/lib/utils";
1
+ import type { VariantProps } from "#lib/utils";
2
2
  /**
3
3
  * @since 0.3.16-canary.0
4
4
  */
@@ -1,4 +1,4 @@
1
- import { tv } from "#/lib/utils";
1
+ import { tv } from "#lib/utils";
2
2
  // ── Variant: Toggle ──────────────────────────────────────────────────────────────────────────────────────────────────
3
3
  /**
4
4
  * @since 0.3.16-canary.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefast/ui",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "description": "Core UI components library built with React and Tailwind CSS",
5
5
  "keywords": [
6
6
  "components",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "files": [
28
28
  "dist",
29
+ "src/css",
29
30
  "CHANGELOG.md",
30
31
  "README.md",
31
32
  "LICENSE"
@@ -38,7 +39,7 @@
38
39
  "module": "./dist/index.js",
39
40
  "types": "./dist/index.d.ts",
40
41
  "imports": {
41
- "#/*": {
42
+ "#*": {
42
43
  "types": "./dist/*.d.ts",
43
44
  "default": "./dist/*.js"
44
45
  }
@@ -487,19 +488,19 @@
487
488
  "access": "public"
488
489
  },
489
490
  "dependencies": {
490
- "@codefast/tailwind-variants": "0.8.0",
491
+ "@codefast/tailwind-variants": "0.9.0",
491
492
  "@daypicker/react": "^10.0.1",
492
493
  "cmdk": "^1.1.1",
493
494
  "embla-carousel-react": "^8.6.0",
494
495
  "input-otp": "^1.5.0",
495
- "lucide-react": "^1.41.0",
496
+ "lucide-react": "^1.47.0",
496
497
  "next-themes": "^0.4.6",
497
498
  "radix-ui": "^1.6.7",
498
- "react-hook-form": "^7.87.0",
499
- "react-resizable-panels": "^4.12.3",
499
+ "react-hook-form": "^7.88.0",
500
+ "react-resizable-panels": "^4.13.2",
500
501
  "recharts": "^3.10.1",
501
502
  "sonner": "^2.0.8",
502
- "tailwind-merge": "^3.6.0",
503
+ "tailwind-merge": "^3.7.0",
503
504
  "tw-animate-css": "^1.4.0",
504
505
  "vaul": "^1.1.2"
505
506
  },
@@ -0,0 +1,68 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Base
3
+ *
4
+ * Global element defaults layered into Tailwind's `base` cascade: default
5
+ * border/outline colors, scrollbar styling, document background, and
6
+ * native input appearance resets.
7
+ * ------------------------------------------------------------------------- */
8
+
9
+ @layer base {
10
+ /* ── Default border & focus-ring colors for every element ──────────────────────────────────────────────────────── */
11
+
12
+ *,
13
+ ::after,
14
+ ::before,
15
+ ::backdrop,
16
+ ::file-selector-button {
17
+ border-color: var(--color-border);
18
+ outline-color: --alpha(var(--color-ring) / 20%);
19
+ }
20
+
21
+ /* ----------------------------------------------------------------------
22
+ * Scrollbars — WebKit (size + colors) and Firefox (thin + colors)
23
+ * ---------------------------------------------------------------------- */
24
+
25
+ ::-webkit-scrollbar {
26
+ @apply size-2;
27
+ }
28
+
29
+ ::-webkit-scrollbar-track {
30
+ @apply bg-transparent;
31
+ }
32
+
33
+ ::-webkit-scrollbar-thumb {
34
+ @apply rounded-full bg-border;
35
+ }
36
+
37
+ * {
38
+ scrollbar-width: thin;
39
+ scrollbar-color: var(--color-border) transparent;
40
+ }
41
+
42
+ /* ── Document ──────────────────────────────────────────────────────────────────────────────────────────────────── */
43
+
44
+ html,
45
+ body {
46
+ background-color: var(--color-background);
47
+ color: var(--color-foreground);
48
+ }
49
+
50
+ /* ── Inputs — strip native search & number-spinner affordances ─────────────────────────────────────────────────── */
51
+
52
+ input {
53
+ &::-webkit-search-cancel-button,
54
+ &::-webkit-search-decoration {
55
+ appearance: none;
56
+ }
57
+
58
+ &::-webkit-outer-spin-button,
59
+ &::-webkit-inner-spin-button {
60
+ -webkit-appearance: none;
61
+ margin: 0;
62
+ }
63
+
64
+ &[type="number"] {
65
+ -moz-appearance: textfield;
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,65 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Motion
3
+ *
4
+ * Easing curves, semantic durations, and keyframes for @codefast/ui. Tokens
5
+ * are exposed through Tailwind's @theme so they mint matching `ease-*`,
6
+ * `duration-*`, and `animate-*` utilities.
7
+ * ------------------------------------------------------------------------- */
8
+
9
+ @theme {
10
+ /* ── Easing — enter curves (decelerate into place) ─────────────────────────────────────────────────────────────── */
11
+
12
+ --ease-ui: cubic-bezier(0.32, 0.72, 0, 1); /* Large surfaces: dialog, sheet */
13
+ --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* Playful overshoot (opt-in) */
14
+ --ease-snappy: cubic-bezier(0.23, 1, 0.32, 1); /* Small popups: menu, tooltip */
15
+ --ease-gentle: cubic-bezier(0.4, 0, 0.2, 1); /* Continuous layout shifts, fades */
16
+
17
+ /* ----------------------------------------------------------------------
18
+ * Easing — exit curve (accelerate away; pair with `data-closed:`)
19
+ * ---------------------------------------------------------------------- */
20
+
21
+ --ease-exit: cubic-bezier(0.4, 0, 1, 1);
22
+
23
+ /* ----------------------------------------------------------------------
24
+ * Durations — enter/exit pairs per surface role
25
+ *
26
+ * Exit ≈ 60% of enter to offset the slow start of the accelerating exit
27
+ * curve.
28
+ * ---------------------------------------------------------------------- */
29
+
30
+ --animation-duration-menu-in: 150ms; /* Menus, tooltip — instant tools */
31
+ --animation-duration-menu-out: 100ms;
32
+ --animation-duration-popup-in: 200ms; /* Popover, hover card — content surfaces */
33
+ --animation-duration-popup-out: 120ms;
34
+ --animation-duration-overlay-in: 220ms; /* Dialog content + backdrop */
35
+ --animation-duration-overlay-out: 150ms;
36
+ --animation-duration-panel-in: 320ms; /* Sheet, drawer — large sliding panels */
37
+ --animation-duration-panel-out: 220ms;
38
+ --animation-duration-expand-in: 200ms; /* Accordion, inline disclosure */
39
+ --animation-duration-expand-out: 150ms;
40
+
41
+ /* ----------------------------------------------------------------------
42
+ * Durations — form controls (switch, checkbox, radio)
43
+ *
44
+ * Defined in the transition-duration namespace so they mint clean
45
+ * `duration-control*` utilities; `animate-in` also picks them up via its
46
+ * --tw-duration fallback, so a single utility drives both the state
47
+ * transition and the indicator keyframe.
48
+ * ---------------------------------------------------------------------- */
49
+
50
+ --transition-duration-control: 100ms; /* Container / ring: switch track, checkbox & radio box */
51
+ --transition-duration-control-indicator: 200ms; /* Moving part: switch thumb, check, radio dot */
52
+
53
+ /* ── Keyframes ─────────────────────────────────────────────────────────────────────────────────────────────────── */
54
+
55
+ --animate-shimmer: shimmer 2.2s linear infinite;
56
+
57
+ @keyframes shimmer {
58
+ from {
59
+ background-position: 200% center;
60
+ }
61
+ to {
62
+ background-position: -200% center;
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,14 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Source
3
+ *
4
+ * Third-party imports and the Tailwind content sources scanned for the
5
+ * class names the components use.
6
+ * ------------------------------------------------------------------------- */
7
+
8
+ @import "tw-animate-css";
9
+
10
+ /* Workspace apps read `src` in dev, through the `source` export condition. */
11
+ @source "../../**/*.{ts,tsx}";
12
+
13
+ /* Consumers read `dist`: the published tarball ships no `src` beyond `src/css`. */
14
+ @source "../../../dist/**/*.js";
@@ -0,0 +1,83 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Design tokens
3
+ *
4
+ * Bridges the raw theme variables (`--background`, `--primary`, …) defined by
5
+ * each theme into Tailwind's `@theme inline` namespace, minting the
6
+ * `bg-*`, `text-*`, `border-*`, and `rounded-*` utilities the components use.
7
+ * ------------------------------------------------------------------------- */
8
+
9
+ :root {
10
+ --radius: 0.375rem;
11
+ }
12
+
13
+ @theme inline {
14
+ /* ── Typography ────────────────────────────────────────────────────────────────────────────────────────────────── */
15
+
16
+ /* Bridge the app-owned raw vars into the font-* utilities; fall back to sane
17
+ stacks so a consumer that forgets one degrades gracefully instead of
18
+ silently inheriting the sans font. */
19
+ --font-sans: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
20
+ --font-heading: var(--font-heading, var(--font-sans, ui-sans-serif, system-ui, sans-serif));
21
+ --font-mono: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
22
+
23
+ /* ── Surfaces & semantic colors ────────────────────────────────────────────────────────────────────────────────── */
24
+
25
+ --color-background: var(--background);
26
+ --color-foreground: var(--foreground);
27
+
28
+ --color-primary: var(--primary);
29
+ --color-primary-foreground: var(--primary-foreground);
30
+
31
+ --color-secondary: var(--secondary);
32
+ --color-secondary-foreground: var(--secondary-foreground);
33
+
34
+ --color-destructive: var(--destructive);
35
+
36
+ --color-muted: var(--muted);
37
+ --color-muted-foreground: var(--muted-foreground);
38
+
39
+ --color-accent: var(--accent);
40
+ --color-accent-foreground: var(--accent-foreground);
41
+
42
+ --color-popover: var(--popover);
43
+ --color-popover-foreground: var(--popover-foreground);
44
+
45
+ --color-card: var(--card);
46
+ --color-card-foreground: var(--card-foreground);
47
+
48
+ /* ── Form & focus ──────────────────────────────────────────────────────────────────────────────────────────────── */
49
+
50
+ --color-border: var(--border);
51
+ --color-input: var(--input);
52
+ --color-ring: var(--ring);
53
+
54
+ /* ── Sidebar ───────────────────────────────────────────────────────────────────────────────────────────────────── */
55
+
56
+ --color-sidebar: var(--sidebar);
57
+ --color-sidebar-foreground: var(--sidebar-foreground);
58
+ --color-sidebar-primary: var(--sidebar-primary);
59
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
60
+ --color-sidebar-accent: var(--sidebar-accent);
61
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
62
+ --color-sidebar-border: var(--sidebar-border);
63
+ --color-sidebar-ring: var(--sidebar-ring);
64
+
65
+ /* ── Charts ────────────────────────────────────────────────────────────────────────────────────────────────────── */
66
+
67
+ --color-chart-1: var(--chart-1);
68
+ --color-chart-2: var(--chart-2);
69
+ --color-chart-3: var(--chart-3);
70
+ --color-chart-4: var(--chart-4);
71
+ --color-chart-5: var(--chart-5);
72
+
73
+ /* ── Radius scale — derived from --radius (6 = base unit) ──────────────────────────────────────────────────────── */
74
+
75
+ --radius-xs: calc(var(--radius) * 2 / 6);
76
+ --radius-sm: calc(var(--radius) * 4 / 6);
77
+ --radius-md: var(--radius);
78
+ --radius-lg: calc(var(--radius) * 8 / 6);
79
+ --radius-xl: calc(var(--radius) * 12 / 6);
80
+ --radius-2xl: calc(var(--radius) * 16 / 6);
81
+ --radius-3xl: calc(var(--radius) * 24 / 6);
82
+ --radius-4xl: calc(var(--radius) * 32 / 6);
83
+ }