@startsimpli/ui 0.1.0 → 0.1.3
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/chunk-27YUQBOE.mjs +3954 -0
- package/dist/chunk-27YUQBOE.mjs.map +1 -0
- package/dist/chunk-G2AM3DBU.mjs +1026 -0
- package/dist/chunk-G2AM3DBU.mjs.map +1 -0
- package/dist/chunk-G4XBXCFH.mjs +63 -0
- package/dist/chunk-G4XBXCFH.mjs.map +1 -0
- package/dist/chunk-LZOMFHX3.mjs +35 -0
- package/dist/chunk-LZOMFHX3.mjs.map +1 -0
- package/dist/chunk-QYXFLOO7.mjs +210 -0
- package/dist/chunk-QYXFLOO7.mjs.map +1 -0
- package/dist/components/index.d.mts +472 -0
- package/dist/components/index.d.ts +472 -0
- package/dist/components/index.js +5149 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +6 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/components/unified-table/index.d.mts +725 -0
- package/dist/components/unified-table/index.d.ts +725 -0
- package/dist/components/unified-table/index.js +4000 -0
- package/dist/components/unified-table/index.js.map +1 -0
- package/dist/components/unified-table/index.mjs +5 -0
- package/dist/components/unified-table/index.mjs.map +1 -0
- package/dist/index.d.mts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +5448 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12 -0
- package/dist/index.mjs.map +1 -0
- package/dist/theme/index.d.mts +20 -0
- package/dist/theme/index.d.ts +20 -0
- package/dist/theme/index.js +245 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/index.mjs +9 -0
- package/dist/theme/index.mjs.map +1 -0
- package/dist/utils/index.d.mts +38 -0
- package/dist/utils/index.d.ts +38 -0
- package/dist/utils/index.js +72 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +4 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +62 -21
- package/src/__mocks__/next/navigation.js +18 -0
- package/src/components/__tests__/safe-html.test.tsx +45 -0
- package/src/components/__tests__/states.test.tsx +94 -0
- package/src/components/__tests__/status-badge.test.tsx +101 -0
- package/src/components/__tests__/toast.test.tsx +124 -0
- package/src/components/badge/StatusBadge.tsx +55 -0
- package/src/components/badge/index.ts +2 -0
- package/src/components/dialog/BaseDialog.tsx +184 -0
- package/src/components/dialog/index.ts +8 -0
- package/src/components/index.ts +25 -0
- package/src/components/loading/DashboardSkeleton.tsx +27 -0
- package/src/components/loading/TableSkeleton.tsx +63 -0
- package/src/components/loading/index.ts +4 -0
- package/src/components/safe-html.tsx +18 -0
- package/src/components/states/EmptyState.tsx +48 -0
- package/src/components/states/ErrorState.tsx +76 -0
- package/src/components/states/index.ts +4 -0
- package/src/components/toast/Toaster.tsx +72 -0
- package/src/components/toast/index.ts +5 -0
- package/src/components/toast/use-notify.ts +45 -0
- package/src/components/toast/use-toast.ts +150 -0
- package/src/components/ui/api-error-boundary.tsx +64 -0
- package/src/components/ui/feature-gate.tsx +87 -0
- package/src/components/ui/index.ts +4 -0
- package/src/components/ui/page-loader.tsx +31 -0
- package/src/components/ui/query-provider.tsx +30 -0
- package/src/components/unified-table/components/Toolbar/StandardTableToolbar.tsx +1 -1
- package/src/components/unified-table/hooks/useFilters.ts +1 -0
- package/src/components/unified-table/hooks/usePagination.ts +1 -0
- package/src/components/unified-table/hooks/useSelection.ts +2 -1
- package/src/components/unified-table/hooks/useTableKeyboard.ts +2 -1
- package/src/components/unified-table/hooks/useTablePreferences.ts +1 -0
- package/src/components/unified-table/hooks/useTableState.ts +1 -0
- package/src/components/unified-table/hooks/useTableURL.test.tsx +1 -1
- package/src/components/unified-table/index.ts +4 -0
- package/src/components/wizard/StepIndicator.tsx +60 -0
- package/src/components/wizard/index.ts +2 -0
- package/src/theme/tailwind.config.d.ts +3 -0
- package/tailwind.preset.js +87 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, ApiErrorBoundary, BaseDialog, Calendar, Collapsible, CollapsibleContent, CollapsibleTrigger, DashboardSkeleton, EmptyState, ErrorState, FeatureGate, PageLoader, Popover, PopoverContent, PopoverTrigger, Progress, QueryProvider, SafeHtml, ScrollArea, ScrollBar, Separator, Sidebar, SidebarLayout, Skeleton, StatusBadge, StepIndicator, TableSkeleton, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, clearAllToasts, notify, toast, useDialogContext, useNotify, useToast } from './chunk-G2AM3DBU.mjs';
|
|
2
|
+
import { import_tailwind } from './chunk-QYXFLOO7.mjs';
|
|
3
|
+
export { THEME_TOKENS, tailwind_preset_default as tailwindPreset } from './chunk-QYXFLOO7.mjs';
|
|
4
|
+
export { Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, Label, MOBILE_BREAKPOINT, Card2 as MobileCard, CardActions as MobileCardActions, MobileView, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StandardTableToolbar, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, UnifiedTable, badgeVariants, buttonVariants, combineRenderers, commonRenderers, compactTheme, createCellRenderer, createCustomTheme, defaultTheme, exportData, exportToCSV, exportToExcel, generateExportFilename, getNestedValue, getTheme, logValidationResults, minimalTheme, spaciousTheme, themes, useColumnReorder, useColumnResize, useColumnVisibility, useFilters, usePagination, useResponsive, useSelection, useTableKeyboard, useTablePreferences, useTableState, useTableURL, validateColumnConfig, validateMobileCardConfig } from './chunk-27YUQBOE.mjs';
|
|
5
|
+
export { cn, formatCurrency, formatDate, formatRelativeDate, formatRelativeTime, generateId, getInitials, sleep } from './chunk-G4XBXCFH.mjs';
|
|
6
|
+
import './chunk-LZOMFHX3.mjs';
|
|
7
|
+
|
|
8
|
+
var export_tailwindConfig = import_tailwind.default;
|
|
9
|
+
|
|
10
|
+
export { export_tailwindConfig as tailwindConfig };
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
12
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Config } from 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
declare const config: Config
|
|
4
|
+
|
|
5
|
+
declare const preset: Partial<Config>;
|
|
6
|
+
|
|
7
|
+
/** All CSS custom property names that apps must define in their theme */
|
|
8
|
+
declare const THEME_TOKENS: {
|
|
9
|
+
readonly colors: readonly ["--background", "--foreground", "--card", "--card-foreground", "--popover", "--popover-foreground", "--primary", "--primary-foreground", "--secondary", "--secondary-foreground", "--muted", "--muted-foreground", "--accent", "--accent-foreground", "--destructive", "--destructive-foreground", "--border", "--input", "--ring"];
|
|
10
|
+
readonly shape: readonly ["--radius", "--radius-sm", "--radius-md", "--radius-lg", "--radius-xl", "--radius-full"];
|
|
11
|
+
readonly shadows: readonly ["--shadow-sm", "--shadow-md", "--shadow-lg", "--shadow-xl"];
|
|
12
|
+
readonly typography: readonly ["--font-sans", "--font-mono", "--font-heading"];
|
|
13
|
+
readonly animation: readonly ["--duration-fast", "--duration-normal", "--duration-slow", "--easing-default"];
|
|
14
|
+
readonly borders: readonly ["--border-width"];
|
|
15
|
+
};
|
|
16
|
+
type ThemeColorTokens = (typeof THEME_TOKENS.colors)[number];
|
|
17
|
+
type ThemeShapeTokens = (typeof THEME_TOKENS.shape)[number];
|
|
18
|
+
type ThemeToken = ThemeColorTokens | ThemeShapeTokens | (typeof THEME_TOKENS.shadows)[number] | (typeof THEME_TOKENS.typography)[number] | (typeof THEME_TOKENS.animation)[number] | (typeof THEME_TOKENS.borders)[number];
|
|
19
|
+
|
|
20
|
+
export { THEME_TOKENS, type ThemeColorTokens, type ThemeShapeTokens, type ThemeToken, config as tailwindConfig, preset as tailwindPreset };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Config } from 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
declare const config: Config
|
|
4
|
+
|
|
5
|
+
declare const preset: Partial<Config>;
|
|
6
|
+
|
|
7
|
+
/** All CSS custom property names that apps must define in their theme */
|
|
8
|
+
declare const THEME_TOKENS: {
|
|
9
|
+
readonly colors: readonly ["--background", "--foreground", "--card", "--card-foreground", "--popover", "--popover-foreground", "--primary", "--primary-foreground", "--secondary", "--secondary-foreground", "--muted", "--muted-foreground", "--accent", "--accent-foreground", "--destructive", "--destructive-foreground", "--border", "--input", "--ring"];
|
|
10
|
+
readonly shape: readonly ["--radius", "--radius-sm", "--radius-md", "--radius-lg", "--radius-xl", "--radius-full"];
|
|
11
|
+
readonly shadows: readonly ["--shadow-sm", "--shadow-md", "--shadow-lg", "--shadow-xl"];
|
|
12
|
+
readonly typography: readonly ["--font-sans", "--font-mono", "--font-heading"];
|
|
13
|
+
readonly animation: readonly ["--duration-fast", "--duration-normal", "--duration-slow", "--easing-default"];
|
|
14
|
+
readonly borders: readonly ["--border-width"];
|
|
15
|
+
};
|
|
16
|
+
type ThemeColorTokens = (typeof THEME_TOKENS.colors)[number];
|
|
17
|
+
type ThemeShapeTokens = (typeof THEME_TOKENS.shape)[number];
|
|
18
|
+
type ThemeToken = ThemeColorTokens | ThemeShapeTokens | (typeof THEME_TOKENS.shadows)[number] | (typeof THEME_TOKENS.typography)[number] | (typeof THEME_TOKENS.animation)[number] | (typeof THEME_TOKENS.borders)[number];
|
|
19
|
+
|
|
20
|
+
export { THEME_TOKENS, type ThemeColorTokens, type ThemeShapeTokens, type ThemeToken, config as tailwindConfig, preset as tailwindPreset };
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
10
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
|
+
}) : x)(function(x) {
|
|
12
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
|
+
});
|
|
15
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
16
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
34
|
+
|
|
35
|
+
// src/theme/tailwind.config.js
|
|
36
|
+
var require_tailwind_config = __commonJS({
|
|
37
|
+
"src/theme/tailwind.config.js"(exports$1, module) {
|
|
38
|
+
module.exports = {
|
|
39
|
+
darkMode: ["class"],
|
|
40
|
+
theme: {
|
|
41
|
+
container: {
|
|
42
|
+
center: true,
|
|
43
|
+
padding: "2rem",
|
|
44
|
+
screens: {
|
|
45
|
+
"2xl": "1400px"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
extend: {
|
|
49
|
+
colors: {
|
|
50
|
+
border: "hsl(var(--border))",
|
|
51
|
+
input: "hsl(var(--input))",
|
|
52
|
+
ring: "hsl(var(--ring))",
|
|
53
|
+
background: "hsl(var(--background))",
|
|
54
|
+
foreground: "hsl(var(--foreground))",
|
|
55
|
+
primary: {
|
|
56
|
+
DEFAULT: "hsl(var(--primary))",
|
|
57
|
+
foreground: "hsl(var(--primary-foreground))"
|
|
58
|
+
},
|
|
59
|
+
secondary: {
|
|
60
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
61
|
+
foreground: "hsl(var(--secondary-foreground))"
|
|
62
|
+
},
|
|
63
|
+
destructive: {
|
|
64
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
65
|
+
foreground: "hsl(var(--destructive-foreground))"
|
|
66
|
+
},
|
|
67
|
+
muted: {
|
|
68
|
+
DEFAULT: "hsl(var(--muted))",
|
|
69
|
+
foreground: "hsl(var(--muted-foreground))"
|
|
70
|
+
},
|
|
71
|
+
accent: {
|
|
72
|
+
DEFAULT: "hsl(var(--accent))",
|
|
73
|
+
foreground: "hsl(var(--accent-foreground))"
|
|
74
|
+
},
|
|
75
|
+
popover: {
|
|
76
|
+
DEFAULT: "hsl(var(--popover))",
|
|
77
|
+
foreground: "hsl(var(--popover-foreground))"
|
|
78
|
+
},
|
|
79
|
+
card: {
|
|
80
|
+
DEFAULT: "hsl(var(--card))",
|
|
81
|
+
foreground: "hsl(var(--card-foreground))"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
borderRadius: {
|
|
85
|
+
lg: "var(--radius)",
|
|
86
|
+
md: "calc(var(--radius) - 2px)",
|
|
87
|
+
sm: "calc(var(--radius) - 4px)"
|
|
88
|
+
},
|
|
89
|
+
keyframes: {
|
|
90
|
+
"accordion-down": {
|
|
91
|
+
from: { height: 0 },
|
|
92
|
+
to: { height: "var(--radix-accordion-content-height)" }
|
|
93
|
+
},
|
|
94
|
+
"accordion-up": {
|
|
95
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
|
96
|
+
to: { height: 0 }
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
animation: {
|
|
100
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
101
|
+
"accordion-up": "accordion-up 0.2s ease-out"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
plugins: [__require("tailwindcss-animate")]
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// src/theme/index.ts
|
|
111
|
+
var import_tailwind = __toESM(require_tailwind_config());
|
|
112
|
+
|
|
113
|
+
// src/theme/tailwind.preset.ts
|
|
114
|
+
var preset = {
|
|
115
|
+
darkMode: ["class"],
|
|
116
|
+
theme: {
|
|
117
|
+
extend: {
|
|
118
|
+
colors: {
|
|
119
|
+
background: "hsl(var(--background))",
|
|
120
|
+
foreground: "hsl(var(--foreground))",
|
|
121
|
+
card: {
|
|
122
|
+
DEFAULT: "hsl(var(--card))",
|
|
123
|
+
foreground: "hsl(var(--card-foreground))"
|
|
124
|
+
},
|
|
125
|
+
popover: {
|
|
126
|
+
DEFAULT: "hsl(var(--popover))",
|
|
127
|
+
foreground: "hsl(var(--popover-foreground))"
|
|
128
|
+
},
|
|
129
|
+
primary: {
|
|
130
|
+
DEFAULT: "hsl(var(--primary))",
|
|
131
|
+
foreground: "hsl(var(--primary-foreground))"
|
|
132
|
+
},
|
|
133
|
+
secondary: {
|
|
134
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
135
|
+
foreground: "hsl(var(--secondary-foreground))"
|
|
136
|
+
},
|
|
137
|
+
muted: {
|
|
138
|
+
DEFAULT: "hsl(var(--muted))",
|
|
139
|
+
foreground: "hsl(var(--muted-foreground))"
|
|
140
|
+
},
|
|
141
|
+
accent: {
|
|
142
|
+
DEFAULT: "hsl(var(--accent))",
|
|
143
|
+
foreground: "hsl(var(--accent-foreground))"
|
|
144
|
+
},
|
|
145
|
+
destructive: {
|
|
146
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
147
|
+
foreground: "hsl(var(--destructive-foreground))"
|
|
148
|
+
},
|
|
149
|
+
border: "hsl(var(--border))",
|
|
150
|
+
input: "hsl(var(--input))",
|
|
151
|
+
ring: "hsl(var(--ring))"
|
|
152
|
+
},
|
|
153
|
+
borderRadius: {
|
|
154
|
+
// All derived from per-step vars so changing --radius reshapes everything
|
|
155
|
+
sm: "var(--radius-sm)",
|
|
156
|
+
md: "var(--radius-md)",
|
|
157
|
+
lg: "var(--radius-lg)",
|
|
158
|
+
xl: "var(--radius-xl)",
|
|
159
|
+
full: "var(--radius-full)",
|
|
160
|
+
DEFAULT: "var(--radius)"
|
|
161
|
+
},
|
|
162
|
+
boxShadow: {
|
|
163
|
+
sm: "var(--shadow-sm)",
|
|
164
|
+
DEFAULT: "var(--shadow-md)",
|
|
165
|
+
md: "var(--shadow-md)",
|
|
166
|
+
lg: "var(--shadow-lg)",
|
|
167
|
+
xl: "var(--shadow-xl)",
|
|
168
|
+
none: "none"
|
|
169
|
+
},
|
|
170
|
+
fontFamily: {
|
|
171
|
+
sans: ["var(--font-sans)", "ui-sans-serif", "system-ui", "sans-serif"],
|
|
172
|
+
mono: ["var(--font-mono)", "ui-monospace", "monospace"],
|
|
173
|
+
heading: ["var(--font-heading, var(--font-sans))", "ui-sans-serif", "sans-serif"]
|
|
174
|
+
},
|
|
175
|
+
transitionDuration: {
|
|
176
|
+
fast: "var(--duration-fast)",
|
|
177
|
+
DEFAULT: "var(--duration-normal)",
|
|
178
|
+
slow: "var(--duration-slow)"
|
|
179
|
+
},
|
|
180
|
+
borderWidth: {
|
|
181
|
+
DEFAULT: "var(--border-width)"
|
|
182
|
+
},
|
|
183
|
+
keyframes: {
|
|
184
|
+
"accordion-down": {
|
|
185
|
+
from: { height: "0" },
|
|
186
|
+
to: { height: "var(--radix-accordion-content-height)" }
|
|
187
|
+
},
|
|
188
|
+
"accordion-up": {
|
|
189
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
|
190
|
+
to: { height: "0" }
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
animation: {
|
|
194
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
195
|
+
"accordion-up": "accordion-up 0.2s ease-out"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
plugins: []
|
|
200
|
+
};
|
|
201
|
+
var tailwind_preset_default = preset;
|
|
202
|
+
|
|
203
|
+
// src/theme/contract.ts
|
|
204
|
+
var THEME_TOKENS = {
|
|
205
|
+
colors: [
|
|
206
|
+
"--background",
|
|
207
|
+
"--foreground",
|
|
208
|
+
"--card",
|
|
209
|
+
"--card-foreground",
|
|
210
|
+
"--popover",
|
|
211
|
+
"--popover-foreground",
|
|
212
|
+
"--primary",
|
|
213
|
+
"--primary-foreground",
|
|
214
|
+
"--secondary",
|
|
215
|
+
"--secondary-foreground",
|
|
216
|
+
"--muted",
|
|
217
|
+
"--muted-foreground",
|
|
218
|
+
"--accent",
|
|
219
|
+
"--accent-foreground",
|
|
220
|
+
"--destructive",
|
|
221
|
+
"--destructive-foreground",
|
|
222
|
+
"--border",
|
|
223
|
+
"--input",
|
|
224
|
+
"--ring"
|
|
225
|
+
],
|
|
226
|
+
shape: [
|
|
227
|
+
"--radius",
|
|
228
|
+
"--radius-sm",
|
|
229
|
+
"--radius-md",
|
|
230
|
+
"--radius-lg",
|
|
231
|
+
"--radius-xl",
|
|
232
|
+
"--radius-full"
|
|
233
|
+
],
|
|
234
|
+
shadows: ["--shadow-sm", "--shadow-md", "--shadow-lg", "--shadow-xl"],
|
|
235
|
+
typography: ["--font-sans", "--font-mono", "--font-heading"],
|
|
236
|
+
animation: ["--duration-fast", "--duration-normal", "--duration-slow", "--easing-default"],
|
|
237
|
+
borders: ["--border-width"]
|
|
238
|
+
};
|
|
239
|
+
var export_tailwindConfig = import_tailwind.default;
|
|
240
|
+
|
|
241
|
+
exports.THEME_TOKENS = THEME_TOKENS;
|
|
242
|
+
exports.tailwindConfig = export_tailwindConfig;
|
|
243
|
+
exports.tailwindPreset = tailwind_preset_default;
|
|
244
|
+
//# sourceMappingURL=index.js.map
|
|
245
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/theme/tailwind.config.js","../../src/theme/index.ts","../../src/theme/tailwind.preset.ts","../../src/theme/contract.ts"],"names":["exports"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,uBAAA,GAAA,UAAA,CAAA;AAAA,EAAA,8BAAA,CAAAA,SAAA,EAAA,MAAA,EAAA;AACA,IAAA,MAAA,CAAO,OAAA,GAAU;AAAA,MACf,QAAA,EAAU,CAAC,OAAO,CAAA;AAAA,MAClB,KAAA,EAAO;AAAA,QACL,SAAA,EAAW;AAAA,UACT,MAAA,EAAQ,IAAA;AAAA,UACR,OAAA,EAAS,MAAA;AAAA,UACT,OAAA,EAAS;AAAA,YACP,KAAA,EAAO;AAAA;AACT,SACF;AAAA,QACA,MAAA,EAAQ;AAAA,UACN,MAAA,E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AAQ;;;AC3FR,IAAM,YAAA,GAAe;AAAA,EAC1B,MAAA,EAAQ;AAAA,IACN,cAAA;AAAA,IACA,cAAA;AAAA,IACA,QAAA;AAAA,IACA,mBAAA;AAAA,IACA,WAAA;AAAA,IACA,sBAAA;AAAA,IACA,WAAA;AAAA,IACA,sBAAA;AAAA,IACA,aAAA;AAAA,IACA,wBAAA;AAAA,IACA,SAAA;AAAA,IACA,oBAAA;AAAA,IACA,UAAA;AAAA,IACA,qBAAA;AAAA,IACA,eAAA;AAAA,IACA,0BAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,KAAA,EAAO;AAAA,IACL,UAAA;AAAA,IACA,aAAA;AAAA,IACA,aAAA;AAAA,IACA,aAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,OAAA,EAAS,CAAC,aAAA,EAAe,aAAA,EAAe,eAAe,aAAa,CAAA;AAAA,EACpE,UAAA,EAAY,CAAC,aAAA,EAAe,aAAA,EAAe,gBAAgB,CAAA;AAAA,EAC3D,SAAA,EAAW,CAAC,iBAAA,EAAmB,mBAAA,EAAqB,mBAAmB,kBAAkB,CAAA;AAAA,EACzF,OAAA,EAAS,CAAC,gBAAgB;AAC5B","file":"index.js","sourcesContent":["/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n darkMode: [\"class\"],\n theme: {\n container: {\n center: true,\n padding: \"2rem\",\n screens: {\n \"2xl\": \"1400px\",\n },\n },\n extend: {\n colors: {\n border: \"hsl(var(--border))\",\n input: \"hsl(var(--input))\",\n ring: \"hsl(var(--ring))\",\n background: \"hsl(var(--background))\",\n foreground: \"hsl(var(--foreground))\",\n primary: {\n DEFAULT: \"hsl(var(--primary))\",\n foreground: \"hsl(var(--primary-foreground))\",\n },\n secondary: {\n DEFAULT: \"hsl(var(--secondary))\",\n foreground: \"hsl(var(--secondary-foreground))\",\n },\n destructive: {\n DEFAULT: \"hsl(var(--destructive))\",\n foreground: \"hsl(var(--destructive-foreground))\",\n },\n muted: {\n DEFAULT: \"hsl(var(--muted))\",\n foreground: \"hsl(var(--muted-foreground))\",\n },\n accent: {\n DEFAULT: \"hsl(var(--accent))\",\n foreground: \"hsl(var(--accent-foreground))\",\n },\n popover: {\n DEFAULT: \"hsl(var(--popover))\",\n foreground: \"hsl(var(--popover-foreground))\",\n },\n card: {\n DEFAULT: \"hsl(var(--card))\",\n foreground: \"hsl(var(--card-foreground))\",\n },\n },\n borderRadius: {\n lg: \"var(--radius)\",\n md: \"calc(var(--radius) - 2px)\",\n sm: \"calc(var(--radius) - 4px)\",\n },\n keyframes: {\n \"accordion-down\": {\n from: { height: 0 },\n to: { height: \"var(--radix-accordion-content-height)\" },\n },\n \"accordion-up\": {\n from: { height: \"var(--radix-accordion-content-height)\" },\n to: { height: 0 },\n },\n },\n animation: {\n \"accordion-down\": \"accordion-down 0.2s ease-out\",\n \"accordion-up\": \"accordion-up 0.2s ease-out\",\n },\n },\n },\n plugins: [require(\"tailwindcss-animate\")],\n}\n","// Export Tailwind config for apps to extend (legacy CJS config)\nexport { default as tailwindConfig } from './tailwind.config'\n\n// Export TypeScript preset — the canonical way for apps to extend the design system\nexport { default as tailwindPreset } from './tailwind.preset'\n\n// Design token contract — all CSS variables apps must define\nexport { THEME_TOKENS } from './contract'\nexport type { ThemeColorTokens, ThemeShapeTokens, ThemeToken } from './contract'\n","import type { Config } from 'tailwindcss'\n\n// Presets intentionally omit `content` — each consuming app supplies its own.\n// tailwindcss exposes PresetsConfig = Partial<Config> for this purpose.\nconst preset: Partial<Config> = {\n darkMode: ['class'],\n theme: {\n extend: {\n colors: {\n background: 'hsl(var(--background))',\n foreground: 'hsl(var(--foreground))',\n card: {\n DEFAULT: 'hsl(var(--card))',\n foreground: 'hsl(var(--card-foreground))',\n },\n popover: {\n DEFAULT: 'hsl(var(--popover))',\n foreground: 'hsl(var(--popover-foreground))',\n },\n primary: {\n DEFAULT: 'hsl(var(--primary))',\n foreground: 'hsl(var(--primary-foreground))',\n },\n secondary: {\n DEFAULT: 'hsl(var(--secondary))',\n foreground: 'hsl(var(--secondary-foreground))',\n },\n muted: {\n DEFAULT: 'hsl(var(--muted))',\n foreground: 'hsl(var(--muted-foreground))',\n },\n accent: {\n DEFAULT: 'hsl(var(--accent))',\n foreground: 'hsl(var(--accent-foreground))',\n },\n destructive: {\n DEFAULT: 'hsl(var(--destructive))',\n foreground: 'hsl(var(--destructive-foreground))',\n },\n border: 'hsl(var(--border))',\n input: 'hsl(var(--input))',\n ring: 'hsl(var(--ring))',\n },\n borderRadius: {\n // All derived from per-step vars so changing --radius reshapes everything\n sm: 'var(--radius-sm)',\n md: 'var(--radius-md)',\n lg: 'var(--radius-lg)',\n xl: 'var(--radius-xl)',\n full: 'var(--radius-full)',\n DEFAULT: 'var(--radius)',\n },\n boxShadow: {\n sm: 'var(--shadow-sm)',\n DEFAULT: 'var(--shadow-md)',\n md: 'var(--shadow-md)',\n lg: 'var(--shadow-lg)',\n xl: 'var(--shadow-xl)',\n none: 'none',\n },\n fontFamily: {\n sans: ['var(--font-sans)', 'ui-sans-serif', 'system-ui', 'sans-serif'],\n mono: ['var(--font-mono)', 'ui-monospace', 'monospace'],\n heading: ['var(--font-heading, var(--font-sans))', 'ui-sans-serif', 'sans-serif'],\n },\n transitionDuration: {\n fast: 'var(--duration-fast)',\n DEFAULT: 'var(--duration-normal)',\n slow: 'var(--duration-slow)',\n },\n borderWidth: {\n DEFAULT: 'var(--border-width)',\n },\n keyframes: {\n 'accordion-down': {\n from: { height: '0' },\n to: { height: 'var(--radix-accordion-content-height)' },\n },\n 'accordion-up': {\n from: { height: 'var(--radix-accordion-content-height)' },\n to: { height: '0' },\n },\n },\n animation: {\n 'accordion-down': 'accordion-down 0.2s ease-out',\n 'accordion-up': 'accordion-up 0.2s ease-out',\n },\n },\n },\n plugins: [],\n}\n\nexport default preset\n","/** All CSS custom property names that apps must define in their theme */\nexport const THEME_TOKENS = {\n colors: [\n '--background',\n '--foreground',\n '--card',\n '--card-foreground',\n '--popover',\n '--popover-foreground',\n '--primary',\n '--primary-foreground',\n '--secondary',\n '--secondary-foreground',\n '--muted',\n '--muted-foreground',\n '--accent',\n '--accent-foreground',\n '--destructive',\n '--destructive-foreground',\n '--border',\n '--input',\n '--ring',\n ],\n shape: [\n '--radius',\n '--radius-sm',\n '--radius-md',\n '--radius-lg',\n '--radius-xl',\n '--radius-full',\n ],\n shadows: ['--shadow-sm', '--shadow-md', '--shadow-lg', '--shadow-xl'],\n typography: ['--font-sans', '--font-mono', '--font-heading'],\n animation: ['--duration-fast', '--duration-normal', '--duration-slow', '--easing-default'],\n borders: ['--border-width'],\n} as const\n\nexport type ThemeColorTokens = (typeof THEME_TOKENS.colors)[number]\nexport type ThemeShapeTokens = (typeof THEME_TOKENS.shape)[number]\nexport type ThemeToken =\n | ThemeColorTokens\n | ThemeShapeTokens\n | (typeof THEME_TOKENS.shadows)[number]\n | (typeof THEME_TOKENS.typography)[number]\n | (typeof THEME_TOKENS.animation)[number]\n | (typeof THEME_TOKENS.borders)[number]\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { import_tailwind } from '../chunk-QYXFLOO7.mjs';
|
|
2
|
+
export { THEME_TOKENS, tailwind_preset_default as tailwindPreset } from '../chunk-QYXFLOO7.mjs';
|
|
3
|
+
import '../chunk-LZOMFHX3.mjs';
|
|
4
|
+
|
|
5
|
+
var export_tailwindConfig = import_tailwind.default;
|
|
6
|
+
|
|
7
|
+
export { export_tailwindConfig as tailwindConfig };
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
|
|
3
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generate a random ID with optional prefix
|
|
7
|
+
*/
|
|
8
|
+
declare function generateId(prefix?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Sleep for a given number of milliseconds
|
|
11
|
+
*/
|
|
12
|
+
declare function sleep(ms: number): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Format a date as a short human-readable string (e.g. "Jan 5, 2024").
|
|
15
|
+
* Accepts a Date object or an ISO date string.
|
|
16
|
+
*/
|
|
17
|
+
declare function formatDate(date: Date | string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Format a date relative to now using coarse buckets
|
|
20
|
+
* (Today / Yesterday / N days ago / N weeks ago / formatted date).
|
|
21
|
+
* Accepts a Date object or an ISO date string.
|
|
22
|
+
*/
|
|
23
|
+
declare function formatRelativeTime(date: Date | string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Format a date relative to now using fine-grained buckets
|
|
26
|
+
* (just now / Xm ago / Xh ago / Xd ago / formatted date).
|
|
27
|
+
*/
|
|
28
|
+
declare function formatRelativeDate(date: Date): string;
|
|
29
|
+
/**
|
|
30
|
+
* Format a number as USD currency (no cents, e.g. "$1,000,000")
|
|
31
|
+
*/
|
|
32
|
+
declare function formatCurrency(amount: number): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get initials from a display name (up to 2 characters)
|
|
35
|
+
*/
|
|
36
|
+
declare function getInitials(name: string): string;
|
|
37
|
+
|
|
38
|
+
export { cn, formatCurrency, formatDate, formatRelativeDate, formatRelativeTime, generateId, getInitials, sleep };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
|
|
3
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generate a random ID with optional prefix
|
|
7
|
+
*/
|
|
8
|
+
declare function generateId(prefix?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Sleep for a given number of milliseconds
|
|
11
|
+
*/
|
|
12
|
+
declare function sleep(ms: number): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Format a date as a short human-readable string (e.g. "Jan 5, 2024").
|
|
15
|
+
* Accepts a Date object or an ISO date string.
|
|
16
|
+
*/
|
|
17
|
+
declare function formatDate(date: Date | string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Format a date relative to now using coarse buckets
|
|
20
|
+
* (Today / Yesterday / N days ago / N weeks ago / formatted date).
|
|
21
|
+
* Accepts a Date object or an ISO date string.
|
|
22
|
+
*/
|
|
23
|
+
declare function formatRelativeTime(date: Date | string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Format a date relative to now using fine-grained buckets
|
|
26
|
+
* (just now / Xm ago / Xh ago / Xd ago / formatted date).
|
|
27
|
+
*/
|
|
28
|
+
declare function formatRelativeDate(date: Date): string;
|
|
29
|
+
/**
|
|
30
|
+
* Format a number as USD currency (no cents, e.g. "$1,000,000")
|
|
31
|
+
*/
|
|
32
|
+
declare function formatCurrency(amount: number): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get initials from a display name (up to 2 characters)
|
|
35
|
+
*/
|
|
36
|
+
declare function getInitials(name: string): string;
|
|
37
|
+
|
|
38
|
+
export { cn, formatCurrency, formatDate, formatRelativeDate, formatRelativeTime, generateId, getInitials, sleep };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var clsx = require('clsx');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
|
|
6
|
+
// src/utils/cn.ts
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/utils/index.ts
|
|
12
|
+
function generateId(prefix = "") {
|
|
13
|
+
const random = Math.random().toString(36).substring(2, 9);
|
|
14
|
+
return prefix ? `${prefix}_${random}` : random;
|
|
15
|
+
}
|
|
16
|
+
function sleep(ms) {
|
|
17
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
18
|
+
}
|
|
19
|
+
function formatDate(date) {
|
|
20
|
+
const d = typeof date === "string" ? new Date(date) : date;
|
|
21
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
22
|
+
month: "short",
|
|
23
|
+
day: "numeric",
|
|
24
|
+
year: "numeric"
|
|
25
|
+
}).format(d);
|
|
26
|
+
}
|
|
27
|
+
function formatRelativeTime(date) {
|
|
28
|
+
const d = typeof date === "string" ? new Date(date) : date;
|
|
29
|
+
const now = /* @__PURE__ */ new Date();
|
|
30
|
+
const diffMs = now.getTime() - d.getTime();
|
|
31
|
+
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
32
|
+
if (diffDays === 0) return "Today";
|
|
33
|
+
if (diffDays === 1) return "Yesterday";
|
|
34
|
+
if (diffDays < 7) return `${diffDays} days ago`;
|
|
35
|
+
if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`;
|
|
36
|
+
return formatDate(d);
|
|
37
|
+
}
|
|
38
|
+
function formatRelativeDate(date) {
|
|
39
|
+
const now = /* @__PURE__ */ new Date();
|
|
40
|
+
const diffMs = now.getTime() - date.getTime();
|
|
41
|
+
const diffSecs = Math.floor(diffMs / 1e3);
|
|
42
|
+
const diffMins = Math.floor(diffSecs / 60);
|
|
43
|
+
const diffHours = Math.floor(diffMins / 60);
|
|
44
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
45
|
+
if (diffSecs < 60) return "just now";
|
|
46
|
+
if (diffMins < 60) return `${diffMins}m ago`;
|
|
47
|
+
if (diffHours < 24) return `${diffHours}h ago`;
|
|
48
|
+
if (diffDays < 7) return `${diffDays}d ago`;
|
|
49
|
+
return date.toLocaleDateString();
|
|
50
|
+
}
|
|
51
|
+
function formatCurrency(amount) {
|
|
52
|
+
return new Intl.NumberFormat("en-US", {
|
|
53
|
+
style: "currency",
|
|
54
|
+
currency: "USD",
|
|
55
|
+
minimumFractionDigits: 0,
|
|
56
|
+
maximumFractionDigits: 0
|
|
57
|
+
}).format(amount);
|
|
58
|
+
}
|
|
59
|
+
function getInitials(name) {
|
|
60
|
+
return name.split(" ").map((word) => word[0]).join("").toUpperCase().slice(0, 2);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.cn = cn;
|
|
64
|
+
exports.formatCurrency = formatCurrency;
|
|
65
|
+
exports.formatDate = formatDate;
|
|
66
|
+
exports.formatRelativeDate = formatRelativeDate;
|
|
67
|
+
exports.formatRelativeTime = formatRelativeTime;
|
|
68
|
+
exports.generateId = generateId;
|
|
69
|
+
exports.getInitials = getInitials;
|
|
70
|
+
exports.sleep = sleep;
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts","../../src/utils/index.ts"],"names":["twMerge","clsx"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;;;ACAO,SAAS,UAAA,CAAW,SAAS,EAAA,EAAY;AAC9C,EAAA,MAAM,MAAA,GAAS,KAAK,MAAA,EAAO,CAAE,SAAS,EAAE,CAAA,CAAE,SAAA,CAAU,CAAA,EAAG,CAAC,CAAA;AACxD,EAAA,OAAO,MAAA,GAAS,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,GAAK,MAAA;AAC1C;AAKO,SAAS,MAAM,EAAA,EAA2B;AAC/C,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,YAAY,UAAA,CAAW,OAAA,EAAS,EAAE,CAAC,CAAA;AACzD;AAMO,SAAS,WAAW,IAAA,EAA6B;AACtD,EAAA,MAAM,IAAI,OAAO,IAAA,KAAS,WAAW,IAAI,IAAA,CAAK,IAAI,CAAA,GAAI,IAAA;AACtD,EAAA,OAAO,IAAI,IAAA,C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AAW,EAAE,CAAA;AAC1C,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,KAAA,CAAM,SAAA,GAAY,EAAE,CAAA;AAE1C,EAAA,IAAI,QAAA,GAAW,IAAI,OAAO,UAAA;AAC1B,EAAA,IAAI,QAAA,GAAW,EAAA,EAAI,OAAO,CAAA,EAAG,QAAQ,CAAA,KAAA,CAAA;AACrC,EAAA,IAAI,SAAA,GAAY,EAAA,EAAI,OAAO,CAAA,EAAG,SAAS,CAAA,KAAA,CAAA;AACvC,EAAA,IAAI,QAAA,GAAW,CAAA,EAAG,OAAO,CAAA,EAAG,QAAQ,CAAA,KAAA,CAAA;AAEpC,EAAA,OAAO,KAAK,kBAAA,EAAmB;AACjC;AAKO,SAAS,eAAe,MAAA,EAAwB;AACrD,EAAA,OAAO,IAAI,IAAA,CAAK,YAAA,CAAa,OAAA,EAAS;AAAA,IACpC,KAAA,EAAO,UAAA;AAAA,IACP,QAAA,EAAU,KAAA;AAAA,IACV,qBAAA,EAAuB,CAAA;AAAA,IACvB,qBAAA,EAAuB;AAAA,GACxB,CAAA,CAAE,MAAA,CAAO,MAAM,CAAA;AAClB;AAKO,SAAS,YAAY,IAAA,EAAsB;AAChD,EAAA,OAAO,KACJ,KAAA,CAAM,GAAG,EACT,GAAA,CAAI,CAAC,SAAS,IAAA,CAAK,CAAC,CAAC,CAAA,CACrB,KAAK,EAAE,CAAA,CACP,aAAY,CACZ,KAAA,CAAM,GAAG,CAAC,CAAA;AACf","file":"index.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","export { cn } from './cn'\n\n/**\n * Generate a random ID with optional prefix\n */\nexport function generateId(prefix = ''): string {\n const random = Math.random().toString(36).substring(2, 9)\n return prefix ? `${prefix}_${random}` : random\n}\n\n/**\n * Sleep for a given number of milliseconds\n */\nexport function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\n/**\n * Format a date as a short human-readable string (e.g. \"Jan 5, 2024\").\n * Accepts a Date object or an ISO date string.\n */\nexport function formatDate(date: Date | string): string {\n const d = typeof date === 'string' ? new Date(date) : date\n return new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n }).format(d)\n}\n\n/**\n * Format a date relative to now using coarse buckets\n * (Today / Yesterday / N days ago / N weeks ago / formatted date).\n * Accepts a Date object or an ISO date string.\n */\nexport function formatRelativeTime(date: Date | string): string {\n const d = typeof date === 'string' ? new Date(date) : date\n const now = new Date()\n const diffMs = now.getTime() - d.getTime()\n const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24))\n\n if (diffDays === 0) return 'Today'\n if (diffDays === 1) return 'Yesterday'\n if (diffDays < 7) return `${diffDays} days ago`\n if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`\n return formatDate(d)\n}\n\n/**\n * Format a date relative to now using fine-grained buckets\n * (just now / Xm ago / Xh ago / Xd ago / formatted date).\n */\nexport function formatRelativeDate(date: Date): string {\n const now = new Date()\n const diffMs = now.getTime() - date.getTime()\n const diffSecs = Math.floor(diffMs / 1000)\n const diffMins = Math.floor(diffSecs / 60)\n const diffHours = Math.floor(diffMins / 60)\n const diffDays = Math.floor(diffHours / 24)\n\n if (diffSecs < 60) return 'just now'\n if (diffMins < 60) return `${diffMins}m ago`\n if (diffHours < 24) return `${diffHours}h ago`\n if (diffDays < 7) return `${diffDays}d ago`\n\n return date.toLocaleDateString()\n}\n\n/**\n * Format a number as USD currency (no cents, e.g. \"$1,000,000\")\n */\nexport function formatCurrency(amount: number): string {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(amount)\n}\n\n/**\n * Get initials from a display name (up to 2 characters)\n */\nexport function getInitials(name: string): string {\n return name\n .split(' ')\n .map((word) => word[0])\n .join('')\n .toUpperCase()\n .slice(0, 2)\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
package/package.json
CHANGED
|
@@ -1,34 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startsimpli/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Shared UI components package for StartSimpli applications",
|
|
5
|
-
"main": "./
|
|
6
|
-
"types": "./
|
|
7
|
-
"files": ["src"],
|
|
8
|
-
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
10
|
-
},
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
11
7
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"./
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./table": {
|
|
14
|
+
"types": "./dist/components/unified-table/index.d.ts",
|
|
15
|
+
"import": "./dist/components/unified-table/index.mjs",
|
|
16
|
+
"require": "./dist/components/unified-table/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./components": {
|
|
19
|
+
"types": "./dist/components/index.d.ts",
|
|
20
|
+
"import": "./dist/components/index.mjs",
|
|
21
|
+
"require": "./dist/components/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./utils": {
|
|
24
|
+
"types": "./dist/utils/index.d.ts",
|
|
25
|
+
"import": "./dist/utils/index.mjs",
|
|
26
|
+
"require": "./dist/utils/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./theme": {
|
|
29
|
+
"types": "./dist/theme/index.d.ts",
|
|
30
|
+
"import": "./dist/theme/index.mjs",
|
|
31
|
+
"require": "./dist/theme/index.js"
|
|
32
|
+
},
|
|
18
33
|
"./theme/contract": "./theme/contract.css",
|
|
19
|
-
"./tailwind": "./
|
|
34
|
+
"./tailwind": "./tailwind.preset.js"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"src",
|
|
38
|
+
"tailwind.preset.js",
|
|
39
|
+
"README.md",
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
20
44
|
},
|
|
21
45
|
"scripts": {
|
|
46
|
+
"build": "tsup",
|
|
47
|
+
"dev": "tsup --watch",
|
|
48
|
+
"type-check": "tsc --noEmit",
|
|
22
49
|
"test": "jest",
|
|
23
50
|
"test:watch": "jest --watch",
|
|
24
51
|
"test:coverage": "jest --coverage",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
52
|
+
"lint": "eslint src/**/*.{ts,tsx}",
|
|
53
|
+
"clean": "rm -rf dist"
|
|
27
54
|
},
|
|
28
55
|
"peerDependencies": {
|
|
56
|
+
"@tanstack/react-query": ">=5.0.0",
|
|
57
|
+
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
29
58
|
"react": "^18.0.0 || ^19.0.0",
|
|
30
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
31
|
-
|
|
59
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"@tanstack/react-query": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
32
65
|
},
|
|
33
66
|
"dependencies": {
|
|
34
67
|
"@hello-pangea/dnd": "^18.0.1",
|
|
@@ -48,6 +81,8 @@
|
|
|
48
81
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
49
82
|
"class-variance-authority": "^0.7.0",
|
|
50
83
|
"clsx": "^2.1.1",
|
|
84
|
+
"dompurify": "^3.3.1",
|
|
85
|
+
"isomorphic-dompurify": "^2.36.0",
|
|
51
86
|
"lucide-react": "^0.408.0",
|
|
52
87
|
"react-day-picker": "^9.13.2",
|
|
53
88
|
"tailwind-merge": "^2.4.0",
|
|
@@ -55,18 +90,23 @@
|
|
|
55
90
|
"xlsx": "^0.18.5"
|
|
56
91
|
},
|
|
57
92
|
"devDependencies": {
|
|
93
|
+
"@tanstack/react-query": "^5.0.0",
|
|
94
|
+
"@swc/core": "^1.15.13",
|
|
95
|
+
"@swc/jest": "^0.2.39",
|
|
58
96
|
"@testing-library/jest-dom": "^6.8.0",
|
|
59
97
|
"@testing-library/react": "^16.3.0",
|
|
60
98
|
"@testing-library/user-event": "^14.6.1",
|
|
99
|
+
"@types/dompurify": "^3.0.5",
|
|
61
100
|
"@types/jest": "^30.0.0",
|
|
62
101
|
"@types/node": "^20.14.10",
|
|
63
|
-
"@types/react": "^
|
|
64
|
-
"@types/react-dom": "^
|
|
102
|
+
"@types/react": "^19.0.0",
|
|
103
|
+
"@types/react-dom": "^19.0.0",
|
|
65
104
|
"eslint": "^8.57.0",
|
|
66
105
|
"identity-obj-proxy": "^3.0.0",
|
|
67
106
|
"jest": "^30.1.3",
|
|
68
107
|
"jest-environment-jsdom": "^30.1.2",
|
|
69
108
|
"tailwindcss": "^3.4.6",
|
|
109
|
+
"tsup": "^8.5.1",
|
|
70
110
|
"typescript": "^5.5.3"
|
|
71
111
|
},
|
|
72
112
|
"keywords": [
|
|
@@ -76,5 +116,6 @@
|
|
|
76
116
|
"react",
|
|
77
117
|
"nextjs",
|
|
78
118
|
"startsimpli"
|
|
79
|
-
]
|
|
119
|
+
],
|
|
120
|
+
"module": "./dist/index.mjs"
|
|
80
121
|
}
|