pixelize-design-library 2.3.1-beta.1 → 2.3.1-beta.11
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 +21 -1
- package/dist/Components/Accordion/Accordion.js +26 -5
- package/dist/Components/KanbanBoard/AccountCard.js +17 -14
- package/dist/Components/KanbanBoard/KanbanBoard.js +93 -78
- package/dist/Components/NavigationBar/NavigationBar.js +4 -4
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +1 -1
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +42 -24
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.d.ts +2 -0
- package/dist/Components/SearchSelect/SearchSelect.js +53 -21
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Table/Table.js +167 -32
- package/dist/Components/Table/TableProps.d.ts +9 -1
- package/dist/Components/Table/{Components → components}/Pagination.js +1 -1
- package/dist/Components/Table/{Components → components}/TableActions.d.ts +2 -2
- package/dist/Components/Table/{Components → components}/TableActions.js +5 -4
- package/dist/Components/Table/{Components → components}/TableBody.js +98 -29
- package/dist/Components/Table/{Components → components}/TableHeader.js +5 -9
- package/dist/Components/Table/hooks/useTable.d.ts +2 -1
- package/dist/Components/Table/hooks/useTable.js +24 -10
- package/dist/Components/Table/settings/TableSettings.d.ts +3 -2
- package/dist/Components/Table/settings/TableSettings.js +30 -6
- package/dist/Components/Timeline/Timeline.d.ts +1 -1
- package/dist/Components/Timeline/Timeline.js +145 -78
- package/dist/Components/Toaster/Toaster.js +40 -20
- package/dist/Utils/table.d.ts +6 -1
- package/dist/Utils/table.js +47 -27
- package/package.json +1 -1
- package/dist/App.d.ts +0 -4
- package/dist/App.js +0 -131
- package/dist/Components/Table/CompactSelect.d.ts +0 -15
- package/dist/Components/Table/CompactSelect.js +0 -69
- package/dist/Components/Table/Components/ActiveFilters.d.ts +0 -9
- package/dist/Components/Table/Components/ActiveFilters.js +0 -132
- package/dist/Components/Table/Components/TableFilters.d.ts +0 -7
- package/dist/Components/Table/Components/TableFilters.js +0 -89
- package/dist/Components/Table/Components/useDebounce.d.ts +0 -2
- package/dist/Components/Table/Components/useDebounce.js +0 -28
- package/dist/Components/Table/Components/useTable.d.ts +0 -47
- package/dist/Components/Table/Components/useTable.js +0 -219
- package/dist/Components/Table/LeftFilterPane.d.ts +0 -36
- package/dist/Components/Table/LeftFilterPane.js +0 -273
- package/dist/Components/Table/SelectOperationControls.d.ts +0 -8
- package/dist/Components/Table/SelectOperationControls.js +0 -15
- package/dist/Components/Table/TableSettings/ManageColumns.d.ts +0 -12
- package/dist/Components/Table/TableSettings/ManageColumns.js +0 -166
- package/dist/Components/Table/TableSettings/ManageColumns.test.d.ts +0 -1
- package/dist/Components/Table/TableSettings/ManageColumns.test.js +0 -146
- package/dist/Components/Table/TableSettings/TableFilters.d.ts +0 -10
- package/dist/Components/Table/TableSettings/TableFilters.js +0 -69
- package/dist/Components/Table/TableSettings/TableFilters.test.d.ts +0 -1
- package/dist/Components/Table/TableSettings/TableFilters.test.js +0 -109
- package/dist/Components/Table/TableSettings/TableSettings.d.ts +0 -8
- package/dist/Components/Table/TableSettings/TableSettings.js +0 -141
- package/dist/Components/Table/TableToDo.d.ts +0 -2
- package/dist/Components/Table/TableToDo.js +0 -291
- package/dist/Components/Table/TextOperationControls.d.ts +0 -12
- package/dist/Components/Table/TextOperationControls.js +0 -29
- package/dist/Layout.d.ts +0 -3
- package/dist/Layout.js +0 -292
- package/dist/Pages/TInput.d.ts +0 -3
- package/dist/Pages/TInput.js +0 -56
- package/dist/Pages/accordion.d.ts +0 -3
- package/dist/Pages/accordion.js +0 -42
- package/dist/Pages/alertdialog.d.ts +0 -3
- package/dist/Pages/alertdialog.js +0 -54
- package/dist/Pages/button.d.ts +0 -3
- package/dist/Pages/button.js +0 -46
- package/dist/Pages/card.d.ts +0 -3
- package/dist/Pages/card.js +0 -117
- package/dist/Pages/chart.d.ts +0 -4
- package/dist/Pages/chart.js +0 -40
- package/dist/Pages/checkbox.d.ts +0 -3
- package/dist/Pages/checkbox.js +0 -12
- package/dist/Pages/contactForm.d.ts +0 -3
- package/dist/Pages/contactForm.js +0 -16
- package/dist/Pages/datePick.d.ts +0 -3
- package/dist/Pages/datePick.js +0 -88
- package/dist/Pages/drawer.d.ts +0 -3
- package/dist/Pages/drawer.js +0 -58
- package/dist/Pages/dropdown.d.ts +0 -3
- package/dist/Pages/dropdown.js +0 -24
- package/dist/Pages/editor.d.ts +0 -3
- package/dist/Pages/editor.js +0 -14
- package/dist/Pages/feedback.d.ts +0 -2
- package/dist/Pages/feedback.js +0 -15
- package/dist/Pages/fileUpload.d.ts +0 -2
- package/dist/Pages/fileUpload.js +0 -82
- package/dist/Pages/input.d.ts +0 -3
- package/dist/Pages/input.js +0 -92
- package/dist/Pages/kanbanboard.d.ts +0 -3
- package/dist/Pages/kanbanboard.js +0 -224
- package/dist/Pages/modal.d.ts +0 -3
- package/dist/Pages/modal.js +0 -65
- package/dist/Pages/multiSelect.d.ts +0 -3
- package/dist/Pages/multiSelect.js +0 -55
- package/dist/Pages/noteArea.d.ts +0 -3
- package/dist/Pages/noteArea.js +0 -59
- package/dist/Pages/notification.d.ts +0 -3
- package/dist/Pages/notification.js +0 -25
- package/dist/Pages/numberInput.d.ts +0 -3
- package/dist/Pages/numberInput.js +0 -49
- package/dist/Pages/photoViewer.d.ts +0 -3
- package/dist/Pages/photoViewer.js +0 -12
- package/dist/Pages/pinInputs.d.ts +0 -3
- package/dist/Pages/pinInputs.js +0 -12
- package/dist/Pages/productCaard.d.ts +0 -3
- package/dist/Pages/productCaard.js +0 -311
- package/dist/Pages/productDetailCard.d.ts +0 -3
- package/dist/Pages/productDetailCard.js +0 -78
- package/dist/Pages/productFilter.d.ts +0 -3
- package/dist/Pages/productFilter.js +0 -202
- package/dist/Pages/progressbar.d.ts +0 -3
- package/dist/Pages/progressbar.js +0 -12
- package/dist/Pages/radioButton.d.ts +0 -3
- package/dist/Pages/radioButton.js +0 -54
- package/dist/Pages/search.d.ts +0 -3
- package/dist/Pages/search.js +0 -54
- package/dist/Pages/searchSelect.d.ts +0 -3
- package/dist/Pages/searchSelect.js +0 -133
- package/dist/Pages/select.d.ts +0 -3
- package/dist/Pages/select.js +0 -53
- package/dist/Pages/selectSearch.d.ts +0 -3
- package/dist/Pages/selectSearch.js +0 -103
- package/dist/Pages/skeleton.d.ts +0 -3
- package/dist/Pages/skeleton.js +0 -22
- package/dist/Pages/switch.d.ts +0 -3
- package/dist/Pages/switch.js +0 -50
- package/dist/Pages/table.d.ts +0 -3
- package/dist/Pages/table.js +0 -174
- package/dist/Pages/textArea.d.ts +0 -3
- package/dist/Pages/textArea.js +0 -15
- package/dist/Pages/timeline.d.ts +0 -3
- package/dist/Pages/timeline.js +0 -74
- package/dist/Pages/tooltip.d.ts +0 -3
- package/dist/Pages/tooltip.js +0 -12
- package/dist/Pages/toster.d.ts +0 -3
- package/dist/Pages/toster.js +0 -68
- package/dist/Pages/verifyEmail.d.ts +0 -3
- package/dist/Pages/verifyEmail.js +0 -18
- package/dist/Theme/Dark/palette.d.ts +0 -370
- package/dist/Theme/Dark/palette.js +0 -372
- package/dist/bootstrap.d.ts +0 -1
- package/dist/bootstrap.js +0 -14
- package/dist/components-v2/AlertDialog/AlertDialog.d.ts +0 -23
- package/dist/components-v2/AlertDialog/AlertDialog.js +0 -98
- package/dist/components-v2/Breadcrumbs/Breadcrumbs.d.ts +0 -14
- package/dist/components-v2/Breadcrumbs/Breadcrumbs.js +0 -66
- package/dist/components-v2/Charts/AreaChart.d.ts +0 -23
- package/dist/components-v2/Charts/AreaChart.js +0 -63
- package/dist/components-v2/Charts/BarChart.d.ts +0 -25
- package/dist/components-v2/Charts/BarChart.js +0 -57
- package/dist/components-v2/Charts/LineChart.d.ts +0 -23
- package/dist/components-v2/Charts/LineChart.js +0 -55
- package/dist/components-v2/Charts/PieChart.d.ts +0 -15
- package/dist/components-v2/Charts/PieChart.js +0 -54
- package/dist/components-v2/Charts/PolarChart.d.ts +0 -14
- package/dist/components-v2/Charts/PolarChart.js +0 -54
- package/dist/components-v2/Charts/chartOptions.d.ts +0 -7
- package/dist/components-v2/Charts/chartOptions.js +0 -41
- package/dist/components-v2/Charts/useChartTheme.d.ts +0 -22
- package/dist/components-v2/Charts/useChartTheme.js +0 -106
- package/dist/components-v2/ContactForm/ContactForm.d.ts +0 -25
- package/dist/components-v2/ContactForm/ContactForm.js +0 -116
- package/dist/components-v2/DatePicker/Calendar.d.ts +0 -19
- package/dist/components-v2/DatePicker/Calendar.js +0 -212
- package/dist/components-v2/DatePicker/DatePicker.d.ts +0 -46
- package/dist/components-v2/DatePicker/DatePicker.js +0 -189
- package/dist/components-v2/DatePicker/TimePicker.d.ts +0 -12
- package/dist/components-v2/DatePicker/TimePicker.js +0 -105
- package/dist/components-v2/DatePicker/utils.d.ts +0 -31
- package/dist/components-v2/DatePicker/utils.js +0 -109
- package/dist/components-v2/Drawer/Drawer.d.ts +0 -27
- package/dist/components-v2/Drawer/Drawer.js +0 -132
- package/dist/components-v2/FeedbackForm/FeedbackForm.d.ts +0 -26
- package/dist/components-v2/FeedbackForm/FeedbackForm.js +0 -112
- package/dist/components-v2/FileUploader/FileUploader.d.ts +0 -28
- package/dist/components-v2/FileUploader/FileUploader.js +0 -127
- package/dist/components-v2/Input/TextInput.d.ts +0 -41
- package/dist/components-v2/Input/TextInput.js +0 -169
- package/dist/components-v2/KanbanBoard/KanbanBoard.d.ts +0 -39
- package/dist/components-v2/KanbanBoard/KanbanBoard.js +0 -101
- package/dist/components-v2/Layout/AppLayout.d.ts +0 -22
- package/dist/components-v2/Layout/AppLayout.js +0 -53
- package/dist/components-v2/Loading/Loading.d.ts +0 -19
- package/dist/components-v2/Loading/Loading.js +0 -55
- package/dist/components-v2/Modal/Modal.d.ts +0 -30
- package/dist/components-v2/Modal/Modal.js +0 -82
- package/dist/components-v2/NavigationBar/NavigationBar.d.ts +0 -47
- package/dist/components-v2/NavigationBar/NavigationBar.js +0 -148
- package/dist/components-v2/Notification/Notification.d.ts +0 -22
- package/dist/components-v2/Notification/Notification.js +0 -113
- package/dist/components-v2/NumberInput/NumberInput.d.ts +0 -37
- package/dist/components-v2/NumberInput/NumberInput.js +0 -210
- package/dist/components-v2/PinInput/PinInput.d.ts +0 -26
- package/dist/components-v2/PinInput/PinInput.js +0 -138
- package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +0 -18
- package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.js +0 -91
- package/dist/components-v2/Select/Select.d.ts +0 -41
- package/dist/components-v2/Select/Select.js +0 -284
- package/dist/components-v2/Sidebar/Sidebar.d.ts +0 -41
- package/dist/components-v2/Sidebar/Sidebar.js +0 -182
- package/dist/components-v2/Slider/Slider.d.ts +0 -18
- package/dist/components-v2/Slider/Slider.js +0 -101
- package/dist/components-v2/Table/Table.d.ts +0 -7
- package/dist/components-v2/Table/Table.js +0 -172
- package/dist/components-v2/Table/TableProps.d.ts +0 -139
- package/dist/components-v2/Table/TableProps.js +0 -9
- package/dist/components-v2/Table/components/ActiveFilters.d.ts +0 -10
- package/dist/components-v2/Table/components/ActiveFilters.js +0 -70
- package/dist/components-v2/Table/components/BulkActionBar.d.ts +0 -11
- package/dist/components-v2/Table/components/BulkActionBar.js +0 -92
- package/dist/components-v2/Table/components/ColumnResizeHandle.d.ts +0 -7
- package/dist/components-v2/Table/components/ColumnResizeHandle.js +0 -41
- package/dist/components-v2/Table/components/Pagination.d.ts +0 -11
- package/dist/components-v2/Table/components/Pagination.js +0 -92
- package/dist/components-v2/Table/components/TableBody.d.ts +0 -23
- package/dist/components-v2/Table/components/TableBody.js +0 -69
- package/dist/components-v2/Table/components/TableCell.d.ts +0 -14
- package/dist/components-v2/Table/components/TableCell.js +0 -63
- package/dist/components-v2/Table/components/TableEmptyState.d.ts +0 -12
- package/dist/components-v2/Table/components/TableEmptyState.js +0 -55
- package/dist/components-v2/Table/components/TableErrorState.d.ts +0 -6
- package/dist/components-v2/Table/components/TableErrorState.js +0 -52
- package/dist/components-v2/Table/components/TableHeader.d.ts +0 -21
- package/dist/components-v2/Table/components/TableHeader.js +0 -94
- package/dist/components-v2/Table/components/TableRow.d.ts +0 -20
- package/dist/components-v2/Table/components/TableRow.js +0 -64
- package/dist/components-v2/Table/components/TableSearch.d.ts +0 -8
- package/dist/components-v2/Table/components/TableSearch.js +0 -47
- package/dist/components-v2/Table/filters/FilterChips.d.ts +0 -6
- package/dist/components-v2/Table/filters/FilterChips.js +0 -9
- package/dist/components-v2/Table/filters/LeftFilterPane.d.ts +0 -17
- package/dist/components-v2/Table/filters/LeftFilterPane.js +0 -105
- package/dist/components-v2/Table/filters/TableFilters.d.ts +0 -12
- package/dist/components-v2/Table/filters/TableFilters.js +0 -127
- package/dist/components-v2/Table/hooks/useColumnResize.d.ts +0 -15
- package/dist/components-v2/Table/hooks/useColumnResize.js +0 -104
- package/dist/components-v2/Table/hooks/useTable.d.ts +0 -58
- package/dist/components-v2/Table/hooks/useTable.js +0 -254
- package/dist/components-v2/Table/hooks/useTableKeyboard.d.ts +0 -25
- package/dist/components-v2/Table/hooks/useTableKeyboard.js +0 -112
- package/dist/components-v2/Table/hooks/useVirtualScroll.d.ts +0 -29
- package/dist/components-v2/Table/hooks/useVirtualScroll.js +0 -83
- package/dist/components-v2/Table/settings/ManageColumns.d.ts +0 -12
- package/dist/components-v2/Table/settings/ManageColumns.js +0 -59
- package/dist/components-v2/Table/settings/TableSettings.d.ts +0 -12
- package/dist/components-v2/Table/settings/TableSettings.js +0 -57
- package/dist/components-v2/Table/utils/filterUtils.d.ts +0 -7
- package/dist/components-v2/Table/utils/filterUtils.js +0 -149
- package/dist/components-v2/Table/utils/sortUtils.d.ts +0 -6
- package/dist/components-v2/Table/utils/sortUtils.js +0 -65
- package/dist/components-v2/Tag/Tag.d.ts +0 -15
- package/dist/components-v2/Tag/Tag.js +0 -87
- package/dist/components-v2/Timeline/Timeline.d.ts +0 -18
- package/dist/components-v2/Timeline/Timeline.js +0 -76
- package/dist/components-v2/Toaster/Toaster.d.ts +0 -61
- package/dist/components-v2/Toaster/Toaster.js +0 -63
- package/dist/components-v2/Toggle/Toggle.d.ts +0 -28
- package/dist/components-v2/Toggle/Toggle.js +0 -90
- package/dist/components-v2/ui/accordion.d.ts +0 -12
- package/dist/components-v2/ui/accordion.js +0 -104
- package/dist/components-v2/ui/alert.d.ts +0 -18
- package/dist/components-v2/ui/alert.js +0 -99
- package/dist/components-v2/ui/avatar.d.ts +0 -12
- package/dist/components-v2/ui/avatar.js +0 -80
- package/dist/components-v2/ui/badge.d.ts +0 -10
- package/dist/components-v2/ui/badge.js +0 -76
- package/dist/components-v2/ui/button.d.ts +0 -18
- package/dist/components-v2/ui/button.js +0 -97
- package/dist/components-v2/ui/checkbox.d.ts +0 -15
- package/dist/components-v2/ui/checkbox.js +0 -86
- package/dist/components-v2/ui/dialog.d.ts +0 -30
- package/dist/components-v2/ui/dialog.js +0 -115
- package/dist/components-v2/ui/dropdown-menu.d.ts +0 -26
- package/dist/components-v2/ui/dropdown-menu.js +0 -121
- package/dist/components-v2/ui/field.d.ts +0 -32
- package/dist/components-v2/ui/field.js +0 -62
- package/dist/components-v2/ui/form-field.d.ts +0 -25
- package/dist/components-v2/ui/form-field.js +0 -96
- package/dist/components-v2/ui/input.d.ts +0 -9
- package/dist/components-v2/ui/input.js +0 -73
- package/dist/components-v2/ui/label.d.ts +0 -10
- package/dist/components-v2/ui/label.js +0 -70
- package/dist/components-v2/ui/popover.d.ts +0 -9
- package/dist/components-v2/ui/popover.js +0 -60
- package/dist/components-v2/ui/progress.d.ts +0 -12
- package/dist/components-v2/ui/progress.js +0 -75
- package/dist/components-v2/ui/radio-group.d.ts +0 -17
- package/dist/components-v2/ui/radio-group.js +0 -91
- package/dist/components-v2/ui/select.d.ts +0 -24
- package/dist/components-v2/ui/select.js +0 -122
- package/dist/components-v2/ui/separator.d.ts +0 -5
- package/dist/components-v2/ui/separator.js +0 -55
- package/dist/components-v2/ui/skeleton.d.ts +0 -9
- package/dist/components-v2/ui/skeleton.js +0 -68
- package/dist/components-v2/ui/spinner.d.ts +0 -16
- package/dist/components-v2/ui/spinner.js +0 -64
- package/dist/components-v2/ui/switch.d.ts +0 -10
- package/dist/components-v2/ui/switch.js +0 -81
- package/dist/components-v2/ui/tabs.d.ts +0 -13
- package/dist/components-v2/ui/tabs.js +0 -95
- package/dist/components-v2/ui/textarea.d.ts +0 -10
- package/dist/components-v2/ui/textarea.js +0 -96
- package/dist/components-v2/ui/tooltip.d.ts +0 -17
- package/dist/components-v2/ui/tooltip.js +0 -75
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +0 -8
- package/dist/theme-v2/ThemeProvider.d.ts +0 -19
- package/dist/theme-v2/ThemeProvider.js +0 -149
- package/dist/theme-v2/dark.css +0 -47
- package/dist/theme-v2/tokens.css +0 -72
- /package/dist/Components/Table/{Components → components}/HeaderActions.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/HeaderActions.js +0 -0
- /package/dist/Components/Table/{Components → components}/Pagination.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableGroupRow.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableGroupRow.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableHeader.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableLoading.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableLoading.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableSearch.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableSearch.js +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { ApexOptions } from "apexcharts";
|
|
3
|
-
export interface BarSeriesPoint {
|
|
4
|
-
x: string | number;
|
|
5
|
-
y: number;
|
|
6
|
-
}
|
|
7
|
-
export interface BarSeries {
|
|
8
|
-
name: string;
|
|
9
|
-
data: BarSeriesPoint[] | number[];
|
|
10
|
-
}
|
|
11
|
-
export interface BarChartProps {
|
|
12
|
-
series: BarSeries[];
|
|
13
|
-
categories?: (string | number)[];
|
|
14
|
-
height?: number | string;
|
|
15
|
-
horizontal?: boolean;
|
|
16
|
-
stacked?: boolean;
|
|
17
|
-
showLegend?: boolean;
|
|
18
|
-
/** Extra Apex options merged on top of the themed base. */
|
|
19
|
-
options?: ApexOptions;
|
|
20
|
-
className?: string;
|
|
21
|
-
}
|
|
22
|
-
export declare function BarChart({ series, categories, height, horizontal, stacked, showLegend, options, className, }: BarChartProps): React.ReactElement;
|
|
23
|
-
export declare namespace BarChart {
|
|
24
|
-
var displayName: string;
|
|
25
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BarChart = BarChart;
|
|
40
|
-
const React = __importStar(require("react"));
|
|
41
|
-
const react_apexcharts_1 = __importDefault(require("react-apexcharts"));
|
|
42
|
-
const utils_1 = require("../../lib/utils");
|
|
43
|
-
const chartOptions_1 = require("./chartOptions");
|
|
44
|
-
const useChartTheme_1 = require("./useChartTheme");
|
|
45
|
-
function BarChart({ series, categories, height = 320, horizontal = false, stacked = false, showLegend = true, options, className, }) {
|
|
46
|
-
const theme = (0, useChartTheme_1.useChartTheme)();
|
|
47
|
-
const merged = React.useMemo(() => {
|
|
48
|
-
const base = (0, chartOptions_1.baseApexOptions)(theme);
|
|
49
|
-
return Object.assign(Object.assign(Object.assign({}, base), { chart: Object.assign(Object.assign({}, base.chart), { type: "bar", stacked }), plotOptions: {
|
|
50
|
-
bar: { horizontal, borderRadius: 4, columnWidth: "55%" },
|
|
51
|
-
}, xaxis: categories
|
|
52
|
-
? Object.assign(Object.assign({}, base.xaxis), { categories }) : base.xaxis, legend: Object.assign(Object.assign({}, base.legend), { show: showLegend }) }), options);
|
|
53
|
-
}, [theme, categories, horizontal, stacked, showLegend, options]);
|
|
54
|
-
return (React.createElement("div", { className: (0, utils_1.cn)("w-full", className) },
|
|
55
|
-
React.createElement(react_apexcharts_1.default, { key: `${theme.mode}-${theme.primary}`, options: merged, series: series, type: "bar", height: height })));
|
|
56
|
-
}
|
|
57
|
-
BarChart.displayName = "BarChart";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { ApexOptions } from "apexcharts";
|
|
3
|
-
export interface LinePoint {
|
|
4
|
-
x: string | number | Date;
|
|
5
|
-
y: number;
|
|
6
|
-
}
|
|
7
|
-
export interface LineSeries {
|
|
8
|
-
name: string;
|
|
9
|
-
data: LinePoint[] | number[];
|
|
10
|
-
}
|
|
11
|
-
export interface LineChartProps {
|
|
12
|
-
series: LineSeries[];
|
|
13
|
-
categories?: (string | number)[];
|
|
14
|
-
height?: number | string;
|
|
15
|
-
curve?: "smooth" | "straight" | "stepline";
|
|
16
|
-
showLegend?: boolean;
|
|
17
|
-
options?: ApexOptions;
|
|
18
|
-
className?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare function LineChart({ series, categories, height, curve, showLegend, options, className, }: LineChartProps): React.ReactElement;
|
|
21
|
-
export declare namespace LineChart {
|
|
22
|
-
var displayName: string;
|
|
23
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.LineChart = LineChart;
|
|
40
|
-
const React = __importStar(require("react"));
|
|
41
|
-
const react_apexcharts_1 = __importDefault(require("react-apexcharts"));
|
|
42
|
-
const utils_1 = require("../../lib/utils");
|
|
43
|
-
const chartOptions_1 = require("./chartOptions");
|
|
44
|
-
const useChartTheme_1 = require("./useChartTheme");
|
|
45
|
-
function LineChart({ series, categories, height = 320, curve = "smooth", showLegend = true, options, className, }) {
|
|
46
|
-
const theme = (0, useChartTheme_1.useChartTheme)();
|
|
47
|
-
const merged = React.useMemo(() => {
|
|
48
|
-
const base = (0, chartOptions_1.baseApexOptions)(theme);
|
|
49
|
-
return Object.assign(Object.assign(Object.assign({}, base), { chart: Object.assign(Object.assign({}, base.chart), { type: "line" }), stroke: { curve, width: 2 }, markers: { size: 4 }, xaxis: categories
|
|
50
|
-
? Object.assign(Object.assign({}, base.xaxis), { categories }) : base.xaxis, legend: Object.assign(Object.assign({}, base.legend), { show: showLegend }) }), options);
|
|
51
|
-
}, [theme, categories, curve, showLegend, options]);
|
|
52
|
-
return (React.createElement("div", { className: (0, utils_1.cn)("w-full", className) },
|
|
53
|
-
React.createElement(react_apexcharts_1.default, { key: `${theme.mode}-${theme.primary}`, options: merged, series: series, type: "line", height: height })));
|
|
54
|
-
}
|
|
55
|
-
LineChart.displayName = "LineChart";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { ApexOptions } from "apexcharts";
|
|
3
|
-
export interface PieChartProps {
|
|
4
|
-
series: number[];
|
|
5
|
-
labels: string[];
|
|
6
|
-
height?: number | string;
|
|
7
|
-
variant?: "pie" | "donut";
|
|
8
|
-
showLegend?: boolean;
|
|
9
|
-
options?: ApexOptions;
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function PieChart({ series, labels, height, variant, showLegend, options, className, }: PieChartProps): React.ReactElement;
|
|
13
|
-
export declare namespace PieChart {
|
|
14
|
-
var displayName: string;
|
|
15
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.PieChart = PieChart;
|
|
40
|
-
const React = __importStar(require("react"));
|
|
41
|
-
const react_apexcharts_1 = __importDefault(require("react-apexcharts"));
|
|
42
|
-
const utils_1 = require("../../lib/utils");
|
|
43
|
-
const chartOptions_1 = require("./chartOptions");
|
|
44
|
-
const useChartTheme_1 = require("./useChartTheme");
|
|
45
|
-
function PieChart({ series, labels, height = 320, variant = "pie", showLegend = true, options, className, }) {
|
|
46
|
-
const theme = (0, useChartTheme_1.useChartTheme)();
|
|
47
|
-
const merged = React.useMemo(() => {
|
|
48
|
-
const base = (0, chartOptions_1.baseApexOptions)(theme);
|
|
49
|
-
return Object.assign(Object.assign(Object.assign({}, base), { chart: Object.assign(Object.assign({}, base.chart), { type: variant }), labels, stroke: { width: 0 }, legend: Object.assign(Object.assign({}, base.legend), { show: showLegend, position: "bottom" }) }), options);
|
|
50
|
-
}, [theme, labels, variant, showLegend, options]);
|
|
51
|
-
return (React.createElement("div", { className: (0, utils_1.cn)("w-full", className) },
|
|
52
|
-
React.createElement(react_apexcharts_1.default, { key: `${theme.mode}-${theme.primary}-${variant}`, options: merged, series: series, type: variant, height: height })));
|
|
53
|
-
}
|
|
54
|
-
PieChart.displayName = "PieChart";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { ApexOptions } from "apexcharts";
|
|
3
|
-
export interface PolarChartProps {
|
|
4
|
-
series: number[];
|
|
5
|
-
labels: string[];
|
|
6
|
-
height?: number | string;
|
|
7
|
-
showLegend?: boolean;
|
|
8
|
-
options?: ApexOptions;
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function PolarChart({ series, labels, height, showLegend, options, className, }: PolarChartProps): React.ReactElement;
|
|
12
|
-
export declare namespace PolarChart {
|
|
13
|
-
var displayName: string;
|
|
14
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.PolarChart = PolarChart;
|
|
40
|
-
const React = __importStar(require("react"));
|
|
41
|
-
const react_apexcharts_1 = __importDefault(require("react-apexcharts"));
|
|
42
|
-
const utils_1 = require("../../lib/utils");
|
|
43
|
-
const chartOptions_1 = require("./chartOptions");
|
|
44
|
-
const useChartTheme_1 = require("./useChartTheme");
|
|
45
|
-
function PolarChart({ series, labels, height = 320, showLegend = true, options, className, }) {
|
|
46
|
-
const theme = (0, useChartTheme_1.useChartTheme)();
|
|
47
|
-
const merged = React.useMemo(() => {
|
|
48
|
-
const base = (0, chartOptions_1.baseApexOptions)(theme);
|
|
49
|
-
return Object.assign(Object.assign(Object.assign({}, base), { chart: Object.assign(Object.assign({}, base.chart), { type: "polarArea" }), labels, stroke: { colors: [theme.border], width: 1 }, fill: { opacity: 0.85 }, legend: Object.assign(Object.assign({}, base.legend), { show: showLegend, position: "bottom" }) }), options);
|
|
50
|
-
}, [theme, labels, showLegend, options]);
|
|
51
|
-
return (React.createElement("div", { className: (0, utils_1.cn)("w-full", className) },
|
|
52
|
-
React.createElement(react_apexcharts_1.default, { key: `${theme.mode}-${theme.primary}`, options: merged, series: series, type: "polarArea", height: height })));
|
|
53
|
-
}
|
|
54
|
-
PolarChart.displayName = "PolarChart";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ApexOptions } from "apexcharts";
|
|
2
|
-
import type { ChartTheme } from "./useChartTheme";
|
|
3
|
-
/**
|
|
4
|
-
* Shared Apex options derived from the active theme. Each chart wrapper merges
|
|
5
|
-
* additional config on top.
|
|
6
|
-
*/
|
|
7
|
-
export declare function baseApexOptions(theme: ChartTheme): ApexOptions;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.baseApexOptions = baseApexOptions;
|
|
4
|
-
/**
|
|
5
|
-
* Shared Apex options derived from the active theme. Each chart wrapper merges
|
|
6
|
-
* additional config on top.
|
|
7
|
-
*/
|
|
8
|
-
function baseApexOptions(theme) {
|
|
9
|
-
return {
|
|
10
|
-
chart: {
|
|
11
|
-
background: "transparent",
|
|
12
|
-
foreColor: theme.foreground,
|
|
13
|
-
fontFamily: "inherit",
|
|
14
|
-
toolbar: { show: false },
|
|
15
|
-
zoom: { enabled: false },
|
|
16
|
-
},
|
|
17
|
-
theme: { mode: theme.mode },
|
|
18
|
-
colors: theme.palette,
|
|
19
|
-
grid: {
|
|
20
|
-
borderColor: theme.border,
|
|
21
|
-
strokeDashArray: 3,
|
|
22
|
-
xaxis: { lines: { show: false } },
|
|
23
|
-
},
|
|
24
|
-
xaxis: {
|
|
25
|
-
labels: { style: { colors: theme.muted } },
|
|
26
|
-
axisBorder: { color: theme.border },
|
|
27
|
-
axisTicks: { color: theme.border },
|
|
28
|
-
},
|
|
29
|
-
yaxis: {
|
|
30
|
-
labels: { style: { colors: theme.muted } },
|
|
31
|
-
},
|
|
32
|
-
legend: {
|
|
33
|
-
labels: { colors: theme.foreground },
|
|
34
|
-
},
|
|
35
|
-
tooltip: {
|
|
36
|
-
theme: theme.mode,
|
|
37
|
-
},
|
|
38
|
-
dataLabels: { enabled: false },
|
|
39
|
-
stroke: { curve: "smooth", width: 2 },
|
|
40
|
-
};
|
|
41
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface ChartTheme {
|
|
2
|
-
/** Series palette (hsl strings). */
|
|
3
|
-
palette: string[];
|
|
4
|
-
/** Primary color from current theme. */
|
|
5
|
-
primary: string;
|
|
6
|
-
/** Page foreground. */
|
|
7
|
-
foreground: string;
|
|
8
|
-
/** Muted text + axis labels. */
|
|
9
|
-
muted: string;
|
|
10
|
-
/** Border / grid lines. */
|
|
11
|
-
border: string;
|
|
12
|
-
/** Card background. */
|
|
13
|
-
background: string;
|
|
14
|
-
/** ApexCharts mode token. */
|
|
15
|
-
mode: "light" | "dark";
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Reads computed CSS variables from `:root` so chart libraries get real colors
|
|
19
|
-
* (not `hsl(var(--*))` strings). Re-runs when the resolved light/dark mode
|
|
20
|
-
* changes so theme switches re-paint charts.
|
|
21
|
-
*/
|
|
22
|
-
export declare function useChartTheme(): ChartTheme;
|
|
@@ -1,106 +0,0 @@
|
|
|
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.useChartTheme = useChartTheme;
|
|
37
|
-
const React = __importStar(require("react"));
|
|
38
|
-
const ThemeProvider_1 = require("../../theme-v2/ThemeProvider");
|
|
39
|
-
/**
|
|
40
|
-
* Reads computed CSS variables from `:root` so chart libraries get real colors
|
|
41
|
-
* (not `hsl(var(--*))` strings). Re-runs when the resolved light/dark mode
|
|
42
|
-
* changes so theme switches re-paint charts.
|
|
43
|
-
*/
|
|
44
|
-
function useChartTheme() {
|
|
45
|
-
const { resolvedMode, theme } = (0, ThemeProvider_1.useTheme)();
|
|
46
|
-
const [colors, setColors] = React.useState(() => fallbackTheme());
|
|
47
|
-
React.useEffect(() => {
|
|
48
|
-
if (typeof window === "undefined")
|
|
49
|
-
return;
|
|
50
|
-
const id = requestAnimationFrame(() => {
|
|
51
|
-
setColors(readThemeFromDocument(resolvedMode));
|
|
52
|
-
});
|
|
53
|
-
return () => cancelAnimationFrame(id);
|
|
54
|
-
}, [resolvedMode, theme]);
|
|
55
|
-
return colors;
|
|
56
|
-
}
|
|
57
|
-
function readThemeFromDocument(mode) {
|
|
58
|
-
const root = document.documentElement;
|
|
59
|
-
const styles = getComputedStyle(root);
|
|
60
|
-
const read = (variable) => {
|
|
61
|
-
const value = styles.getPropertyValue(variable).trim();
|
|
62
|
-
return value ? `hsl(${value})` : "";
|
|
63
|
-
};
|
|
64
|
-
const primary = read("--color-primary") || "#3b82f6";
|
|
65
|
-
const foreground = read("--color-foreground") || "#0f172a";
|
|
66
|
-
const muted = read("--color-muted-foreground") || "#64748b";
|
|
67
|
-
const border = read("--color-border") || "#e2e8f0";
|
|
68
|
-
const background = read("--color-card") || (mode === "dark" ? "#0f172a" : "#ffffff");
|
|
69
|
-
const palette = derivePalette(primary, mode);
|
|
70
|
-
return { palette, primary, foreground, muted, border, background, mode };
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Derive a small categorical palette around the primary hue, plus a few
|
|
74
|
-
* complementary fixed hues for variety.
|
|
75
|
-
*/
|
|
76
|
-
function derivePalette(primary, mode) {
|
|
77
|
-
const baseHueMatch = primary.match(/hsl\(\s*(-?[\d.]+)/);
|
|
78
|
-
const hue = baseHueMatch ? parseFloat(baseHueMatch[1]) : 220;
|
|
79
|
-
const lightness = mode === "dark" ? 60 : 50;
|
|
80
|
-
return [
|
|
81
|
-
`hsl(${hue} 80% ${lightness}%)`,
|
|
82
|
-
`hsl(${(hue + 60) % 360} 70% ${lightness}%)`,
|
|
83
|
-
`hsl(${(hue + 120) % 360} 70% ${lightness}%)`,
|
|
84
|
-
`hsl(${(hue + 180) % 360} 70% ${lightness}%)`,
|
|
85
|
-
`hsl(${(hue + 240) % 360} 70% ${lightness}%)`,
|
|
86
|
-
`hsl(${(hue + 300) % 360} 70% ${lightness}%)`,
|
|
87
|
-
];
|
|
88
|
-
}
|
|
89
|
-
function fallbackTheme() {
|
|
90
|
-
return {
|
|
91
|
-
palette: [
|
|
92
|
-
"hsl(221 83% 53%)",
|
|
93
|
-
"hsl(168 76% 36%)",
|
|
94
|
-
"hsl(27 96% 54%)",
|
|
95
|
-
"hsl(346 77% 49%)",
|
|
96
|
-
"hsl(199 89% 48%)",
|
|
97
|
-
"hsl(248 53% 58%)",
|
|
98
|
-
],
|
|
99
|
-
primary: "hsl(221 83% 53%)",
|
|
100
|
-
foreground: "hsl(222 47% 11%)",
|
|
101
|
-
muted: "hsl(215 16% 47%)",
|
|
102
|
-
border: "hsl(214 32% 91%)",
|
|
103
|
-
background: "hsl(0 0% 100%)",
|
|
104
|
-
mode: "light",
|
|
105
|
-
};
|
|
106
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface ContactFormValues {
|
|
3
|
-
name: string;
|
|
4
|
-
email: string;
|
|
5
|
-
subject?: string;
|
|
6
|
-
message: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ContactFormProps {
|
|
9
|
-
onSubmit: (values: ContactFormValues) => void | Promise<void>;
|
|
10
|
-
isLoading?: boolean;
|
|
11
|
-
successMessage?: React.ReactNode;
|
|
12
|
-
/** Field visibility / required state. */
|
|
13
|
-
fields?: {
|
|
14
|
-
subject?: boolean | "required";
|
|
15
|
-
};
|
|
16
|
-
submitLabel?: string;
|
|
17
|
-
className?: string;
|
|
18
|
-
/** Reset state to idle after a successful submission. */
|
|
19
|
-
isSubmitted?: boolean;
|
|
20
|
-
onReset?: () => void;
|
|
21
|
-
}
|
|
22
|
-
export declare function ContactForm({ onSubmit, isLoading, successMessage, fields, submitLabel, className, isSubmitted, onReset, }: ContactFormProps): React.ReactElement;
|
|
23
|
-
export declare namespace ContactForm {
|
|
24
|
-
var displayName: string;
|
|
25
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
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.ContactForm = ContactForm;
|
|
37
|
-
const React = __importStar(require("react"));
|
|
38
|
-
const lucide_react_1 = require("lucide-react");
|
|
39
|
-
const utils_1 = require("../../lib/utils");
|
|
40
|
-
const button_1 = require("../ui/button");
|
|
41
|
-
const TextInput_1 = require("../Input/TextInput");
|
|
42
|
-
const textarea_1 = require("../ui/textarea");
|
|
43
|
-
const field_1 = require("../ui/field");
|
|
44
|
-
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
45
|
-
function validate(values, requireSubject) {
|
|
46
|
-
var _a;
|
|
47
|
-
const errors = {};
|
|
48
|
-
if (!values.name.trim())
|
|
49
|
-
errors.name = "Name is required.";
|
|
50
|
-
if (!values.email.trim())
|
|
51
|
-
errors.email = "Email is required.";
|
|
52
|
-
else if (!EMAIL_RE.test(values.email))
|
|
53
|
-
errors.email = "Enter a valid email.";
|
|
54
|
-
if (requireSubject && !((_a = values.subject) !== null && _a !== void 0 ? _a : "").trim())
|
|
55
|
-
errors.subject = "Subject is required.";
|
|
56
|
-
if (!values.message.trim())
|
|
57
|
-
errors.message = "Message is required.";
|
|
58
|
-
return errors;
|
|
59
|
-
}
|
|
60
|
-
function ContactForm({ onSubmit, isLoading = false, successMessage, fields = { subject: true }, submitLabel = "Send message", className, isSubmitted = false, onReset, }) {
|
|
61
|
-
var _a;
|
|
62
|
-
const [values, setValues] = React.useState({
|
|
63
|
-
name: "",
|
|
64
|
-
email: "",
|
|
65
|
-
subject: "",
|
|
66
|
-
message: "",
|
|
67
|
-
});
|
|
68
|
-
const [errors, setErrors] = React.useState({});
|
|
69
|
-
const [touched, setTouched] = React.useState({
|
|
70
|
-
name: false,
|
|
71
|
-
email: false,
|
|
72
|
-
subject: false,
|
|
73
|
-
message: false,
|
|
74
|
-
});
|
|
75
|
-
const showSubject = fields.subject !== false;
|
|
76
|
-
const requireSubject = fields.subject === "required";
|
|
77
|
-
const update = (key) => (event) => {
|
|
78
|
-
setValues((prev) => (Object.assign(Object.assign({}, prev), { [key]: event.target.value })));
|
|
79
|
-
if (touched[key]) {
|
|
80
|
-
setErrors(validate(Object.assign(Object.assign({}, values), { [key]: event.target.value }), requireSubject));
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const blur = (key) => () => {
|
|
84
|
-
setTouched((prev) => (Object.assign(Object.assign({}, prev), { [key]: true })));
|
|
85
|
-
setErrors(validate(values, requireSubject));
|
|
86
|
-
};
|
|
87
|
-
const handleSubmit = async (event) => {
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
const next = validate(values, requireSubject);
|
|
90
|
-
setErrors(next);
|
|
91
|
-
setTouched({
|
|
92
|
-
name: true,
|
|
93
|
-
email: true,
|
|
94
|
-
subject: true,
|
|
95
|
-
message: true,
|
|
96
|
-
});
|
|
97
|
-
if (Object.keys(next).length > 0)
|
|
98
|
-
return;
|
|
99
|
-
await onSubmit(values);
|
|
100
|
-
};
|
|
101
|
-
if (isSubmitted && successMessage) {
|
|
102
|
-
return (React.createElement("div", { role: "status", className: (0, utils_1.cn)("flex flex-col items-center gap-3 rounded-lg border border-success/40 bg-success/10 p-6 text-center text-success", className) },
|
|
103
|
-
React.createElement(lucide_react_1.CheckCircle2, { "aria-hidden": "true", className: "h-8 w-8" }),
|
|
104
|
-
React.createElement("div", { className: "text-sm" }, successMessage),
|
|
105
|
-
onReset && (React.createElement(button_1.Button, { variant: "outline", size: "sm", onClick: onReset }, "Send another"))));
|
|
106
|
-
}
|
|
107
|
-
return (React.createElement("form", { onSubmit: handleSubmit, noValidate: true, className: (0, utils_1.cn)("space-y-4", className) },
|
|
108
|
-
React.createElement(TextInput_1.TextInput, { label: "Name", isRequired: true, value: values.name, onChange: update("name"), onBlur: blur("name"), error: !!errors.name && touched.name, errorMessage: errors.name, autoComplete: "name" }),
|
|
109
|
-
React.createElement(TextInput_1.TextInput, { label: "Email", type: "email", isRequired: true, value: values.email, onChange: update("email"), onBlur: blur("email"), error: !!errors.email && touched.email, errorMessage: errors.email, autoComplete: "email" }),
|
|
110
|
-
showSubject && (React.createElement(TextInput_1.TextInput, { label: "Subject", isRequired: requireSubject, value: (_a = values.subject) !== null && _a !== void 0 ? _a : "", onChange: update("subject"), onBlur: blur("subject"), error: !!errors.subject && touched.subject, errorMessage: errors.subject })),
|
|
111
|
-
React.createElement(field_1.Field, { label: "Message", isRequired: true, error: !!errors.message && touched.message, errorMessage: errors.message },
|
|
112
|
-
React.createElement(textarea_1.Textarea, { value: values.message, onChange: update("message"), onBlur: blur("message"), rows: 5, autoResize: true, minRows: 4, maxRows: 10 })),
|
|
113
|
-
React.createElement("div", { className: "flex justify-end" },
|
|
114
|
-
React.createElement(button_1.Button, { type: "submit", isLoading: isLoading, loadingText: "Sending\u2026" }, submitLabel))));
|
|
115
|
-
}
|
|
116
|
-
ContactForm.displayName = "ContactForm";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { type DateConstraints, type DayOfWeek } from "./utils";
|
|
3
|
-
export interface CalendarProps {
|
|
4
|
-
/** Currently focused / displayed month. */
|
|
5
|
-
viewDate: Date;
|
|
6
|
-
onViewDateChange: (date: Date) => void;
|
|
7
|
-
/** Selected date(s). */
|
|
8
|
-
selected?: Date | null;
|
|
9
|
-
rangeStart?: Date | null;
|
|
10
|
-
rangeEnd?: Date | null;
|
|
11
|
-
onSelectDate: (date: Date) => void;
|
|
12
|
-
mode: "single" | "range";
|
|
13
|
-
constraints?: DateConstraints;
|
|
14
|
-
weekStartsOn?: DayOfWeek;
|
|
15
|
-
locale?: Intl.LocalesArgument;
|
|
16
|
-
/** Render compactly inside a Popover. */
|
|
17
|
-
compact?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
|