pixelize-design-library 2.2.192 → 2.2.193
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/.claude/settings.local.json +15 -0
- package/coverage/clover.xml +638 -0
- package/coverage/coverage-final.json +20 -0
- package/coverage/lcov-report/Table/CompactSelect.tsx.html +379 -0
- package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +514 -0
- package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +373 -0
- package/coverage/lcov-report/Table/Components/Pagination.tsx.html +574 -0
- package/coverage/lcov-report/Table/Components/TableActions.tsx.html +574 -0
- package/coverage/lcov-report/Table/Components/TableBody.tsx.html +1027 -0
- package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +397 -0
- package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +1060 -0
- package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +361 -0
- package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +337 -0
- package/coverage/lcov-report/Table/Components/index.html +266 -0
- package/coverage/lcov-report/Table/Components/useDebounce.ts.html +178 -0
- package/coverage/lcov-report/Table/Components/useTable.ts.html +778 -0
- package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +1810 -0
- package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +178 -0
- package/coverage/lcov-report/Table/Table.tsx.html +1567 -0
- package/coverage/lcov-report/Table/TableProps.tsx.html +658 -0
- package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +619 -0
- package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +229 -0
- package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +532 -0
- package/coverage/lcov-report/Table/TableSettings/index.html +146 -0
- package/coverage/lcov-report/Table/TableToDo.tsx.html +973 -0
- package/coverage/lcov-report/Table/TextOperationControls.tsx.html +271 -0
- package/coverage/lcov-report/Table/filterTypes.ts.html +97 -0
- package/coverage/lcov-report/Table/index.html +176 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +1836 -0
- package/dist/Assets/defaultLogo.tsx +31 -0
- package/dist/Components/Table/Components/TableBody.d.ts +1 -1
- package/dist/Components/Table/Components/TableBody.js +60 -3
- package/dist/Components/Table/Components/TableBody.virtualize.test.d.ts +1 -0
- package/dist/Components/Table/Components/TableBody.virtualize.test.js +93 -0
- package/dist/Components/Table/Table.js +1 -1
- package/dist/Components/Table/TableProps.d.ts +1 -0
- package/dist/Theme/Dark/palette.d.ts +370 -0
- package/dist/Theme/Dark/palette.js +372 -0
- package/dist/components-v2/AlertDialog/AlertDialog.d.ts +23 -0
- package/dist/components-v2/AlertDialog/AlertDialog.js +98 -0
- package/dist/components-v2/Breadcrumbs/Breadcrumbs.d.ts +14 -0
- package/dist/components-v2/Breadcrumbs/Breadcrumbs.js +66 -0
- package/dist/components-v2/Charts/AreaChart.d.ts +23 -0
- package/dist/components-v2/Charts/AreaChart.js +63 -0
- package/dist/components-v2/Charts/BarChart.d.ts +25 -0
- package/dist/components-v2/Charts/BarChart.js +57 -0
- package/dist/components-v2/Charts/LineChart.d.ts +23 -0
- package/dist/components-v2/Charts/LineChart.js +55 -0
- package/dist/components-v2/Charts/PieChart.d.ts +15 -0
- package/dist/components-v2/Charts/PieChart.js +54 -0
- package/dist/components-v2/Charts/PolarChart.d.ts +14 -0
- package/dist/components-v2/Charts/PolarChart.js +54 -0
- package/dist/components-v2/Charts/chartOptions.d.ts +7 -0
- package/dist/components-v2/Charts/chartOptions.js +41 -0
- package/dist/components-v2/Charts/useChartTheme.d.ts +22 -0
- package/dist/components-v2/Charts/useChartTheme.js +106 -0
- package/dist/components-v2/ContactForm/ContactForm.d.ts +25 -0
- package/dist/components-v2/ContactForm/ContactForm.js +116 -0
- package/dist/components-v2/DatePicker/Calendar.d.ts +19 -0
- package/dist/components-v2/DatePicker/Calendar.js +212 -0
- package/dist/components-v2/DatePicker/DatePicker.d.ts +46 -0
- package/dist/components-v2/DatePicker/DatePicker.js +189 -0
- package/dist/components-v2/DatePicker/TimePicker.d.ts +12 -0
- package/dist/components-v2/DatePicker/TimePicker.js +105 -0
- package/dist/components-v2/DatePicker/utils.d.ts +31 -0
- package/dist/components-v2/DatePicker/utils.js +109 -0
- package/dist/components-v2/Drawer/Drawer.d.ts +27 -0
- package/dist/components-v2/Drawer/Drawer.js +132 -0
- package/dist/components-v2/FeedbackForm/FeedbackForm.d.ts +26 -0
- package/dist/components-v2/FeedbackForm/FeedbackForm.js +112 -0
- package/dist/components-v2/FileUploader/FileUploader.d.ts +28 -0
- package/dist/components-v2/FileUploader/FileUploader.js +127 -0
- package/dist/components-v2/Input/TextInput.d.ts +41 -0
- package/dist/components-v2/Input/TextInput.js +169 -0
- package/dist/components-v2/KanbanBoard/KanbanBoard.d.ts +39 -0
- package/dist/components-v2/KanbanBoard/KanbanBoard.js +101 -0
- package/dist/components-v2/Layout/AppLayout.d.ts +22 -0
- package/dist/components-v2/Layout/AppLayout.js +53 -0
- package/dist/components-v2/Loading/Loading.d.ts +19 -0
- package/dist/components-v2/Loading/Loading.js +55 -0
- package/dist/components-v2/Modal/Modal.d.ts +30 -0
- package/dist/components-v2/Modal/Modal.js +82 -0
- package/dist/components-v2/NavigationBar/NavigationBar.d.ts +47 -0
- package/dist/components-v2/NavigationBar/NavigationBar.js +148 -0
- package/dist/components-v2/Notification/Notification.d.ts +22 -0
- package/dist/components-v2/Notification/Notification.js +113 -0
- package/dist/components-v2/NumberInput/NumberInput.d.ts +37 -0
- package/dist/components-v2/NumberInput/NumberInput.js +210 -0
- package/dist/components-v2/PinInput/PinInput.d.ts +26 -0
- package/dist/components-v2/PinInput/PinInput.js +138 -0
- package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +18 -0
- package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.js +91 -0
- package/dist/components-v2/Select/Select.d.ts +41 -0
- package/dist/components-v2/Select/Select.js +284 -0
- package/dist/components-v2/Sidebar/Sidebar.d.ts +41 -0
- package/dist/components-v2/Sidebar/Sidebar.js +182 -0
- package/dist/components-v2/Slider/Slider.d.ts +18 -0
- package/dist/components-v2/Slider/Slider.js +101 -0
- package/dist/components-v2/Table/Table.d.ts +7 -0
- package/dist/components-v2/Table/Table.js +172 -0
- package/dist/components-v2/Table/TableProps.d.ts +139 -0
- package/dist/components-v2/Table/TableProps.js +9 -0
- package/dist/components-v2/Table/components/ActiveFilters.d.ts +10 -0
- package/dist/components-v2/Table/components/ActiveFilters.js +70 -0
- package/dist/components-v2/Table/components/BulkActionBar.d.ts +11 -0
- package/dist/components-v2/Table/components/BulkActionBar.js +92 -0
- package/dist/components-v2/Table/components/ColumnResizeHandle.d.ts +7 -0
- package/dist/components-v2/Table/components/ColumnResizeHandle.js +41 -0
- package/dist/components-v2/Table/components/Pagination.d.ts +11 -0
- package/dist/components-v2/Table/components/Pagination.js +92 -0
- package/dist/components-v2/Table/components/TableBody.d.ts +23 -0
- package/dist/components-v2/Table/components/TableBody.js +69 -0
- package/dist/components-v2/Table/components/TableCell.d.ts +14 -0
- package/dist/components-v2/Table/components/TableCell.js +63 -0
- package/dist/components-v2/Table/components/TableEmptyState.d.ts +12 -0
- package/dist/components-v2/Table/components/TableEmptyState.js +55 -0
- package/dist/components-v2/Table/components/TableErrorState.d.ts +6 -0
- package/dist/components-v2/Table/components/TableErrorState.js +52 -0
- package/dist/components-v2/Table/components/TableHeader.d.ts +21 -0
- package/dist/components-v2/Table/components/TableHeader.js +94 -0
- package/dist/components-v2/Table/components/TableRow.d.ts +20 -0
- package/dist/components-v2/Table/components/TableRow.js +64 -0
- package/dist/components-v2/Table/components/TableSearch.d.ts +8 -0
- package/dist/components-v2/Table/components/TableSearch.js +47 -0
- package/dist/components-v2/Table/filters/FilterChips.d.ts +6 -0
- package/dist/components-v2/Table/filters/FilterChips.js +9 -0
- package/dist/components-v2/Table/filters/LeftFilterPane.d.ts +17 -0
- package/dist/components-v2/Table/filters/LeftFilterPane.js +105 -0
- package/dist/components-v2/Table/filters/TableFilters.d.ts +12 -0
- package/dist/components-v2/Table/filters/TableFilters.js +127 -0
- package/dist/components-v2/Table/hooks/useColumnResize.d.ts +15 -0
- package/dist/components-v2/Table/hooks/useColumnResize.js +104 -0
- package/dist/components-v2/Table/hooks/useTable.d.ts +58 -0
- package/dist/components-v2/Table/hooks/useTable.js +254 -0
- package/dist/components-v2/Table/hooks/useTableKeyboard.d.ts +25 -0
- package/dist/components-v2/Table/hooks/useTableKeyboard.js +112 -0
- package/dist/components-v2/Table/hooks/useVirtualScroll.d.ts +29 -0
- package/dist/components-v2/Table/hooks/useVirtualScroll.js +83 -0
- package/dist/components-v2/Table/settings/ManageColumns.d.ts +12 -0
- package/dist/components-v2/Table/settings/ManageColumns.js +59 -0
- package/dist/components-v2/Table/settings/TableSettings.d.ts +12 -0
- package/dist/components-v2/Table/settings/TableSettings.js +57 -0
- package/dist/components-v2/Table/utils/filterUtils.d.ts +7 -0
- package/dist/components-v2/Table/utils/filterUtils.js +149 -0
- package/dist/components-v2/Table/utils/sortUtils.d.ts +6 -0
- package/dist/components-v2/Table/utils/sortUtils.js +65 -0
- package/dist/components-v2/Tag/Tag.d.ts +15 -0
- package/dist/components-v2/Tag/Tag.js +87 -0
- package/dist/components-v2/Timeline/Timeline.d.ts +18 -0
- package/dist/components-v2/Timeline/Timeline.js +76 -0
- package/dist/components-v2/Toaster/Toaster.d.ts +61 -0
- package/dist/components-v2/Toaster/Toaster.js +63 -0
- package/dist/components-v2/Toggle/Toggle.d.ts +28 -0
- package/dist/components-v2/Toggle/Toggle.js +90 -0
- package/dist/components-v2/ui/accordion.d.ts +12 -0
- package/dist/components-v2/ui/accordion.js +104 -0
- package/dist/components-v2/ui/alert.d.ts +18 -0
- package/dist/components-v2/ui/alert.js +99 -0
- package/dist/components-v2/ui/avatar.d.ts +12 -0
- package/dist/components-v2/ui/avatar.js +80 -0
- package/dist/components-v2/ui/badge.d.ts +10 -0
- package/dist/components-v2/ui/badge.js +76 -0
- package/dist/components-v2/ui/button.d.ts +18 -0
- package/dist/components-v2/ui/button.js +97 -0
- package/dist/components-v2/ui/checkbox.d.ts +15 -0
- package/dist/components-v2/ui/checkbox.js +86 -0
- package/dist/components-v2/ui/dialog.d.ts +30 -0
- package/dist/components-v2/ui/dialog.js +115 -0
- package/dist/components-v2/ui/dropdown-menu.d.ts +26 -0
- package/dist/components-v2/ui/dropdown-menu.js +121 -0
- package/dist/components-v2/ui/field.d.ts +32 -0
- package/dist/components-v2/ui/field.js +62 -0
- package/dist/components-v2/ui/form-field.d.ts +25 -0
- package/dist/components-v2/ui/form-field.js +96 -0
- package/dist/components-v2/ui/input.d.ts +9 -0
- package/dist/components-v2/ui/input.js +73 -0
- package/dist/components-v2/ui/label.d.ts +10 -0
- package/dist/components-v2/ui/label.js +70 -0
- package/dist/components-v2/ui/popover.d.ts +9 -0
- package/dist/components-v2/ui/popover.js +60 -0
- package/dist/components-v2/ui/progress.d.ts +12 -0
- package/dist/components-v2/ui/progress.js +75 -0
- package/dist/components-v2/ui/radio-group.d.ts +17 -0
- package/dist/components-v2/ui/radio-group.js +91 -0
- package/dist/components-v2/ui/select.d.ts +24 -0
- package/dist/components-v2/ui/select.js +122 -0
- package/dist/components-v2/ui/separator.d.ts +5 -0
- package/dist/components-v2/ui/separator.js +55 -0
- package/dist/components-v2/ui/skeleton.d.ts +9 -0
- package/dist/components-v2/ui/skeleton.js +68 -0
- package/dist/components-v2/ui/spinner.d.ts +16 -0
- package/dist/components-v2/ui/spinner.js +64 -0
- package/dist/components-v2/ui/switch.d.ts +10 -0
- package/dist/components-v2/ui/switch.js +81 -0
- package/dist/components-v2/ui/tabs.d.ts +13 -0
- package/dist/components-v2/ui/tabs.js +95 -0
- package/dist/components-v2/ui/textarea.d.ts +10 -0
- package/dist/components-v2/ui/textarea.js +96 -0
- package/dist/components-v2/ui/tooltip.d.ts +17 -0
- package/dist/components-v2/ui/tooltip.js +75 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/theme-v2/ThemeProvider.d.ts +19 -0
- package/dist/theme-v2/ThemeProvider.js +149 -0
- package/dist/theme-v2/dark.css +47 -0
- package/dist/theme-v2/tokens.css +72 -0
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.Textarea = void 0;
|
|
48
|
+
const React = __importStar(require("react"));
|
|
49
|
+
const utils_1 = require("../../lib/utils");
|
|
50
|
+
const form_field_1 = require("./form-field");
|
|
51
|
+
function syncHeight(element, minRows, maxRows) {
|
|
52
|
+
const computed = window.getComputedStyle(element);
|
|
53
|
+
const lineHeight = parseFloat(computed.lineHeight) || 20;
|
|
54
|
+
const paddingTop = parseFloat(computed.paddingTop) || 0;
|
|
55
|
+
const paddingBottom = parseFloat(computed.paddingBottom) || 0;
|
|
56
|
+
element.style.height = "auto";
|
|
57
|
+
const contentHeight = element.scrollHeight - paddingTop - paddingBottom;
|
|
58
|
+
const rows = Math.ceil(contentHeight / lineHeight);
|
|
59
|
+
const clamped = Math.max(minRows, maxRows ? Math.min(rows, maxRows) : rows);
|
|
60
|
+
element.style.height = `${clamped * lineHeight + paddingTop + paddingBottom}px`;
|
|
61
|
+
element.style.overflowY = maxRows && rows > maxRows ? "auto" : "hidden";
|
|
62
|
+
}
|
|
63
|
+
exports.Textarea = React.forwardRef((_a, ref) => {
|
|
64
|
+
var { className, autoResize = false, maxRows, minRows = 3, id: idProp, value, defaultValue, onChange, "aria-describedby": ariaDescribedByProp, "aria-invalid": ariaInvalidProp } = _a, rest = __rest(_a, ["className", "autoResize", "maxRows", "minRows", "id", "value", "defaultValue", "onChange", "aria-describedby", "aria-invalid"]);
|
|
65
|
+
const field = (0, form_field_1.useFormField)();
|
|
66
|
+
const id = idProp !== null && idProp !== void 0 ? idProp : (field.id || undefined);
|
|
67
|
+
const describedBy = ariaDescribedByProp !== null && ariaDescribedByProp !== void 0 ? ariaDescribedByProp : (0, form_field_1.buildAriaDescribedBy)(field);
|
|
68
|
+
const invalid = ariaInvalidProp !== undefined ? ariaInvalidProp : field.hasError || undefined;
|
|
69
|
+
const innerRef = React.useRef(null);
|
|
70
|
+
const setRefs = React.useCallback((node) => {
|
|
71
|
+
innerRef.current = node;
|
|
72
|
+
if (typeof ref === "function") {
|
|
73
|
+
ref(node);
|
|
74
|
+
}
|
|
75
|
+
else if (ref) {
|
|
76
|
+
ref.current =
|
|
77
|
+
node;
|
|
78
|
+
}
|
|
79
|
+
}, [ref]);
|
|
80
|
+
React.useLayoutEffect(() => {
|
|
81
|
+
if (!autoResize)
|
|
82
|
+
return;
|
|
83
|
+
const node = innerRef.current;
|
|
84
|
+
if (!node)
|
|
85
|
+
return;
|
|
86
|
+
syncHeight(node, minRows, maxRows);
|
|
87
|
+
}, [autoResize, minRows, maxRows, value, defaultValue]);
|
|
88
|
+
const handleChange = (event) => {
|
|
89
|
+
if (autoResize && innerRef.current) {
|
|
90
|
+
syncHeight(innerRef.current, minRows, maxRows);
|
|
91
|
+
}
|
|
92
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
93
|
+
};
|
|
94
|
+
return (React.createElement("textarea", Object.assign({ ref: setRefs, id: id, rows: minRows, value: value, defaultValue: defaultValue, onChange: handleChange, "aria-describedby": describedBy, "aria-invalid": invalid, className: (0, utils_1.cn)("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground shadow-sm transition-colors", "placeholder:text-muted-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background", "disabled:cursor-not-allowed disabled:opacity-50", "aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:ring-destructive", autoResize ? "resize-none" : "resize-y", className) }, rest)));
|
|
95
|
+
});
|
|
96
|
+
exports.Textarea.displayName = "Textarea";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
/**
|
|
5
|
+
* TooltipProvider is mounted globally by ThemeProvider. Re-exported here for
|
|
6
|
+
* consumers who render outside ThemeProvider (e.g. portal roots, tests).
|
|
7
|
+
*/
|
|
8
|
+
export declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
9
|
+
export declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
10
|
+
export declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
declare const contentVariants: (props?: ({
|
|
12
|
+
size?: "sm" | "md" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
14
|
+
export interface TooltipContentProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, VariantProps<typeof contentVariants> {
|
|
15
|
+
}
|
|
16
|
+
export declare const TooltipContent: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.TooltipContent = exports.TooltipTrigger = exports.Tooltip = exports.TooltipProvider = void 0;
|
|
48
|
+
const React = __importStar(require("react"));
|
|
49
|
+
const TooltipPrimitive = __importStar(require("@radix-ui/react-tooltip"));
|
|
50
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
51
|
+
const utils_1 = require("../../lib/utils");
|
|
52
|
+
/**
|
|
53
|
+
* TooltipProvider is mounted globally by ThemeProvider. Re-exported here for
|
|
54
|
+
* consumers who render outside ThemeProvider (e.g. portal roots, tests).
|
|
55
|
+
*/
|
|
56
|
+
exports.TooltipProvider = TooltipPrimitive.Provider;
|
|
57
|
+
exports.Tooltip = TooltipPrimitive.Root;
|
|
58
|
+
exports.TooltipTrigger = TooltipPrimitive.Trigger;
|
|
59
|
+
const contentVariants = (0, class_variance_authority_1.cva)((0, utils_1.cn)("z-50 overflow-hidden rounded-md bg-foreground px-3 py-1.5 text-background shadow-md", "animate-in fade-in-0 zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2"), {
|
|
60
|
+
variants: {
|
|
61
|
+
size: {
|
|
62
|
+
sm: "px-2 py-1 text-xs",
|
|
63
|
+
md: "px-3 py-1.5 text-xs",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
defaultVariants: {
|
|
67
|
+
size: "md",
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
exports.TooltipContent = React.forwardRef((_a, ref) => {
|
|
71
|
+
var { className, size, sideOffset = 4, side = "top" } = _a, rest = __rest(_a, ["className", "size", "sideOffset", "side"]);
|
|
72
|
+
return (React.createElement(TooltipPrimitive.Portal, null,
|
|
73
|
+
React.createElement(TooltipPrimitive.Content, Object.assign({ ref: ref, sideOffset: sideOffset, side: side, className: (0, utils_1.cn)(contentVariants({ size }), className) }, rest))));
|
|
74
|
+
});
|
|
75
|
+
exports.TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cn = cn;
|
|
4
|
+
const clsx_1 = require("clsx");
|
|
5
|
+
const tailwind_merge_1 = require("tailwind-merge");
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ThemeName = "default" | "meadow" | "rosewood" | "skyline" | "slate" | "emerald" | "radiant";
|
|
3
|
+
export type ThemeMode = "light" | "dark" | "system";
|
|
4
|
+
export type ResolvedMode = "light" | "dark";
|
|
5
|
+
export interface ThemeContextValue {
|
|
6
|
+
theme: ThemeName;
|
|
7
|
+
setTheme: (theme: ThemeName) => void;
|
|
8
|
+
mode: ThemeMode;
|
|
9
|
+
setMode: (mode: ThemeMode) => void;
|
|
10
|
+
resolvedMode: ResolvedMode;
|
|
11
|
+
}
|
|
12
|
+
export interface ThemeProviderProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
defaultTheme?: ThemeName;
|
|
15
|
+
defaultMode?: ThemeMode;
|
|
16
|
+
storageKey?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function ThemeProvider({ children, defaultTheme, defaultMode, storageKey, }: ThemeProviderProps): React.ReactElement;
|
|
19
|
+
export declare function useTheme(): ThemeContextValue;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ThemeProvider = ThemeProvider;
|
|
37
|
+
exports.useTheme = useTheme;
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const TooltipPrimitive = __importStar(require("@radix-ui/react-tooltip"));
|
|
40
|
+
const ThemeContext = React.createContext(null);
|
|
41
|
+
const THEME_NAMES = [
|
|
42
|
+
"default",
|
|
43
|
+
"meadow",
|
|
44
|
+
"rosewood",
|
|
45
|
+
"skyline",
|
|
46
|
+
"slate",
|
|
47
|
+
"emerald",
|
|
48
|
+
"radiant",
|
|
49
|
+
];
|
|
50
|
+
const MODES = ["light", "dark", "system"];
|
|
51
|
+
function isThemeName(value) {
|
|
52
|
+
return typeof value === "string" && THEME_NAMES.includes(value);
|
|
53
|
+
}
|
|
54
|
+
function isThemeMode(value) {
|
|
55
|
+
return typeof value === "string" && MODES.includes(value);
|
|
56
|
+
}
|
|
57
|
+
function readStorage(key) {
|
|
58
|
+
if (typeof window === "undefined")
|
|
59
|
+
return {};
|
|
60
|
+
try {
|
|
61
|
+
const raw = window.localStorage.getItem(key);
|
|
62
|
+
if (!raw)
|
|
63
|
+
return {};
|
|
64
|
+
const parsed = JSON.parse(raw);
|
|
65
|
+
if (!parsed || typeof parsed !== "object")
|
|
66
|
+
return {};
|
|
67
|
+
const candidate = parsed;
|
|
68
|
+
return {
|
|
69
|
+
theme: isThemeName(candidate.theme) ? candidate.theme : undefined,
|
|
70
|
+
mode: isThemeMode(candidate.mode) ? candidate.mode : undefined,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (_a) {
|
|
74
|
+
return {};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function getSystemMode() {
|
|
78
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
79
|
+
return "light";
|
|
80
|
+
}
|
|
81
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
82
|
+
}
|
|
83
|
+
function ThemeProvider({ children, defaultTheme = "default", defaultMode = "system", storageKey = "px-ui-theme", }) {
|
|
84
|
+
const [theme, setThemeState] = React.useState(defaultTheme);
|
|
85
|
+
const [mode, setModeState] = React.useState(defaultMode);
|
|
86
|
+
const [systemMode, setSystemMode] = React.useState("light");
|
|
87
|
+
// Hydrate from storage + initial system mode after mount (SSR-safe).
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
const stored = readStorage(storageKey);
|
|
90
|
+
if (stored.theme)
|
|
91
|
+
setThemeState(stored.theme);
|
|
92
|
+
if (stored.mode)
|
|
93
|
+
setModeState(stored.mode);
|
|
94
|
+
setSystemMode(getSystemMode());
|
|
95
|
+
}, [storageKey]);
|
|
96
|
+
// Subscribe to OS color-scheme changes.
|
|
97
|
+
React.useEffect(() => {
|
|
98
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
102
|
+
const handler = (event) => {
|
|
103
|
+
setSystemMode(event.matches ? "dark" : "light");
|
|
104
|
+
};
|
|
105
|
+
mq.addEventListener("change", handler);
|
|
106
|
+
return () => mq.removeEventListener("change", handler);
|
|
107
|
+
}, []);
|
|
108
|
+
const resolvedMode = mode === "system" ? systemMode : mode;
|
|
109
|
+
// Apply data-theme + .dark class to <html>.
|
|
110
|
+
React.useEffect(() => {
|
|
111
|
+
if (typeof document === "undefined")
|
|
112
|
+
return;
|
|
113
|
+
const root = document.documentElement;
|
|
114
|
+
root.setAttribute("data-theme", theme);
|
|
115
|
+
if (resolvedMode === "dark") {
|
|
116
|
+
root.classList.add("dark");
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
root.classList.remove("dark");
|
|
120
|
+
}
|
|
121
|
+
}, [theme, resolvedMode]);
|
|
122
|
+
// Persist selections.
|
|
123
|
+
React.useEffect(() => {
|
|
124
|
+
if (typeof window === "undefined")
|
|
125
|
+
return;
|
|
126
|
+
try {
|
|
127
|
+
window.localStorage.setItem(storageKey, JSON.stringify({ theme, mode }));
|
|
128
|
+
}
|
|
129
|
+
catch (_a) {
|
|
130
|
+
// Storage may be unavailable (private mode, quota). Ignore.
|
|
131
|
+
}
|
|
132
|
+
}, [theme, mode, storageKey]);
|
|
133
|
+
const setTheme = React.useCallback((next) => {
|
|
134
|
+
setThemeState(next);
|
|
135
|
+
}, []);
|
|
136
|
+
const setMode = React.useCallback((next) => {
|
|
137
|
+
setModeState(next);
|
|
138
|
+
}, []);
|
|
139
|
+
const value = React.useMemo(() => ({ theme, setTheme, mode, setMode, resolvedMode }), [theme, setTheme, mode, setMode, resolvedMode]);
|
|
140
|
+
return (React.createElement(ThemeContext.Provider, { value: value },
|
|
141
|
+
React.createElement(TooltipPrimitive.Provider, { delayDuration: 200, skipDelayDuration: 300 }, children)));
|
|
142
|
+
}
|
|
143
|
+
function useTheme() {
|
|
144
|
+
const ctx = React.useContext(ThemeContext);
|
|
145
|
+
if (!ctx) {
|
|
146
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
147
|
+
}
|
|
148
|
+
return ctx;
|
|
149
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dark mode token overrides.
|
|
3
|
+
*
|
|
4
|
+
* Activated by adding `.dark` to the <html> element (handled by ThemeProvider).
|
|
5
|
+
* Avoids pure black: surfaces sit on a desaturated blue-gray to feel premium
|
|
6
|
+
* while staying inside WCAG AA contrast against `--color-foreground`.
|
|
7
|
+
*/
|
|
8
|
+
.dark {
|
|
9
|
+
--color-primary: 217 91% 60%;
|
|
10
|
+
--color-primary-foreground: 222 47% 11%;
|
|
11
|
+
|
|
12
|
+
--color-background: 222 47% 8%;
|
|
13
|
+
--color-foreground: 210 40% 98%;
|
|
14
|
+
|
|
15
|
+
--color-card: 222 47% 11%;
|
|
16
|
+
--color-card-foreground: 210 40% 98%;
|
|
17
|
+
|
|
18
|
+
--color-secondary: 217 33% 18%;
|
|
19
|
+
--color-secondary-foreground: 210 40% 98%;
|
|
20
|
+
|
|
21
|
+
--color-muted: 217 33% 17%;
|
|
22
|
+
--color-muted-foreground: 215 20% 65%;
|
|
23
|
+
|
|
24
|
+
--color-accent: 217 33% 20%;
|
|
25
|
+
--color-accent-foreground: 210 40% 98%;
|
|
26
|
+
|
|
27
|
+
--color-border: 217 33% 20%;
|
|
28
|
+
--color-input: 217 33% 22%;
|
|
29
|
+
--color-ring: 217 91% 60%;
|
|
30
|
+
|
|
31
|
+
--color-destructive: 0 63% 50%;
|
|
32
|
+
--color-destructive-foreground: 210 40% 98%;
|
|
33
|
+
|
|
34
|
+
--color-success: 142 65% 45%;
|
|
35
|
+
--color-success-foreground: 222 47% 11%;
|
|
36
|
+
|
|
37
|
+
--color-warning: 38 92% 55%;
|
|
38
|
+
--color-warning-foreground: 222 47% 11%;
|
|
39
|
+
|
|
40
|
+
--shadow-sm: 0 1px 2px 0 hsl(0 0% 0% / 0.4);
|
|
41
|
+
--shadow-md:
|
|
42
|
+
0 4px 6px -1px hsl(0 0% 0% / 0.5),
|
|
43
|
+
0 2px 4px -2px hsl(0 0% 0% / 0.4);
|
|
44
|
+
--shadow-lg:
|
|
45
|
+
0 10px 15px -3px hsl(0 0% 0% / 0.6),
|
|
46
|
+
0 4px 6px -4px hsl(0 0% 0% / 0.45);
|
|
47
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base design tokens — light mode defaults.
|
|
3
|
+
*
|
|
4
|
+
* All color values are HSL channels without the hsl() wrapper so they can be
|
|
5
|
+
* composed with Tailwind opacity modifiers (e.g. `bg-primary/50`).
|
|
6
|
+
*
|
|
7
|
+
* --color-primary: 221 83% 53%;
|
|
8
|
+
* background-color: hsl(var(--color-primary) / 0.5);
|
|
9
|
+
*
|
|
10
|
+
* Consumers can override any of these variables on :root (or a scoped element)
|
|
11
|
+
* to fully restyle the library.
|
|
12
|
+
*/
|
|
13
|
+
:root {
|
|
14
|
+
/* Brand */
|
|
15
|
+
--color-primary: 221 83% 53%;
|
|
16
|
+
--color-primary-foreground: 0 0% 100%;
|
|
17
|
+
|
|
18
|
+
/* Surfaces */
|
|
19
|
+
--color-background: 0 0% 100%;
|
|
20
|
+
--color-foreground: 222 47% 11%;
|
|
21
|
+
|
|
22
|
+
--color-card: 0 0% 100%;
|
|
23
|
+
--color-card-foreground: 222 47% 11%;
|
|
24
|
+
|
|
25
|
+
/* Secondary action surfaces */
|
|
26
|
+
--color-secondary: 210 40% 96%;
|
|
27
|
+
--color-secondary-foreground: 222 47% 11%;
|
|
28
|
+
|
|
29
|
+
--color-muted: 210 40% 96%;
|
|
30
|
+
--color-muted-foreground: 215 16% 47%;
|
|
31
|
+
|
|
32
|
+
--color-accent: 210 40% 96%;
|
|
33
|
+
--color-accent-foreground: 222 47% 11%;
|
|
34
|
+
|
|
35
|
+
/* Lines / focus */
|
|
36
|
+
--color-border: 214 32% 91%;
|
|
37
|
+
--color-input: 214 32% 91%;
|
|
38
|
+
--color-ring: 221 83% 53%;
|
|
39
|
+
|
|
40
|
+
/* Status */
|
|
41
|
+
--color-destructive: 0 84% 60%;
|
|
42
|
+
--color-destructive-foreground: 0 0% 100%;
|
|
43
|
+
|
|
44
|
+
--color-success: 142 71% 45%;
|
|
45
|
+
--color-success-foreground: 0 0% 100%;
|
|
46
|
+
|
|
47
|
+
--color-warning: 38 92% 50%;
|
|
48
|
+
--color-warning-foreground: 222 47% 11%;
|
|
49
|
+
|
|
50
|
+
/* Radius */
|
|
51
|
+
--radius: 0.5rem;
|
|
52
|
+
|
|
53
|
+
/* Elevation */
|
|
54
|
+
--shadow-sm: 0 1px 2px 0 hsl(222 47% 11% / 0.05);
|
|
55
|
+
--shadow-md:
|
|
56
|
+
0 4px 6px -1px hsl(222 47% 11% / 0.08),
|
|
57
|
+
0 2px 4px -2px hsl(222 47% 11% / 0.06);
|
|
58
|
+
--shadow-lg:
|
|
59
|
+
0 10px 15px -3px hsl(222 47% 11% / 0.1),
|
|
60
|
+
0 4px 6px -4px hsl(222 47% 11% / 0.06);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
*,
|
|
65
|
+
*::before,
|
|
66
|
+
*::after {
|
|
67
|
+
animation-duration: 0.01ms !important;
|
|
68
|
+
animation-iteration-count: 1 !important;
|
|
69
|
+
transition-duration: 0.01ms !important;
|
|
70
|
+
scroll-behavior: auto !important;
|
|
71
|
+
}
|
|
72
|
+
}
|