tembro 6.0.3 → 6.1.1
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/CHANGELOG.md +13 -0
- package/dist/components/actions/action-menu.d.ts +11 -1
- package/dist/components/calendar/calendar-range-scheduler.cjs +1 -0
- package/dist/components/calendar/calendar-range-scheduler.d.ts +20 -0
- package/dist/components/calendar/calendar-range-scheduler.js +1 -0
- package/dist/components/calendar/date-time-picker.cjs +1 -0
- package/dist/components/calendar/date-time-picker.d.ts +15 -0
- package/dist/components/calendar/date-time-picker.js +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/charts/chart-card.cjs +1 -0
- package/dist/components/charts/chart-card.d.ts +24 -0
- package/dist/components/charts/chart-card.js +1 -0
- package/dist/components/charts/index.d.ts +1 -0
- package/dist/components/command/advanced-command-menu.cjs +1 -0
- package/dist/components/command/advanced-command-menu.d.ts +25 -0
- package/dist/components/command/advanced-command-menu.js +1 -0
- package/dist/components/command/index.d.ts +1 -0
- package/dist/components/data-table/data-grid.cjs +1 -0
- package/dist/components/data-table/data-grid.d.ts +15 -0
- package/dist/components/data-table/data-grid.js +1 -0
- package/dist/components/data-table/index.d.ts +1 -0
- package/dist/components/data-table/public.d.ts +1 -0
- package/dist/components/display/index.d.ts +0 -2
- package/dist/components/feedback/async-boundary.cjs +1 -0
- package/dist/components/feedback/async-boundary.d.ts +12 -0
- package/dist/components/feedback/async-boundary.js +1 -0
- package/dist/components/feedback/index.d.ts +1 -0
- package/dist/components/filters/index.d.ts +0 -1
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/inputs/multi-select.cjs +1 -0
- package/dist/components/inputs/multi-select.d.ts +16 -0
- package/dist/components/inputs/multi-select.js +1 -0
- package/dist/components/inputs/public.d.ts +1 -0
- package/dist/components/inputs/time-picker.d.ts +11 -3
- package/dist/components/modern/file-manager.cjs +1 -0
- package/dist/components/modern/file-manager.d.ts +20 -0
- package/dist/components/modern/file-manager.js +1 -0
- package/dist/components/modern/index.d.ts +4 -1
- package/dist/components/modern/map.cjs +1 -0
- package/dist/components/modern/map.d.ts +29 -0
- package/dist/components/modern/map.js +1 -0
- package/dist/components/modern/media-player.cjs +1 -0
- package/dist/components/modern/media-player.d.ts +21 -0
- package/dist/components/modern/media-player.js +1 -0
- package/dist/components/modern/spreadsheet.cjs +1 -0
- package/dist/components/modern/spreadsheet.d.ts +35 -0
- package/dist/components/modern/spreadsheet.js +1 -0
- package/dist/components/notifications/action-toast.cjs +1 -0
- package/dist/components/notifications/action-toast.d.ts +16 -0
- package/dist/components/notifications/action-toast.js +1 -0
- package/dist/components/notifications/index.d.ts +1 -0
- package/dist/components/overlay/drawer.d.ts +3 -1
- package/dist/components/patterns/index.d.ts +1 -0
- package/dist/components/patterns/permissions-matrix.cjs +1 -0
- package/dist/components/patterns/permissions-matrix.d.ts +19 -0
- package/dist/components/patterns/permissions-matrix.js +1 -0
- package/dist/components/patterns/public.d.ts +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/src/components/actions/action-menu.cjs +1 -1
- package/dist/src/components/actions/action-menu.js +47 -39
- package/dist/src/components/actions/copy-button.cjs +1 -1
- package/dist/src/components/actions/copy-button.js +4 -1
- package/dist/src/components/calendar/calendar-range-scheduler.cjs +1 -0
- package/dist/src/components/calendar/calendar-range-scheduler.js +75 -0
- package/dist/src/components/calendar/date-picker.cjs +1 -1
- package/dist/src/components/calendar/date-picker.js +5 -8
- package/dist/src/components/calendar/date-range-picker.cjs +1 -1
- package/dist/src/components/calendar/date-range-picker.js +12 -27
- package/dist/src/components/calendar/date-time-picker.cjs +1 -0
- package/dist/src/components/calendar/date-time-picker.js +36 -0
- package/dist/src/components/calendar/index.cjs +1 -1
- package/dist/src/components/calendar/index.js +5 -3
- package/dist/src/components/charts/chart-card.cjs +1 -0
- package/dist/src/components/charts/chart-card.js +55 -0
- package/dist/src/components/charts/index.cjs +1 -1
- package/dist/src/components/charts/index.js +3 -2
- package/dist/src/components/command/advanced-command-menu.cjs +1 -0
- package/dist/src/components/command/advanced-command-menu.js +57 -0
- package/dist/src/components/command/index.cjs +1 -1
- package/dist/src/components/command/index.js +3 -2
- package/dist/src/components/data-table/data-grid.cjs +1 -0
- package/dist/src/components/data-table/data-grid.js +32 -0
- package/dist/src/components/data-table/data-table-saved-filters.cjs +1 -1
- package/dist/src/components/data-table/data-table-saved-filters.js +11 -11
- package/dist/src/components/data-table/data-table.cjs +1 -1
- package/dist/src/components/data-table/data-table.js +175 -174
- package/dist/src/components/data-table/index.cjs +1 -1
- package/dist/src/components/data-table/index.js +15 -14
- package/dist/src/components/data-table/public.cjs +1 -1
- package/dist/src/components/data-table/public.js +3 -2
- package/dist/src/components/display/index.cjs +1 -1
- package/dist/src/components/display/index.js +9 -11
- package/dist/src/components/feedback/async-boundary.cjs +1 -0
- package/dist/src/components/feedback/async-boundary.js +22 -0
- package/dist/src/components/feedback/index.cjs +1 -1
- package/dist/src/components/feedback/index.js +2 -1
- package/dist/src/components/filters/index.cjs +1 -1
- package/dist/src/components/filters/index.js +2 -3
- package/dist/src/components/inputs/color-picker.cjs +1 -1
- package/dist/src/components/inputs/color-picker.js +63 -46
- package/dist/src/components/inputs/index.cjs +1 -1
- package/dist/src/components/inputs/index.js +13 -12
- package/dist/src/components/inputs/multi-select.cjs +1 -0
- package/dist/src/components/inputs/multi-select.js +80 -0
- package/dist/src/components/inputs/public.cjs +1 -1
- package/dist/src/components/inputs/public.js +13 -12
- package/dist/src/components/inputs/slider.cjs +1 -1
- package/dist/src/components/inputs/slider.js +3 -3
- package/dist/src/components/inputs/tag-input.cjs +1 -1
- package/dist/src/components/inputs/tag-input.js +7 -4
- package/dist/src/components/inputs/time-picker.cjs +1 -1
- package/dist/src/components/inputs/time-picker.js +90 -34
- package/dist/src/components/modern/file-manager.cjs +1 -0
- package/dist/src/components/modern/file-manager.js +75 -0
- package/dist/src/components/modern/index.cjs +1 -1
- package/dist/src/components/modern/index.js +7 -4
- package/dist/src/components/modern/map.cjs +1 -0
- package/dist/src/components/modern/map.js +158 -0
- package/dist/src/components/modern/media-player.cjs +1 -0
- package/dist/src/components/modern/media-player.js +176 -0
- package/dist/src/components/modern/resizable-panel.cjs +1 -1
- package/dist/src/components/modern/resizable-panel.js +39 -32
- package/dist/src/components/modern/spreadsheet.cjs +1 -0
- package/dist/src/components/modern/spreadsheet.js +97 -0
- package/dist/src/components/navigation/pagination.cjs +1 -1
- package/dist/src/components/navigation/pagination.js +5 -5
- package/dist/src/components/notifications/action-toast.cjs +1 -0
- package/dist/src/components/notifications/action-toast.js +49 -0
- package/dist/src/components/notifications/index.cjs +1 -1
- package/dist/src/components/notifications/index.js +3 -2
- package/dist/src/components/notifications/toast.cjs +1 -1
- package/dist/src/components/notifications/toast.js +68 -63
- package/dist/src/components/overlay/alert-dialog.cjs +1 -1
- package/dist/src/components/overlay/alert-dialog.js +8 -6
- package/dist/src/components/overlay/drawer.cjs +1 -1
- package/dist/src/components/overlay/drawer.js +38 -20
- package/dist/src/components/patterns/index.cjs +1 -1
- package/dist/src/components/patterns/index.js +2 -1
- package/dist/src/components/patterns/permissions-matrix.cjs +1 -0
- package/dist/src/components/patterns/permissions-matrix.js +43 -0
- package/dist/src/components/patterns/public.cjs +1 -1
- package/dist/src/components/patterns/public.js +2 -1
- package/dist/src/components/ui/checkbox/index.cjs +1 -1
- package/dist/src/components/ui/checkbox/index.js +2 -1
- package/dist/src/components/ui/dialog/index.cjs +1 -1
- package/dist/src/components/ui/dialog/index.js +8 -8
- package/dist/src/components/ui/dropdown-menu/index.cjs +1 -1
- package/dist/src/components/ui/dropdown-menu/index.js +21 -19
- package/dist/src/components/ui/input/group.cjs +1 -1
- package/dist/src/components/ui/input/group.js +8 -8
- package/dist/src/components/ui/popover/index.cjs +1 -1
- package/dist/src/components/ui/popover/index.js +10 -10
- package/dist/src/components/ui/tabs/index.cjs +1 -1
- package/dist/src/components/ui/tabs/index.js +6 -6
- package/dist/src/components/ui/toggle-group/index.cjs +1 -1
- package/dist/src/components/ui/toggle-group/index.js +2 -2
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.js +111 -104
- package/dist/src/public-component-surface.cjs +1 -1
- package/dist/src/public-component-surface.js +59 -14
- package/package.json +1 -2
- package/packages/cli/dist/index.cjs +45 -165
- package/packages/cli/vendor/src/components/actions/action-menu.tsx +47 -19
- package/packages/cli/vendor/src/components/actions/copy-button.tsx +2 -2
- package/packages/cli/vendor/src/components/calendar/calendar-range-scheduler.tsx +72 -0
- package/packages/cli/vendor/src/components/calendar/date-picker.tsx +2 -5
- package/packages/cli/vendor/src/components/calendar/date-range-picker.tsx +5 -12
- package/packages/cli/vendor/src/components/calendar/date-time-picker.tsx +53 -0
- package/packages/cli/vendor/src/components/calendar/index.ts +5 -3
- package/packages/cli/vendor/src/components/charts/chart-card.tsx +81 -0
- package/packages/cli/vendor/src/components/charts/index.ts +1 -0
- package/packages/cli/vendor/src/components/command/advanced-command-menu.tsx +88 -0
- package/packages/cli/vendor/src/components/command/index.ts +2 -1
- package/packages/cli/vendor/src/components/data-table/data-grid.tsx +59 -0
- package/packages/cli/vendor/src/components/data-table/data-table.tsx +45 -34
- package/packages/cli/vendor/src/components/data-table/index.ts +3 -2
- package/packages/cli/vendor/src/components/data-table/public.ts +1 -0
- package/packages/cli/vendor/src/components/display/index.ts +3 -5
- package/packages/cli/vendor/src/components/feedback/async-boundary.tsx +36 -0
- package/packages/cli/vendor/src/components/feedback/index.ts +1 -0
- package/packages/cli/vendor/src/components/filters/index.ts +0 -1
- package/packages/cli/vendor/src/components/inputs/color-picker.tsx +15 -1
- package/packages/cli/vendor/src/components/inputs/index.ts +1 -0
- package/packages/cli/vendor/src/components/inputs/multi-select.tsx +75 -0
- package/packages/cli/vendor/src/components/inputs/public.ts +1 -0
- package/packages/cli/vendor/src/components/inputs/slider.tsx +3 -3
- package/packages/cli/vendor/src/components/inputs/tag-input.tsx +4 -4
- package/packages/cli/vendor/src/components/inputs/time-picker.tsx +91 -38
- package/packages/cli/vendor/src/components/modern/file-manager.tsx +79 -0
- package/packages/cli/vendor/src/components/modern/index.ts +4 -1
- package/packages/cli/vendor/src/components/modern/map.tsx +146 -0
- package/packages/cli/vendor/src/components/modern/media-player.tsx +182 -0
- package/packages/cli/vendor/src/components/modern/resizable-panel.tsx +15 -5
- package/packages/cli/vendor/src/components/modern/spreadsheet.tsx +155 -0
- package/packages/cli/vendor/src/components/navigation/pagination.tsx +9 -5
- package/packages/cli/vendor/src/components/notifications/action-toast.tsx +78 -0
- package/packages/cli/vendor/src/components/notifications/index.ts +2 -1
- package/packages/cli/vendor/src/components/notifications/toast.tsx +20 -10
- package/packages/cli/vendor/src/components/overlay/alert-dialog.tsx +3 -5
- package/packages/cli/vendor/src/components/overlay/drawer.tsx +22 -11
- package/packages/cli/vendor/src/components/patterns/index.ts +1 -0
- package/packages/cli/vendor/src/components/patterns/permissions-matrix.tsx +71 -0
- package/packages/cli/vendor/src/components/patterns/public.ts +1 -0
- package/packages/cli/vendor/src/components/ui/checkbox/index.tsx +3 -1
- package/packages/cli/vendor/src/components/ui/dialog/index.tsx +4 -4
- package/packages/cli/vendor/src/components/ui/dropdown-menu/index.tsx +18 -22
- package/packages/cli/vendor/src/components/ui/popover/index.tsx +4 -4
- package/packages/cli/vendor/src/components/ui/tabs/index.tsx +8 -3
- package/packages/cli/vendor/src/components/ui/toggle-group/index.tsx +6 -6
- package/packages/cli/vendor/src/index.ts +0 -2
- package/packages/cli/vendor/src/public-component-surface.ts +13 -4
- package/packages/cli/vendor/templates/showcase/src/showcase/data/registry.ts +6 -6
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +23 -8
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
- package/packages/cli/vendor/templates/showcase/src/showcase/sections/PatternsSection.tsx +1 -1
- package/packages/cli/vendor/templates/styles/globals.css +0 -120
- package/registry.json +3197 -2794
- package/dist/components/display/info-card.cjs +0 -1
- package/dist/components/display/info-card.d.ts +0 -51
- package/dist/components/display/info-card.js +0 -1
- package/dist/components/display/statistic.cjs +0 -1
- package/dist/components/display/statistic.d.ts +0 -25
- package/dist/components/display/statistic.js +0 -1
- package/dist/components/filters/filter-bar.cjs +0 -1
- package/dist/components/filters/filter-bar.d.ts +0 -28
- package/dist/components/filters/filter-bar.js +0 -1
- package/dist/components/modern/image-cropper.cjs +0 -1
- package/dist/components/modern/image-cropper.d.ts +0 -39
- package/dist/components/modern/image-cropper.js +0 -1
- package/dist/components/ui/number-field/index.cjs +0 -1
- package/dist/components/ui/number-field/index.d.ts +0 -18
- package/dist/components/ui/number-field/index.js +0 -1
- package/dist/components/ui/toolbar/index.cjs +0 -1
- package/dist/components/ui/toolbar/index.d.ts +0 -14
- package/dist/components/ui/toolbar/index.js +0 -1
- package/dist/src/components/display/info-card.cjs +0 -1
- package/dist/src/components/display/info-card.js +0 -124
- package/dist/src/components/display/statistic.cjs +0 -1
- package/dist/src/components/display/statistic.js +0 -104
- package/dist/src/components/filters/filter-bar.cjs +0 -1
- package/dist/src/components/filters/filter-bar.js +0 -103
- package/dist/src/components/modern/image-cropper.cjs +0 -1
- package/dist/src/components/modern/image-cropper.js +0 -143
- package/dist/src/components/ui/number-field/index.cjs +0 -1
- package/dist/src/components/ui/number-field/index.js +0 -73
- package/dist/src/components/ui/toolbar/index.cjs +0 -1
- package/dist/src/components/ui/toolbar/index.js +0 -50
- package/packages/cli/vendor/src/components/display/info-card.tsx +0 -195
- package/packages/cli/vendor/src/components/display/statistic.tsx +0 -114
- package/packages/cli/vendor/src/components/filters/filter-bar.tsx +0 -163
- package/packages/cli/vendor/src/components/modern/image-cropper.tsx +0 -226
- package/packages/cli/vendor/src/components/ui/number-field/index.tsx +0 -89
- package/packages/cli/vendor/src/components/ui/toolbar/index.tsx +0 -67
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 6.1.0 - 2026-07-18
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added 10 product-grade public components: `MultiSelect`, `ActionToast`, `ChartCard`, `AsyncBoundary`, `AdvancedCommandMenu`, `PermissionsMatrix`, `CalendarRangeScheduler`, `FileManager`, `CalendarDateTimePicker`, and `DataGrid`.
|
|
10
|
+
- Added registry `kind` metadata so real components, presets, aliases, hooks, utilities, and internal entries are separated instead of being counted as one mixed component list.
|
|
11
|
+
- Added dashboard, calendar, command, feedback, file management, data grid, chart, notification, input, and permissions coverage to the source-copy registry.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Simplified the primary component surface by moving duplicate or composable entries into `alias`, `preset`, `hook`, `utility`, or `internal` kinds.
|
|
16
|
+
- Expanded dashboard preset coverage with `async-boundary`, `chart-card`, and `multi-select` so generated apps exercise richer real-project UI states.
|
|
17
|
+
|
|
5
18
|
## 6.0.3 - 2026-07-18
|
|
6
19
|
|
|
7
20
|
### Fixed
|
|
@@ -16,7 +16,11 @@ export type ActionMenuItem = {
|
|
|
16
16
|
};
|
|
17
17
|
export type ActionMenuProps = {
|
|
18
18
|
actions: ActionMenuItem[];
|
|
19
|
+
open?: boolean;
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
22
|
label?: React.ReactNode;
|
|
23
|
+
triggerLabel?: string;
|
|
20
24
|
trigger?: React.ReactElement;
|
|
21
25
|
align?: "start" | "center" | "end";
|
|
22
26
|
side?: "top" | "right" | "bottom" | "left";
|
|
@@ -33,6 +37,12 @@ export type ActionMenuProps = {
|
|
|
33
37
|
menuWidth?: number | string;
|
|
34
38
|
loadingLabel?: React.ReactNode;
|
|
35
39
|
persistIconSpace?: boolean;
|
|
40
|
+
itemRoleDescription?: string;
|
|
41
|
+
renderItem?: (action: ActionMenuItem, state: {
|
|
42
|
+
loading: boolean;
|
|
43
|
+
close: () => void;
|
|
44
|
+
}) => React.ReactNode;
|
|
45
|
+
onActionError?: (error: unknown, action: ActionMenuItem) => void;
|
|
36
46
|
};
|
|
37
|
-
declare function ActionMenu({ actions, label, trigger, align, side, sideOffset, disabled, triggerVariant, triggerSize, showChevron, closeOnSelect, contentClassName, triggerClassName, itemClassName, emptyLabel, menuWidth, loadingLabel, persistIconSpace, }: ActionMenuProps): React.JSX.Element;
|
|
47
|
+
declare function ActionMenu({ actions, open: openProp, defaultOpen, onOpenChange, label, triggerLabel, trigger, align, side, sideOffset, disabled, triggerVariant, triggerSize, showChevron, closeOnSelect, contentClassName, triggerClassName, itemClassName, emptyLabel, menuWidth, loadingLabel, persistIconSpace, itemRoleDescription, renderItem, onActionError, }: ActionMenuProps): React.JSX.Element;
|
|
38
48
|
export { ActionMenu };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/calendar/calendar-range-scheduler.cjs")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DateRangePickerValue } from "@/components/calendar/date-range-picker";
|
|
3
|
+
import { Card } from "@/components/ui/card";
|
|
4
|
+
export type CalendarRangeSchedulerEvent = {
|
|
5
|
+
id: string;
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
range: DateRangePickerValue;
|
|
8
|
+
tone?: "default" | "info" | "success" | "warning" | "danger";
|
|
9
|
+
meta?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type CalendarRangeSchedulerProps = Omit<React.ComponentProps<typeof Card>, "onSelect"> & {
|
|
12
|
+
value?: DateRangePickerValue;
|
|
13
|
+
onValueChange?: (range: DateRangePickerValue) => void;
|
|
14
|
+
events?: CalendarRangeSchedulerEvent[];
|
|
15
|
+
onEventSelect?: (event: CalendarRangeSchedulerEvent) => void;
|
|
16
|
+
title?: React.ReactNode;
|
|
17
|
+
action?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
declare function CalendarRangeScheduler({ value, onValueChange, events, onEventSelect, title, action, className, ...props }: CalendarRangeSchedulerProps): React.JSX.Element;
|
|
20
|
+
export { CalendarRangeScheduler };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/calendar/calendar-range-scheduler.js"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/calendar/date-time-picker.cjs")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DatePickerProps } from "@/components/calendar/date-picker";
|
|
3
|
+
export type DateTimeValue = {
|
|
4
|
+
date?: string;
|
|
5
|
+
time?: string;
|
|
6
|
+
};
|
|
7
|
+
export type CalendarDateTimePickerProps = Omit<React.ComponentProps<"div">, "value" | "onChange"> & {
|
|
8
|
+
value?: DateTimeValue;
|
|
9
|
+
onValueChange?: (value: DateTimeValue) => void;
|
|
10
|
+
datePickerProps?: Omit<DatePickerProps, "value" | "onValueChange">;
|
|
11
|
+
timeLabel?: React.ReactNode;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare function CalendarDateTimePicker({ value, onValueChange, datePickerProps, timeLabel, disabled, className, ...props }: CalendarDateTimePickerProps): React.JSX.Element;
|
|
15
|
+
export { CalendarDateTimePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/calendar/date-time-picker.js"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/charts/chart-card.cjs")
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ChartDatum, type ChartSeries, type ChartState } from "@/components/charts/charts";
|
|
3
|
+
import { Card } from "@/components/ui/card";
|
|
4
|
+
export type ChartCardType = "bar" | "line" | "donut";
|
|
5
|
+
export type ChartCardFilter = {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
export type ChartCardProps = Omit<React.ComponentProps<typeof Card>, "type"> & {
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
type?: ChartCardType;
|
|
13
|
+
data?: ChartDatum[];
|
|
14
|
+
series?: ChartSeries[];
|
|
15
|
+
labels?: React.ReactNode[];
|
|
16
|
+
state?: ChartState;
|
|
17
|
+
metric?: React.ReactNode;
|
|
18
|
+
badge?: React.ReactNode;
|
|
19
|
+
filters?: ChartCardFilter[];
|
|
20
|
+
filterValue?: string;
|
|
21
|
+
onFilterChange?: (value: string) => void;
|
|
22
|
+
};
|
|
23
|
+
declare function ChartCard({ title, description, type, data, series, labels, state, metric, badge, filters, filterValue, onFilterChange, className, ...props }: ChartCardProps): React.JSX.Element;
|
|
24
|
+
export { ChartCard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/charts/chart-card.js"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/command/advanced-command-menu.cjs")
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type AdvancedCommandMenuItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
shortcut?: React.ReactNode;
|
|
8
|
+
keywords?: string[];
|
|
9
|
+
onSelect?: () => void;
|
|
10
|
+
};
|
|
11
|
+
export type AdvancedCommandMenuGroup = {
|
|
12
|
+
id: string;
|
|
13
|
+
label: React.ReactNode;
|
|
14
|
+
items: AdvancedCommandMenuItem[];
|
|
15
|
+
};
|
|
16
|
+
export type AdvancedCommandMenuProps = {
|
|
17
|
+
open?: boolean;
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
groups: AdvancedCommandMenuGroup[];
|
|
20
|
+
title?: React.ReactNode;
|
|
21
|
+
triggerLabel?: React.ReactNode;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function AdvancedCommandMenu({ open, onOpenChange, groups, title, triggerLabel, placeholder, }: AdvancedCommandMenuProps): React.JSX.Element;
|
|
25
|
+
export { AdvancedCommandMenu };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/command/advanced-command-menu.js"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/data-table/data-grid.cjs")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type DataGridColumn<TRow extends Record<string, unknown>> = {
|
|
3
|
+
key: keyof TRow & string;
|
|
4
|
+
header: React.ReactNode;
|
|
5
|
+
editable?: boolean;
|
|
6
|
+
width?: React.CSSProperties["width"];
|
|
7
|
+
render?: (value: TRow[keyof TRow], row: TRow, rowIndex: number) => React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type DataGridProps<TRow extends Record<string, unknown>> = React.ComponentProps<"div"> & {
|
|
10
|
+
columns: DataGridColumn<TRow>[];
|
|
11
|
+
rows: TRow[];
|
|
12
|
+
onRowsChange?: (rows: TRow[]) => void;
|
|
13
|
+
};
|
|
14
|
+
declare function DataGrid<TRow extends Record<string, unknown>>({ columns, rows, onRowsChange, className, ...props }: DataGridProps<TRow>): React.JSX.Element;
|
|
15
|
+
export { DataGrid };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/data-table/data-grid.js"
|
|
@@ -6,12 +6,10 @@ export * from "./code-block";
|
|
|
6
6
|
export * from "./data-state";
|
|
7
7
|
export * from "./list";
|
|
8
8
|
export * from "./progress";
|
|
9
|
-
export * from "./statistic";
|
|
10
9
|
export * from "./status-dot";
|
|
11
10
|
export * from "./status-legend";
|
|
12
11
|
export * from "./timeline";
|
|
13
12
|
export * from "./tree-view";
|
|
14
|
-
export * from "./info-card";
|
|
15
13
|
export * from "./virtual-list";
|
|
16
14
|
export * from "./qr-code";
|
|
17
15
|
export * from "./carousel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/feedback/async-boundary.cjs")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type AsyncBoundaryProps = React.PropsWithChildren<{
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
error?: unknown;
|
|
5
|
+
empty?: boolean;
|
|
6
|
+
loadingTitle?: React.ReactNode;
|
|
7
|
+
errorTitle?: React.ReactNode;
|
|
8
|
+
emptyTitle?: React.ReactNode;
|
|
9
|
+
onRetry?: () => void;
|
|
10
|
+
}>;
|
|
11
|
+
declare function AsyncBoundary({ loading, error, empty, loadingTitle, errorTitle, emptyTitle, onRetry, children, }: AsyncBoundaryProps): React.JSX.Element;
|
|
12
|
+
export { AsyncBoundary };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/feedback/async-boundary.js"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/inputs/multi-select.cjs")
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type MultiSelectOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type MultiSelectProps = React.ComponentProps<"div"> & {
|
|
9
|
+
options: MultiSelectOption[];
|
|
10
|
+
value?: string[];
|
|
11
|
+
onValueChange?: (value: string[]) => void;
|
|
12
|
+
placeholder?: React.ReactNode;
|
|
13
|
+
maxVisibleTags?: number;
|
|
14
|
+
};
|
|
15
|
+
declare function MultiSelect({ options, value, onValueChange, placeholder, maxVisibleTags, className, ...props }: MultiSelectProps): React.JSX.Element;
|
|
16
|
+
export { MultiSelect };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/inputs/multi-select.js"
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export type TimePickerProps = Omit<React.ComponentProps<"input">, "type"> & {
|
|
3
3
|
label?: React.ReactNode;
|
|
4
|
+
clearable?: boolean;
|
|
5
|
+
onClear?: () => void;
|
|
4
6
|
};
|
|
5
7
|
export type DateTimePickerProps = Omit<React.ComponentProps<"input">, "type"> & {
|
|
6
8
|
label?: React.ReactNode;
|
|
9
|
+
clearable?: boolean;
|
|
10
|
+
onClear?: () => void;
|
|
7
11
|
};
|
|
8
12
|
export type TimeRangePickerProps = React.ComponentProps<"div"> & {
|
|
9
13
|
from?: string;
|
|
@@ -11,8 +15,12 @@ export type TimeRangePickerProps = React.ComponentProps<"div"> & {
|
|
|
11
15
|
onFromChange?: (value: string) => void;
|
|
12
16
|
onToChange?: (value: string) => void;
|
|
13
17
|
disabled?: boolean;
|
|
18
|
+
labels?: {
|
|
19
|
+
from?: React.ReactNode;
|
|
20
|
+
to?: React.ReactNode;
|
|
21
|
+
};
|
|
14
22
|
};
|
|
15
|
-
declare function TimePicker({ label, className, ...props }: TimePickerProps): React.JSX.Element;
|
|
16
|
-
declare function DateTimePicker({ label, className, ...props }: DateTimePickerProps): React.JSX.Element;
|
|
17
|
-
declare function TimeRangePicker({ from, to, onFromChange, onToChange, disabled, className, ...props }: TimeRangePickerProps): React.JSX.Element;
|
|
23
|
+
declare function TimePicker({ label, className, clearable, onClear, value, defaultValue, disabled, onChange, ...props }: TimePickerProps): React.JSX.Element;
|
|
24
|
+
declare function DateTimePicker({ label, className, clearable, onClear, value, defaultValue, disabled, onChange, ...props }: DateTimePickerProps): React.JSX.Element;
|
|
25
|
+
declare function TimeRangePicker({ from, to, onFromChange, onToChange, disabled, labels, className, ...props }: TimeRangePickerProps): React.JSX.Element;
|
|
18
26
|
export { DateTimePicker, TimePicker, TimeRangePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/modern/file-manager.cjs")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type FileManagerItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: "file" | "folder";
|
|
6
|
+
size?: React.ReactNode;
|
|
7
|
+
owner?: React.ReactNode;
|
|
8
|
+
status?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type FileManagerProps = Omit<React.ComponentProps<"div">, "onSelect"> & {
|
|
11
|
+
items: FileManagerItem[];
|
|
12
|
+
selectedId?: string;
|
|
13
|
+
onSelect?: (item: FileManagerItem) => void;
|
|
14
|
+
onOpen?: (item: FileManagerItem) => void;
|
|
15
|
+
onSearchChange?: (value: string) => void;
|
|
16
|
+
searchValue?: string;
|
|
17
|
+
actions?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
declare function FileManager({ items, selectedId, onSelect, onOpen, searchValue, onSearchChange, actions, className, ...props }: FileManagerProps): React.JSX.Element;
|
|
20
|
+
export { FileManager };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/modern/file-manager.js"
|
|
@@ -2,4 +2,7 @@ export * from "./calendar-scheduler";
|
|
|
2
2
|
export * from "./dual-list-picker";
|
|
3
3
|
export * from "./resizable-panel";
|
|
4
4
|
export * from "./rich-text-editor";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./file-manager";
|
|
6
|
+
export * from "./map";
|
|
7
|
+
export * from "./media-player";
|
|
8
|
+
export * from "./spreadsheet";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/modern/map.cjs")
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type MapMarker = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
latitude: number;
|
|
6
|
+
longitude: number;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
tone?: "neutral" | "info" | "success" | "warning" | "danger" | "muted";
|
|
9
|
+
};
|
|
10
|
+
export type MapViewProps = React.ComponentProps<"section"> & {
|
|
11
|
+
center?: {
|
|
12
|
+
latitude: number;
|
|
13
|
+
longitude: number;
|
|
14
|
+
};
|
|
15
|
+
zoom?: number;
|
|
16
|
+
markers?: MapMarker[];
|
|
17
|
+
title?: React.ReactNode;
|
|
18
|
+
description?: React.ReactNode;
|
|
19
|
+
height?: number | string;
|
|
20
|
+
showMarkerList?: boolean;
|
|
21
|
+
showControls?: boolean;
|
|
22
|
+
iframeTitle?: string;
|
|
23
|
+
mapUrl?: string;
|
|
24
|
+
onMarkerSelect?: (marker: MapMarker) => void;
|
|
25
|
+
selectedMarkerKey?: string;
|
|
26
|
+
defaultSelectedMarkerKey?: string;
|
|
27
|
+
};
|
|
28
|
+
declare function MapView({ center, zoom, markers, title, description, height, showMarkerList, showControls, iframeTitle, mapUrl, onMarkerSelect, selectedMarkerKey, defaultSelectedMarkerKey, className, ...props }: MapViewProps): React.JSX.Element;
|
|
29
|
+
export { MapView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/modern/map.js"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/modern/media-player.cjs")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type MediaTrack = {
|
|
3
|
+
src: string;
|
|
4
|
+
kind?: React.TrackHTMLAttributes<HTMLTrackElement>["kind"];
|
|
5
|
+
srcLang?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
default?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type MediaPlayerProps = Omit<React.ComponentProps<"video">, "controls" | "children" | "onTimeUpdate" | "onVolumeChange"> & {
|
|
10
|
+
src: string;
|
|
11
|
+
title?: React.ReactNode;
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
tracks?: MediaTrack[];
|
|
14
|
+
actions?: React.ReactNode;
|
|
15
|
+
aspectRatio?: "video" | "square" | "wide" | string;
|
|
16
|
+
showMeta?: boolean;
|
|
17
|
+
onTimeChange?: (time: number, duration: number) => void;
|
|
18
|
+
onVolumeValueChange?: (volume: number, muted: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
declare function MediaPlayer({ src, title, description, tracks, actions, aspectRatio, showMeta, poster, autoPlay, muted: mutedProp, loop, playsInline, preload, onTimeChange, onVolumeValueChange, className, ...props }: MediaPlayerProps): React.JSX.Element;
|
|
21
|
+
export { MediaPlayer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/modern/media-player.js"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/modern/spreadsheet.cjs")
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SpreadsheetColumn = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
width?: number | string;
|
|
6
|
+
align?: "left" | "center" | "right";
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
formatter?: (value: string, row: SpreadsheetRow) => React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type SpreadsheetRow = {
|
|
11
|
+
key: string;
|
|
12
|
+
cells: Record<string, string>;
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type SpreadsheetSelection = {
|
|
16
|
+
rowKey: string;
|
|
17
|
+
columnKey: string;
|
|
18
|
+
};
|
|
19
|
+
export type SpreadsheetProps = Omit<React.ComponentProps<"div">, "onChange"> & {
|
|
20
|
+
columns: SpreadsheetColumn[];
|
|
21
|
+
rows?: SpreadsheetRow[];
|
|
22
|
+
defaultRows?: SpreadsheetRow[];
|
|
23
|
+
onRowsChange?: (rows: SpreadsheetRow[], selection?: SpreadsheetSelection) => void;
|
|
24
|
+
onCellChange?: (value: string, selection: SpreadsheetSelection, rows: SpreadsheetRow[]) => void;
|
|
25
|
+
selectedCell?: SpreadsheetSelection;
|
|
26
|
+
defaultSelectedCell?: SpreadsheetSelection;
|
|
27
|
+
onSelectedCellChange?: (selection: SpreadsheetSelection) => void;
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
showRowNumbers?: boolean;
|
|
30
|
+
showAddRow?: boolean;
|
|
31
|
+
addRowLabel?: React.ReactNode;
|
|
32
|
+
empty?: React.ReactNode;
|
|
33
|
+
};
|
|
34
|
+
declare function Spreadsheet({ columns, rows: rowsProp, defaultRows, onRowsChange, onCellChange, selectedCell, defaultSelectedCell, onSelectedCellChange, readOnly, showRowNumbers, showAddRow, addRowLabel, empty, className, ...props }: SpreadsheetProps): React.JSX.Element;
|
|
35
|
+
export { Spreadsheet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/modern/spreadsheet.js"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/notifications/action-toast.cjs")
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
import { useToast, type CreateToastInput, type ToastShortcutInput } from "@/components/notifications/toast";
|
|
4
|
+
export type ActionToastOptions = Omit<CreateToastInput, "action"> & {
|
|
5
|
+
actionLabel?: React.ReactNode;
|
|
6
|
+
onAction?: () => void;
|
|
7
|
+
undoLabel?: React.ReactNode;
|
|
8
|
+
onUndo?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export type ActionToastButtonProps = React.ComponentProps<typeof Button> & {
|
|
11
|
+
toast: ActionToastOptions;
|
|
12
|
+
};
|
|
13
|
+
declare function ActionToastButton({ toast, children, onClick, ...props }: ActionToastButtonProps): React.JSX.Element;
|
|
14
|
+
declare function showActionToast(toaster: ReturnType<typeof useToast>, { actionLabel, onAction, undoLabel, onUndo, ...toast }: ActionToastOptions): string;
|
|
15
|
+
declare function useActionToast(): (toast: ActionToastOptions | ToastShortcutInput) => string;
|
|
16
|
+
export { ActionToastButton, showActionToast, useActionToast };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/notifications/action-toast.js"
|
|
@@ -3,12 +3,14 @@ import { Button } from "@/components/ui/button";
|
|
|
3
3
|
import { Dialog } from "@/components/ui/dialog";
|
|
4
4
|
export type DrawerSide = "left" | "right" | "top" | "bottom";
|
|
5
5
|
export type DrawerWidth = "sm" | "md" | "lg" | "xl" | "full";
|
|
6
|
+
export type DrawerDensity = "compact" | "default" | "comfortable";
|
|
6
7
|
export type DrawerProps = Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
7
8
|
trigger?: React.ReactNode;
|
|
8
9
|
title?: React.ReactNode;
|
|
9
10
|
description?: React.ReactNode;
|
|
10
11
|
side?: DrawerSide;
|
|
11
12
|
width?: DrawerWidth;
|
|
13
|
+
density?: DrawerDensity;
|
|
12
14
|
footer?: React.ReactNode;
|
|
13
15
|
headerClassName?: string;
|
|
14
16
|
bodyClassName?: string;
|
|
@@ -17,6 +19,6 @@ export type DrawerProps = Omit<React.ComponentProps<typeof Dialog>, "children">
|
|
|
17
19
|
showCloseButton?: boolean;
|
|
18
20
|
children?: React.ReactNode;
|
|
19
21
|
};
|
|
20
|
-
declare function Drawer({ trigger, title, description, side, width, footer, headerClassName, bodyClassName, footerClassName, contentClassName, showCloseButton, children, ...props }: DrawerProps): React.JSX.Element;
|
|
22
|
+
declare function Drawer({ trigger, title, description, side, width, density, footer, headerClassName, bodyClassName, footerClassName, contentClassName, showCloseButton, children, ...props }: DrawerProps): React.JSX.Element;
|
|
21
23
|
declare function DrawerCloseButton({ children, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
22
24
|
export { Drawer, DrawerCloseButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../src/components/patterns/permissions-matrix.cjs")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type PermissionMatrixRole = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export type PermissionMatrixPermission = {
|
|
7
|
+
key: string;
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type PermissionMatrixValue = Record<string, string[]>;
|
|
12
|
+
export type PermissionsMatrixProps = React.ComponentProps<"div"> & {
|
|
13
|
+
roles: PermissionMatrixRole[];
|
|
14
|
+
permissions: PermissionMatrixPermission[];
|
|
15
|
+
value?: PermissionMatrixValue;
|
|
16
|
+
onValueChange?: (value: PermissionMatrixValue) => void;
|
|
17
|
+
};
|
|
18
|
+
declare function PermissionsMatrix({ roles, permissions, value, onValueChange, className, ...props }: PermissionsMatrixProps): React.JSX.Element;
|
|
19
|
+
export { PermissionsMatrix };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../src/components/patterns/permissions-matrix.js"
|
package/dist/index.d.ts
CHANGED
|
@@ -26,9 +26,7 @@ export * from './components/ui/kbd';
|
|
|
26
26
|
export * from './components/ui/radio-group';
|
|
27
27
|
export * from './components/ui/scroll-box';
|
|
28
28
|
export * from './components/ui/right-click-menu';
|
|
29
|
-
export * from './components/ui/number-field';
|
|
30
29
|
export * from './components/ui/toggle-group';
|
|
31
|
-
export * from './components/ui/toolbar';
|
|
32
30
|
export * from './components/actions/public';
|
|
33
31
|
export * from './components/layout/public';
|
|
34
32
|
export * from './components/navigation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/dropdown-menu/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");function s({actions:e,
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/dropdown-menu/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");function s({actions:e,open:s,defaultOpen:c=!1,onOpenChange:l,label:u,triggerLabel:d=`Open actions`,trigger:f,align:p=`end`,side:m=`bottom`,sideOffset:h=4,disabled:g=!1,triggerVariant:_=`ghost`,triggerSize:v=`icon-sm`,showChevron:y=!1,closeOnSelect:b=!0,contentClassName:x,triggerClassName:S,itemClassName:C,emptyLabel:w=`No actions`,menuWidth:T,loadingLabel:E=`Working...`,persistIconSpace:D=!0,itemRoleDescription:O,renderItem:k,onActionError:A}){let j=e.filter(e=>!e.hidden),[M,N]=i.useState(null),[P,F]=i.useState(c),I=s??P,L=i.useRef(null),R=i.useCallback(e=>{s===void 0&&F(e),l?.(e)},[l,s]),z=async e=>{if(!(e.disabled||e.loading||M))try{N(e.key),await e.onSelect?.(),b&&!e.keepOpen&&R(!1)}catch(t){if(A?.(t,e),!A)throw t}finally{N(null)}},B=e=>{L.current!==e.key&&(L.current=e.key,queueMicrotask(()=>{L.current===e.key&&(L.current=null)}),z(e))};return(0,o.jsxs)(r.DropdownMenu,{open:I,onOpenChange:R,children:[(0,o.jsxs)(r.DropdownMenuTrigger,{render:f??(0,o.jsx)(n.Button,{type:`button`,variant:_,size:v,disabled:g,className:t.cn(`rounded-full border border-transparent text-muted-foreground shadow-none transition-[background-color,border-color,color,box-shadow] hover:border-border/70 hover:bg-accent hover:text-foreground focus-visible:border-[color:var(--aui-focus-ring,var(--ring))] focus-visible:shadow-[0_0_0_3px_var(--aui-focus-ring-soft,transparent)]`,S),onMouseDown:t.stopInteractivePropagation,onDoubleClick:t.stopInteractivePropagation}),children:[!f&&(0,o.jsx)(a.MoreHorizontalIcon,{}),!f&&y&&(0,o.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-[0.18em]`,children:`Menu`}),(0,o.jsx)(`span`,{className:`sr-only`,children:d})]}),(0,o.jsxs)(r.DropdownMenuContent,{align:p,side:m,sideOffset:h,className:t.cn(`min-w-48 rounded-[var(--aui-card-radius,var(--radius-lg))]`,x),style:T?{width:typeof T==`number`?`${T}px`:T}:void 0,children:[u&&(0,o.jsx)(r.DropdownMenuLabel,{children:u}),u&&j.length>0&&(0,o.jsx)(r.DropdownMenuSeparator,{}),j.length===0&&(0,o.jsx)(r.DropdownMenuItem,{disabled:!0,children:w}),j.map((e,n)=>{let s=e.loading||M===e.key,c=n>0?j[n-1]?.section:void 0,l=!!(e.section&&e.section!==c);return(0,o.jsxs)(i.Fragment,{children:[l?(0,o.jsxs)(o.Fragment,{children:[n>0?(0,o.jsx)(r.DropdownMenuSeparator,{}):null,(0,o.jsx)(r.DropdownMenuLabel,{children:e.section})]}):null,(0,o.jsx)(r.DropdownMenuItem,{disabled:e.disabled||s,variant:e.destructive?`destructive`:`default`,closeOnSelect:b&&!e.keepOpen,"aria-roledescription":O,className:t.cn(`min-h-11 items-start gap-3 rounded-[calc(var(--radius-md)+1px)] border border-transparent py-2.5 transition-[background-color,color,border-color,box-shadow] data-[highlighted]:shadow-[inset_0_0_0_1px_color-mix(in_oklch,var(--primary),transparent_76%)] data-[disabled]:opacity-45`,C),onSelect:n=>{(e.keepOpen||!b)&&n.preventDefault(),t.stopInteractivePropagation(n),B(e)},onClick:n=>{t.stopInteractivePropagation(n),B(e)},onMouseDown:t.stopInteractivePropagation,onDoubleClick:t.stopInteractivePropagation,children:k?.(e,{loading:s,close:()=>R(!1)})??(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{className:t.cn(`mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground`,!D&&!s&&!e.icon&&`hidden`),children:s?(0,o.jsx)(a.Loader2Icon,{className:`size-4 animate-spin`}):e.icon}),(0,o.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`span`,{className:`block truncate`,children:e.label}),e.description?(0,o.jsx)(r.DropdownMenuItemDescription,{className:`mt-0.5 truncate`,children:s?E:e.description}):null]}),e.shortcut&&(0,o.jsx)(r.DropdownMenuShortcut,{children:e.shortcut})]})})]},e.key)})]})]})}exports.ActionMenu=s;
|