@erxes/ui 4.0.0-v2.1 → 4.0.0-v2.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/AGENTS.md +58 -0
- package/CATALOG.md +251 -0
- package/README.md +25 -2
- package/dist/components/accordion.d.ts +1 -0
- package/dist/components/accordion.js +1 -0
- package/dist/components/alert-dialog.d.ts +4 -0
- package/dist/components/alert-dialog.js +4 -0
- package/dist/components/alert.d.ts +1 -0
- package/dist/components/alert.js +1 -0
- package/dist/components/avatar.d.ts +2 -0
- package/dist/components/avatar.js +1 -0
- package/dist/components/background-gradient-animation.d.ts +4 -1
- package/dist/components/background-gradient-animation.js +4 -1
- package/dist/components/badge.d.ts +3 -0
- package/dist/components/badge.js +2 -0
- package/dist/components/breadcrumb.d.ts +1 -0
- package/dist/components/breadcrumb.js +1 -0
- package/dist/components/button.d.ts +6 -1
- package/dist/components/button.js +5 -1
- package/dist/components/calendar.d.ts +5 -0
- package/dist/components/calendar.js +4 -0
- package/dist/components/card.d.ts +1 -0
- package/dist/components/card.js +1 -0
- package/dist/components/chart-config.d.ts +4 -1
- package/dist/components/charts.d.ts +6 -0
- package/dist/components/charts.js +12 -3
- package/dist/components/checkbox.d.ts +1 -0
- package/dist/components/checkbox.js +1 -0
- package/dist/components/choicebox-group.d.ts +1 -0
- package/dist/components/choicebox-group.js +1 -0
- package/dist/components/collapsible.d.ts +1 -0
- package/dist/components/collapsible.js +1 -0
- package/dist/components/color-picker.d.ts +1 -0
- package/dist/components/color-picker.js +13 -6
- package/dist/components/combobox.d.ts +6 -1
- package/dist/components/combobox.js +9 -1
- package/dist/components/command-bar.d.ts +4 -0
- package/dist/components/command-bar.js +4 -0
- package/dist/components/command.d.ts +4 -0
- package/dist/components/command.js +4 -0
- package/dist/components/context-menu.d.ts +1 -0
- package/dist/components/context-menu.js +1 -0
- package/dist/components/copy-text.d.ts +1 -0
- package/dist/components/copy-text.js +1 -0
- package/dist/components/date-picker-value.d.ts +5 -9
- package/dist/components/date-picker-value.js +15 -34
- package/dist/components/date-picker.d.ts +4 -4
- package/dist/components/date-picker.js +9 -7
- package/dist/components/date-text-input.d.ts +2 -4
- package/dist/components/date-text-input.js +11 -9
- package/dist/components/dialog.d.ts +4 -0
- package/dist/components/dialog.js +5 -1
- package/dist/components/drag-handle.d.ts +1 -0
- package/dist/components/drag-handle.js +1 -0
- package/dist/components/dropdown-menu.d.ts +1 -0
- package/dist/components/dropdown-menu.js +1 -0
- package/dist/components/empty.d.ts +6 -1
- package/dist/components/empty.js +25 -2
- package/dist/components/form.d.ts +6 -2
- package/dist/components/form.js +8 -2
- package/dist/components/hover-card.d.ts +1 -0
- package/dist/components/hover-card.js +1 -0
- package/dist/components/icon-tip.d.ts +7 -0
- package/dist/components/icon-tip.js +16 -0
- package/dist/components/info-card.d.ts +4 -0
- package/dist/components/info-card.js +4 -0
- package/dist/components/input-group.d.ts +5 -4
- package/dist/components/input-group.js +5 -4
- package/dist/components/input.d.ts +1 -0
- package/dist/components/input.js +1 -0
- package/dist/components/kbd.d.ts +2 -1
- package/dist/components/kbd.js +2 -1
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/multiselect.d.ts +1 -0
- package/dist/components/multiselect.js +3 -2
- package/dist/components/on-demand.d.ts +6 -0
- package/dist/components/on-demand.js +6 -0
- package/dist/components/popover.d.ts +4 -0
- package/dist/components/popover.js +4 -0
- package/dist/components/radio-group.d.ts +1 -0
- package/dist/components/radio-group.js +1 -0
- package/dist/components/scroll-area.d.ts +1 -0
- package/dist/components/scroll-area.js +1 -0
- package/dist/components/select.d.ts +5 -1
- package/dist/components/select.js +7 -1
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +4 -0
- package/dist/components/sheet.d.ts +4 -0
- package/dist/components/sheet.js +8 -4
- package/dist/components/sidebar/panel.js +29 -7
- package/dist/components/sidebar.d.ts +1 -0
- package/dist/components/sidebar.js +1 -0
- package/dist/components/skeleton.d.ts +1 -0
- package/dist/components/skeleton.js +1 -0
- package/dist/components/spinner.d.ts +1 -0
- package/dist/components/spinner.js +1 -0
- package/dist/components/string-array.js +1 -0
- package/dist/components/switch.d.ts +1 -0
- package/dist/components/switch.js +1 -0
- package/dist/components/table.d.ts +4 -0
- package/dist/components/table.js +4 -0
- package/dist/components/tabs.d.ts +8 -1
- package/dist/components/tabs.js +8 -1
- package/dist/components/text-overflow.d.ts +4 -1
- package/dist/components/text-overflow.js +4 -1
- package/dist/components/textarea.d.ts +1 -0
- package/dist/components/textarea.js +1 -0
- package/dist/components/toaster.d.ts +4 -1
- package/dist/components/toaster.js +5 -2
- package/dist/components/toggle-group.d.ts +5 -0
- package/dist/components/toggle-group.js +19 -11
- package/dist/components/toggle.d.ts +1 -0
- package/dist/components/toggle.js +1 -0
- package/dist/components/tooltip.d.ts +4 -0
- package/dist/components/tooltip.js +4 -0
- package/dist/components/upload.d.ts +4 -0
- package/dist/components/upload.js +20 -11
- package/dist/federation.d.ts +8 -1
- package/dist/federation.js +12 -2
- package/dist/hooks/use-item-keys.d.ts +11 -0
- package/dist/hooks/use-item-keys.js +24 -0
- package/dist/hooks/use-page-hotkey.d.ts +12 -0
- package/dist/hooks/use-page-hotkey.js +22 -0
- package/dist/hooks/use-toast.d.ts +5 -0
- package/dist/hooks/use-toast.js +5 -0
- package/dist/index.d.ts +33 -6
- package/dist/index.js +31 -4
- package/dist/lib/format.d.ts +60 -0
- package/dist/lib/format.js +86 -0
- package/dist/lib/money.d.ts +13 -0
- package/dist/lib/money.js +21 -0
- package/dist/lib/stored.d.ts +13 -0
- package/dist/lib/stored.js +41 -0
- package/dist/lib/text.d.ts +11 -0
- package/dist/lib/text.js +18 -0
- package/dist/modules/attachments/use-carousel.js +5 -10
- package/dist/modules/blocks/hooks/useBarcodeSizeForm.d.ts +1 -1
- package/dist/modules/blocks/utils/parseBlocks.d.ts +1 -1
- package/dist/modules/blocks/utils/parseBlocks.js +1 -1
- package/dist/modules/conditions/ConditionValueInput.d.ts +10 -0
- package/dist/modules/conditions/ConditionValueInput.js +166 -0
- package/dist/modules/conditions/ConditionsEditor.d.ts +11 -0
- package/dist/modules/conditions/ConditionsEditor.js +209 -0
- package/dist/modules/conditions/LazyConditionsEditor.d.ts +10 -0
- package/dist/modules/conditions/LazyConditionsEditor.js +11 -0
- package/dist/modules/conditions/PathPicker.d.ts +8 -0
- package/dist/modules/conditions/PathPicker.js +51 -0
- package/dist/modules/conditions/conditions.d.ts +66 -0
- package/dist/modules/conditions/conditions.js +136 -0
- package/dist/modules/display/components/EmailDisplay.d.ts +4 -0
- package/dist/modules/display/components/EmailDisplay.js +6 -3
- package/dist/modules/display/components/PhoneDisplay.d.ts +4 -0
- package/dist/modules/display/components/PhoneDisplay.js +4 -0
- package/dist/modules/display/components/RelativeDateDisplay.d.ts +7 -5
- package/dist/modules/display/components/RelativeDateDisplay.js +10 -8
- package/dist/modules/display/components/SexDisplay.d.ts +1 -0
- package/dist/modules/display/components/SexDisplay.js +1 -0
- package/dist/modules/filter/components/Filter.d.ts +4 -0
- package/dist/modules/filter/components/Filter.js +4 -0
- package/dist/modules/filter/components/FilterBar.js +5 -7
- package/dist/modules/filter/components/FilterDialog.js +4 -5
- package/dist/modules/filter/components/FilterPopover.js +1 -1
- package/dist/modules/filter/components/FilterProvider.d.ts +1 -2
- package/dist/modules/filter/components/FilterProvider.js +22 -16
- package/dist/modules/filter/hooks/useFilterContext.d.ts +1 -0
- package/dist/modules/filter/hooks/useFilterContext.js +1 -0
- package/dist/modules/filter/types/filter.d.ts +0 -1
- package/dist/modules/hotkey/components/PopoverScoped.d.ts +5 -0
- package/dist/modules/hotkey/components/PopoverScoped.js +5 -0
- package/dist/modules/hotkey/hooks/usePreviousHotkeyScope.d.ts +1 -0
- package/dist/modules/hotkey/hooks/usePreviousHotkeyScope.js +1 -0
- package/dist/modules/hotkey/hooks/useScopedHotkeys.d.ts +5 -1
- package/dist/modules/hotkey/hooks/useScopedHotkeys.js +5 -1
- package/dist/modules/icons/components/IconComponent.d.ts +4 -0
- package/dist/modules/icons/components/IconComponent.js +4 -0
- package/dist/modules/icons/components/IconPicker.d.ts +4 -0
- package/dist/modules/icons/components/IconPicker.js +7 -5
- package/dist/modules/icons/providers/IconsProvider.d.ts +1 -0
- package/dist/modules/icons/providers/IconsProvider.js +1 -0
- package/dist/modules/inputs/components/EmailField.d.ts +4 -1
- package/dist/modules/inputs/components/EmailField.js +4 -1
- package/dist/modules/inputs/components/FullNameField.d.ts +6 -0
- package/dist/modules/inputs/components/FullNameField.js +20 -8
- package/dist/modules/inputs/components/PhoneField.d.ts +4 -1
- package/dist/modules/inputs/components/PhoneField.js +4 -1
- package/dist/modules/inputs/components/SexField.d.ts +1 -0
- package/dist/modules/inputs/components/SexField.js +1 -0
- package/dist/modules/layout/components/AppLayout.d.ts +6 -6
- package/dist/modules/layout/components/AppLayout.js +12 -13
- package/dist/modules/layout/components/AppLayoutResizeHandle.d.ts +5 -12
- package/dist/modules/layout/components/AppLayoutResizeHandle.js +15 -18
- package/dist/modules/layout/components/Page.d.ts +5 -0
- package/dist/modules/layout/components/Page.js +5 -0
- package/dist/modules/layout/components/PageHeader.d.ts +4 -1
- package/dist/modules/layout/components/PageHeader.js +9 -3
- package/dist/modules/list/DisplayMenu.d.ts +24 -0
- package/dist/modules/list/DisplayMenu.js +87 -0
- package/dist/modules/list/ListFilter.d.ts +63 -0
- package/dist/modules/list/ListFilter.js +44 -0
- package/dist/modules/list/ViewBar.d.ts +13 -0
- package/dist/modules/list/ViewBar.js +30 -0
- package/dist/modules/list/filter/AdvancedFilterDialog.d.ts +5 -0
- package/dist/modules/list/filter/AdvancedFilterDialog.js +52 -0
- package/dist/modules/list/filter/FieldMenus.d.ts +5 -0
- package/dist/modules/list/filter/FieldMenus.js +184 -0
- package/dist/modules/list/filter/ListFilterBar.d.ts +6 -0
- package/dist/modules/list/filter/ListFilterBar.js +246 -0
- package/dist/modules/list/filter/RecordCount.d.ts +7 -0
- package/dist/modules/list/filter/RecordCount.js +22 -0
- package/dist/modules/list/filter/RuleChips.d.ts +2 -0
- package/dist/modules/list/filter/RuleChips.js +157 -0
- package/dist/modules/list/filter/fieldIcons.d.ts +7 -0
- package/dist/modules/list/filter/fieldIcons.js +16 -0
- package/dist/modules/list/filter/filterRules.d.ts +46 -0
- package/dist/modules/list/filter/filterRules.js +166 -0
- package/dist/modules/list/filter/listFilterContext.d.ts +29 -0
- package/dist/modules/list/filter/listFilterContext.js +34 -0
- package/dist/modules/list/filter/listFilterQuery.d.ts +16 -0
- package/dist/modules/list/filter/listFilterQuery.js +22 -0
- package/dist/modules/navigation-menu/components/NavigationMenu.d.ts +4 -3
- package/dist/modules/navigation-menu/components/NavigationMenu.js +7 -7
- package/dist/modules/pickers/EntityPicker.d.ts +37 -0
- package/dist/modules/pickers/EntityPicker.js +67 -0
- package/dist/modules/pickers/LookupPicker.d.ts +51 -0
- package/dist/modules/pickers/LookupPicker.js +84 -0
- package/dist/modules/pickers/SelectMember.d.ts +41 -0
- package/dist/modules/pickers/SelectMember.js +122 -0
- package/dist/modules/pickers/members.d.ts +30 -0
- package/dist/modules/pickers/members.js +18 -0
- package/dist/modules/record-field/components/NumberField.d.ts +5 -0
- package/dist/modules/record-field/components/NumberField.js +14 -7
- package/dist/modules/record-field/components/TextField.d.ts +4 -0
- package/dist/modules/record-field/components/TextField.js +14 -3
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.d.ts +5 -0
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.js +5 -0
- package/dist/modules/record-list/RecordList.d.ts +18 -0
- package/dist/modules/record-list/RecordList.js +23 -0
- package/dist/modules/record-list/RecordListProvider.d.ts +30 -0
- package/dist/modules/record-list/RecordListProvider.js +57 -0
- package/dist/modules/record-list/RecordListRoot.d.ts +28 -0
- package/dist/modules/record-list/RecordListRoot.js +124 -0
- package/dist/modules/record-list/selection.d.ts +22 -0
- package/dist/modules/record-list/selection.js +54 -0
- package/dist/modules/record-panel/PanelDescriptionEditor.d.ts +9 -0
- package/dist/modules/record-panel/PanelDescriptionEditor.js +39 -0
- package/dist/modules/record-panel/PanelDescriptionField.d.ts +13 -0
- package/dist/modules/record-panel/PanelDescriptionField.js +39 -0
- package/dist/modules/record-panel/PanelField.d.ts +17 -0
- package/dist/modules/record-panel/PanelField.js +47 -0
- package/dist/modules/record-panel/PanelForm.d.ts +28 -0
- package/dist/modules/record-panel/PanelForm.js +88 -0
- package/dist/modules/record-panel/PanelLabel.d.ts +10 -0
- package/dist/modules/record-panel/PanelLabel.js +55 -0
- package/dist/modules/record-panel/PanelSection.d.ts +12 -0
- package/dist/modules/record-panel/PanelSection.js +24 -0
- package/dist/modules/record-panel/panelExpansion.d.ts +10 -0
- package/dist/modules/record-panel/panelExpansion.js +7 -0
- package/dist/modules/record-panel/useSaveOnLeave.d.ts +14 -0
- package/dist/modules/record-panel/useSaveOnLeave.js +42 -0
- package/dist/modules/record-table/components/RecordTable.d.ts +6 -0
- package/dist/modules/record-table/components/RecordTable.js +6 -0
- package/dist/modules/record-table/components/RecordTableCell.d.ts +9 -0
- package/dist/modules/record-table/components/RecordTableCell.js +16 -2
- package/dist/modules/record-table/components/RecordTableCellInline.d.ts +5 -0
- package/dist/modules/record-table/components/RecordTableCellInline.js +8 -7
- package/dist/modules/record-table/components/RecordTableCursor.js +30 -28
- package/dist/modules/record-table/components/RecordTableProvider.js +12 -7
- package/dist/modules/record-table/hooks/useTablePreferences.d.ts +1 -1
- package/dist/modules/record-table/hooks/useTablePreferences.js +18 -31
- package/dist/modules/record-table/states/RecordTableCursorState.d.ts +21 -1
- package/dist/modules/record-table/states/RecordTableCursorState.js +21 -3
- package/dist/modules/record-table/types/RecordTableCursorTypes.d.ts +1 -0
- package/dist/modules/record-table/types/RecordTableCursorTypes.js +1 -0
- package/dist/modules/records/ContactLink.d.ts +13 -0
- package/dist/modules/records/ContactLink.js +77 -0
- package/dist/modules/records/contacts.d.ts +35 -0
- package/dist/modules/records/contacts.js +10 -0
- package/dist/modules/records/openRecord.d.ts +44 -0
- package/dist/modules/records/openRecord.js +48 -0
- package/dist/state/sidebarPanelState.d.ts +5 -1
- package/dist/state/sidebarPanelState.js +11 -3
- package/dist/state/themeState.d.ts +13 -2
- package/dist/state/themeState.js +18 -4
- package/dist/theme.css +5 -2
- package/dist/types/SexCode.d.ts +1 -0
- package/dist/types/SexCode.js +1 -0
- package/dist/types/UIConfig.d.ts +131 -3
- package/dist/utils/IsUndefinedOrNull.d.ts +1 -0
- package/dist/utils/IsUndefinedOrNull.js +1 -0
- package/dist/utils/file-storage.d.ts +1 -0
- package/dist/utils/file-storage.js +1 -0
- package/dist/utils/format/formatPhoneNumber.d.ts +4 -0
- package/dist/utils/format/formatPhoneNumber.js +4 -0
- package/dist/utils/getPluginAssetsUrl.d.ts +5 -0
- package/dist/utils/getPluginAssetsUrl.js +5 -0
- package/dist/utils/host-component.d.ts +10 -0
- package/dist/utils/host-component.js +34 -0
- package/dist/utils/json.d.ts +3 -2
- package/dist/utils/json.js +3 -2
- package/dist/utils/plugin-runtime.d.ts +21 -17
- package/dist/utils/plugin-runtime.js +59 -12
- package/dist/utils/plugin-styles.d.ts +7 -0
- package/dist/utils/plugin-styles.js +54 -0
- package/dist/utils/record-timeline.d.ts +10 -9
- package/dist/utils/record-timeline.js +12 -17
- package/exports.txt +226 -0
- package/package.json +13 -3
- package/dist/constants/IntlLanguages.d.ts +0 -74
- package/dist/constants/IntlLanguages.js +0 -76
- package/dist/hooks/use-query-state.d.ts +0 -16
- package/dist/hooks/use-query-state.js +0 -122
- package/dist/modules/filter/hooks/useFilterQueryState.d.ts +0 -4
- package/dist/modules/filter/hooks/useFilterQueryState.js +0 -14
- package/dist/types/Theme.d.ts +0 -1
- package/dist/types/Theme.js +0 -0
- package/dist/utils/localization/formatDateISOStringToRelativeDate.d.ts +0 -2
- package/dist/utils/localization/formatDateISOStringToRelativeDate.js +0 -16
|
@@ -34,6 +34,7 @@ declare const DropdownMenuLabel: ({ className, inset, ...props }: React.Componen
|
|
|
34
34
|
}) => React.JSX.Element;
|
|
35
35
|
declare const DropdownMenuSeparator: ({ className, ...props }: Menu.Separator.Props) => React.JSX.Element;
|
|
36
36
|
declare const DropdownMenuShortcut: ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => React.JSX.Element;
|
|
37
|
+
/** A menu of actions that opens from a button, such as a row's "more" menu. */
|
|
37
38
|
export declare const DropdownMenu: typeof DropdownMenuRoot & {
|
|
38
39
|
Trigger: Menu.Trigger;
|
|
39
40
|
Group: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").MenuGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -102,6 +102,7 @@ const DropdownMenuShortcut = ({ className, ...props }) => {
|
|
|
102
102
|
...props
|
|
103
103
|
});
|
|
104
104
|
};
|
|
105
|
+
/** A menu of actions that opens from a button, such as a row's "more" menu. */
|
|
105
106
|
const DropdownMenu = Object.assign(DropdownMenuRoot, {
|
|
106
107
|
Trigger: Menu.Trigger,
|
|
107
108
|
Group: Menu.Group,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
|
-
declare
|
|
2
|
+
declare const emptyVariants: (props?: ({
|
|
3
|
+
variant?: "default" | "outline" | null | undefined;
|
|
4
|
+
size?: "default" | "sm" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function EmptyRoot({ className, variant, size, ...props }: React.ComponentProps<'div'> & VariantProps<typeof emptyVariants>): import("react").JSX.Element;
|
|
3
7
|
declare function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
4
8
|
declare const emptyMediaVariants: (props?: ({
|
|
5
9
|
variant?: "default" | "icon" | null | undefined;
|
|
@@ -8,6 +12,7 @@ declare function EmptyMedia({ className, variant, ...props }: React.ComponentPro
|
|
|
8
12
|
declare function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
9
13
|
declare function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>): import("react").JSX.Element;
|
|
10
14
|
declare function EmptyContent({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
15
|
+
/** A list's or page's empty state: icon, title, a line and an action. */
|
|
11
16
|
export declare const Empty: typeof EmptyRoot & {
|
|
12
17
|
Header: typeof EmptyHeader;
|
|
13
18
|
Title: typeof EmptyTitle;
|
package/dist/components/empty.js
CHANGED
|
@@ -2,10 +2,32 @@ import { cn } from "../lib/utils.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
// src/components/empty.tsx
|
|
5
|
-
|
|
5
|
+
const emptyVariants = cva("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed text-center text-balance", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "",
|
|
9
|
+
/** A dashed outline on the page background, standing in for missing content. */
|
|
10
|
+
outline: "border bg-background"
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
default: "px-6 py-12 md:px-12",
|
|
14
|
+
/** Inside a card or a widget, where a page's spacing would crowd it. */
|
|
15
|
+
sm: "p-6"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "default",
|
|
20
|
+
size: "default"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function EmptyRoot({ className, variant, size, ...props }) {
|
|
6
24
|
return /* @__PURE__ */ jsx("div", {
|
|
7
25
|
"data-slot": "empty",
|
|
8
|
-
className: cn(
|
|
26
|
+
className: cn(emptyVariants({
|
|
27
|
+
variant,
|
|
28
|
+
size,
|
|
29
|
+
className
|
|
30
|
+
})),
|
|
9
31
|
...props
|
|
10
32
|
});
|
|
11
33
|
}
|
|
@@ -55,6 +77,7 @@ function EmptyContent({ className, ...props }) {
|
|
|
55
77
|
...props
|
|
56
78
|
});
|
|
57
79
|
}
|
|
80
|
+
/** A list's or page's empty state: icon, title, a line and an action. */
|
|
58
81
|
const Empty = Object.assign(EmptyRoot, {
|
|
59
82
|
Header: EmptyHeader,
|
|
60
83
|
Title: EmptyTitle,
|
|
@@ -8,7 +8,7 @@ declare const useFormField: () => {
|
|
|
8
8
|
isDirty: boolean;
|
|
9
9
|
isTouched: boolean;
|
|
10
10
|
isValidating: boolean;
|
|
11
|
-
error?: import("react-hook-form").FieldError;
|
|
11
|
+
error?: import("react-hook-form").FieldError | undefined;
|
|
12
12
|
id: string;
|
|
13
13
|
name: string | undefined;
|
|
14
14
|
formItemId: string;
|
|
@@ -36,7 +36,11 @@ declare const formMessageVariants: (props?: ({
|
|
|
36
36
|
variant?: "default" | "solid" | null | undefined;
|
|
37
37
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
38
38
|
declare const FormMessage: ({ ref, className, children, variant, ...props }: React.ComponentProps<'p'> & VariantProps<typeof formMessageVariants>) => React.JSX.Element | null;
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* react-hook-form's provider with field, label, control and error parts.
|
|
41
|
+
* A settings page lays out `Form.Item`s with `Form.Label` above and `Form.Message` below.
|
|
42
|
+
*/
|
|
43
|
+
export declare const Form: (<TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getErrors, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element) & {
|
|
40
44
|
Control: typeof FormControl;
|
|
41
45
|
Description: typeof FormDescription;
|
|
42
46
|
Field: typeof FormField;
|
package/dist/components/form.js
CHANGED
|
@@ -8,8 +8,9 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
8
8
|
// src/components/form.tsx
|
|
9
9
|
const FormFieldContext = React.createContext(null);
|
|
10
10
|
const FormField = ({ ...props }) => {
|
|
11
|
+
const field = React.useMemo(() => ({ name: props.name }), [props.name]);
|
|
11
12
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, {
|
|
12
|
-
value:
|
|
13
|
+
value: field,
|
|
13
14
|
children: /* @__PURE__ */ jsx(Controller, { ...props })
|
|
14
15
|
});
|
|
15
16
|
};
|
|
@@ -39,8 +40,9 @@ const formItemVariants = cva("", {
|
|
|
39
40
|
});
|
|
40
41
|
const FormItem = ({ ref, className, orientation, ...props }) => {
|
|
41
42
|
const id = React.useId();
|
|
43
|
+
const item = React.useMemo(() => ({ id }), [id]);
|
|
42
44
|
return /* @__PURE__ */ jsx(FormItemContext.Provider, {
|
|
43
|
-
value:
|
|
45
|
+
value: item,
|
|
44
46
|
children: /* @__PURE__ */ jsx("div", {
|
|
45
47
|
ref,
|
|
46
48
|
className: cn(formItemVariants({ orientation }), className),
|
|
@@ -97,6 +99,10 @@ const FormMessage = ({ ref, className, children, variant, ...props }) => {
|
|
|
97
99
|
children: body
|
|
98
100
|
});
|
|
99
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* react-hook-form's provider with field, label, control and error parts.
|
|
104
|
+
* A settings page lays out `Form.Item`s with `Form.Label` above and `Form.Message` below.
|
|
105
|
+
*/
|
|
100
106
|
const Form = Object.assign(FormProvider, {
|
|
101
107
|
Control: FormControl,
|
|
102
108
|
Description: FormDescription,
|
|
@@ -2,6 +2,7 @@ import { PreviewCard } from "@base-ui/react/preview-card";
|
|
|
2
2
|
/** Opens after 700ms, the delay Radix's hover card had. */
|
|
3
3
|
declare const HoverCardTrigger: ({ delay, ...props }: PreviewCard.Trigger.Props) => import("react").JSX.Element;
|
|
4
4
|
declare const HoverCardContent: ({ className, side, sideOffset, align, alignOffset, ...props }: PreviewCard.Popup.Props & Pick<PreviewCard.Positioner.Props, 'side' | 'sideOffset' | 'align' | 'alignOffset'>) => import("react").JSX.Element;
|
|
5
|
+
/** A preview card that opens when the pointer rests on a link, after 700ms. */
|
|
5
6
|
export declare const HoverCard: (<Payload>(props: PreviewCard.Root.Props<Payload>) => React.JSX.Element) & {
|
|
6
7
|
Trigger: typeof HoverCardTrigger;
|
|
7
8
|
Content: typeof HoverCardContent;
|
|
@@ -19,6 +19,7 @@ const HoverCardContent = ({ className, side = "bottom", sideOffset = 4, align =
|
|
|
19
19
|
...props
|
|
20
20
|
})
|
|
21
21
|
}) });
|
|
22
|
+
/** A preview card that opens when the pointer rests on a link, after 700ms. */
|
|
22
23
|
const HoverCard = Object.assign(PreviewCard.Root, {
|
|
23
24
|
Trigger: HoverCardTrigger,
|
|
24
25
|
Content: HoverCardContent
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
/** The hover label of an icon-only button, with its shortcut if it has one. */
|
|
3
|
+
export declare const IconTip: ({ label, hotkey, children }: {
|
|
4
|
+
label: string;
|
|
5
|
+
hotkey?: string;
|
|
6
|
+
children: ReactElement;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Kbd } from "./kbd.js";
|
|
2
|
+
import { Tooltip } from "./tooltip.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/icon-tip.tsx
|
|
5
|
+
/** The hover label of an icon-only button, with its shortcut if it has one. */
|
|
6
|
+
const IconTip = ({ label, hotkey, children }) => /* @__PURE__ */ jsx(Tooltip.Provider, {
|
|
7
|
+
delay: 300,
|
|
8
|
+
children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: children }), /* @__PURE__ */ jsx(Tooltip.Content, {
|
|
9
|
+
side: "bottom",
|
|
10
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
11
|
+
className: "flex items-center gap-1.5",
|
|
12
|
+
children: [label, hotkey && /* @__PURE__ */ jsx(Kbd, { children: hotkey })]
|
|
13
|
+
})
|
|
14
|
+
})] })
|
|
15
|
+
});
|
|
16
|
+
export { IconTip };
|
|
@@ -6,6 +6,10 @@ declare const InfoCardRoot: ({ title, description, children, className }: {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
}) => React.JSX.Element;
|
|
8
8
|
declare const InfoCardContent: ({ ref, children, className, ...props }: React.ComponentProps<'div'>) => React.JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* A tinted dashboard tile: a caps title, an info tip and a content box.
|
|
11
|
+
* `description` shows in the tooltip behind the info icon.
|
|
12
|
+
*/
|
|
9
13
|
export declare const InfoCard: typeof InfoCardRoot & {
|
|
10
14
|
Content: typeof InfoCardContent;
|
|
11
15
|
};
|
|
@@ -32,5 +32,9 @@ const InfoCardContent = ({ ref, children, className, ...props }) => {
|
|
|
32
32
|
children
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* A tinted dashboard tile: a caps title, an info tip and a content box.
|
|
37
|
+
* `description` shows in the tooltip behind the info icon.
|
|
38
|
+
*/
|
|
35
39
|
const InfoCard = Object.assign(InfoCardRoot, { Content: InfoCardContent });
|
|
36
40
|
export { InfoCard };
|
|
@@ -2,10 +2,6 @@ import { Input } from "./input.js";
|
|
|
2
2
|
import { Textarea } from "./textarea.js";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
|
-
/**
|
|
6
|
-
* An input or textarea with an icon or button beside its text, inside the same box. The group
|
|
7
|
-
* draws the box and the focus ring; the field inside is bare. After shadcn's InputGroup.
|
|
8
|
-
*/
|
|
9
5
|
declare const InputGroupRoot: ({ className, ...props }: React.ComponentProps<'div'>) => React.JSX.Element;
|
|
10
6
|
declare const addonVariants: (props?: ({
|
|
11
7
|
align?: "end" | "start" | null | undefined;
|
|
@@ -14,6 +10,11 @@ declare const addonVariants: (props?: ({
|
|
|
14
10
|
declare const InputGroupAddon: ({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof addonVariants>) => React.JSX.Element;
|
|
15
11
|
declare const InputGroupInput: ({ className, ...props }: React.ComponentProps<typeof Input>) => React.JSX.Element;
|
|
16
12
|
declare const InputGroupTextarea: ({ className, ...props }: React.ComponentProps<typeof Textarea>) => React.JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* An input or textarea with an icon or button inside the same box.
|
|
15
|
+
* The group draws the box and the focus ring; the field inside is bare. After shadcn's
|
|
16
|
+
* InputGroup.
|
|
17
|
+
*/
|
|
17
18
|
export declare const InputGroup: typeof InputGroupRoot & {
|
|
18
19
|
Addon: typeof InputGroupAddon;
|
|
19
20
|
Input: typeof InputGroupInput;
|
|
@@ -5,10 +5,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
// src/components/input-group.tsx
|
|
8
|
-
/**
|
|
9
|
-
* An input or textarea with an icon or button beside its text, inside the same box. The group
|
|
10
|
-
* draws the box and the focus ring; the field inside is bare. After shadcn's InputGroup.
|
|
11
|
-
*/
|
|
12
8
|
const InputGroupRoot = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
13
9
|
className: cn("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-sm bg-background shadow-xs transition has-[>textarea]:h-auto has-[>:is(input,textarea):focus-visible]:shadow-focus has-[>:is(input,textarea):disabled]:opacity-50", "has-[>[data-align=start]]:[&>:is(input,textarea)]:pl-1.5 has-[>[data-align=end]]:[&>:is(input,textarea)]:pr-1.5", className),
|
|
14
10
|
...props
|
|
@@ -34,6 +30,11 @@ const InputGroupTextarea = ({ className, ...props }) => /* @__PURE__ */ jsx(Text
|
|
|
34
30
|
className: cn("min-w-0 flex-1 shadow-none focus-visible:shadow-none", className),
|
|
35
31
|
...props
|
|
36
32
|
});
|
|
33
|
+
/**
|
|
34
|
+
* An input or textarea with an icon or button inside the same box.
|
|
35
|
+
* The group draws the box and the focus ring; the field inside is bare. After shadcn's
|
|
36
|
+
* InputGroup.
|
|
37
|
+
*/
|
|
37
38
|
const InputGroup = Object.assign(InputGroupRoot, {
|
|
38
39
|
Addon: InputGroupAddon,
|
|
39
40
|
Input: InputGroupInput,
|
|
@@ -22,6 +22,7 @@ declare const InputNumber: ({ value, onChange, className, ...props }: ReactEleme
|
|
|
22
22
|
onChange?: (value?: number | '') => void;
|
|
23
23
|
value?: number;
|
|
24
24
|
}) => React.JSX.Element;
|
|
25
|
+
/** A themed text input; `Input.Number` adds thousands separators. */
|
|
25
26
|
export declare const Input: typeof InputMain & {
|
|
26
27
|
Number: typeof InputNumber;
|
|
27
28
|
};
|
package/dist/components/input.js
CHANGED
|
@@ -63,5 +63,6 @@ const InputNumber = ({ value, onChange, className, ...props }) => {
|
|
|
63
63
|
...props
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
|
+
/** A themed text input; `Input.Number` adds thousands separators. */
|
|
66
67
|
const Input = Object.assign(InputMain, { Number: InputNumber });
|
|
67
68
|
export { Input, fieldTextVariants, inputVariants };
|
package/dist/components/kbd.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A keyboard key, such as a shortcut in a tooltip or menu.
|
|
4
|
+
* A `<kbd>` that takes all of its props; `variant` picks a light or dark tint.
|
|
4
5
|
*/
|
|
5
6
|
export declare const Kbd: ({ ref, children, className, variant, ...props }: React.ComponentProps<'kbd'> & {
|
|
6
7
|
variant?: 'background' | 'foreground';
|
package/dist/components/kbd.js
CHANGED
|
@@ -3,7 +3,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import "react";
|
|
4
4
|
// src/components/kbd.tsx
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* A keyboard key, such as a shortcut in a tooltip or menu.
|
|
7
|
+
* A `<kbd>` that takes all of its props; `variant` picks a light or dark tint.
|
|
7
8
|
*/
|
|
8
9
|
const Kbd = ({ ref, children, className, variant = "background", ...props }) => {
|
|
9
10
|
return /* @__PURE__ */ jsx("kbd", {
|
|
@@ -3,6 +3,6 @@ import { VariantProps } from "class-variance-authority";
|
|
|
3
3
|
declare const labelVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "muted" | "option" | "peer" | "plain" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
/** A native label
|
|
6
|
+
/** A form control's label, a native `<label>` since Base UI has none. */
|
|
7
7
|
export declare const Label: ({ className, variant, htmlFor, ...props }: React.ComponentProps<'label'> & VariantProps<typeof labelVariants>) => React.JSX.Element;
|
|
8
8
|
export {};
|
package/dist/components/label.js
CHANGED
|
@@ -13,7 +13,7 @@ const labelVariants = cva("leading-none inline-block peer-disabled:cursor-not-al
|
|
|
13
13
|
} },
|
|
14
14
|
defaultVariants: { variant: "default" }
|
|
15
15
|
});
|
|
16
|
-
/** A native label
|
|
16
|
+
/** A form control's label, a native `<label>` since Base UI has none. */
|
|
17
17
|
const Label = ({ className, variant, htmlFor, ...props }) => /* @__PURE__ */ jsx("label", {
|
|
18
18
|
htmlFor,
|
|
19
19
|
className: cn(labelVariants({ variant }), className),
|
|
@@ -14,7 +14,7 @@ const SelectorField = ({ fieldRef, value, placeholder, hidePlaceholderWhenSelect
|
|
|
14
14
|
className: "flex flex-wrap gap-1 w-full",
|
|
15
15
|
children: [
|
|
16
16
|
value.map((option) => /* @__PURE__ */ jsxs(Combobox.Chip, {
|
|
17
|
-
className: "relative inline-flex h-7 cursor-default items-center rounded-md border border-solid bg-background pe-7 pl-2 ps-2 text-xs font-medium text-secondary-foreground transition-
|
|
17
|
+
className: "relative inline-flex h-7 cursor-default items-center rounded-md border border-solid bg-background pe-7 pl-2 ps-2 text-xs font-medium text-secondary-foreground transition-colors hover:bg-background data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
18
18
|
children: [option.label, /* @__PURE__ */ jsx(Combobox.ChipRemove, {
|
|
19
19
|
"aria-label": "Remove",
|
|
20
20
|
className: "absolute -inset-y-px -end-px flex size-7 items-center justify-center rounded-e-lg border border-transparent p-0 text-muted-foreground/80 outline-0 transition-colors hover:text-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-ring/70",
|
|
@@ -68,8 +68,9 @@ const SelectorPopup = ({ fieldRef, emptyIndicator }) => /* @__PURE__ */ jsx(Comb
|
|
|
68
68
|
})
|
|
69
69
|
}) });
|
|
70
70
|
const has = (list, key) => list.some((item) => item.value === key);
|
|
71
|
+
const NONE = [];
|
|
71
72
|
/** Picks several options from a list, shown as removable badges; picked options leave the list. */
|
|
72
|
-
const MultipleSelector = ({ value =
|
|
73
|
+
const MultipleSelector = ({ value = NONE, onChange, options = NONE, placeholder = "Search", creatable, emptyIndicator, disabled, ...fieldProps }) => {
|
|
73
74
|
const fieldRef = useRef(null);
|
|
74
75
|
const [query, setQuery] = useState("");
|
|
75
76
|
const typed = query.trim();
|
|
@@ -3,12 +3,18 @@ import { Resizable as Resizable$1 } from "./resizable.js";
|
|
|
3
3
|
import { SliderProps } from "./slider.js";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
5
|
declare const Selector: import("react").LazyExoticComponent<typeof MultipleSelector$1>;
|
|
6
|
+
/**
|
|
7
|
+
* Picks several options from a list, shown as removable badges.
|
|
8
|
+
* Picked options leave the list. The code loads the first time one renders.
|
|
9
|
+
*/
|
|
6
10
|
export declare const MultipleSelector: (props: ComponentProps<typeof Selector>) => import("react").JSX.Element;
|
|
11
|
+
/** A draggable slider for one number or a range. Its code loads on first render. */
|
|
7
12
|
export declare const Slider: <Value extends number | readonly number[]>(props: SliderProps<Value>) => import("react").JSX.Element;
|
|
8
13
|
type Parts = typeof Resizable$1;
|
|
9
14
|
declare const ResizablePanelGroup: (props: ComponentProps<Parts['PanelGroup']>) => import("react").JSX.Element;
|
|
10
15
|
declare const ResizablePanel: (props: ComponentProps<Parts['Panel']>) => import("react").JSX.Element;
|
|
11
16
|
declare const ResizableHandle: (props: ComponentProps<Parts['Handle']>) => import("react").JSX.Element;
|
|
17
|
+
/** Side-by-side panels with handles that drag their sizes. Its code loads on first render. */
|
|
12
18
|
export declare const Resizable: {
|
|
13
19
|
PanelGroup: typeof ResizablePanelGroup;
|
|
14
20
|
Panel: typeof ResizablePanel;
|
|
@@ -3,6 +3,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Suspense, lazy, use } from "react";
|
|
4
4
|
// src/components/on-demand.tsx
|
|
5
5
|
const Selector = lazy(async () => ({ default: (await import("./multiselect.js")).MultipleSelector }));
|
|
6
|
+
/**
|
|
7
|
+
* Picks several options from a list, shown as removable badges.
|
|
8
|
+
* Picked options leave the list. The code loads the first time one renders.
|
|
9
|
+
*/
|
|
6
10
|
const MultipleSelector = (props) => /* @__PURE__ */ jsx(Suspense, {
|
|
7
11
|
fallback: /* @__PURE__ */ jsx("div", { className: cn("min-h-7 w-full rounded shadow-xs", props.className) }),
|
|
8
12
|
children: /* @__PURE__ */ jsx(Selector, { ...props })
|
|
@@ -12,6 +16,7 @@ const LoadedSlider = (props) => {
|
|
|
12
16
|
const { Slider } = use(sliderModule ??= import("./slider.js"));
|
|
13
17
|
return /* @__PURE__ */ jsx(Slider, { ...props });
|
|
14
18
|
};
|
|
19
|
+
/** A draggable slider for one number or a range. Its code loads on first render. */
|
|
15
20
|
const Slider = (props) => /* @__PURE__ */ jsx(Suspense, {
|
|
16
21
|
fallback: /* @__PURE__ */ jsx("div", { className: "h-4 w-full" }),
|
|
17
22
|
children: /* @__PURE__ */ jsx(LoadedSlider, { ...props })
|
|
@@ -34,6 +39,7 @@ const ResizableHandle = (props) => {
|
|
|
34
39
|
const { Handle } = useResizable();
|
|
35
40
|
return /* @__PURE__ */ jsx(Handle, { ...props });
|
|
36
41
|
};
|
|
42
|
+
/** Side-by-side panels with handles that drag their sizes. Its code loads on first render. */
|
|
37
43
|
const Resizable = {
|
|
38
44
|
PanelGroup: ResizablePanelGroup,
|
|
39
45
|
Panel: ResizablePanel,
|
|
@@ -14,6 +14,10 @@ export type PopoverContentProps = Popover$1.Popup.Props & Pick<Popover$1.Positio
|
|
|
14
14
|
* on its root, which has no tabbable element for the default focus to land on.
|
|
15
15
|
*/
|
|
16
16
|
declare const PopoverContent: ({ ref, className, side, sideOffset, align, alignOffset, collisionPadding, anchor, variant, disableTransition, initialFocus, ...props }: PopoverContentProps) => import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* A floating box anchored to its trigger, for a picker or a few controls.
|
|
19
|
+
* Content sits in a positioner, which sets `--anchor-width` and `--available-height`.
|
|
20
|
+
*/
|
|
17
21
|
export declare const Popover: typeof Popover$1.Root & {
|
|
18
22
|
Trigger: Popover$1.Trigger;
|
|
19
23
|
Content: typeof PopoverContent;
|
|
@@ -38,6 +38,10 @@ const PopoverContent = ({ ref, className, side = "bottom", sideOffset = 4, align
|
|
|
38
38
|
})
|
|
39
39
|
}) });
|
|
40
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* A floating box anchored to its trigger, for a picker or a few controls.
|
|
43
|
+
* Content sits in a positioner, which sets `--anchor-width` and `--available-height`.
|
|
44
|
+
*/
|
|
41
45
|
const Popover = Object.assign(Popover$1.Root, {
|
|
42
46
|
Trigger: Popover$1.Trigger,
|
|
43
47
|
Content: PopoverContent,
|
|
@@ -3,6 +3,7 @@ import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
|
3
3
|
export type RadioGroupProps<Value = string> = RadioGroup$1.Props<Value>;
|
|
4
4
|
declare const RadioGroupRoot: <Value = string>({ className, ...props }: RadioGroupProps<Value>) => import("react").JSX.Element;
|
|
5
5
|
declare const RadioGroupItem: <Value = string>({ className, ...props }: Radio.Root.Props<Value>) => import("react").JSX.Element;
|
|
6
|
+
/** A set of radio buttons where one value is picked. */
|
|
6
7
|
export declare const RadioGroup: typeof RadioGroupRoot & {
|
|
7
8
|
Item: typeof RadioGroupItem;
|
|
8
9
|
};
|
|
@@ -12,6 +12,7 @@ declare const ScrollAreaRoot: ({ className, gutter, ...props }: ScrollArea$1.Roo
|
|
|
12
12
|
declare const ScrollAreaViewport: ({ className, children, ...props }: ScrollArea$1.Viewport.Props) => import("react").JSX.Element;
|
|
13
13
|
/** Shows while the pointer is over the area or it scrolls, and hides 600ms after, as Radix's hover type did. */
|
|
14
14
|
declare const ScrollBar: ({ className, orientation, ...props }: ScrollArea$1.Scrollbar.Props) => import("react").JSX.Element;
|
|
15
|
+
/** A scrolling box with thin scrollbars that show on hover or scroll. */
|
|
15
16
|
export declare const ScrollArea: typeof ScrollAreaMain & {
|
|
16
17
|
Root: typeof ScrollAreaRoot;
|
|
17
18
|
Viewport: typeof ScrollAreaViewport;
|
|
@@ -33,6 +33,7 @@ const ScrollBar = ({ className, orientation = "vertical", ...props }) => /* @__P
|
|
|
33
33
|
...props,
|
|
34
34
|
children: /* @__PURE__ */ jsx(ScrollArea$1.Thumb, { className: "relative flex-1 rounded-full bg-scroll" })
|
|
35
35
|
});
|
|
36
|
+
/** A scrolling box with thin scrollbars that show on hover or scroll. */
|
|
36
37
|
const ScrollArea = Object.assign(ScrollAreaMain, {
|
|
37
38
|
Root: ScrollAreaRoot,
|
|
38
39
|
Viewport: ScrollAreaViewport,
|
|
@@ -11,13 +11,17 @@ declare const SelectGroup: (props: Select$1.Group.Props) => string | number | bi
|
|
|
11
11
|
declare const selectTriggerVariants: (props?: ({
|
|
12
12
|
variant?: "bordered" | "default" | "flush" | null | undefined;
|
|
13
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
-
declare const SelectTrigger: ({ className, children, variant, ...props }: Select$1.Trigger.Props & VariantProps<typeof selectTriggerVariants>) => React.JSX.Element;
|
|
14
|
+
declare const SelectTrigger: ({ className, children, variant, id, ...props }: Select$1.Trigger.Props & VariantProps<typeof selectTriggerVariants>) => React.JSX.Element;
|
|
15
15
|
declare const SelectContent: ({ className, children, side, align, ...props }: Select$1.Popup.Props & Pick<Select$1.Positioner.Props, 'side' | 'align'>) => React.JSX.Element;
|
|
16
16
|
declare const SelectLabel: ({ className, ...props }: Select$1.GroupLabel.Props) => React.JSX.Element | null;
|
|
17
17
|
declare const SelectItem: ({ className, children, value, ...props }: Omit<Select$1.Item.Props, 'value'> & {
|
|
18
18
|
value: string;
|
|
19
19
|
}) => React.JSX.Element;
|
|
20
20
|
declare const SelectSeparator: ({ className, ...props }: Select$1.Separator.Props) => React.JSX.Element | null;
|
|
21
|
+
/**
|
|
22
|
+
* A dropdown to pick one value from a short fixed list.
|
|
23
|
+
* An empty string means nothing is selected. For a searchable or long list, use `Combobox`.
|
|
24
|
+
*/
|
|
21
25
|
export declare const Select: typeof SelectRoot & {
|
|
22
26
|
Group: typeof SelectGroup;
|
|
23
27
|
Value: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectValueProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { useCellLabel } from "../modules/record-table/components/RecordTableCell.js";
|
|
2
3
|
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { createContext, use, useCallback, useLayoutEffect, useState } from "react";
|
|
@@ -38,7 +39,8 @@ const selectTriggerVariants = cva("flex h-7 w-full items-center font-medium just
|
|
|
38
39
|
} },
|
|
39
40
|
defaultVariants: { variant: "default" }
|
|
40
41
|
});
|
|
41
|
-
const SelectTrigger = ({ className, children, variant, ...props }) => /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
42
|
+
const SelectTrigger = ({ className, children, variant, id, ...props }) => /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
43
|
+
...useCellLabel(id),
|
|
42
44
|
className: cn(selectTriggerVariants({ variant }), className),
|
|
43
45
|
...props,
|
|
44
46
|
children: [children, /* @__PURE__ */ jsx(IconChevronDown, {
|
|
@@ -103,6 +105,10 @@ const SelectSeparator = ({ className, ...props }) => use(CollectingContext) ? nu
|
|
|
103
105
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
104
106
|
...props
|
|
105
107
|
});
|
|
108
|
+
/**
|
|
109
|
+
* A dropdown to pick one value from a short fixed list.
|
|
110
|
+
* An empty string means nothing is selected. For a searchable or long list, use `Combobox`.
|
|
111
|
+
*/
|
|
106
112
|
const Select = Object.assign(SelectRoot, {
|
|
107
113
|
Group: SelectGroup,
|
|
108
114
|
Value: Select$1.Value,
|
|
@@ -2,6 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { Separator as Separator$1 } from "@base-ui/react/separator";
|
|
3
3
|
declare const SeparatorRoot: ({ className, orientation, ...props }: React.ComponentProps<typeof Separator$1>) => React.JSX.Element;
|
|
4
4
|
declare const SeparatorInline: ({ className, orientation, ...props }: React.ComponentProps<typeof Separator$1>) => React.JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* A thin horizontal or vertical line between sections.
|
|
7
|
+
* `Separator.Inline` is a short tick in text.
|
|
8
|
+
*/
|
|
5
9
|
export declare const Separator: typeof SeparatorRoot & {
|
|
6
10
|
Inline: typeof SeparatorInline;
|
|
7
11
|
};
|
|
@@ -13,5 +13,9 @@ const SeparatorInline = ({ className, orientation = "vertical", ...props }) => /
|
|
|
13
13
|
className: cn("inline-block bg-border rounded-lg flex-none", orientation === "horizontal" ? "w-3 h-0.5" : "w-0.5 h-3", className),
|
|
14
14
|
...props
|
|
15
15
|
});
|
|
16
|
+
/**
|
|
17
|
+
* A thin horizontal or vertical line between sections.
|
|
18
|
+
* `Separator.Inline` is a short tick in text.
|
|
19
|
+
*/
|
|
16
20
|
const Separator = Object.assign(SeparatorRoot, { Inline: SeparatorInline });
|
|
17
21
|
export { Separator };
|
|
@@ -21,6 +21,10 @@ declare const SheetContent: ({ className, ...props }: React.HTMLAttributes<HTMLD
|
|
|
21
21
|
declare const SheetFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
22
22
|
declare const SheetTitle: ({ className, ...props }: Dialog.Title.Props) => React.JSX.Element;
|
|
23
23
|
declare const SheetDescription: ({ className, ...props }: Dialog.Description.Props) => React.JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* A panel that slides in from a page edge over a dimmed page.
|
|
26
|
+
* A plugin's records open in core's side panel through `useOpenRecord`, never in a Sheet.
|
|
27
|
+
*/
|
|
24
28
|
export declare const Sheet: typeof SheetRoot & {
|
|
25
29
|
Trigger: Dialog.Trigger;
|
|
26
30
|
View: typeof SheetView;
|
package/dist/components/sheet.js
CHANGED
|
@@ -4,8 +4,8 @@ import { IconX } from "@tabler/icons-react";
|
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
|
-
import { Dialog } from "@base-ui/react/dialog";
|
|
8
7
|
import { useTranslation } from "react-i18next";
|
|
8
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
9
9
|
// src/components/sheet.tsx
|
|
10
10
|
const SheetHeaderActionsContext = React.createContext(null);
|
|
11
11
|
const SheetRoot = ({ headerActions = null, ...props }) => /* @__PURE__ */ jsx(SheetHeaderActionsContext, {
|
|
@@ -80,7 +80,7 @@ const SheetHeader = ({ className, children, ...props }) => {
|
|
|
80
80
|
const items = React.Children.toArray(children);
|
|
81
81
|
const close = actions ? items.find((child) => React.isValidElement(child) && child.type === SheetClose) : void 0;
|
|
82
82
|
return /* @__PURE__ */ jsx("div", {
|
|
83
|
-
className: cn("flex px-5 h-10
|
|
83
|
+
className: cn("flex flex-wrap items-center gap-x-2 gap-y-1 px-5 py-2 min-h-10 bg-background border-b flex-none", className),
|
|
84
84
|
...props,
|
|
85
85
|
children: actions ? /* @__PURE__ */ jsxs(Fragment, { children: [items.filter((child) => child !== close), /* @__PURE__ */ jsxs("div", {
|
|
86
86
|
className: "ml-auto flex shrink-0 items-center gap-1 [&>button]:ml-0",
|
|
@@ -97,13 +97,17 @@ const SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
|
97
97
|
...props
|
|
98
98
|
});
|
|
99
99
|
const SheetTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Title, {
|
|
100
|
-
className: cn("text-lg font-semibold text-foreground leading-
|
|
100
|
+
className: cn("min-w-0 flex-1 text-lg font-semibold text-foreground leading-tight", className),
|
|
101
101
|
...props
|
|
102
102
|
});
|
|
103
103
|
const SheetDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Description, {
|
|
104
|
-
className: cn("text-sm leading-
|
|
104
|
+
className: cn("order-last basis-full text-sm leading-snug text-muted-foreground", className),
|
|
105
105
|
...props
|
|
106
106
|
});
|
|
107
|
+
/**
|
|
108
|
+
* A panel that slides in from a page edge over a dimmed page.
|
|
109
|
+
* A plugin's records open in core's side panel through `useOpenRecord`, never in a Sheet.
|
|
110
|
+
*/
|
|
107
111
|
const Sheet = Object.assign(SheetRoot, {
|
|
108
112
|
Trigger: Dialog.Trigger,
|
|
109
113
|
View: SheetView,
|