@danieljoffe/shared-ui 0.0.1 → 0.1.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 (54) hide show
  1. package/dist/index.js +110 -5358
  2. package/dist/lib/Alert.js +72 -0
  3. package/dist/lib/AspectRatio.js +31 -0
  4. package/dist/lib/Avatar.js +47 -0
  5. package/dist/lib/Badge.js +43 -0
  6. package/dist/lib/Breadcrumb.js +28 -0
  7. package/dist/lib/Button.js +82 -0
  8. package/dist/lib/CTACard.js +31 -0
  9. package/dist/lib/Card.js +91 -0
  10. package/dist/lib/Checkbox.js +75 -0
  11. package/dist/lib/Container.js +35 -0
  12. package/dist/lib/Divider.js +48 -0
  13. package/dist/lib/Dropdown.js +158 -0
  14. package/dist/lib/FormFieldError.js +8 -0
  15. package/dist/lib/Grid.js +67 -0
  16. package/dist/lib/GridBg.js +31 -0
  17. package/dist/lib/Heading.js +40 -0
  18. package/dist/lib/Input.js +55 -0
  19. package/dist/lib/Kbd.js +19 -0
  20. package/dist/lib/Loading.js +44 -0
  21. package/dist/lib/Modal.js +119 -0
  22. package/dist/lib/PageContainer.js +35 -0
  23. package/dist/lib/PageLayout.js +25 -0
  24. package/dist/lib/Pagination.js +111 -0
  25. package/dist/lib/ProgressBar.js +68 -0
  26. package/dist/lib/Section.js +58 -0
  27. package/dist/lib/SectionLabel.js +19 -0
  28. package/dist/lib/Select.js +67 -0
  29. package/dist/lib/Sidebar.js +97 -0
  30. package/dist/lib/Skeleton.js +63 -0
  31. package/dist/lib/Spacer.js +17 -0
  32. package/dist/lib/Spinner.js +39 -0
  33. package/dist/lib/Stack.js +59 -0
  34. package/dist/lib/StatsCard.js +79 -0
  35. package/dist/lib/StructuredData.js +15 -0
  36. package/dist/lib/Switch.js +69 -0
  37. package/dist/lib/Table.js +91 -0
  38. package/dist/lib/Tabs.js +101 -0
  39. package/dist/lib/Text.js +48 -0
  40. package/dist/lib/Textarea.js +50 -0
  41. package/dist/lib/ThemeProvider.js +54 -0
  42. package/dist/lib/ThemeToggle.js +29 -0
  43. package/dist/lib/Toast.js +95 -0
  44. package/dist/lib/Tooltip.js +70 -0
  45. package/dist/lib/index.js +112 -0
  46. package/dist/lib/styles/formStyles.js +24 -0
  47. package/dist/lib/styles/semanticVariants.js +27 -0
  48. package/dist/lib/types.js +1 -0
  49. package/dist/lib/utils/ErrorBoundary.js +17 -0
  50. package/dist/lib/utils/ModalErrorBoundary.js +17 -0
  51. package/dist/lib/utils/cn.js +8 -0
  52. package/dist/lib/utils/index.js +10 -0
  53. package/dist/lib/utils/validateProps.js +7 -0
  54. package/package.json +7 -4
