@alexgorbatchev/shadcn 0.0.20 → 0.0.21
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/README.md +24 -14
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/dist/{chunk-s46hvhjw.js → chunk-0w6rxpr5.js} +1 -1
- package/dist/{chunk-gabqzfq0.js → chunk-1p7pend8.js} +3 -3
- package/dist/chunk-21wbz345.js +65 -0
- package/dist/{chunk-84ca0dpc.js → chunk-67dkgsm3.js} +1 -1
- package/dist/{chunk-p8qtk151.js → chunk-72qr0gqe.js} +1 -1
- package/dist/{chunk-4drqqqz1.js → chunk-83cckb23.js} +1 -1
- package/dist/{chunk-ztcbee24.js → chunk-9dqspkha.js} +1 -1
- package/dist/{chunk-eq88qk1d.js → chunk-d3ad53et.js} +8 -8
- package/dist/{chunk-h979cxnh.js → chunk-dq7kr5y0.js} +2 -1
- package/dist/{chunk-mrrbycgx.js → chunk-e0gcczqk.js} +1 -1
- package/dist/{chunk-553bzh59.js → chunk-f4c0tg2x.js} +1 -1
- package/dist/{chunk-14qj6w54.js → chunk-f9ha76ap.js} +4 -4
- package/dist/{chunk-ykt5sv7n.js → chunk-gkkbg7rq.js} +1 -1
- package/dist/{chunk-qv19jhdk.js → chunk-k8v9y2dw.js} +1 -1
- package/dist/chunk-kbg2e95b.js +434 -0
- package/dist/chunk-r9qrb6b6.js +54 -0
- package/dist/{chunk-ecmk3vgd.js → chunk-seeed8a2.js} +1 -1
- package/dist/{chunk-d9jbqd99.js → chunk-tynbgc30.js} +1 -1
- package/dist/{chunk-1qhf8gh8.js → chunk-wwyzwptb.js} +1 -1
- package/dist/components/AccountMenu.d.ts +12 -0
- package/dist/components/AppShell.d.ts +23 -0
- package/dist/components/AuthForm.d.ts +18 -0
- package/dist/components/BarList.d.ts +16 -0
- package/dist/components/BillingUsage.d.ts +20 -0
- package/dist/components/Combobox.d.ts +2 -1
- package/dist/components/DashboardLayout.d.ts +18 -0
- package/dist/components/FilterBar.d.ts +20 -0
- package/dist/components/Kanban.d.ts +23 -0
- package/dist/components/Meter.d.ts +9 -0
- package/dist/components/NumberField.d.ts +11 -0
- package/dist/components/PageHeader.d.ts +11 -0
- package/dist/components/SettingsSection.d.ts +16 -0
- package/dist/components/Sidebar.d.ts +2 -1
- package/dist/components/StatCard.d.ts +14 -0
- package/dist/components/StatusTracker.d.ts +16 -0
- package/dist/components/Stepper.d.ts +12 -0
- package/dist/components/TagInput.d.ts +16 -0
- package/dist/components/Toolbar.d.ts +10 -0
- package/dist/components/WorkspaceSwitcher.d.ts +14 -0
- package/dist/components/assistant-ui/elements/ApprovalCard.d.ts +1 -1
- package/dist/components/assistant-ui/elements/CommandPalette.js +3 -3
- package/dist/components/assistant-ui/elements/MessageTiming.d.ts +1 -1
- package/dist/components/assistant-ui/elements/ModelSelector.js +9 -9
- package/dist/components/assistant-ui/elements/ModelSelectorContent.js +8 -8
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorItem.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorList.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +3 -3
- package/dist/components/assistant-ui/elements/types.d.ts +0 -4
- package/dist/components/assistant-ui/index.js +11 -11
- package/dist/components/assistant-ui/native/AssistantModal.js +3 -3
- package/dist/components/assistant-ui/native/AssistantSidebar.js +3 -3
- package/dist/components/assistant-ui/native/ModelSelector.js +11 -11
- package/dist/components/assistant-ui/native/TaskCard.js +2 -2
- package/dist/components/assistant-ui/native/TaskGroup.js +3 -3
- package/dist/components/assistant-ui/native/Thread.js +2 -2
- package/dist/components/assistant-ui/native/ThreadListSidebar.js +2 -2
- package/dist/components/assistant-ui/native/index.js +17 -17
- package/dist/components/calendar/DatePicker.d.ts +27 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +175 -2
- package/dist/components/chart/AnalyticsChart.d.ts +24 -0
- package/dist/components/chart/index.d.ts +2 -0
- package/dist/components/chart/index.js +88 -0
- package/dist/components/color-picker/ColorPicker.d.ts +14 -0
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/index.js +52 -0
- package/dist/components/command/index.js +1 -1
- package/dist/components/data-grid/DataGrid.d.ts +44 -0
- package/dist/components/data-grid/index.d.ts +2 -0
- package/dist/components/data-grid/index.js +228 -0
- package/dist/components/editor/RichTextEditor.d.ts +14 -0
- package/dist/components/editor/index.d.ts +2 -0
- package/dist/components/editor/index.js +108 -0
- package/dist/components/event-calendar/EventCalendar.d.ts +16 -0
- package/dist/components/event-calendar/EventForm.d.ts +18 -0
- package/dist/components/event-calendar/index.d.ts +4 -0
- package/dist/components/event-calendar/index.js +266 -0
- package/dist/components/file-upload/FileUpload.d.ts +14 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.js +80 -0
- package/dist/components/gantt/Gantt.d.ts +22 -0
- package/dist/components/gantt/Roadmap.d.ts +18 -0
- package/dist/components/gantt/index.d.ts +4 -0
- package/dist/components/gantt/index.js +357 -0
- package/dist/components/image-crop/ImageCrop.d.ts +10 -0
- package/dist/components/image-crop/index.d.ts +2 -0
- package/dist/components/image-crop/index.js +35 -0
- package/dist/components/tree/Tree.d.ts +16 -0
- package/dist/components/tree/index.d.ts +2 -0
- package/dist/components/tree/index.js +57 -0
- package/dist/event-calendar.css +83 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +1411 -708
- package/dist/options/types.d.ts +5 -0
- package/llms/components/actions/Toolbar.md +89 -0
- package/llms/components/data-display/AnalyticsChart.md +48 -0
- package/llms/components/data-display/BarList.md +50 -0
- package/llms/components/data-display/DataGrid.md +51 -0
- package/llms/components/data-display/Meter.md +74 -0
- package/llms/components/data-display/Sparkline.md +50 -0
- package/llms/components/data-display/StatCard.md +65 -0
- package/llms/components/data-display/StatusTracker.md +51 -0
- package/llms/components/dates/DatePicker.md +97 -0
- package/llms/components/forms/AuthForm.md +70 -0
- package/llms/components/forms/ColorPicker.md +70 -0
- package/llms/components/forms/EventForm.md +66 -0
- package/llms/components/forms/FileUpload.md +55 -0
- package/llms/components/forms/FilterBar.md +34 -0
- package/llms/components/forms/ImageCrop.md +88 -0
- package/llms/components/forms/NumberField.md +94 -0
- package/llms/components/forms/Questionnaire.md +12 -0
- package/llms/components/forms/RichTextEditor.md +62 -0
- package/llms/components/forms/SettingsSection.md +65 -0
- package/llms/components/forms/Stepper.md +85 -0
- package/llms/components/forms/TagInput.md +47 -0
- package/llms/components/layout/AppShell.md +63 -0
- package/llms/components/layout/BillingUsage.md +51 -0
- package/llms/components/layout/DashboardLayout.md +78 -0
- package/llms/components/layout/PageHeader.md +49 -0
- package/llms/components/navigation/AccountMenu.md +42 -0
- package/llms/components/navigation/Tree.md +28 -0
- package/llms/components/navigation/WorkspaceSwitcher.md +48 -0
- package/llms/components/planning/EventCalendar.md +67 -0
- package/llms/components/planning/Gantt.md +66 -0
- package/llms/components/planning/Kanban.md +50 -0
- package/llms/components/planning/Roadmap.md +34 -0
- package/llms/setup.md +24 -14
- package/llms.txt +34 -0
- package/package.json +105 -3
- /package/dist/{chunk-8fcjx3he.js → chunk-az81pc04.js} +0 -0
- /package/dist/{chunk-7pyt4e5t.js → chunk-ghmkxqn5.js} +0 -0
- /package/dist/{chunk-5pvyxayg.js → chunk-m9zsppp2.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Thread2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-az81pc04.js";
|
|
4
4
|
import"../../../chunk-8a15x4a8.js";
|
|
5
5
|
import"../../../chunk-c2vcrwjp.js";
|
|
6
6
|
import"../../../chunk-sbrpnv8s.js";
|
|
@@ -28,9 +28,9 @@ import"../../../chunk-d70rcwk7.js";
|
|
|
28
28
|
import"../../../chunk-24d68cjp.js";
|
|
29
29
|
import"../../../chunk-jpvw9xqy.js";
|
|
30
30
|
import"../../../chunk-70vndezn.js";
|
|
31
|
+
import"../../../chunk-hz9azhzx.js";
|
|
31
32
|
import"../../../chunk-aa7m22zj.js";
|
|
32
33
|
import"../../../chunk-j89xg1ak.js";
|
|
33
|
-
import"../../../chunk-hz9azhzx.js";
|
|
34
34
|
import"../../../chunk-e6hk39ev.js";
|
|
35
35
|
import"../../../chunk-73rkr9ct.js";
|
|
36
36
|
import"../../../chunk-cp2m7y7v.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ThreadListSidebar2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-tynbgc30.js";
|
|
4
4
|
import"../../../chunk-1tgrhacr.js";
|
|
5
5
|
import"../../../chunk-dtkw8m6d.js";
|
|
6
6
|
import"../../../chunk-4bjqbky7.js";
|
|
7
|
-
import"../../../chunk-
|
|
7
|
+
import"../../../chunk-dq7kr5y0.js";
|
|
8
8
|
import"../../../chunk-mz3e810d.js";
|
|
9
9
|
import"../../../chunk-d70rcwk7.js";
|
|
10
10
|
import"../../../chunk-jpvw9xqy.js";
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
import"../../../chunk-d70rcwk7.js";
|
|
66
66
|
import {
|
|
67
67
|
Thread2
|
|
68
|
-
} from "../../../chunk-
|
|
68
|
+
} from "../../../chunk-az81pc04.js";
|
|
69
69
|
import {
|
|
70
70
|
useThreadListGroups2,
|
|
71
71
|
ThreadList3,
|
|
@@ -78,11 +78,11 @@ import {
|
|
|
78
78
|
import"../../../chunk-59p19t57.js";
|
|
79
79
|
import {
|
|
80
80
|
AssistantModal2
|
|
81
|
-
} from "../../../chunk-
|
|
81
|
+
} from "../../../chunk-wwyzwptb.js";
|
|
82
82
|
import"../../../chunk-rffrerg5.js";
|
|
83
83
|
import {
|
|
84
84
|
AssistantSidebar2
|
|
85
|
-
} from "../../../chunk-
|
|
85
|
+
} from "../../../chunk-67dkgsm3.js";
|
|
86
86
|
import {
|
|
87
87
|
ComposerQuotePreviewRoot2,
|
|
88
88
|
ComposerQuotePreviewIcon2,
|
|
@@ -149,19 +149,19 @@ import"../../../chunk-e0pv0me5.js";
|
|
|
149
149
|
import"../../../chunk-0qkdp68h.js";
|
|
150
150
|
import"../../../chunk-96wh7ccv.js";
|
|
151
151
|
import"../../../chunk-1jeg5z55.js";
|
|
152
|
-
import"../../../chunk-
|
|
153
|
-
import"../../../chunk-
|
|
154
|
-
import"../../../chunk-
|
|
155
|
-
import"../../../chunk-
|
|
156
|
-
import"../../../chunk-
|
|
157
|
-
import"../../../chunk-
|
|
152
|
+
import"../../../chunk-ghmkxqn5.js";
|
|
153
|
+
import"../../../chunk-f4c0tg2x.js";
|
|
154
|
+
import"../../../chunk-0w6rxpr5.js";
|
|
155
|
+
import"../../../chunk-72qr0gqe.js";
|
|
156
|
+
import"../../../chunk-83cckb23.js";
|
|
157
|
+
import"../../../chunk-1p7pend8.js";
|
|
158
158
|
import"../../../chunk-r07v9c4f.js";
|
|
159
|
-
import"../../../chunk-
|
|
160
|
-
import"../../../chunk-
|
|
161
|
-
import"../../../chunk-
|
|
159
|
+
import"../../../chunk-f9ha76ap.js";
|
|
160
|
+
import"../../../chunk-k8v9y2dw.js";
|
|
161
|
+
import"../../../chunk-seeed8a2.js";
|
|
162
162
|
import {
|
|
163
163
|
ModelSelector3
|
|
164
|
-
} from "../../../chunk-
|
|
164
|
+
} from "../../../chunk-d3ad53et.js";
|
|
165
165
|
import {
|
|
166
166
|
QuoteBlockRoot2,
|
|
167
167
|
QuoteBlockIcon2,
|
|
@@ -189,18 +189,18 @@ import"../../../chunk-3qqdfft7.js";
|
|
|
189
189
|
import {
|
|
190
190
|
isTaskPart2,
|
|
191
191
|
TaskCard2
|
|
192
|
-
} from "../../../chunk-
|
|
192
|
+
} from "../../../chunk-m9zsppp2.js";
|
|
193
193
|
import {
|
|
194
194
|
TaskGroup2
|
|
195
|
-
} from "../../../chunk-
|
|
195
|
+
} from "../../../chunk-9dqspkha.js";
|
|
196
196
|
import {
|
|
197
197
|
TaskTray2
|
|
198
198
|
} from "../../../chunk-2bx2r98r.js";
|
|
199
199
|
import"../../../chunk-4bjqbky7.js";
|
|
200
|
-
import"../../../chunk-
|
|
200
|
+
import"../../../chunk-dq7kr5y0.js";
|
|
201
201
|
import {
|
|
202
202
|
ThreadListSidebar2
|
|
203
|
-
} from "../../../chunk-
|
|
203
|
+
} from "../../../chunk-tynbgc30.js";
|
|
204
204
|
import {
|
|
205
205
|
useVoiceTranscript2,
|
|
206
206
|
VoiceConversation2
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactElement } from "react";
|
|
2
|
+
import type { DateRange } from "@daypicker/react";
|
|
3
|
+
import type { IDensityProps } from "../../density/types.js";
|
|
4
|
+
import { Calendar } from "./Calendar.js";
|
|
5
|
+
type PickerCalendarProps = Omit<ComponentProps<typeof Calendar>, "mode" | "selected" | "onSelect" | "required" | "locale">;
|
|
6
|
+
type DatePickerProps = IDensityProps & {
|
|
7
|
+
label: string;
|
|
8
|
+
value?: Date;
|
|
9
|
+
defaultValue?: Date;
|
|
10
|
+
onValueChange?: (value: Date | undefined) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
name?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
locale?: ComponentProps<typeof Calendar>["locale"];
|
|
15
|
+
calendarProps?: PickerCalendarProps;
|
|
16
|
+
};
|
|
17
|
+
type DateRangePickerProps = Omit<DatePickerProps, "value" | "defaultValue" | "onValueChange" | "name"> & {
|
|
18
|
+
value?: DateRange;
|
|
19
|
+
defaultValue?: DateRange;
|
|
20
|
+
onValueChange?: (value: DateRange | undefined) => void;
|
|
21
|
+
startName?: string;
|
|
22
|
+
endName?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function DatePicker(props: DatePickerProps): ReactElement;
|
|
25
|
+
declare function DateRangePicker(props: DateRangePickerProps): ReactElement;
|
|
26
|
+
export { DatePicker, DateRangePicker };
|
|
27
|
+
export type { DatePickerProps, DateRangePickerProps };
|
|
@@ -1,10 +1,183 @@
|
|
|
1
1
|
import"../../chunk-cp2m7y7v.js";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
Button2
|
|
4
|
+
} from "../../chunk-73rkr9ct.js";
|
|
3
5
|
import {
|
|
4
6
|
Calendar2,
|
|
5
7
|
CalendarDayButton2
|
|
6
8
|
} from "../../chunk-ttyqqw3y.js";
|
|
9
|
+
import"../../chunk-e6hk39ev.js";
|
|
10
|
+
import"../../chunk-j89xg1ak.js";
|
|
11
|
+
import"../../chunk-aa7m22zj.js";
|
|
12
|
+
import {
|
|
13
|
+
Popover2,
|
|
14
|
+
PopoverTrigger2,
|
|
15
|
+
PopoverContent2,
|
|
16
|
+
PopoverTitle2
|
|
17
|
+
} from "../../chunk-4djw71cv.js";
|
|
18
|
+
// src/components/calendar/DatePicker.tsx
|
|
19
|
+
import { useState } from "react";
|
|
20
|
+
import { CalendarIcon } from "lucide-react";
|
|
21
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
22
|
+
function dateInputValue(date) {
|
|
23
|
+
return date ? `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}` : "";
|
|
24
|
+
}
|
|
25
|
+
function DatePicker(props) {
|
|
26
|
+
const {
|
|
27
|
+
label,
|
|
28
|
+
value,
|
|
29
|
+
defaultValue,
|
|
30
|
+
onValueChange,
|
|
31
|
+
disabled,
|
|
32
|
+
name,
|
|
33
|
+
placeholder = "Choose date",
|
|
34
|
+
locale,
|
|
35
|
+
density,
|
|
36
|
+
calendarProps
|
|
37
|
+
} = props;
|
|
38
|
+
const [draft, setDraft] = useState(defaultValue);
|
|
39
|
+
const [open, setOpen] = useState(false);
|
|
40
|
+
const selected = Object.hasOwn(props, "value") ? value : draft;
|
|
41
|
+
const format = new Intl.DateTimeFormat(locale?.code ?? "en-US", { dateStyle: "medium" });
|
|
42
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsxs(Popover2, {
|
|
45
|
+
open,
|
|
46
|
+
onOpenChange: setOpen,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsxs(PopoverTrigger2, {
|
|
49
|
+
render: /* @__PURE__ */ jsx(Button2, {
|
|
50
|
+
variant: "outline",
|
|
51
|
+
density,
|
|
52
|
+
disabled
|
|
53
|
+
}),
|
|
54
|
+
"aria-label": label,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(CalendarIcon, {
|
|
57
|
+
"data-icon": "inline-start"
|
|
58
|
+
}),
|
|
59
|
+
selected ? format.format(selected) : placeholder
|
|
60
|
+
]
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsxs(PopoverContent2, {
|
|
63
|
+
density,
|
|
64
|
+
align: "start",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(PopoverTitle2, {
|
|
67
|
+
className: "sr-only",
|
|
68
|
+
children: label
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsx(Calendar2, {
|
|
71
|
+
...calendarProps,
|
|
72
|
+
density,
|
|
73
|
+
locale,
|
|
74
|
+
defaultMonth: selected ?? calendarProps?.defaultMonth,
|
|
75
|
+
mode: "single",
|
|
76
|
+
selected,
|
|
77
|
+
onSelect: (next) => {
|
|
78
|
+
if (!Object.hasOwn(props, "value"))
|
|
79
|
+
setDraft(next);
|
|
80
|
+
onValueChange?.(next);
|
|
81
|
+
setOpen(false);
|
|
82
|
+
},
|
|
83
|
+
autoFocus: true
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
}),
|
|
89
|
+
name && /* @__PURE__ */ jsx("input", {
|
|
90
|
+
type: "hidden",
|
|
91
|
+
disabled,
|
|
92
|
+
name,
|
|
93
|
+
value: dateInputValue(selected)
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function DateRangePicker(props) {
|
|
99
|
+
const {
|
|
100
|
+
label,
|
|
101
|
+
value,
|
|
102
|
+
defaultValue,
|
|
103
|
+
onValueChange,
|
|
104
|
+
disabled,
|
|
105
|
+
startName,
|
|
106
|
+
endName,
|
|
107
|
+
placeholder = "Choose dates",
|
|
108
|
+
locale,
|
|
109
|
+
density,
|
|
110
|
+
calendarProps
|
|
111
|
+
} = props;
|
|
112
|
+
const [draft, setDraft] = useState(defaultValue);
|
|
113
|
+
const [open, setOpen] = useState(false);
|
|
114
|
+
const selected = Object.hasOwn(props, "value") ? value : draft;
|
|
115
|
+
const format = new Intl.DateTimeFormat(locale?.code ?? "en-US", { dateStyle: "medium" });
|
|
116
|
+
const text = selected?.from ? selected.to ? format.formatRange(selected.from, selected.to) : format.format(selected.from) : placeholder;
|
|
117
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsxs(Popover2, {
|
|
120
|
+
open,
|
|
121
|
+
onOpenChange: setOpen,
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ jsxs(PopoverTrigger2, {
|
|
124
|
+
render: /* @__PURE__ */ jsx(Button2, {
|
|
125
|
+
variant: "outline",
|
|
126
|
+
density,
|
|
127
|
+
disabled
|
|
128
|
+
}),
|
|
129
|
+
"aria-label": label,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ jsx(CalendarIcon, {
|
|
132
|
+
"data-icon": "inline-start"
|
|
133
|
+
}),
|
|
134
|
+
text
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ jsxs(PopoverContent2, {
|
|
138
|
+
density,
|
|
139
|
+
align: "start",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ jsx(PopoverTitle2, {
|
|
142
|
+
className: "sr-only",
|
|
143
|
+
children: label
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ jsx(Calendar2, {
|
|
146
|
+
...calendarProps,
|
|
147
|
+
density,
|
|
148
|
+
locale,
|
|
149
|
+
defaultMonth: selected?.from ?? calendarProps?.defaultMonth,
|
|
150
|
+
mode: "range",
|
|
151
|
+
selected,
|
|
152
|
+
onSelect: (next) => {
|
|
153
|
+
if (!Object.hasOwn(props, "value"))
|
|
154
|
+
setDraft(next);
|
|
155
|
+
onValueChange?.(next);
|
|
156
|
+
},
|
|
157
|
+
autoFocus: true
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
})
|
|
161
|
+
]
|
|
162
|
+
}),
|
|
163
|
+
startName && /* @__PURE__ */ jsx("input", {
|
|
164
|
+
type: "hidden",
|
|
165
|
+
disabled,
|
|
166
|
+
name: startName,
|
|
167
|
+
value: dateInputValue(selected?.from)
|
|
168
|
+
}),
|
|
169
|
+
endName && /* @__PURE__ */ jsx("input", {
|
|
170
|
+
type: "hidden",
|
|
171
|
+
disabled,
|
|
172
|
+
name: endName,
|
|
173
|
+
value: dateInputValue(selected?.to)
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
});
|
|
177
|
+
}
|
|
7
178
|
export {
|
|
8
179
|
Calendar2 as Calendar,
|
|
9
|
-
CalendarDayButton2 as CalendarDayButton
|
|
180
|
+
CalendarDayButton2 as CalendarDayButton,
|
|
181
|
+
DatePicker,
|
|
182
|
+
DateRangePicker
|
|
10
183
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { IDensityProps } from "../../density/types.js";
|
|
3
|
+
type AnalyticsSeries = {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
type?: "line" | "area" | "bar";
|
|
7
|
+
stackId?: string;
|
|
8
|
+
};
|
|
9
|
+
type AnalyticsChartProps = IDensityProps & {
|
|
10
|
+
label: string;
|
|
11
|
+
data: Record<string, string | number>[];
|
|
12
|
+
index: string;
|
|
13
|
+
series: readonly AnalyticsSeries[];
|
|
14
|
+
valueFormatter?: (value: number) => string;
|
|
15
|
+
};
|
|
16
|
+
declare function AnalyticsChart({ label, data, index, series, valueFormatter, density }: AnalyticsChartProps): ReactElement;
|
|
17
|
+
type SparklineProps = IDensityProps & {
|
|
18
|
+
label: string;
|
|
19
|
+
values: readonly number[];
|
|
20
|
+
type?: "line" | "area" | "bar";
|
|
21
|
+
};
|
|
22
|
+
declare function Sparkline({ label, values, type, density }: SparklineProps): ReactElement;
|
|
23
|
+
export { AnalyticsChart, Sparkline };
|
|
24
|
+
export type { AnalyticsChartProps, AnalyticsSeries, SparklineProps };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { Chart, ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, } from "./Chart.js";
|
|
2
2
|
export type { ChartConfig, ChartProps, ChartTooltipContentProps, ChartLegendContentProps } from "./types.js";
|
|
3
3
|
export { useChart } from "./hooks/useChart.js";
|
|
4
|
+
export { AnalyticsChart, Sparkline } from "./AnalyticsChart.js";
|
|
5
|
+
export type { AnalyticsChartProps, AnalyticsSeries, SparklineProps } from "./AnalyticsChart.js";
|
|
@@ -10,7 +10,94 @@ import {
|
|
|
10
10
|
import"../../chunk-e6hk39ev.js";
|
|
11
11
|
import"../../chunk-cp2m7y7v.js";
|
|
12
12
|
import"../../chunk-jpvw9xqy.js";
|
|
13
|
+
// src/components/chart/AnalyticsChart.tsx
|
|
14
|
+
import { Area, Bar, CartesianGrid, ComposedChart, Line, XAxis, YAxis } from "recharts";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
function AnalyticsChart({ label, data, index, series, valueFormatter, density }) {
|
|
17
|
+
const config = Object.fromEntries(series.map((item, i) => [item.key, { label: item.label, color: `var(--chart-${i % 5 + 1})` }]));
|
|
18
|
+
return /* @__PURE__ */ jsx(Chart3, {
|
|
19
|
+
"aria-label": label,
|
|
20
|
+
density,
|
|
21
|
+
config,
|
|
22
|
+
className: "h-72 w-full aspect-auto",
|
|
23
|
+
children: /* @__PURE__ */ jsxs(ComposedChart, {
|
|
24
|
+
data,
|
|
25
|
+
accessibilityLayer: true,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx(CartesianGrid, {
|
|
28
|
+
vertical: false
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
31
|
+
dataKey: index,
|
|
32
|
+
tickLine: false,
|
|
33
|
+
axisLine: false
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
36
|
+
tickLine: false,
|
|
37
|
+
axisLine: false,
|
|
38
|
+
tickFormatter: valueFormatter
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ jsx(ChartTooltip2, {
|
|
41
|
+
content: /* @__PURE__ */ jsx(ChartTooltipContent2, {})
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ jsx(ChartLegend2, {
|
|
44
|
+
content: /* @__PURE__ */ jsx(ChartLegendContent2, {})
|
|
45
|
+
}),
|
|
46
|
+
series.map((item) => item.type === "bar" ? /* @__PURE__ */ jsx(Bar, {
|
|
47
|
+
dataKey: item.key,
|
|
48
|
+
fill: config[item.key]?.color,
|
|
49
|
+
stackId: item.stackId,
|
|
50
|
+
isAnimationActive: false
|
|
51
|
+
}, item.key) : item.type === "area" ? /* @__PURE__ */ jsx(Area, {
|
|
52
|
+
dataKey: item.key,
|
|
53
|
+
stroke: config[item.key]?.color,
|
|
54
|
+
fill: config[item.key]?.color,
|
|
55
|
+
fillOpacity: 0.15,
|
|
56
|
+
stackId: item.stackId,
|
|
57
|
+
isAnimationActive: false
|
|
58
|
+
}, item.key) : /* @__PURE__ */ jsx(Line, {
|
|
59
|
+
dataKey: item.key,
|
|
60
|
+
stroke: config[item.key]?.color,
|
|
61
|
+
dot: false,
|
|
62
|
+
isAnimationActive: false
|
|
63
|
+
}, item.key))
|
|
64
|
+
]
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function Sparkline({ label, values, type = "line", density }) {
|
|
69
|
+
const data = values.map((value) => ({ value }));
|
|
70
|
+
const config = { value: { label, color: "var(--chart-1)" } };
|
|
71
|
+
return /* @__PURE__ */ jsx(Chart3, {
|
|
72
|
+
role: "img",
|
|
73
|
+
"aria-label": `${label}: ${values.join(", ")}`,
|
|
74
|
+
density,
|
|
75
|
+
config,
|
|
76
|
+
className: "h-12 w-32 aspect-auto",
|
|
77
|
+
children: /* @__PURE__ */ jsx(ComposedChart, {
|
|
78
|
+
data,
|
|
79
|
+
accessibilityLayer: false,
|
|
80
|
+
children: type === "bar" ? /* @__PURE__ */ jsx(Bar, {
|
|
81
|
+
dataKey: "value",
|
|
82
|
+
fill: "var(--chart-1)",
|
|
83
|
+
isAnimationActive: false
|
|
84
|
+
}) : type === "area" ? /* @__PURE__ */ jsx(Area, {
|
|
85
|
+
dataKey: "value",
|
|
86
|
+
stroke: "var(--chart-1)",
|
|
87
|
+
fill: "var(--chart-1)",
|
|
88
|
+
fillOpacity: 0.15,
|
|
89
|
+
isAnimationActive: false
|
|
90
|
+
}) : /* @__PURE__ */ jsx(Line, {
|
|
91
|
+
dataKey: "value",
|
|
92
|
+
stroke: "var(--chart-1)",
|
|
93
|
+
dot: false,
|
|
94
|
+
isAnimationActive: false
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
}
|
|
13
99
|
export {
|
|
100
|
+
AnalyticsChart,
|
|
14
101
|
Chart3 as Chart,
|
|
15
102
|
Chart3 as ChartContainer,
|
|
16
103
|
ChartLegend2 as ChartLegend,
|
|
@@ -18,5 +105,6 @@ export {
|
|
|
18
105
|
ChartStyle2 as ChartStyle,
|
|
19
106
|
ChartTooltip2 as ChartTooltip,
|
|
20
107
|
ChartTooltipContent2 as ChartTooltipContent,
|
|
108
|
+
Sparkline,
|
|
21
109
|
useChart2 as useChart
|
|
22
110
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import type { IDensityProps } from "../../density/types.js";
|
|
3
|
+
type ColorPickerProps = IDensityProps & {
|
|
4
|
+
label: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?: (color: string) => void;
|
|
8
|
+
alpha?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
};
|
|
12
|
+
declare function ColorPicker(props: ColorPickerProps): ReactElement;
|
|
13
|
+
export { ColorPicker };
|
|
14
|
+
export type { ColorPickerProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn2
|
|
3
|
+
} from "../../chunk-cp2m7y7v.js";
|
|
4
|
+
|
|
5
|
+
// src/components/color-picker/ColorPicker.tsx
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { HexAlphaColorPicker, HexColorInput, HexColorPicker } from "react-colorful";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function ColorPicker(props) {
|
|
10
|
+
const { label, defaultValue = "#000000", onValueChange, alpha = false, disabled, name, density } = props;
|
|
11
|
+
const [local, setLocal] = useState(defaultValue);
|
|
12
|
+
const color = props.value ?? local;
|
|
13
|
+
const change = (next) => {
|
|
14
|
+
if (!Object.hasOwn(props, "value"))
|
|
15
|
+
setLocal(next);
|
|
16
|
+
onValueChange?.(next);
|
|
17
|
+
};
|
|
18
|
+
const Picker = alpha ? HexAlphaColorPicker : HexColorPicker;
|
|
19
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
20
|
+
"data-density": density,
|
|
21
|
+
disabled,
|
|
22
|
+
className: cn2("grid w-56 gap-3", disabled && "pointer-events-none opacity-50"),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsx("legend", {
|
|
25
|
+
className: "mb-2 text-sm font-medium",
|
|
26
|
+
children: label
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ jsx("div", {
|
|
29
|
+
inert: disabled,
|
|
30
|
+
children: /* @__PURE__ */ jsx(Picker, {
|
|
31
|
+
color,
|
|
32
|
+
onChange: change,
|
|
33
|
+
"aria-label": label,
|
|
34
|
+
className: "!h-48 !w-full [&_.react-colorful__saturation]:!rounded-t-sm [&_.react-colorful__last-control]:!rounded-b-sm"
|
|
35
|
+
})
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ jsx(HexColorInput, {
|
|
38
|
+
color,
|
|
39
|
+
onChange: change,
|
|
40
|
+
alpha,
|
|
41
|
+
prefixed: true,
|
|
42
|
+
"aria-label": `${label} hex`,
|
|
43
|
+
name,
|
|
44
|
+
disabled,
|
|
45
|
+
className: "h-control w-full rounded-sm border border-input bg-background px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
ColorPicker
|
|
52
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type ReactTable, type RowData, type Column, type CellData } from "@tanstack/react-table";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { IDensityProps } from "../../density/types.js";
|
|
4
|
+
declare const dataGridFeatures: {
|
|
5
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
6
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
7
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
8
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
9
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
10
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
11
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
12
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
13
|
+
filterFns: {
|
|
14
|
+
includesString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
15
|
+
};
|
|
16
|
+
sortFns: {
|
|
17
|
+
alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
18
|
+
basic: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
type DataGridTable<T extends RowData> = ReactTable<typeof dataGridFeatures, T>;
|
|
22
|
+
type DataGridProps<T extends RowData> = IDensityProps & {
|
|
23
|
+
table: DataGridTable<T>;
|
|
24
|
+
label: string;
|
|
25
|
+
toolbar?: ReactNode;
|
|
26
|
+
empty?: ReactNode;
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
pagination?: boolean;
|
|
29
|
+
};
|
|
30
|
+
declare function DataGrid<T extends RowData>({ table, label, toolbar, empty, loading, pagination, density, }: DataGridProps<T>): ReactElement;
|
|
31
|
+
declare function DataGridColumnHeader<T extends RowData, V extends CellData>({ column, children, }: {
|
|
32
|
+
column: Column<typeof dataGridFeatures, T, V>;
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}): ReactElement;
|
|
35
|
+
declare function DataGridFilter<T extends RowData>({ table, columnId, label, }: {
|
|
36
|
+
table: DataGridTable<T>;
|
|
37
|
+
columnId: string;
|
|
38
|
+
label: string;
|
|
39
|
+
}): ReactElement;
|
|
40
|
+
declare function DataGridPagination<T extends RowData>({ table }: {
|
|
41
|
+
table: DataGridTable<T>;
|
|
42
|
+
}): ReactElement;
|
|
43
|
+
export { DataGrid, DataGridColumnHeader, DataGridFilter, DataGridPagination, dataGridFeatures };
|
|
44
|
+
export type { DataGridProps, DataGridTable };
|