@zvk/ui 0.1.9 → 0.1.12
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 +23 -0
- package/README.md +4 -0
- package/dist/components/grid-list/grid-list.d.ts +29 -0
- package/dist/components/grid-list/grid-list.js +125 -0
- package/dist/components/grid-list/index.d.ts +2 -0
- package/dist/components/grid-list/index.js +2 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +8 -0
- package/dist/components/list-row/index.d.ts +2 -0
- package/dist/components/list-row/index.js +2 -0
- package/dist/components/list-row/list-row.d.ts +54 -0
- package/dist/components/list-row/list-row.js +60 -0
- package/dist/components/multi-select/index.d.ts +2 -0
- package/dist/components/multi-select/index.js +2 -0
- package/dist/components/multi-select/multi-select.d.ts +32 -0
- package/dist/components/multi-select/multi-select.js +212 -0
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.js +2 -0
- package/dist/components/splitter/splitter.d.ts +63 -0
- package/dist/components/splitter/splitter.js +163 -0
- package/dist/components/stepper/index.d.ts +2 -0
- package/dist/components/stepper/index.js +2 -0
- package/dist/components/stepper/stepper.d.ts +30 -0
- package/dist/components/stepper/stepper.js +61 -0
- package/dist/components/tags-input/index.d.ts +2 -0
- package/dist/components/tags-input/index.js +2 -0
- package/dist/components/tags-input/tags-input.d.ts +21 -0
- package/dist/components/tags-input/tags-input.js +132 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/index.js +2 -0
- package/dist/components/toolbar/toolbar.d.ts +33 -0
- package/dist/components/toolbar/toolbar.js +106 -0
- package/dist/components/tree-view/index.d.ts +2 -0
- package/dist/components/tree-view/index.js +2 -0
- package/dist/components/tree-view/tree-view.d.ts +33 -0
- package/dist/components/tree-view/tree-view.js +190 -0
- package/dist/internal/collection/index.d.ts +2 -0
- package/dist/internal/collection/index.js +1 -0
- package/dist/internal/collection/selection.d.ts +11 -0
- package/dist/internal/collection/selection.js +60 -0
- package/dist/styles.css +1006 -161
- package/package.json +43 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.12](https://github.com/brandon-schabel/zvk/compare/v0.1.11...v0.1.12) (2026-06-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* improve out-of-box DX and UI components ([#24](https://github.com/brandon-schabel/zvk/issues/24)) ([b01272a](https://github.com/brandon-schabel/zvk/commit/b01272a2b35099f5e1fa1dea5883687a0fb4c2e6))
|
|
9
|
+
|
|
10
|
+
## [0.1.11](https://github.com/brandon-schabel/zvk/compare/v0.1.10...v0.1.11) (2026-06-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add composite component package ([dc0920f](https://github.com/brandon-schabel/zvk/commit/dc0920fe77dd2bd63015a40b3d7675fe8f1d0067))
|
|
16
|
+
* add theme presets and package improvements ([#19](https://github.com/brandon-schabel/zvk/issues/19)) ([867f955](https://github.com/brandon-schabel/zvk/commit/867f9556f7a60144cad4e747f2c032f2d5ede353))
|
|
17
|
+
* improve consumer migration support ([10b9e8a](https://github.com/brandon-schabel/zvk/commit/10b9e8ac106774eeba0be19db8522abbda02a422))
|
|
18
|
+
* improve package release workflow and repo maintainability ([#22](https://github.com/brandon-schabel/zvk/issues/22)) ([a41cb66](https://github.com/brandon-schabel/zvk/commit/a41cb66554496f241c5a8e30b29a76c8b8ca92b3))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* harden popup positioning ([efb8c8a](https://github.com/brandon-schabel/zvk/commit/efb8c8a98c2b759f4e84a60f5ae292b1e8900907))
|
|
24
|
+
* restore preview source aliases ([6fd494a](https://github.com/brandon-schabel/zvk/commit/6fd494af071bc4dd3fe1685bce9cd5c44aa22bd6))
|
|
25
|
+
|
|
3
26
|
## [0.1.9](https://github.com/brandon-schabel/zvk/compare/v0.1.8...v0.1.9) (2026-06-19)
|
|
4
27
|
|
|
5
28
|
|
package/README.md
CHANGED
|
@@ -36,3 +36,7 @@ You may use it in personal, internal, or commercial applications, but you may
|
|
|
36
36
|
not redistribute, republish, resell, fork, mirror, or repackage it as a standalone
|
|
37
37
|
library or competing component system.
|
|
38
38
|
See [LICENSE.md](./LICENSE.md) for details.
|
|
39
|
+
|
|
40
|
+
## Repo Skill
|
|
41
|
+
|
|
42
|
+
Use `.codex/skills/use-zvk-ui/SKILL.md` when maintaining this package.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type CollectionSelectionMode } from "../../internal/collection/index.js";
|
|
3
|
+
export type GridListSelectionMode = CollectionSelectionMode;
|
|
4
|
+
export interface GridListItemState {
|
|
5
|
+
active: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
id: string;
|
|
8
|
+
selected: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface GridListProps<Item> extends Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> {
|
|
11
|
+
activeKey?: string;
|
|
12
|
+
defaultActiveKey?: string;
|
|
13
|
+
defaultSelectedKeys?: readonly string[];
|
|
14
|
+
emptyState?: React.ReactNode;
|
|
15
|
+
getItemId: (item: Item) => string;
|
|
16
|
+
getItemTextValue?: (item: Item) => string;
|
|
17
|
+
isItemDisabled?: (item: Item) => boolean;
|
|
18
|
+
items: readonly Item[];
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
loadingState?: React.ReactNode;
|
|
21
|
+
onAction?: (key: string, item: Item) => void;
|
|
22
|
+
onActiveKeyChange?: (key: string | undefined) => void;
|
|
23
|
+
onSelectedKeysChange?: (keys: string[]) => void;
|
|
24
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
25
|
+
renderItem: (item: Item, state: GridListItemState) => React.ReactNode;
|
|
26
|
+
selectedKeys?: readonly string[];
|
|
27
|
+
selectionMode?: GridListSelectionMode;
|
|
28
|
+
}
|
|
29
|
+
export declare function GridList<Item>({ activeKey, className, defaultActiveKey, defaultSelectedKeys, emptyState, getItemId, getItemTextValue, isItemDisabled, items, loading, loadingState, onAction, onActiveKeyChange, onKeyDown, onSelectedKeysChange, ref, renderItem, role, selectedKeys, selectionMode, ...props }: GridListProps<Item>): React.JSX.Element;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
5
|
+
import { moveCollectionKey, normalizeSelectionKeys, toggleSelectionKey } from "../../internal/collection/index.js";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import { composeEventHandlers } from "../../utils/compose-event-handlers.js";
|
|
8
|
+
function getGridListRecords({ getItemId, getItemTextValue, isItemDisabled, items }) {
|
|
9
|
+
return items.map((item) => {
|
|
10
|
+
const id = getItemId(item);
|
|
11
|
+
return {
|
|
12
|
+
disabled: isItemDisabled?.(item) ?? false,
|
|
13
|
+
id,
|
|
14
|
+
item,
|
|
15
|
+
textValue: getItemTextValue?.(item) ?? id
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export function GridList({ activeKey, className, defaultActiveKey, defaultSelectedKeys = [], emptyState, getItemId, getItemTextValue, isItemDisabled, items, loading = false, loadingState, onAction, onActiveKeyChange, onKeyDown, onSelectedKeysChange, ref, renderItem, role = "grid", selectedKeys, selectionMode = "none", ...props }) {
|
|
20
|
+
const records = React.useMemo(() => getGridListRecords({ getItemId, getItemTextValue, isItemDisabled, items }), [getItemId, getItemTextValue, isItemDisabled, items]);
|
|
21
|
+
const navigationItems = records.map((record) => ({
|
|
22
|
+
disabled: record.disabled,
|
|
23
|
+
id: record.id,
|
|
24
|
+
textValue: record.textValue
|
|
25
|
+
}));
|
|
26
|
+
const firstEnabledKey = moveCollectionKey(navigationItems, undefined, "first");
|
|
27
|
+
const rowRefs = React.useRef(new Map());
|
|
28
|
+
const [currentActiveKey, setCurrentActiveKey] = useControllableState({
|
|
29
|
+
...(activeKey !== undefined ? { value: activeKey } : {}),
|
|
30
|
+
defaultValue: defaultActiveKey ?? firstEnabledKey,
|
|
31
|
+
...(onActiveKeyChange ? { onChange: onActiveKeyChange } : {})
|
|
32
|
+
});
|
|
33
|
+
const [currentSelectedKeys, setCurrentSelectedKeys] = useControllableState({
|
|
34
|
+
...(selectedKeys !== undefined ? { value: normalizeSelectionKeys(selectedKeys) } : {}),
|
|
35
|
+
defaultValue: normalizeSelectionKeys(defaultSelectedKeys),
|
|
36
|
+
...(onSelectedKeysChange ? { onChange: onSelectedKeysChange } : {})
|
|
37
|
+
});
|
|
38
|
+
const rovingActiveKey = currentActiveKey ?? firstEnabledKey;
|
|
39
|
+
React.useLayoutEffect(() => {
|
|
40
|
+
if (rovingActiveKey === undefined) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const activeRecord = records.find((record) => record.id === rovingActiveKey);
|
|
44
|
+
if (!activeRecord || activeRecord.disabled) {
|
|
45
|
+
setCurrentActiveKey(firstEnabledKey);
|
|
46
|
+
}
|
|
47
|
+
}, [firstEnabledKey, records, rovingActiveKey, setCurrentActiveKey]);
|
|
48
|
+
function focusRow(key) {
|
|
49
|
+
if (key === undefined) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
rowRefs.current.get(key)?.focus();
|
|
53
|
+
}
|
|
54
|
+
function selectRecord(record) {
|
|
55
|
+
if (record.disabled) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
setCurrentSelectedKeys((keys) => toggleSelectionKey(keys, record.id, selectionMode));
|
|
59
|
+
}
|
|
60
|
+
function moveActiveRecord(movement) {
|
|
61
|
+
const nextKey = moveCollectionKey(navigationItems, rovingActiveKey, movement);
|
|
62
|
+
setCurrentActiveKey(nextKey);
|
|
63
|
+
focusRow(nextKey);
|
|
64
|
+
}
|
|
65
|
+
return (_jsx("div", { ...props, ref: ref, "aria-busy": loading ? true : props["aria-busy"], "aria-multiselectable": selectionMode === "multiple" ? true : undefined, className: cn("zvk-ui-grid-list", className), "data-loading": loading ? "true" : undefined, "data-selection-mode": selectionMode, onKeyDown: onKeyDown, role: role, children: loading ? (_jsx("div", { className: "zvk-ui-grid-list__loading", role: "status", children: loadingState })) : records.length === 0 ? (_jsx("div", { className: "zvk-ui-grid-list__empty", children: emptyState })) : (records.map((record) => {
|
|
66
|
+
const selected = currentSelectedKeys.includes(record.id);
|
|
67
|
+
const active = rovingActiveKey === record.id;
|
|
68
|
+
const state = {
|
|
69
|
+
active,
|
|
70
|
+
disabled: record.disabled,
|
|
71
|
+
id: record.id,
|
|
72
|
+
selected
|
|
73
|
+
};
|
|
74
|
+
return (_jsx("div", { ref: (node) => {
|
|
75
|
+
if (node) {
|
|
76
|
+
rowRefs.current.set(record.id, node);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
rowRefs.current.delete(record.id);
|
|
80
|
+
}
|
|
81
|
+
}, "aria-disabled": record.disabled ? "true" : undefined, "aria-selected": selectionMode === "none" ? undefined : selected ? "true" : "false", className: "zvk-ui-grid-list__row", "data-active": active ? "true" : undefined, "data-disabled": record.disabled ? "true" : undefined, "data-selected": selected ? "true" : undefined, onClick: () => {
|
|
82
|
+
if (record.disabled) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
setCurrentActiveKey(record.id);
|
|
86
|
+
onAction?.(record.id, record.item);
|
|
87
|
+
}, onFocus: () => {
|
|
88
|
+
if (!record.disabled) {
|
|
89
|
+
setCurrentActiveKey(record.id);
|
|
90
|
+
}
|
|
91
|
+
}, onKeyDown: composeEventHandlers(undefined, (event) => {
|
|
92
|
+
if (event.key === "ArrowDown" || event.key === "ArrowRight") {
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
moveActiveRecord("next");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (event.key === "ArrowUp" || event.key === "ArrowLeft") {
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
moveActiveRecord("previous");
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (event.key === "Home") {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
moveActiveRecord("first");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (event.key === "End") {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
moveActiveRecord("last");
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (event.key === " ") {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
selectRecord(record);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (event.key === "Enter") {
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
if (!record.disabled) {
|
|
120
|
+
onAction?.(record.id, record.item);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}), role: "row", tabIndex: record.disabled ? -1 : active ? 0 : -1, children: _jsx("div", { className: "zvk-ui-grid-list__cell", role: "gridcell", children: renderItem(record.item, state) }) }, record.id));
|
|
124
|
+
})) }));
|
|
125
|
+
}
|
|
@@ -46,6 +46,8 @@ export { ContextMenu } from "./context-menu/index.js";
|
|
|
46
46
|
export type { ContextMenuCheckboxItemProps, ContextMenuContentProps, ContextMenuItemProps, ContextMenuLabelProps, ContextMenuProps, ContextMenuRadioItemProps, ContextMenuSeparatorProps, ContextMenuTriggerProps } from "./context-menu/index.js";
|
|
47
47
|
export { Menubar } from "./menubar/index.js";
|
|
48
48
|
export type { MenubarCheckboxItemProps, MenubarContentProps, MenubarItemProps, MenubarLabelProps, MenubarMenuProps, MenubarProps, MenubarRadioItemProps, MenubarSeparatorProps, MenubarShortcutProps, MenubarTriggerProps } from "./menubar/index.js";
|
|
49
|
+
export { MultiSelect } from "./multi-select/index.js";
|
|
50
|
+
export type { MultiSelectOption, MultiSelectProps, MultiSelectSize } from "./multi-select/index.js";
|
|
49
51
|
export { EmptyState } from "./empty-state/index.js";
|
|
50
52
|
export type { EmptyStateAlign, EmptyStateProps, EmptyStateSize } from "./empty-state/index.js";
|
|
51
53
|
export { ErrorBoundary, ErrorFallback } from "./error-boundary/index.js";
|
|
@@ -62,18 +64,24 @@ export { HoverCard } from "./hover-card/index.js";
|
|
|
62
64
|
export type { HoverCardContentProps, HoverCardProps, HoverCardTriggerProps } from "./hover-card/index.js";
|
|
63
65
|
export { IconButton } from "./icon-button/index.js";
|
|
64
66
|
export type { IconButtonProps } from "./icon-button/index.js";
|
|
67
|
+
export { GridList } from "./grid-list/index.js";
|
|
68
|
+
export type { GridListItemState, GridListProps, GridListSelectionMode } from "./grid-list/index.js";
|
|
65
69
|
export { Input } from "./input/index.js";
|
|
66
70
|
export type { InputProps, InputSize } from "./input/index.js";
|
|
67
71
|
export { Kbd } from "./kbd/index.js";
|
|
68
72
|
export type { KbdProps, KbdSize } from "./kbd/index.js";
|
|
69
73
|
export { Label } from "./label/index.js";
|
|
70
74
|
export type { LabelProps, LabelSize } from "./label/index.js";
|
|
75
|
+
export { ListRow } from "./list-row/index.js";
|
|
76
|
+
export type { ListRowButtonProps, ListRowDensity, ListRowDescriptionProps, ListRowLinkProps, ListRowProps, ListRowSlotProps, ListRowTitleProps, ListRowVariant } from "./list-row/index.js";
|
|
71
77
|
export { Pagination } from "./pagination/index.js";
|
|
72
78
|
export type { PaginationProps, PaginationRangeItem } from "./pagination/index.js";
|
|
73
79
|
export { Popover } from "./popover/index.js";
|
|
74
80
|
export type { PopoverContentProps, PopoverProps, PopoverTriggerProps } from "./popover/index.js";
|
|
75
81
|
export { Progress } from "./progress/index.js";
|
|
76
82
|
export type { ProgressProps, ProgressSize, ProgressState, ProgressTone } from "./progress/index.js";
|
|
83
|
+
export { Stepper } from "./stepper/index.js";
|
|
84
|
+
export type { StepperItem, StepperItemState, StepperOrientation, StepperProps, StepperStatus } from "./stepper/index.js";
|
|
77
85
|
export { RadioGroup, RadioGroupItem } from "./radio-group/index.js";
|
|
78
86
|
export type { RadioGroupItemProps, RadioGroupOption, RadioGroupOrientation, RadioGroupProps, RadioGroupSize } from "./radio-group/index.js";
|
|
79
87
|
export { Select } from "./select/index.js";
|
|
@@ -84,6 +92,8 @@ export { Separator } from "./separator/index.js";
|
|
|
84
92
|
export type { SeparatorOrientation, SeparatorProps } from "./separator/index.js";
|
|
85
93
|
export { Slider } from "./slider/index.js";
|
|
86
94
|
export type { SliderProps, SliderSize } from "./slider/index.js";
|
|
95
|
+
export { Splitter } from "./splitter/index.js";
|
|
96
|
+
export type { SplitterHandleProps, SplitterOrientation, SplitterPanelProps, SplitterProps, SplitterValue } from "./splitter/index.js";
|
|
87
97
|
export { SidebarShell } from "./sidebar-shell/index.js";
|
|
88
98
|
export type { SidebarShellLandmarkSlotProps, SidebarShellMainProps, SidebarShellProps, SidebarShellSide, SidebarShellSidebarProps, SidebarShellSlotProps, SidebarShellWidth } from "./sidebar-shell/index.js";
|
|
89
99
|
export { SectionedSidebarNav } from "./sectioned-sidebar-nav/index.js";
|
|
@@ -100,14 +110,20 @@ export { Table } from "./table/index.js";
|
|
|
100
110
|
export type { TableBodyProps, TableCaptionProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TableHeaderProps, TableProps, TableRowProps } from "./table/index.js";
|
|
101
111
|
export { Tabs } from "./tabs/index.js";
|
|
102
112
|
export type { TabsActivationMode, TabsContentProps, TabsListProps, TabsOrientation, TabsProps, TabsTriggerProps } from "./tabs/index.js";
|
|
113
|
+
export { TagsInput } from "./tags-input/index.js";
|
|
114
|
+
export type { TagsInputProps, TagsInputSize, TagsInputValidationResult } from "./tags-input/index.js";
|
|
103
115
|
export { TabsWithSidebar } from "./tabs-with-sidebar/index.js";
|
|
104
116
|
export type { TabsWithSidebarPanelProps, TabsWithSidebarProps, TabsWithSidebarSidebarProps, TabsWithSidebarWidth } from "./tabs-with-sidebar/index.js";
|
|
105
117
|
export { Textarea } from "./textarea/index.js";
|
|
106
118
|
export type { TextareaProps, TextareaSize } from "./textarea/index.js";
|
|
119
|
+
export { TreeView } from "./tree-view/index.js";
|
|
120
|
+
export type { TreeViewItemState, TreeViewProps, TreeViewSelectionMode } from "./tree-view/index.js";
|
|
107
121
|
export { createToastController, toast, Toast, Toaster, ToastProvider, ToastViewport, useToast } from "./toast/index.js";
|
|
108
122
|
export type { ToasterPosition, ToasterProps, ToastActionInput, ToastActionProps, ToastCloseProps, ToastController, ToastInput, ToastOptions, ToastPlacement, ToastProviderProps, ToastProps, ToastTextProps, ToastTone, ToastViewportProps } from "./toast/index.js";
|
|
109
123
|
export { Tooltip } from "./tooltip/index.js";
|
|
110
124
|
export type { TooltipProps } from "./tooltip/index.js";
|
|
125
|
+
export { Toolbar } from "./toolbar/index.js";
|
|
126
|
+
export type { ToolbarButtonProps, ToolbarGroupProps, ToolbarOrientation, ToolbarProps, ToolbarSeparatorProps, ToolbarToggleProps } from "./toolbar/index.js";
|
|
111
127
|
export { Toggle } from "./toggle/index.js";
|
|
112
128
|
export type { ToggleProps, ToggleSize, ToggleVariant } from "./toggle/index.js";
|
|
113
129
|
export { ToggleGroup } from "./toggle-group/index.js";
|
package/dist/components/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export { Command, CommandDialog } from "./command/index.js";
|
|
|
22
22
|
export { Combobox } from "./combobox/index.js";
|
|
23
23
|
export { ContextMenu } from "./context-menu/index.js";
|
|
24
24
|
export { Menubar } from "./menubar/index.js";
|
|
25
|
+
export { MultiSelect } from "./multi-select/index.js";
|
|
25
26
|
export { EmptyState } from "./empty-state/index.js";
|
|
26
27
|
export { ErrorBoundary, ErrorFallback } from "./error-boundary/index.js";
|
|
27
28
|
export { Field } from "./field/index.js";
|
|
@@ -30,17 +31,21 @@ export { FileUploadInput } from "./file-upload-input/index.js";
|
|
|
30
31
|
export { FileDropzone } from "./file-dropzone/index.js";
|
|
31
32
|
export { HoverCard } from "./hover-card/index.js";
|
|
32
33
|
export { IconButton } from "./icon-button/index.js";
|
|
34
|
+
export { GridList } from "./grid-list/index.js";
|
|
33
35
|
export { Input } from "./input/index.js";
|
|
34
36
|
export { Kbd } from "./kbd/index.js";
|
|
35
37
|
export { Label } from "./label/index.js";
|
|
38
|
+
export { ListRow } from "./list-row/index.js";
|
|
36
39
|
export { Pagination } from "./pagination/index.js";
|
|
37
40
|
export { Popover } from "./popover/index.js";
|
|
38
41
|
export { Progress } from "./progress/index.js";
|
|
42
|
+
export { Stepper } from "./stepper/index.js";
|
|
39
43
|
export { RadioGroup, RadioGroupItem } from "./radio-group/index.js";
|
|
40
44
|
export { Select } from "./select/index.js";
|
|
41
45
|
export { ResponsiveContainer } from "./responsive-container/index.js";
|
|
42
46
|
export { Separator } from "./separator/index.js";
|
|
43
47
|
export { Slider } from "./slider/index.js";
|
|
48
|
+
export { Splitter } from "./splitter/index.js";
|
|
44
49
|
export { SidebarShell } from "./sidebar-shell/index.js";
|
|
45
50
|
export { SectionedSidebarNav } from "./sectioned-sidebar-nav/index.js";
|
|
46
51
|
export { Skeleton } from "./skeleton/index.js";
|
|
@@ -49,10 +54,13 @@ export { Stat } from "./stat/index.js";
|
|
|
49
54
|
export { Switch } from "./switch/index.js";
|
|
50
55
|
export { Table } from "./table/index.js";
|
|
51
56
|
export { Tabs } from "./tabs/index.js";
|
|
57
|
+
export { TagsInput } from "./tags-input/index.js";
|
|
52
58
|
export { TabsWithSidebar } from "./tabs-with-sidebar/index.js";
|
|
53
59
|
export { Textarea } from "./textarea/index.js";
|
|
60
|
+
export { TreeView } from "./tree-view/index.js";
|
|
54
61
|
export { createToastController, toast, Toast, Toaster, ToastProvider, ToastViewport, useToast } from "./toast/index.js";
|
|
55
62
|
export { Tooltip } from "./tooltip/index.js";
|
|
63
|
+
export { Toolbar } from "./toolbar/index.js";
|
|
56
64
|
export { Toggle } from "./toggle/index.js";
|
|
57
65
|
export { ToggleGroup } from "./toggle-group/index.js";
|
|
58
66
|
export { Conversation } from "./conversation/index.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ListRowDensity = "compact" | "default" | "comfortable";
|
|
3
|
+
export type ListRowVariant = "plain" | "surface";
|
|
4
|
+
export interface ListRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
density?: ListRowDensity;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
variant?: ListRowVariant;
|
|
9
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
10
|
+
}
|
|
11
|
+
export interface ListRowSlotProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
13
|
+
}
|
|
14
|
+
export interface ListRowTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
15
|
+
ref?: React.Ref<HTMLHeadingElement>;
|
|
16
|
+
}
|
|
17
|
+
export interface ListRowDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
18
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
19
|
+
}
|
|
20
|
+
export interface ListRowButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
21
|
+
density?: ListRowDensity;
|
|
22
|
+
selected?: boolean;
|
|
23
|
+
variant?: ListRowVariant;
|
|
24
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
25
|
+
}
|
|
26
|
+
export interface ListRowLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
27
|
+
density?: ListRowDensity;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
variant?: ListRowVariant;
|
|
31
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
32
|
+
}
|
|
33
|
+
declare function ListRowRoot({ className, density, disabled, ref, selected, variant, ...props }: ListRowProps): React.JSX.Element;
|
|
34
|
+
declare function ListRowLeading({ className, ref, ...props }: ListRowSlotProps): React.JSX.Element;
|
|
35
|
+
declare function ListRowContent({ className, ref, ...props }: ListRowSlotProps): React.JSX.Element;
|
|
36
|
+
declare function ListRowTitle({ className, ref, ...props }: ListRowTitleProps): React.JSX.Element;
|
|
37
|
+
declare function ListRowDescription({ className, ref, ...props }: ListRowDescriptionProps): React.JSX.Element;
|
|
38
|
+
declare function ListRowMeta({ className, ref, ...props }: ListRowSlotProps): React.JSX.Element;
|
|
39
|
+
declare function ListRowTrailing({ className, ref, ...props }: ListRowSlotProps): React.JSX.Element;
|
|
40
|
+
declare function ListRowActions({ className, ref, ...props }: ListRowSlotProps): React.JSX.Element;
|
|
41
|
+
declare function ListRowButton({ className, density, disabled, ref, selected, type, variant, ...props }: ListRowButtonProps): React.JSX.Element;
|
|
42
|
+
declare function ListRowLink({ className, density, disabled, onClick, ref, selected, tabIndex, variant, ...props }: ListRowLinkProps): React.JSX.Element;
|
|
43
|
+
export declare const ListRow: typeof ListRowRoot & {
|
|
44
|
+
Actions: typeof ListRowActions;
|
|
45
|
+
Button: typeof ListRowButton;
|
|
46
|
+
Content: typeof ListRowContent;
|
|
47
|
+
Description: typeof ListRowDescription;
|
|
48
|
+
Leading: typeof ListRowLeading;
|
|
49
|
+
Link: typeof ListRowLink;
|
|
50
|
+
Meta: typeof ListRowMeta;
|
|
51
|
+
Title: typeof ListRowTitle;
|
|
52
|
+
Trailing: typeof ListRowTrailing;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
function rowDataAttributes({ density, disabled, selected, variant }) {
|
|
6
|
+
return {
|
|
7
|
+
"data-density": density,
|
|
8
|
+
"data-disabled": disabled ? "true" : undefined,
|
|
9
|
+
"data-selected": selected ? "true" : undefined,
|
|
10
|
+
"data-variant": variant
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function ListRowRoot({ className, density = "default", disabled, ref, selected, variant = "plain", ...props }) {
|
|
14
|
+
return (_jsx("div", { ...props, ...rowDataAttributes({ density, disabled, selected, variant }), ref: ref, className: cn("zvk-ui-list-row", className) }));
|
|
15
|
+
}
|
|
16
|
+
function ListRowLeading({ className, ref, ...props }) {
|
|
17
|
+
return _jsx("div", { ...props, ref: ref, className: cn("zvk-ui-list-row__leading", className) });
|
|
18
|
+
}
|
|
19
|
+
function ListRowContent({ className, ref, ...props }) {
|
|
20
|
+
return _jsx("div", { ...props, ref: ref, className: cn("zvk-ui-list-row__content", className) });
|
|
21
|
+
}
|
|
22
|
+
function ListRowTitle({ className, ref, ...props }) {
|
|
23
|
+
return _jsx("h3", { ...props, ref: ref, className: cn("zvk-ui-list-row__title", className) });
|
|
24
|
+
}
|
|
25
|
+
function ListRowDescription({ className, ref, ...props }) {
|
|
26
|
+
return _jsx("p", { ...props, ref: ref, className: cn("zvk-ui-list-row__description", className) });
|
|
27
|
+
}
|
|
28
|
+
function ListRowMeta({ className, ref, ...props }) {
|
|
29
|
+
return _jsx("div", { ...props, ref: ref, className: cn("zvk-ui-list-row__meta", className) });
|
|
30
|
+
}
|
|
31
|
+
function ListRowTrailing({ className, ref, ...props }) {
|
|
32
|
+
return _jsx("div", { ...props, ref: ref, className: cn("zvk-ui-list-row__trailing", className) });
|
|
33
|
+
}
|
|
34
|
+
function ListRowActions({ className, ref, ...props }) {
|
|
35
|
+
return _jsx("div", { ...props, ref: ref, className: cn("zvk-ui-list-row__actions", className) });
|
|
36
|
+
}
|
|
37
|
+
function ListRowButton({ className, density = "default", disabled, ref, selected, type = "button", variant = "plain", ...props }) {
|
|
38
|
+
return (_jsx("button", { ...props, ...rowDataAttributes({ density, disabled, selected, variant }), ref: ref, className: cn("zvk-ui-list-row", "zvk-ui-list-row--action", className), disabled: disabled, type: type }));
|
|
39
|
+
}
|
|
40
|
+
function ListRowLink({ className, density = "default", disabled, onClick, ref, selected, tabIndex, variant = "plain", ...props }) {
|
|
41
|
+
return (_jsx("a", { ...props, ...rowDataAttributes({ density, disabled, selected, variant }), ref: ref, "aria-disabled": disabled ? true : props["aria-disabled"], className: cn("zvk-ui-list-row", "zvk-ui-list-row--action", className), onClick: (event) => {
|
|
42
|
+
if (disabled) {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
event.stopPropagation();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
onClick?.(event);
|
|
48
|
+
}, tabIndex: disabled ? -1 : tabIndex }));
|
|
49
|
+
}
|
|
50
|
+
export const ListRow = Object.assign(ListRowRoot, {
|
|
51
|
+
Actions: ListRowActions,
|
|
52
|
+
Button: ListRowButton,
|
|
53
|
+
Content: ListRowContent,
|
|
54
|
+
Description: ListRowDescription,
|
|
55
|
+
Leading: ListRowLeading,
|
|
56
|
+
Link: ListRowLink,
|
|
57
|
+
Meta: ListRowMeta,
|
|
58
|
+
Title: ListRowTitle,
|
|
59
|
+
Trailing: ListRowTrailing
|
|
60
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { FloatingPlacement } from "../../internal/floating/index.js";
|
|
3
|
+
import type { PortalProps } from "../../internal/portal/index.js";
|
|
4
|
+
export interface MultiSelectOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
keywords?: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export type MultiSelectSize = "sm" | "md" | "lg";
|
|
11
|
+
export interface MultiSelectProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "name" | "onChange" | "size" | "value"> {
|
|
12
|
+
clearable?: boolean;
|
|
13
|
+
collisionPadding?: number;
|
|
14
|
+
container?: PortalProps["container"];
|
|
15
|
+
defaultValue?: readonly string[];
|
|
16
|
+
description?: React.ReactNode;
|
|
17
|
+
emptyState?: React.ReactNode;
|
|
18
|
+
error?: React.ReactNode;
|
|
19
|
+
invalid?: boolean;
|
|
20
|
+
label?: React.ReactNode;
|
|
21
|
+
matchTriggerWidth?: boolean;
|
|
22
|
+
maxSelected?: number;
|
|
23
|
+
name?: string;
|
|
24
|
+
onValueChange?: (value: string[]) => void;
|
|
25
|
+
options: readonly MultiSelectOption[];
|
|
26
|
+
placement?: FloatingPlacement;
|
|
27
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
28
|
+
sideOffset?: number;
|
|
29
|
+
size?: MultiSelectSize;
|
|
30
|
+
value?: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
export declare function MultiSelect({ "aria-describedby": ariaDescribedBy, className, clearable, collisionPadding, container, defaultValue, description, disabled, emptyState, error, id, invalid, label, matchTriggerWidth, maxSelected, name, onBlur, onFocus, onKeyDown, onValueChange, options, placeholder, placement, ref, required, sideOffset, size, value, ...props }: MultiSelectProps): React.JSX.Element;
|