@@ -0,0 +1,112 @@
1
+ import { Alert as e } from "./Alert.js";
2
+ import { AspectRatio as p } from "./AspectRatio.js";
3
+ import { Avatar as x } from "./Avatar.js";
4
+ import { Badge as a } from "./Badge.js";
5
+ import { Breadcrumb as i } from "./Breadcrumb.js";
6
+ import { Button as T, baseButtonStyles as S, sizeButtonStyles as l, variantButtonStyles as C, variantLinkOutline as s } from "./Button.js";
7
+ import { Card as B, CardContent as c, CardFooter as g, CardHeader as E, CardTitle as b } from "./Card.js";
8
+ import { Checkbox as I } from "./Checkbox.js";
9
+ import { Container as v } from "./Container.js";
10
+ import { CTACard as M } from "./CTACard.js";
11
+ import { Divider as h } from "./Divider.js";
12
+ import { Heading as L } from "./Heading.js";
13
+ import { Text as k } from "./Text.js";
14
+ import { FormFieldError as R } from "./FormFieldError.js";
15
+ import { Dropdown as H } from "./Dropdown.js";
16
+ import { PageContainer as O } from "./PageContainer.js";
17
+ import { PageLayout as K } from "./PageLayout.js";
18
+ import { Grid as j, GridItem as q } from "./Grid.js";
19
+ import { GridBg as Q } from "./GridBg.js";
20
+ import { Input as V } from "./Input.js";
21
+ import { Kbd as Y } from "./Kbd.js";
22
+ import { Loading as $ } from "./Loading.js";
23
+ import { Modal as or } from "./Modal.js";
24
+ import { Pagination as tr } from "./Pagination.js";
25
+ import { ProgressBar as mr } from "./ProgressBar.js";
26
+ import { Section as fr } from "./Section.js";
27
+ import { SectionLabel as dr } from "./SectionLabel.js";
28
+ import { Select as nr } from "./Select.js";
29
+ import { Sidebar as Sr } from "./Sidebar.js";
30
+ import { Skeleton as Cr } from "./Skeleton.js";
31
+ import { Spacer as ur } from "./Spacer.js";
32
+ import { Spinner as cr } from "./Spinner.js";
33
+ import { Stack as Er } from "./Stack.js";
34
+ import { StructuredData as Ar } from "./StructuredData.js";
35
+ import { StatsCard as Pr } from "./StatsCard.js";
36
+ import { Switch as yr } from "./Switch.js";
37
+ import { Table as Nr } from "./Table.js";
38
+ import { Tabs as Gr } from "./Tabs.js";
39
+ import { Textarea as _r } from "./Textarea.js";
40
+ import { ThemeProvider as Dr, useTheme as Rr } from "./ThemeProvider.js";
41
+ import { ThemeToggle as Hr } from "./ThemeToggle.js";
42
+ import { ToastProvider as Or, useToast as zr } from "./Toast.js";
43
+ import { Tooltip as Xr } from "./Tooltip.js";
44
+ import { cn as qr } from "./utils/cn.js";
45
+ import { validateProps as Qr } from "./utils/validateProps.js";
46
+ import { ErrorBoundary as Vr } from "./utils/ErrorBoundary.js";
47
+ import { ModalErrorBoundary as Yr } from "./utils/ModalErrorBoundary.js";
48
+ import { SEMANTIC_BG_LIGHT as $r, SEMANTIC_BORDER as ro, SEMANTIC_SPINNER as oo, SEMANTIC_TEXT as eo } from "./styles/semanticVariants.js";
49
+ export {
50
+ e as Alert,
51
+ p as AspectRatio,
52
+ x as Avatar,
53
+ a as Badge,
54
+ i as Breadcrumb,
55
+ T as Button,
56
+ M as CTACard,
57
+ B as Card,
58
+ c as CardContent,
59
+ g as CardFooter,
60
+ E as CardHeader,
61
+ b as CardTitle,
62
+ I as Checkbox,
63
+ v as Container,
64
+ h as Divider,
65
+ H as Dropdown,
66
+ Vr as ErrorBoundary,
67
+ R as FormFieldError,
68
+ j as Grid,
69
+ Q as GridBg,
70
+ q as GridItem,
71
+ L as Heading,
72
+ V as Input,
73
+ Y as Kbd,
74
+ $ as Loading,
75
+ or as Modal,
76
+ Yr as ModalErrorBoundary,
77
+ O as PageContainer,
78
+ K as PageLayout,
79
+ tr as Pagination,
80
+ mr as ProgressBar,
81
+ $r as SEMANTIC_BG_LIGHT,
82
+ ro as SEMANTIC_BORDER,
83
+ oo as SEMANTIC_SPINNER,
84
+ eo as SEMANTIC_TEXT,
85
+ fr as Section,
86
+ dr as SectionLabel,
87
+ nr as Select,
88
+ Sr as Sidebar,
89
+ Cr as Skeleton,
90
+ ur as Spacer,
91
+ cr as Spinner,
92
+ Er as Stack,
93
+ Pr as StatsCard,
94
+ Ar as StructuredData,
95
+ yr as Switch,
96
+ Nr as Table,
97
+ Gr as Tabs,
98
+ k as Text,
99
+ _r as Textarea,
100
+ Dr as ThemeProvider,
101
+ Hr as ThemeToggle,
102
+ Or as ToastProvider,
103
+ Xr as Tooltip,
104
+ S as baseButtonStyles,
105
+ qr as cn,
106
+ l as sizeButtonStyles,
107
+ Rr as useTheme,
108
+ zr as useToast,
109
+ Qr as validateProps,
110
+ C as variantButtonStyles,
111
+ s as variantLinkOutline
112
+ };
@@ -0,0 +1,24 @@
1
+ const e = "block text-text-primary mb-2", r = "text-error ml-1", s = [
2
+ "w-full bg-surface border border-border rounded-md",
3
+ "text-text-primary",
4
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500",
5
+ "focus-visible:border-transparent transition-all"
6
+ ].join(" "), o = "px-4 py-2.5", i = "placeholder:text-text-tertiary", t = "border-error focus-visible:ring-error", n = "border-success focus-visible:ring-success", c = "disabled:opacity-50 disabled:cursor-not-allowed", l = "peer-disabled:opacity-50 peer-disabled:cursor-not-allowed", b = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500", f = "focus-visible:ring-offset-2 focus-visible:ring-offset-surface", u = [
7
+ "peer-focus-visible:ring-2 peer-focus-visible:ring-brand-500",
8
+ "peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-surface"
9
+ ].join(" "), a = "text-text-tertiary hover:text-text-primary transition-colors";
10
+ export {
11
+ s as BASE_FIELD,
12
+ c as DISABLED,
13
+ l as DISABLED_PEER,
14
+ a as DISMISS_BUTTON,
15
+ t as FIELD_ERROR,
16
+ o as FIELD_PADDING,
17
+ i as FIELD_PLACEHOLDER,
18
+ n as FIELD_SUCCESS,
19
+ b as FOCUS_RING,
20
+ f as FOCUS_RING_OFFSET,
21
+ u as FOCUS_RING_PEER,
22
+ e as FORM_LABEL,
23
+ r as REQUIRED_MARK
24
+ };
@@ -0,0 +1,27 @@
1
+ const e = {
2
+ info: "text-info",
3
+ success: "text-success",
4
+ warning: "text-warning",
5
+ error: "text-error"
6
+ }, n = {
7
+ info: "bg-info-light",
8
+ success: "bg-success-light",
9
+ warning: "bg-warning-light",
10
+ error: "bg-error-light"
11
+ }, r = {
12
+ info: "border-info/30",
13
+ success: "border-success/30",
14
+ warning: "border-warning/30",
15
+ error: "border-error/30"
16
+ }, o = {
17
+ info: `${r.info} border-t-info`,
18
+ success: `${r.success} border-t-success`,
19
+ warning: `${r.warning} border-t-warning`,
20
+ error: `${r.error} border-t-error`
21
+ };
22
+ export {
23
+ n as SEMANTIC_BG_LIGHT,
24
+ r as SEMANTIC_BORDER,
25
+ o as SEMANTIC_SPINNER,
26
+ e as SEMANTIC_TEXT
27
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { Component as t } from "react";
3
+ class n extends t {
4
+ state = { hasError: !1 };
5
+ static getDerivedStateFromError() {
6
+ return { hasError: !0 };
7
+ }
8
+ componentDidCatch(r, e) {
9
+ process.env.NODE_ENV === "development" && console.error("[ErrorBoundary] Render error:", r, e), this.props.onError?.(r, e);
10
+ }
11
+ render() {
12
+ return this.state.hasError ? this.props.fallback ?? null : this.props.children;
13
+ }
14
+ }
15
+ export {
16
+ n as ErrorBoundary
17
+ };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { Component as o } from "react";
3
+ class s extends o {
4
+ state = { hasError: !1 };
5
+ static getDerivedStateFromError() {
6
+ return { hasError: !0 };
7
+ }
8
+ componentDidCatch(r, e) {
9
+ process.env.NODE_ENV === "development" && console.error("[Modal] Render error:", r, e), typeof document < "u" && (document.body.style.overflow = "unset");
10
+ }
11
+ render() {
12
+ return this.state.hasError ? this.props.fallback ?? null : this.props.children;
13
+ }
14
+ }
15
+ export {
16
+ s as ModalErrorBoundary
17
+ };
@@ -0,0 +1,8 @@
1
+ import { clsx as o } from "clsx";
2
+ import { twMerge as t } from "tailwind-merge";
3
+ function n(...r) {
4
+ return t(o(r));
5
+ }
6
+ export {
7
+ n as cn
8
+ };
@@ -0,0 +1,10 @@
1
+ import { cn as a } from "./cn.js";
2
+ import { validateProps as p } from "./validateProps.js";
3
+ import { ErrorBoundary as d } from "./ErrorBoundary.js";
4
+ import { ModalErrorBoundary as m } from "./ModalErrorBoundary.js";
5
+ export {
6
+ d as ErrorBoundary,
7
+ m as ModalErrorBoundary,
8
+ a as cn,
9
+ p as validateProps
10
+ };
@@ -0,0 +1,7 @@
1
+ function i(e, n, o, t) {
2
+ const r = n(e);
3
+ return r ? (process.env.NODE_ENV === "development" && console.error(`[${t}] Invalid props: ${r}`), { ...o, ...e }) : e;
4
+ }
5
+ export {
6
+ i as validateProps
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danieljoffe/shared-ui",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "React component library and design system shared across danieljoffe.com and WyrdFold — Tailwind CSS 4, React 19, server-component-friendly.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -18,17 +18,20 @@
18
18
  "./*": {
19
19
  "@danieljoffe.com/source": "./src/lib/*.tsx",
20
20
  "types": "./dist/lib/*.d.ts",
21
- "default": "./src/lib/*.tsx"
21
+ "import": "./dist/lib/*.js",
22
+ "default": "./dist/lib/*.js"
22
23
  },
23
24
  "./styles/*": {
24
25
  "@danieljoffe.com/source": "./src/lib/styles/*.ts",
25
26
  "types": "./dist/lib/styles/*.d.ts",
26
- "default": "./src/lib/styles/*.ts"
27
+ "import": "./dist/lib/styles/*.js",
28
+ "default": "./dist/lib/styles/*.js"
27
29
  },
28
30
  "./types": {
29
31
  "@danieljoffe.com/source": "./src/lib/types.ts",
30
32
  "types": "./dist/lib/types.d.ts",
31
- "default": "./src/lib/types.ts"
33
+ "import": "./dist/lib/types.js",
34
+ "default": "./dist/lib/types.js"
32
35
  },
33
36
  "./styles/indigo-theme.css": "./src/styles/indigo-theme.css",
34
37
  "./styles/pyre-theme.css": "./src/styles/pyre-theme.css"