@inkra/react 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +316 -2
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/Yozai-OFL.txt +94 -0
- package/dist/Button.d.ts +36 -0
- package/dist/Button.js +89 -0
- package/dist/PencilIcon.d.ts +22 -0
- package/dist/PencilIcon.js +210 -0
- package/dist/PencilLine.d.ts +10 -0
- package/dist/PencilLine.js +91 -0
- package/dist/PencilSurface.d.ts +19 -0
- package/dist/PencilSurface.js +19 -0
- package/dist/PencilText.d.ts +16 -0
- package/dist/PencilText.js +338 -0
- package/dist/accordion/Accordion.d.ts +27 -0
- package/dist/accordion/Accordion.js +40 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +1 -0
- package/dist/alert-dialog/index.d.ts +64 -0
- package/dist/alert-dialog/index.js +109 -0
- package/dist/assets/ui-hand-yozai.woff2 +0 -0
- package/dist/audio-player/index.d.ts +60 -0
- package/dist/audio-player/index.js +101 -0
- package/dist/breadcrumb/index.d.ts +16 -0
- package/dist/breadcrumb/index.js +25 -0
- package/dist/calendar/index.d.ts +21 -0
- package/dist/calendar/index.js +41 -0
- package/dist/carousel/index.d.ts +51 -0
- package/dist/carousel/index.js +290 -0
- package/dist/choice-grid/index.d.ts +38 -0
- package/dist/choice-grid/index.js +85 -0
- package/dist/color-picker/color.d.ts +15 -0
- package/dist/color-picker/color.js +55 -0
- package/dist/color-picker/index.d.ts +31 -0
- package/dist/color-picker/index.js +69 -0
- package/dist/command/index.d.ts +23 -0
- package/dist/command/index.js +39 -0
- package/dist/content/index.d.ts +106 -0
- package/dist/content/index.js +80 -0
- package/dist/context-menu/index.d.ts +76 -0
- package/dist/context-menu/index.js +240 -0
- package/dist/data-table/index.d.ts +47 -0
- package/dist/data-table/index.js +91 -0
- package/dist/date-picker/index.d.ts +50 -0
- package/dist/date-picker/index.js +180 -0
- package/dist/day-agenda/index.d.ts +43 -0
- package/dist/day-agenda/index.js +47 -0
- package/dist/day-agenda/layout.d.ts +20 -0
- package/dist/day-agenda/layout.js +60 -0
- package/dist/display/ProgressRing.d.ts +6 -0
- package/dist/display/ProgressRing.js +146 -0
- package/dist/display/index.d.ts +59 -0
- package/dist/display/index.js +75 -0
- package/dist/dockable-panel/index.d.ts +41 -0
- package/dist/dockable-panel/index.js +253 -0
- package/dist/dockable-panel/model.d.ts +21 -0
- package/dist/dockable-panel/model.js +61 -0
- package/dist/drawer/index.d.ts +63 -0
- package/dist/drawer/index.js +86 -0
- package/dist/dropdown-menu/index.d.ts +34 -0
- package/dist/dropdown-menu/index.js +40 -0
- package/dist/editable/index.d.ts +53 -0
- package/dist/editable/index.js +162 -0
- package/dist/empty/index.d.ts +21 -0
- package/dist/empty/index.js +23 -0
- package/dist/flip/index.d.ts +49 -0
- package/dist/flip/index.js +138 -0
- package/dist/form/EditablePencilText.d.ts +13 -0
- package/dist/form/EditablePencilText.js +323 -0
- package/dist/form/Field.d.ts +13 -0
- package/dist/form/Field.js +26 -0
- package/dist/form/Input.d.ts +27 -0
- package/dist/form/Input.js +97 -0
- package/dist/form/InputAction.d.ts +7 -0
- package/dist/form/InputAction.js +24 -0
- package/dist/form/Textarea.d.ts +17 -0
- package/dist/form/Textarea.js +102 -0
- package/dist/form/context.d.ts +12 -0
- package/dist/form/context.js +10 -0
- package/dist/form/controlProps.d.ts +23 -0
- package/dist/form/controlProps.js +20 -0
- package/dist/form/index.d.ts +7 -0
- package/dist/form/index.js +3 -0
- package/dist/form/types.d.ts +6 -0
- package/dist/form/types.js +1 -0
- package/dist/heatmap/index.d.ts +59 -0
- package/dist/heatmap/index.js +248 -0
- package/dist/hotkey/index.d.ts +37 -0
- package/dist/hotkey/index.js +130 -0
- package/dist/hotkey/model.d.ts +27 -0
- package/dist/hotkey/model.js +97 -0
- package/dist/hover-card/index.d.ts +33 -0
- package/dist/hover-card/index.js +141 -0
- package/dist/image-cropper/index.d.ts +82 -0
- package/dist/image-cropper/index.js +261 -0
- package/dist/image-cropper/model.d.ts +42 -0
- package/dist/image-cropper/model.js +94 -0
- package/dist/image-viewer/index.d.ts +79 -0
- package/dist/image-viewer/index.js +220 -0
- package/dist/image-viewer/model.d.ts +9 -0
- package/dist/image-viewer/model.js +18 -0
- package/dist/images/layers-2x.png +0 -0
- package/dist/images/layers.png +0 -0
- package/dist/images/marker-icon.png +0 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.js +69 -0
- package/dist/input-number/index.d.ts +16 -0
- package/dist/input-number/index.js +77 -0
- package/dist/internal/InputActionContext.d.ts +1 -0
- package/dist/internal/InputActionContext.js +3 -0
- package/dist/internal/cache.d.ts +14 -0
- package/dist/internal/cache.js +54 -0
- package/dist/internal/line.d.ts +4 -0
- package/dist/internal/line.js +21 -0
- package/dist/internal/paper.d.ts +1 -0
- package/dist/internal/paper.js +65 -0
- package/dist/internal/random.d.ts +3 -0
- package/dist/internal/random.js +30 -0
- package/dist/internal/recovery.d.ts +1 -0
- package/dist/internal/recovery.js +52 -0
- package/dist/internal/renderTokens.d.ts +10 -0
- package/dist/internal/renderTokens.js +13 -0
- package/dist/internal/stroke.d.ts +24 -0
- package/dist/internal/stroke.js +144 -0
- package/dist/internal/surfaceRenderer.d.ts +41 -0
- package/dist/internal/surfaceRenderer.js +178 -0
- package/dist/internal/textQueue.d.ts +1 -0
- package/dist/internal/textQueue.js +37 -0
- package/dist/internal/textRenderer.d.ts +28 -0
- package/dist/internal/textRenderer.js +239 -0
- package/dist/internal/travelIcons.d.ts +24 -0
- package/dist/internal/travelIcons.js +14 -0
- package/dist/internal/useBrowserLayoutEffect.d.ts +2 -0
- package/dist/internal/useBrowserLayoutEffect.js +3 -0
- package/dist/internal/usePencilSurface.d.ts +3 -0
- package/dist/internal/usePencilSurface.js +116 -0
- package/dist/internal/useSelectionDrawing.d.ts +2 -0
- package/dist/internal/useSelectionDrawing.js +90 -0
- package/dist/internal/wash.d.ts +16 -0
- package/dist/internal/wash.js +149 -0
- package/dist/journey-map/MapScale.d.ts +4 -0
- package/dist/journey-map/MapScale.js +54 -0
- package/dist/journey-map/index.d.ts +39 -0
- package/dist/journey-map/index.js +197 -0
- package/dist/journey-map/terrain.d.ts +8 -0
- package/dist/journey-map/terrain.js +127 -0
- package/dist/keypad/index.d.ts +23 -0
- package/dist/keypad/index.js +63 -0
- package/dist/keypad/model.d.ts +20 -0
- package/dist/keypad/model.js +33 -0
- package/dist/layout/index.d.ts +63 -0
- package/dist/layout/index.js +62 -0
- package/dist/log/index.d.ts +45 -0
- package/dist/log/index.js +159 -0
- package/dist/log/model.d.ts +16 -0
- package/dist/log/model.js +13 -0
- package/dist/node-graph/index.d.ts +123 -0
- package/dist/node-graph/index.js +304 -0
- package/dist/number-ticker/index.d.ts +29 -0
- package/dist/number-ticker/index.js +132 -0
- package/dist/number-ticker/model.d.ts +8 -0
- package/dist/number-ticker/model.js +34 -0
- package/dist/overflow-list/index.d.ts +39 -0
- package/dist/overflow-list/index.js +230 -0
- package/dist/overflow-list/layout.d.ts +19 -0
- package/dist/overflow-list/layout.js +44 -0
- package/dist/overlay/Overlay.d.ts +65 -0
- package/dist/overlay/Overlay.js +77 -0
- package/dist/overlay/Popover.d.ts +43 -0
- package/dist/overlay/Popover.js +45 -0
- package/dist/overlay/index.d.ts +4 -0
- package/dist/overlay/index.js +2 -0
- package/dist/overlay/themeBridge.d.ts +8 -0
- package/dist/overlay/themeBridge.js +98 -0
- package/dist/pagination/index.d.ts +23 -0
- package/dist/pagination/index.js +41 -0
- package/dist/pagination/model.d.ts +4 -0
- package/dist/pagination/model.js +42 -0
- package/dist/pan-zoom/index.d.ts +71 -0
- package/dist/pan-zoom/index.js +175 -0
- package/dist/pencil.d.ts +10 -0
- package/dist/pencil.js +39 -0
- package/dist/radar/index.d.ts +54 -0
- package/dist/radar/index.js +220 -0
- package/dist/range-slider/index.d.ts +16 -0
- package/dist/range-slider/index.js +22 -0
- package/dist/rating/index.d.ts +28 -0
- package/dist/rating/index.js +127 -0
- package/dist/resizable/index.d.ts +32 -0
- package/dist/resizable/index.js +50 -0
- package/dist/scroll-area/index.d.ts +36 -0
- package/dist/scroll-area/index.js +44 -0
- package/dist/segmented-progress/SegmentedProgress.d.ts +17 -0
- package/dist/segmented-progress/SegmentedProgress.js +42 -0
- package/dist/select/MultipleSelect.d.ts +44 -0
- package/dist/select/MultipleSelect.js +124 -0
- package/dist/select/SearchableSelect.d.ts +45 -0
- package/dist/select/SearchableSelect.js +50 -0
- package/dist/select/Select.d.ts +109 -0
- package/dist/select/Select.js +205 -0
- package/dist/select/index.d.ts +4 -0
- package/dist/select/index.js +2 -0
- package/dist/selection/Checkbox.d.ts +9 -0
- package/dist/selection/Checkbox.js +37 -0
- package/dist/selection/RadioGroup.d.ts +23 -0
- package/dist/selection/RadioGroup.js +82 -0
- package/dist/selection/Switch.d.ts +8 -0
- package/dist/selection/Switch.js +36 -0
- package/dist/selection/index.d.ts +6 -0
- package/dist/selection/index.js +3 -0
- package/dist/selection/useNativeChecked.d.ts +13 -0
- package/dist/selection/useNativeChecked.js +27 -0
- package/dist/slider/index.d.ts +11 -0
- package/dist/slider/index.js +45 -0
- package/dist/slot/index.d.ts +24 -0
- package/dist/slot/index.js +29 -0
- package/dist/sortable/index.d.ts +50 -0
- package/dist/sortable/index.js +278 -0
- package/dist/sortable/model.d.ts +30 -0
- package/dist/sortable/model.js +64 -0
- package/dist/sparkline/index.d.ts +19 -0
- package/dist/sparkline/index.js +240 -0
- package/dist/sparkline/model.d.ts +16 -0
- package/dist/sparkline/model.js +28 -0
- package/dist/steps/index.d.ts +16 -0
- package/dist/steps/index.js +37 -0
- package/dist/styles.css +8226 -0
- package/dist/tabs/index.d.ts +22 -0
- package/dist/tabs/index.js +42 -0
- package/dist/tag-input/index.d.ts +69 -0
- package/dist/tag-input/index.js +325 -0
- package/dist/tag-input/model.d.ts +14 -0
- package/dist/tag-input/model.js +38 -0
- package/dist/time-picker/index.d.ts +15 -0
- package/dist/time-picker/index.js +168 -0
- package/dist/timeline/index.d.ts +14 -0
- package/dist/timeline/index.js +16 -0
- package/dist/toast/index.d.ts +27 -0
- package/dist/toast/index.js +36 -0
- package/dist/toggle-group/index.d.ts +17 -0
- package/dist/toggle-group/index.js +26 -0
- package/dist/tokens.css +356 -0
- package/dist/tooltip/Tooltip.d.ts +24 -0
- package/dist/tooltip/Tooltip.js +32 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/transfer/index.d.ts +64 -0
- package/dist/transfer/index.js +174 -0
- package/dist/transfer/model.d.ts +12 -0
- package/dist/transfer/model.js +33 -0
- package/dist/tree/index.d.ts +39 -0
- package/dist/tree/index.js +36 -0
- package/dist/tree-select/index.d.ts +59 -0
- package/dist/tree-select/index.js +142 -0
- package/dist/tree-select/model.d.ts +31 -0
- package/dist/tree-select/model.js +135 -0
- package/dist/typewriter/index.d.ts +21 -0
- package/dist/typewriter/index.js +101 -0
- package/dist/typewriter/model.d.ts +7 -0
- package/dist/typewriter/model.js +45 -0
- package/dist/upload/index.d.ts +59 -0
- package/dist/upload/index.js +230 -0
- package/dist/virtual-list/index.d.ts +44 -0
- package/dist/virtual-list/index.js +128 -0
- package/dist/virtual-list/model.d.ts +7 -0
- package/dist/virtual-list/model.js +27 -0
- package/package.json +119 -4
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, forwardRef, useContext, useId, useImperativeHandle, useRef, } from 'react';
|
|
3
|
+
import { PencilSurface } from '../PencilSurface.js';
|
|
4
|
+
import { PencilText } from '../PencilText.js';
|
|
5
|
+
import { Checkbox } from '../selection/Checkbox.js';
|
|
6
|
+
import { RadioGroup, RadioGroupItem } from '../selection/RadioGroup.js';
|
|
7
|
+
const classes = (...values) => values.filter(Boolean).join(' ');
|
|
8
|
+
function mergeIds(...values) {
|
|
9
|
+
const merged = Array.from(new Set(values.flatMap(value => value?.split(/\s+/).filter(Boolean) ?? [])));
|
|
10
|
+
return merged.length ? merged.join(' ') : undefined;
|
|
11
|
+
}
|
|
12
|
+
const ChoiceGridContext = createContext(null);
|
|
13
|
+
function GroupMessages({ description, descriptionId, error, errorId }) {
|
|
14
|
+
return description == null && error == null ? null : (_jsxs("div", { className: "inkra-choice-grid__messages", children: [description == null ? null : (_jsx("div", { className: "inkra-choice-grid__description", id: descriptionId, children: typeof description === 'string'
|
|
15
|
+
? _jsx(PencilText, { seed: `${descriptionId}-text`, children: description })
|
|
16
|
+
: description })), error == null ? null : (_jsx("div", { className: "inkra-choice-grid__error", id: errorId, children: typeof error === 'string'
|
|
17
|
+
? _jsx(PencilText, { seed: `${errorId}-text`, children: error })
|
|
18
|
+
: error }))] }));
|
|
19
|
+
}
|
|
20
|
+
function gridStyle(style, columns, minItemWidth) {
|
|
21
|
+
return {
|
|
22
|
+
...style,
|
|
23
|
+
'--inkra-choice-grid-columns': columns,
|
|
24
|
+
'--inkra-choice-grid-min-item': minItemWidth,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export const ChoiceGrid = forwardRef(function ChoiceGrid(props, forwardedRef) {
|
|
28
|
+
const { 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, children, className, columns, description, disabled = false, error, form, label, minItemWidth = '13rem', name, style, type = 'single', ...rest } = props;
|
|
29
|
+
const generatedId = useId();
|
|
30
|
+
const descriptionId = description == null ? undefined : `inkra-choice-grid-${generatedId}-description`;
|
|
31
|
+
const errorId = error == null ? undefined : `inkra-choice-grid-${generatedId}-error`;
|
|
32
|
+
const describedBy = mergeIds(ariaDescribedBy, descriptionId, errorId);
|
|
33
|
+
const errorMessage = mergeIds(ariaErrorMessage, errorId);
|
|
34
|
+
const invalid = Boolean(error) || rest['aria-invalid'] === true || rest['aria-invalid'] === 'true';
|
|
35
|
+
const rootRef = useRef(null);
|
|
36
|
+
useImperativeHandle(forwardedRef, () => rootRef.current);
|
|
37
|
+
if (type === 'single') {
|
|
38
|
+
const single = props;
|
|
39
|
+
const { defaultValue: _defaultValue, onValueChange: _onValueChange, value: _value, ...singleFieldsetProps } = rest;
|
|
40
|
+
return (_jsxs("div", { className: classes('inkra-choice-grid', className), "data-columns": columns, "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-type": "single", style: gridStyle(style, columns, minItemWidth), children: [_jsx(ChoiceGridContext.Provider, { value: { disabled, form, mode: 'single', name }, children: _jsx(RadioGroup, { ...singleFieldsetProps, "aria-describedby": describedBy, "aria-errormessage": errorMessage, "aria-invalid": invalid || undefined, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, defaultValue: single.defaultValue, disabled: disabled, form: form, label: label, name: name, onValueChange: single.onValueChange, ref: rootRef, value: single.value, children: children }) }), _jsx(GroupMessages, { description: description, descriptionId: descriptionId, error: error, errorId: errorId })] }));
|
|
41
|
+
}
|
|
42
|
+
const multiple = props;
|
|
43
|
+
const { defaultValues: _defaultValues, onValuesChange: _onValuesChange, values: _values, ...multipleFieldsetProps } = rest;
|
|
44
|
+
const onMultipleChange = (optionValue, checked) => {
|
|
45
|
+
if (!multiple.onValuesChange)
|
|
46
|
+
return;
|
|
47
|
+
const selected = Array.from(rootRef.current?.querySelectorAll('input[type="checkbox"][data-choice-grid-value]') ?? []).filter(input => input.value === optionValue ? checked : input.checked)
|
|
48
|
+
.map(input => input.value);
|
|
49
|
+
multiple.onValuesChange(selected);
|
|
50
|
+
};
|
|
51
|
+
const context = {
|
|
52
|
+
defaultValues: multiple.defaultValues,
|
|
53
|
+
disabled,
|
|
54
|
+
form,
|
|
55
|
+
mode: 'multiple',
|
|
56
|
+
name,
|
|
57
|
+
onMultipleChange,
|
|
58
|
+
values: multiple.values,
|
|
59
|
+
};
|
|
60
|
+
return (_jsxs("fieldset", { ...multipleFieldsetProps, "aria-describedby": describedBy, "aria-errormessage": errorMessage, "aria-invalid": invalid || undefined, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: classes('inkra-choice-grid', className), "data-columns": columns, "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-type": "multiple", disabled: disabled, form: form, ref: rootRef, style: gridStyle(style, columns, minItemWidth), children: [label == null ? null : typeof label === 'string' ? (_jsx(PencilText, { as: "legend", className: "inkra-choice-grid__legend", seed: `inkra-choice-grid-${generatedId}-label`, children: label })) : _jsx("legend", { className: "inkra-choice-grid__legend", children: label }), _jsx(ChoiceGridContext.Provider, { value: context, children: _jsx("div", { className: "inkra-choice-grid__items", children: children }) }), _jsx(GroupMessages, { description: description, descriptionId: descriptionId, error: error, errorId: errorId })] }));
|
|
61
|
+
});
|
|
62
|
+
function OptionMedia({ icon, image }) {
|
|
63
|
+
if (image) {
|
|
64
|
+
return (_jsx("span", { "aria-hidden": "true", className: "inkra-choice-grid__media", "data-kind": "image", children: _jsx("img", { ...image, alt: "" }) }));
|
|
65
|
+
}
|
|
66
|
+
if (icon != null) {
|
|
67
|
+
return _jsx("span", { "aria-hidden": "true", className: "inkra-choice-grid__media", "data-kind": "icon", children: icon });
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
export const ChoiceGridOption = forwardRef(function ChoiceGridOption({ className, description, disabled = false, form, icon, id, image, label, onChange, required = false, seed, value, ...props }, ref) {
|
|
72
|
+
const context = useContext(ChoiceGridContext);
|
|
73
|
+
if (!context)
|
|
74
|
+
throw new Error('ChoiceGridOption must be rendered inside ChoiceGrid');
|
|
75
|
+
const generatedId = useId();
|
|
76
|
+
const inputId = id ?? `inkra-choice-grid-option-${generatedId}`;
|
|
77
|
+
const resolvedSeed = seed ?? inputId;
|
|
78
|
+
const itemDisabled = context.disabled || disabled;
|
|
79
|
+
const content = (_jsxs(_Fragment, { children: [_jsx(OptionMedia, { icon: icon, image: image }), _jsx("span", { className: "inkra-choice-grid__option-label", children: label })] }));
|
|
80
|
+
const control = context.mode === 'single' ? (_jsx(RadioGroupItem, { ...props, className: "inkra-choice-grid__control", description: description, disabled: itemDisabled, form: form ?? context.form, id: inputId, label: content, onChange: onChange, ref: ref, required: required, seed: resolvedSeed, value: value })) : (_jsx(Checkbox, { ...props, checked: context.values === undefined ? undefined : context.values.includes(value), className: "inkra-choice-grid__control", "data-choice-grid-value": "", defaultChecked: context.values === undefined ? context.defaultValues?.includes(value) : undefined, description: description, disabled: itemDisabled, form: form ?? context.form, id: inputId, label: content, name: context.name, onChange: (event) => {
|
|
81
|
+
onChange?.(event);
|
|
82
|
+
context.onMultipleChange?.(value, event.currentTarget.checked);
|
|
83
|
+
}, ref: ref, required: required, seed: resolvedSeed, value: value }));
|
|
84
|
+
return (_jsxs(PencilSurface, { as: "div", className: classes('inkra-choice-grid__option', className), "data-disabled": itemDisabled || undefined, radius: 8, seed: `${resolvedSeed}-paper`, variant: "paper", children: [_jsx(PencilSurface, { "aria-hidden": "true", as: "span", className: "inkra-choice-grid__selection", radius: 8, seed: `${resolvedSeed}-selection`, variant: "selection" }), control, _jsx(PencilSurface, { "aria-hidden": "true", as: "span", className: "inkra-choice-grid__outline", radius: 8, seed: `${resolvedSeed}-outline`, variant: "outline" })] }));
|
|
85
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DEFAULT_COLOR_VALUE = "#4b96aaff";
|
|
2
|
+
export interface ColorChannels {
|
|
3
|
+
red: number;
|
|
4
|
+
green: number;
|
|
5
|
+
blue: number;
|
|
6
|
+
alpha: number;
|
|
7
|
+
}
|
|
8
|
+
export type ColorValue = `#${string}`;
|
|
9
|
+
export declare function parseColorValue(input: string): ColorChannels | null;
|
|
10
|
+
export declare function formatColorValue(channels: ColorChannels): ColorValue;
|
|
11
|
+
export declare function normalizeColorValue(input: string): ColorValue | null;
|
|
12
|
+
export declare function colorRgbValue(input: string): `#${string}` | null;
|
|
13
|
+
export declare function colorAlphaPercent(input: string): number;
|
|
14
|
+
export declare function withColorAlpha(input: string, percentage: number): ColorValue | null;
|
|
15
|
+
export declare function withColorRgb(input: string, rgb: string): ColorValue | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const DEFAULT_COLOR_VALUE = '#4b96aaff';
|
|
2
|
+
const HEX_COLOR = /^#([\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i;
|
|
3
|
+
function expandHex(value) {
|
|
4
|
+
return value.length <= 4
|
|
5
|
+
? [...value].map(character => `${character}${character}`).join('')
|
|
6
|
+
: value;
|
|
7
|
+
}
|
|
8
|
+
export function parseColorValue(input) {
|
|
9
|
+
const value = input.trim();
|
|
10
|
+
const match = HEX_COLOR.exec(value);
|
|
11
|
+
if (!match)
|
|
12
|
+
return null;
|
|
13
|
+
const expanded = expandHex(match[1]);
|
|
14
|
+
const opaque = expanded.length === 6;
|
|
15
|
+
return {
|
|
16
|
+
red: Number.parseInt(expanded.slice(0, 2), 16),
|
|
17
|
+
green: Number.parseInt(expanded.slice(2, 4), 16),
|
|
18
|
+
blue: Number.parseInt(expanded.slice(4, 6), 16),
|
|
19
|
+
alpha: opaque ? 255 : Number.parseInt(expanded.slice(6, 8), 16),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function channelToHex(channel) {
|
|
23
|
+
return Math.min(255, Math.max(0, Math.round(channel))).toString(16).padStart(2, '0');
|
|
24
|
+
}
|
|
25
|
+
export function formatColorValue(channels) {
|
|
26
|
+
return `#${channelToHex(channels.red)}${channelToHex(channels.green)}${channelToHex(channels.blue)}${channelToHex(channels.alpha)}`;
|
|
27
|
+
}
|
|
28
|
+
export function normalizeColorValue(input) {
|
|
29
|
+
const channels = parseColorValue(input);
|
|
30
|
+
return channels ? formatColorValue(channels) : null;
|
|
31
|
+
}
|
|
32
|
+
export function colorRgbValue(input) {
|
|
33
|
+
const channels = parseColorValue(input);
|
|
34
|
+
return channels ? `#${channelToHex(channels.red)}${channelToHex(channels.green)}${channelToHex(channels.blue)}` : null;
|
|
35
|
+
}
|
|
36
|
+
export function colorAlphaPercent(input) {
|
|
37
|
+
const channels = parseColorValue(input) ?? parseColorValue(DEFAULT_COLOR_VALUE);
|
|
38
|
+
return Math.round(channels.alpha / 255 * 100);
|
|
39
|
+
}
|
|
40
|
+
export function withColorAlpha(input, percentage) {
|
|
41
|
+
const channels = parseColorValue(input);
|
|
42
|
+
if (!channels)
|
|
43
|
+
return null;
|
|
44
|
+
return formatColorValue({
|
|
45
|
+
...channels,
|
|
46
|
+
alpha: Math.round(Math.min(100, Math.max(0, percentage)) / 100 * 255),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function withColorRgb(input, rgb) {
|
|
50
|
+
const current = parseColorValue(input);
|
|
51
|
+
const next = parseColorValue(rgb);
|
|
52
|
+
if (!current || !next)
|
|
53
|
+
return null;
|
|
54
|
+
return formatColorValue({ ...next, alpha: current.alpha });
|
|
55
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FieldsetHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { ColorValue } from './color.js';
|
|
3
|
+
export interface ColorPreset {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ColorPickerLabels {
|
|
8
|
+
palette?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
alpha?: string;
|
|
11
|
+
presets?: string;
|
|
12
|
+
invalid?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ColorPickerChangeDetails {
|
|
15
|
+
source: 'palette' | 'alpha' | 'input' | 'preset';
|
|
16
|
+
}
|
|
17
|
+
export interface ColorPickerProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'defaultValue' | 'onChange' | 'value'> {
|
|
18
|
+
value?: string;
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
onValueChange?: (value: ColorValue, details: ColorPickerChangeDetails) => void;
|
|
21
|
+
onInvalidInput?: (input: string) => void;
|
|
22
|
+
presets?: readonly (string | ColorPreset)[];
|
|
23
|
+
label?: ReactNode;
|
|
24
|
+
labels?: ColorPickerLabels;
|
|
25
|
+
name?: string;
|
|
26
|
+
showAlpha?: boolean;
|
|
27
|
+
seed?: string | number;
|
|
28
|
+
}
|
|
29
|
+
export declare function ColorPicker({ className, defaultValue, disabled, id, label, labels, name, onInvalidInput, onValueChange, presets, seed, showAlpha, value, ...props }: ColorPickerProps): import("react").JSX.Element;
|
|
30
|
+
export { DEFAULT_COLOR_VALUE, colorAlphaPercent, colorRgbValue, formatColorValue, normalizeColorValue, parseColorValue, withColorAlpha, withColorRgb, } from './color.js';
|
|
31
|
+
export type { ColorChannels, ColorValue } from './color.js';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useMemo, useState } from 'react';
|
|
3
|
+
import { Input } from '../form/Input.js';
|
|
4
|
+
import { PencilLine } from '../PencilLine.js';
|
|
5
|
+
import { PencilSurface } from '../PencilSurface.js';
|
|
6
|
+
import { PencilText } from '../PencilText.js';
|
|
7
|
+
import { Slider } from '../slider/index.js';
|
|
8
|
+
import { DEFAULT_COLOR_VALUE, colorAlphaPercent, colorRgbValue, normalizeColorValue, withColorAlpha, withColorRgb, } from './color.js';
|
|
9
|
+
const defaultLabels = {
|
|
10
|
+
palette: 'Open color palette',
|
|
11
|
+
value: 'Color value',
|
|
12
|
+
alpha: 'Opacity',
|
|
13
|
+
presets: 'Color presets',
|
|
14
|
+
invalid: 'Use #RGB, #RGBA, #RRGGBB, or #RRGGBBAA.',
|
|
15
|
+
};
|
|
16
|
+
function presetData(preset) {
|
|
17
|
+
const input = typeof preset === 'string' ? preset : preset.value;
|
|
18
|
+
const value = normalizeColorValue(input);
|
|
19
|
+
if (!value)
|
|
20
|
+
return null;
|
|
21
|
+
return { value, label: typeof preset === 'string' ? value : preset.label ?? value };
|
|
22
|
+
}
|
|
23
|
+
export function ColorPicker({ className, defaultValue = DEFAULT_COLOR_VALUE, disabled = false, id, label = 'Color', labels, name, onInvalidInput, onValueChange, presets = [], seed, showAlpha = true, value, ...props }) {
|
|
24
|
+
const generatedId = useId();
|
|
25
|
+
const resolvedId = id ?? `inkra-color-picker-${generatedId}`;
|
|
26
|
+
const resolvedSeed = seed ?? resolvedId;
|
|
27
|
+
const controlledValue = value === undefined ? null : normalizeColorValue(value);
|
|
28
|
+
const normalizedDefault = normalizeColorValue(defaultValue) ?? DEFAULT_COLOR_VALUE;
|
|
29
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(normalizedDefault);
|
|
30
|
+
const currentValue = controlledValue ?? (value === undefined ? uncontrolledValue : DEFAULT_COLOR_VALUE);
|
|
31
|
+
const [draft, setDraft] = useState(currentValue);
|
|
32
|
+
const copy = { ...defaultLabels, ...labels };
|
|
33
|
+
const parsedPresets = useMemo(() => presets.map(presetData).filter((preset) => preset !== null), [presets]);
|
|
34
|
+
const inputInvalid = normalizeColorValue(draft) === null;
|
|
35
|
+
const rgbValue = colorRgbValue(currentValue) ?? '#4b96aa';
|
|
36
|
+
const alpha = colorAlphaPercent(currentValue);
|
|
37
|
+
useEffect(() => setDraft(currentValue), [currentValue]);
|
|
38
|
+
const commit = (next, source) => {
|
|
39
|
+
if (value === undefined)
|
|
40
|
+
setUncontrolledValue(next);
|
|
41
|
+
else
|
|
42
|
+
setDraft(currentValue);
|
|
43
|
+
onValueChange?.(next, { source });
|
|
44
|
+
};
|
|
45
|
+
const submitDraft = () => {
|
|
46
|
+
const normalized = normalizeColorValue(draft);
|
|
47
|
+
if (normalized)
|
|
48
|
+
commit(normalized, 'input');
|
|
49
|
+
else
|
|
50
|
+
onInvalidInput?.(draft);
|
|
51
|
+
};
|
|
52
|
+
return _jsxs("fieldset", { ...props, className: ['inkra-color-picker', className].filter(Boolean).join(' '), "data-alpha": showAlpha || undefined, "data-controlled": value !== undefined || undefined, "data-invalid-value": value !== undefined && controlledValue === null || undefined, disabled: disabled, id: resolvedId, children: [_jsx("legend", { className: "inkra-color-picker__legend", children: typeof label === 'string' ? _jsx(PencilText, { seed: `${resolvedSeed}-legend`, children: label }) : label }), _jsxs("div", { className: "inkra-color-picker__main", children: [_jsxs("label", { className: "inkra-color-picker__palette", "aria-label": copy.palette, title: copy.palette, children: [_jsx("span", { className: "inkra-color-picker__checker", "aria-hidden": "true" }), _jsx("span", { className: "inkra-color-picker__current", "aria-hidden": "true", style: { backgroundColor: currentValue } }), _jsx(PencilSurface, { as: "span", "aria-hidden": "true", className: "inkra-color-picker__palette-outline", variant: "outline", seed: `${resolvedSeed}-palette` }), _jsx("input", { "aria-label": copy.palette, className: "inkra-color-picker__native", disabled: disabled, type: "color", value: rgbValue, onChange: event => {
|
|
53
|
+
const next = withColorRgb(currentValue, event.currentTarget.value);
|
|
54
|
+
if (next)
|
|
55
|
+
commit(next, 'palette');
|
|
56
|
+
} })] }), _jsxs("div", { className: "inkra-color-picker__value-field", children: [_jsx("label", { className: "inkra-color-picker__label", htmlFor: `${resolvedId}-value`, children: _jsx(PencilText, { seed: `${resolvedSeed}-value-label`, children: copy.value }) }), _jsx(Input, { id: `${resolvedId}-value`, "aria-describedby": inputInvalid ? `${resolvedId}-error` : undefined, "aria-invalid": inputInvalid || undefined, autoCapitalize: "off", autoComplete: "off", className: "inkra-color-picker__input", disabled: disabled, inputMode: "text", spellCheck: false, value: draft, onBlur: submitDraft, onKeyDown: event => {
|
|
57
|
+
if (event.key === 'Enter') {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
submitDraft();
|
|
60
|
+
}
|
|
61
|
+
if (event.key === 'Escape')
|
|
62
|
+
setDraft(currentValue);
|
|
63
|
+
}, onValueChange: setDraft }), _jsx("span", { className: "inkra-color-picker__error", id: `${resolvedId}-error`, "aria-live": "polite", children: inputInvalid ? copy.invalid : '' })] })] }), showAlpha ? _jsxs("div", { className: "inkra-color-picker__alpha", children: [_jsxs("div", { className: "inkra-color-picker__alpha-heading", children: [_jsx("span", { id: `${resolvedId}-alpha-label`, children: _jsx(PencilText, { seed: `${resolvedSeed}-alpha-label`, children: copy.alpha }) }), _jsxs("output", { htmlFor: `${resolvedId}-alpha`, children: [alpha, "%"] })] }), _jsx(Slider, { "aria-labelledby": `${resolvedId}-alpha-label`, disabled: disabled, id: `${resolvedId}-alpha`, max: 100, min: 0, seed: `${resolvedSeed}-alpha`, value: [alpha], getValueLabel: number => `${number}%`, onValueChange: values => {
|
|
64
|
+
const next = withColorAlpha(currentValue, values[0]);
|
|
65
|
+
if (next)
|
|
66
|
+
commit(next, 'alpha');
|
|
67
|
+
} })] }) : null, parsedPresets.length ? _jsxs(_Fragment, { children: [_jsx(PencilLine, { className: "inkra-color-picker__divider", seed: `${resolvedSeed}-divider` }), _jsx("div", { className: "inkra-color-picker__presets", role: "group", "aria-label": copy.presets, children: parsedPresets.map((preset, index) => _jsxs("button", { type: "button", "aria-label": preset.label, "aria-pressed": preset.value === currentValue, className: "inkra-color-picker__preset", disabled: disabled, title: preset.label, onClick: () => commit(preset.value, 'preset'), children: [_jsx("span", { className: "inkra-color-picker__checker", "aria-hidden": "true" }), _jsx("span", { className: "inkra-color-picker__preset-color", "aria-hidden": "true", style: { backgroundColor: preset.value } }), _jsx(PencilSurface, { as: "span", "aria-hidden": "true", className: "inkra-color-picker__preset-outline", variant: preset.value === currentValue ? 'selection' : 'outline', seed: `${resolvedSeed}-preset-${index}` })] }, `${preset.value}-${index}`)) })] }) : null, name ? _jsx("input", { type: "hidden", name: name, value: currentValue }) : null] });
|
|
68
|
+
}
|
|
69
|
+
export { DEFAULT_COLOR_VALUE, colorAlphaPercent, colorRgbValue, formatColorValue, normalizeColorValue, parseColorValue, withColorAlpha, withColorRgb, } from './color.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Command as Primitive } from 'cmdk';
|
|
2
|
+
import type { ComponentPropsWithoutRef, HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
export type CommandRootProps = Omit<ComponentPropsWithoutRef<typeof Primitive>, 'asChild'>;
|
|
4
|
+
export type CommandInputProps = Omit<ComponentPropsWithoutRef<typeof Primitive.Input>, 'asChild'>;
|
|
5
|
+
export type CommandListProps = Omit<ComponentPropsWithoutRef<typeof Primitive.List>, 'asChild'>;
|
|
6
|
+
export interface CommandItemProps extends Omit<ComponentPropsWithoutRef<typeof Primitive.Item>, 'asChild'> {
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
shortcut?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export type CommandGroupProps = Omit<ComponentPropsWithoutRef<typeof Primitive.Group>, 'asChild'>;
|
|
11
|
+
export type CommandEmptyProps = Omit<ComponentPropsWithoutRef<typeof Primitive.Empty>, 'asChild'>;
|
|
12
|
+
export type CommandSeparatorProps = Omit<ComponentPropsWithoutRef<typeof Primitive.Separator>, 'asChild' | 'children'>;
|
|
13
|
+
export type CommandShortcutProps = HTMLAttributes<HTMLElement>;
|
|
14
|
+
export declare const Command: {
|
|
15
|
+
Root: import("react").ForwardRefExoticComponent<CommandRootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
Input: import("react").ForwardRefExoticComponent<CommandInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
17
|
+
List: import("react").ForwardRefExoticComponent<CommandListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Group: import("react").ForwardRefExoticComponent<CommandGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
Item: import("react").ForwardRefExoticComponent<CommandItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Empty: import("react").ForwardRefExoticComponent<CommandEmptyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
Separator: import("react").ForwardRefExoticComponent<CommandSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
Shortcut: import("react").ForwardRefExoticComponent<CommandShortcutProps & import("react").RefAttributes<HTMLElement>>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Command as Primitive } from 'cmdk';
|
|
3
|
+
import { forwardRef, useRef } from 'react';
|
|
4
|
+
import { PencilSurface } from '../PencilSurface.js';
|
|
5
|
+
import { PencilText } from '../PencilText.js';
|
|
6
|
+
import { PencilLine } from '../PencilLine.js';
|
|
7
|
+
function classes(base, extra) { return [base, extra].filter(Boolean).join(' '); }
|
|
8
|
+
function copy(value) { return typeof value === 'string' ? _jsx(PencilText, { children: value }) : value; }
|
|
9
|
+
const Root = forwardRef(function Root({ className, children, loop = true, onKeyDown, onCompositionStartCapture, onCompositionEndCapture, ...props }, ref) {
|
|
10
|
+
const composing = useRef(false);
|
|
11
|
+
return _jsx(Primitive, { ...props, ref: ref, loop: loop, className: classes('inkra-command', className), onCompositionStartCapture: event => { composing.current = true; onCompositionStartCapture?.(event); }, onCompositionEndCapture: event => { composing.current = false; onCompositionEndCapture?.(event); }, onKeyDown: event => {
|
|
12
|
+
// Capture composition state as well as native flags before cmdk handles Enter.
|
|
13
|
+
if (event.key === 'Enter' && (composing.current || event.nativeEvent.isComposing || event.keyCode === 229))
|
|
14
|
+
event.preventDefault();
|
|
15
|
+
onKeyDown?.(event);
|
|
16
|
+
}, children: _jsx(PencilSurface, { variant: "paper", radius: 8, className: "inkra-command__paper", children: children }) });
|
|
17
|
+
});
|
|
18
|
+
const Input = forwardRef(function Input({ className, ...props }, ref) {
|
|
19
|
+
return _jsxs("div", { className: "inkra-command__input-wrap", children: [_jsx(Primitive.Input, { ...props, ref: ref, className: classes('inkra-command__input', className) }), _jsx(PencilLine, { className: "inkra-command__input-line" })] });
|
|
20
|
+
});
|
|
21
|
+
const List = forwardRef(function List({ className, ...props }, ref) {
|
|
22
|
+
return _jsx(Primitive.List, { ...props, ref: ref, className: classes('inkra-command__list', className) });
|
|
23
|
+
});
|
|
24
|
+
const Item = forwardRef(function Item({ className, children, icon, shortcut, ...props }, ref) {
|
|
25
|
+
return _jsxs(Primitive.Item, { ...props, ref: ref, className: classes('inkra-command__item', className), children: [_jsx(PencilSurface, { as: "span", variant: "selection", "aria-hidden": "true", className: "inkra-command__highlight" }), icon != null && _jsx("span", { "aria-hidden": "true", className: "inkra-command__icon", children: icon }), _jsx("span", { className: "inkra-command__label", children: copy(children) }), shortcut != null && _jsx(Shortcut, { children: shortcut })] });
|
|
26
|
+
});
|
|
27
|
+
const Group = forwardRef(function Group({ className, heading, ...props }, ref) {
|
|
28
|
+
return _jsx(Primitive.Group, { ...props, heading: copy(heading), ref: ref, className: classes('inkra-command__group', className) });
|
|
29
|
+
});
|
|
30
|
+
const Empty = forwardRef(function Empty({ className, children, ...props }, ref) {
|
|
31
|
+
return _jsx(Primitive.Empty, { ...props, ref: ref, className: classes('inkra-command__empty', className), children: copy(children) });
|
|
32
|
+
});
|
|
33
|
+
const Separator = forwardRef(function Separator({ className, ...props }, ref) {
|
|
34
|
+
return _jsx(Primitive.Separator, { ...props, ref: ref, className: classes('inkra-command__separator', className), children: _jsx(PencilLine, {}) });
|
|
35
|
+
});
|
|
36
|
+
const Shortcut = forwardRef(function Shortcut({ className, children, ...props }, ref) {
|
|
37
|
+
return _jsx("kbd", { ...props, ref: ref, className: classes('inkra-command__shortcut', className), children: copy(children) });
|
|
38
|
+
});
|
|
39
|
+
export const Command = { Root, Input, List, Group, Item, Empty, Separator, Shortcut };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
2
|
+
import { type HTMLAttributes, type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
3
|
+
export type ContentSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type CardPadding = 'inherit' | 'none' | ContentSize;
|
|
5
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
variant?: 'paper' | 'quiet' | 'outline';
|
|
7
|
+
radius?: number;
|
|
8
|
+
seed?: string | number;
|
|
9
|
+
size?: ContentSize;
|
|
10
|
+
divided?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
action?: ReactNode;
|
|
14
|
+
divided?: boolean;
|
|
15
|
+
padding?: CardPadding;
|
|
16
|
+
align?: 'start' | 'center' | 'end';
|
|
17
|
+
}
|
|
18
|
+
export interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
19
|
+
as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
20
|
+
}
|
|
21
|
+
export interface CardContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
padding?: CardPadding;
|
|
23
|
+
}
|
|
24
|
+
export interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
25
|
+
divided?: boolean;
|
|
26
|
+
justify?: 'start' | 'center' | 'end' | 'between';
|
|
27
|
+
padding?: CardPadding;
|
|
28
|
+
orientation?: 'horizontal' | 'vertical';
|
|
29
|
+
}
|
|
30
|
+
export declare const Card: {
|
|
31
|
+
Root: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
Header: import("react").ForwardRefExoticComponent<CardHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
+
Title: import("react").ForwardRefExoticComponent<CardTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
34
|
+
Description: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
35
|
+
Content: import("react").ForwardRefExoticComponent<CardContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
|
+
Footer: import("react").ForwardRefExoticComponent<CardFooterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
};
|
|
38
|
+
export type AlertVariant = 'info' | 'success' | 'warning' | 'danger';
|
|
39
|
+
export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
40
|
+
variant?: AlertVariant;
|
|
41
|
+
icon?: ReactNode;
|
|
42
|
+
seed?: string | number;
|
|
43
|
+
size?: ContentSize;
|
|
44
|
+
appearance?: 'soft' | 'outline';
|
|
45
|
+
actions?: ReactNode;
|
|
46
|
+
}
|
|
47
|
+
export declare const Alert: {
|
|
48
|
+
Root: import("react").ForwardRefExoticComponent<AlertProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
+
Title: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
50
|
+
Description: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
|
+
};
|
|
52
|
+
export interface AvatarProps extends Omit<AvatarPrimitive.AvatarProps, 'asChild'> {
|
|
53
|
+
size?: 'sm' | 'md' | 'lg';
|
|
54
|
+
radius?: number;
|
|
55
|
+
bordered?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export type AvatarImageProps = Omit<AvatarPrimitive.AvatarImageProps, 'asChild' | 'alt'> & {
|
|
58
|
+
alt: string;
|
|
59
|
+
fit?: 'cover' | 'contain';
|
|
60
|
+
};
|
|
61
|
+
export type AvatarFallbackProps = Omit<AvatarPrimitive.AvatarFallbackProps, 'asChild'>;
|
|
62
|
+
export declare const Avatar: {
|
|
63
|
+
Root: import("react").ForwardRefExoticComponent<AvatarProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
64
|
+
Image: import("react").ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps, "asChild" | "alt"> & {
|
|
65
|
+
alt: string;
|
|
66
|
+
fit?: "cover" | "contain";
|
|
67
|
+
} & import("react").RefAttributes<HTMLImageElement>>;
|
|
68
|
+
Fallback: import("react").ForwardRefExoticComponent<AvatarFallbackProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
69
|
+
};
|
|
70
|
+
export interface TableProps extends ComponentPropsWithoutRef<'table'> {
|
|
71
|
+
density?: 'compact' | 'comfortable';
|
|
72
|
+
striped?: boolean;
|
|
73
|
+
hoverable?: boolean;
|
|
74
|
+
stickyHeader?: boolean;
|
|
75
|
+
captionSide?: 'top' | 'bottom';
|
|
76
|
+
layout?: 'auto' | 'fixed';
|
|
77
|
+
}
|
|
78
|
+
export interface TableRowProps extends ComponentPropsWithoutRef<'tr'> {
|
|
79
|
+
selected?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface TableCellLayout {
|
|
82
|
+
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
83
|
+
wrap?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export type TableHeadProps = Omit<ComponentPropsWithoutRef<'th'>, 'align'> & TableCellLayout & {
|
|
86
|
+
align?: ComponentPropsWithoutRef<'th'>['align'] | 'start' | 'end';
|
|
87
|
+
};
|
|
88
|
+
export type TableCellProps = Omit<ComponentPropsWithoutRef<'td'>, 'align'> & TableCellLayout & {
|
|
89
|
+
align?: ComponentPropsWithoutRef<'td'>['align'] | 'start' | 'end';
|
|
90
|
+
};
|
|
91
|
+
export declare const Table: {
|
|
92
|
+
Container: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
93
|
+
Root: import("react").ForwardRefExoticComponent<TableProps & import("react").RefAttributes<HTMLTableElement>>;
|
|
94
|
+
Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
95
|
+
Body: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
96
|
+
Footer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
97
|
+
Row: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
98
|
+
Head: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref">, "align"> & TableCellLayout & {
|
|
99
|
+
align?: ComponentPropsWithoutRef<"th">["align"] | "start" | "end";
|
|
100
|
+
} & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
101
|
+
Cell: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref">, "align"> & TableCellLayout & {
|
|
102
|
+
align?: ComponentPropsWithoutRef<"td">["align"] | "start" | "end";
|
|
103
|
+
} & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
104
|
+
Caption: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLTableCaptionElement>>;
|
|
105
|
+
};
|
|
106
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
+
import { createContext, useContext, forwardRef, useId } from 'react';
|
|
4
|
+
import { PencilSurface } from '../PencilSurface.js';
|
|
5
|
+
import { PencilText } from '../PencilText.js';
|
|
6
|
+
import { PencilLine } from '../PencilLine.js';
|
|
7
|
+
const classes = (...values) => values.filter(Boolean).join(' ');
|
|
8
|
+
const copy = (children) => typeof children === 'string' ? _jsx(PencilText, { children: children }) : children;
|
|
9
|
+
const CardDividers = createContext(true);
|
|
10
|
+
const CardRoot = forwardRef(function CardRoot({ className, variant = 'paper', radius = 8, seed, size = 'md', divided = true, ...props }, ref) {
|
|
11
|
+
const id = useId();
|
|
12
|
+
return _jsx(CardDividers.Provider, { value: divided, children: _jsx(PencilSurface, { ...props, ref: ref, "data-size": size, className: classes('inkra-card', className), variant: variant, radius: radius, seed: seed ?? `card-${id}` }) });
|
|
13
|
+
});
|
|
14
|
+
const CardHeader = forwardRef(function CardHeader({ className, children, action, divided, padding = 'inherit', align = 'start', ...props }, ref) {
|
|
15
|
+
const inherited = useContext(CardDividers);
|
|
16
|
+
return _jsxs("div", { ...props, ref: ref, "data-padding": padding, "data-align": align, className: classes('inkra-card__header', className), children: [_jsx("div", { className: "inkra-card__heading", children: children }), action != null && _jsx("div", { className: "inkra-card__action", children: action }), (divided ?? inherited) && _jsx(PencilLine, { className: "inkra-card__divider" })] });
|
|
17
|
+
});
|
|
18
|
+
const CardTitle = forwardRef(function CardTitle({ className, children, as: Heading = 'h3', ...props }, ref) {
|
|
19
|
+
return _jsx(Heading, { ...props, ref: ref, className: classes('inkra-card__title', className), children: copy(children) });
|
|
20
|
+
});
|
|
21
|
+
const CardDescription = forwardRef(function CardDescription({ className, children, ...props }, ref) {
|
|
22
|
+
return _jsx("p", { ...props, ref: ref, className: classes('inkra-card__description', className), children: copy(children) });
|
|
23
|
+
});
|
|
24
|
+
const CardContent = forwardRef(function CardContent({ className, padding = 'inherit', ...props }, ref) {
|
|
25
|
+
return _jsx("div", { ...props, ref: ref, "data-padding": padding, className: classes('inkra-card__content', className) });
|
|
26
|
+
});
|
|
27
|
+
const CardFooter = forwardRef(function CardFooter({ className, children, divided, justify = 'start', padding = 'inherit', orientation = 'horizontal', ...props }, ref) {
|
|
28
|
+
const inherited = useContext(CardDividers);
|
|
29
|
+
return _jsxs("div", { ...props, ref: ref, "data-justify": justify, "data-padding": padding, "data-orientation": orientation, className: classes('inkra-card__footer', className), children: [(divided ?? inherited) && _jsx(PencilLine, { className: "inkra-card__divider" }), children] });
|
|
30
|
+
});
|
|
31
|
+
export const Card = { Root: CardRoot, Header: CardHeader, Title: CardTitle, Description: CardDescription, Content: CardContent, Footer: CardFooter };
|
|
32
|
+
const AlertRoot = forwardRef(function AlertRoot({ className, variant = 'info', icon, seed, style, children, role = 'status', size = 'md', appearance = 'soft', actions, ...props }, ref) {
|
|
33
|
+
const id = useId();
|
|
34
|
+
const tokens = {
|
|
35
|
+
color: `var(--inkra-${variant}-foreground)`,
|
|
36
|
+
'--inkra-paper': `var(--inkra-${variant}-surface)`,
|
|
37
|
+
'--inkra-accent': `var(--inkra-${variant}-pigment)`,
|
|
38
|
+
'--inkra-accent-strong': `var(--inkra-${variant}-foreground)`,
|
|
39
|
+
'--inkra-border-strong': `var(--inkra-${variant}-foreground)`,
|
|
40
|
+
'--inkra-border': `var(--inkra-${variant}-foreground)`,
|
|
41
|
+
...style,
|
|
42
|
+
};
|
|
43
|
+
return _jsxs(PencilSurface, { ...props, ref: ref, role: role, className: classes('inkra-alert', className), "data-variant": variant, "data-size": size, "data-appearance": appearance, variant: appearance === 'outline' ? 'outline' : 'action', radius: 8, style: tokens, seed: seed ?? `alert-${id}`, children: [icon && _jsx("span", { className: "inkra-alert__icon", "aria-hidden": "true", children: icon }), _jsxs("div", { className: "inkra-alert__body", children: [children, actions != null && _jsx("div", { className: "inkra-alert__actions", children: actions })] })] });
|
|
44
|
+
});
|
|
45
|
+
const AlertTitle = forwardRef(function AlertTitle({ className, children, ...props }, ref) {
|
|
46
|
+
return _jsx("p", { ...props, ref: ref, className: classes('inkra-alert__title', className), children: copy(children) });
|
|
47
|
+
});
|
|
48
|
+
const AlertDescription = forwardRef(function AlertDescription({ className, children, ...props }, ref) {
|
|
49
|
+
return _jsx("div", { ...props, ref: ref, className: classes('inkra-alert__description', className), children: copy(children) });
|
|
50
|
+
});
|
|
51
|
+
export const Alert = { Root: AlertRoot, Title: AlertTitle, Description: AlertDescription };
|
|
52
|
+
const AvatarRoot = forwardRef(function AvatarRoot({ className, size = 'md', radius = 8, bordered = true, style, children, ...props }, ref) {
|
|
53
|
+
const corner = Number.isFinite(radius) ? Math.max(0, Math.min(8, radius)) : 8;
|
|
54
|
+
return _jsxs(AvatarPrimitive.Root, { ...props, ref: ref, "data-size": size, "data-bordered": bordered, className: classes('inkra-avatar', className), style: { '--inkra-avatar-radius': `${corner}px`, ...style }, children: [children, bordered && _jsx(PencilSurface, { as: "span", "aria-hidden": "true", className: "inkra-avatar__outline", variant: "outline", radius: corner })] });
|
|
55
|
+
});
|
|
56
|
+
const AvatarImage = forwardRef(function AvatarImage({ className, fit = 'cover', ...props }, ref) {
|
|
57
|
+
return _jsx(AvatarPrimitive.Image, { ...props, ref: ref, "data-fit": fit, className: classes('inkra-avatar__image', className) });
|
|
58
|
+
});
|
|
59
|
+
const AvatarFallback = forwardRef(function AvatarFallback({ className, children, ...props }, ref) {
|
|
60
|
+
return _jsx(AvatarPrimitive.Fallback, { ...props, ref: ref, className: classes('inkra-avatar__fallback', className), children: copy(children) });
|
|
61
|
+
});
|
|
62
|
+
export const Avatar = { Root: AvatarRoot, Image: AvatarImage, Fallback: AvatarFallback };
|
|
63
|
+
const TableRoot = forwardRef(function TableRoot({ className, density = 'comfortable', striped = false, hoverable = false, stickyHeader = false, captionSide = 'top', layout = 'auto', ...props }, ref) {
|
|
64
|
+
return _jsx("table", { ...props, ref: ref, "data-layout": layout, "data-density": density, "data-striped": striped || undefined, "data-hoverable": hoverable || undefined, "data-sticky-header": stickyHeader || undefined, "data-caption-side": captionSide, className: classes('inkra-table', className) });
|
|
65
|
+
});
|
|
66
|
+
const TableContainer = forwardRef(function TableContainer({ className, ...props }, ref) {
|
|
67
|
+
return _jsx("div", { tabIndex: 0, ...props, ref: ref, className: classes('inkra-table-container', className) });
|
|
68
|
+
});
|
|
69
|
+
const TableHeader = forwardRef(function TableHeader(props, ref) { return _jsx("thead", { ...props, ref: ref }); });
|
|
70
|
+
const TableBody = forwardRef(function TableBody(props, ref) { return _jsx("tbody", { ...props, ref: ref }); });
|
|
71
|
+
const TableFooter = forwardRef(function TableFooter(props, ref) { return _jsx("tfoot", { ...props, ref: ref }); });
|
|
72
|
+
const TableRow = forwardRef(function TableRow({ selected = false, ...props }, ref) { return _jsx("tr", { ...props, ref: ref, "data-selected": selected || undefined }); });
|
|
73
|
+
const TableHead = forwardRef(function TableHead({ children, align = 'start', verticalAlign = 'middle', wrap = true, ...props }, ref) {
|
|
74
|
+
return _jsxs("th", { scope: "col", ...props, ref: ref, "data-align": align, "data-vertical-align": verticalAlign, "data-wrap": wrap, children: [wrap ? copy(children) : _jsx("div", { className: "inkra-table__nowrap", tabIndex: 0, children: copy(children) }), _jsx(PencilLine, { className: "inkra-table__divider" })] });
|
|
75
|
+
});
|
|
76
|
+
const TableCell = forwardRef(function TableCell({ children, align = 'start', verticalAlign = 'middle', wrap = true, ...props }, ref) {
|
|
77
|
+
return _jsxs("td", { ...props, ref: ref, "data-align": align, "data-vertical-align": verticalAlign, "data-wrap": wrap, children: [wrap ? copy(children) : _jsx("div", { className: "inkra-table__nowrap", tabIndex: 0, children: copy(children) }), _jsx(PencilLine, { className: "inkra-table__divider" })] });
|
|
78
|
+
});
|
|
79
|
+
const TableCaption = forwardRef(function TableCaption({ children, ...props }, ref) { return _jsx("caption", { ...props, ref: ref, children: copy(children) }); });
|
|
80
|
+
export const Table = { Container: TableContainer, Root: TableRoot, Header: TableHeader, Body: TableBody, Footer: TableFooter, Row: TableRow, Head: TableHead, Cell: TableCell, Caption: TableCaption };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as Primitive from '@radix-ui/react-dropdown-menu';
|
|
2
|
+
import type { ComponentPropsWithoutRef, ElementType, HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
3
|
+
import { DropdownMenu } from '../dropdown-menu/index.js';
|
|
4
|
+
import type { DropdownMenuContentProps } from '../dropdown-menu/index.js';
|
|
5
|
+
export type ContextMenuOpenReason = 'pointer' | 'keyboard' | 'long-press' | 'dismiss';
|
|
6
|
+
export interface ContextMenuOpenChangeDetails {
|
|
7
|
+
reason: ContextMenuOpenReason;
|
|
8
|
+
event?: Event;
|
|
9
|
+
}
|
|
10
|
+
export interface ContextMenuRootProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
modal?: boolean;
|
|
15
|
+
dir?: 'ltr' | 'rtl';
|
|
16
|
+
onOpenChange?: (open: boolean, details: ContextMenuOpenChangeDetails) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function ContextMenuRoot({ children, defaultOpen, dir, modal, onOpenChange, open, }: ContextMenuRootProps): import("react").JSX.Element;
|
|
19
|
+
export type ContextMenuNativePolicy = 'editable' | 'always' | 'never';
|
|
20
|
+
export interface ContextMenuLongPressOptions {
|
|
21
|
+
delay?: number;
|
|
22
|
+
movementTolerance?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ContextMenuTriggerProps extends Omit<HTMLAttributes<HTMLElement>, 'onContextMenu'> {
|
|
25
|
+
as?: ElementType;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
exclude?: string | ((target: Element, currentTarget: HTMLElement) => boolean);
|
|
28
|
+
longPress?: boolean | ContextMenuLongPressOptions;
|
|
29
|
+
nativeContextMenu?: ContextMenuNativePolicy;
|
|
30
|
+
onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const ContextMenuTrigger: import("react").ForwardRefExoticComponent<ContextMenuTriggerProps & import("react").RefAttributes<HTMLElement>>;
|
|
33
|
+
export type ContextMenuPortalProps = ComponentPropsWithoutRef<typeof DropdownMenu.Portal>;
|
|
34
|
+
export declare const ContextMenuPortal: ({ children, ...props }: import("../dropdown-menu/index.js").DropdownMenuPortalProps) => import("react").JSX.Element;
|
|
35
|
+
export type ContextMenuContentProps = DropdownMenuContentProps;
|
|
36
|
+
export declare const ContextMenuContent: import("react").ForwardRefExoticComponent<DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export type ContextMenuItemProps = ComponentPropsWithoutRef<typeof DropdownMenu.Item>;
|
|
38
|
+
export declare const ContextMenuItem: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
39
|
+
export type ContextMenuCheckboxItemProps = ComponentPropsWithoutRef<typeof DropdownMenu.CheckboxItem>;
|
|
40
|
+
export declare const ContextMenuCheckboxItem: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
+
export type ContextMenuRadioItemProps = ComponentPropsWithoutRef<typeof DropdownMenu.RadioItem>;
|
|
42
|
+
export declare const ContextMenuRadioItem: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
43
|
+
export type ContextMenuLabelProps = ComponentPropsWithoutRef<typeof DropdownMenu.Label>;
|
|
44
|
+
export declare const ContextMenuLabel: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export type ContextMenuSeparatorProps = ComponentPropsWithoutRef<typeof DropdownMenu.Separator>;
|
|
46
|
+
export declare const ContextMenuSeparator: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
export type ContextMenuGroupProps = ComponentPropsWithoutRef<typeof DropdownMenu.Group>;
|
|
48
|
+
export declare const ContextMenuGroup: import("react").ForwardRefExoticComponent<Primitive.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
+
export type ContextMenuRadioGroupProps = ComponentPropsWithoutRef<typeof DropdownMenu.RadioGroup>;
|
|
50
|
+
export declare const ContextMenuRadioGroup: import("react").ForwardRefExoticComponent<Primitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export type ContextMenuSubProps = ComponentPropsWithoutRef<typeof Primitive.Sub>;
|
|
52
|
+
export declare const ContextMenuSub: import("react").FC<Primitive.DropdownMenuSubProps>;
|
|
53
|
+
export interface ContextMenuSubTriggerProps extends Omit<ComponentPropsWithoutRef<typeof Primitive.SubTrigger>, 'asChild'> {
|
|
54
|
+
icon?: ReactNode;
|
|
55
|
+
}
|
|
56
|
+
export declare const ContextMenuSubTrigger: import("react").ForwardRefExoticComponent<ContextMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
57
|
+
export interface ContextMenuSubContentProps extends Omit<ComponentPropsWithoutRef<typeof Primitive.SubContent>, 'asChild'> {
|
|
58
|
+
seed?: string | number;
|
|
59
|
+
}
|
|
60
|
+
export declare const ContextMenuSubContent: import("react").ForwardRefExoticComponent<ContextMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
61
|
+
export declare const ContextMenu: Readonly<{
|
|
62
|
+
Root: typeof ContextMenuRoot;
|
|
63
|
+
Trigger: import("react").ForwardRefExoticComponent<ContextMenuTriggerProps & import("react").RefAttributes<HTMLElement>>;
|
|
64
|
+
Portal: ({ children, ...props }: import("../dropdown-menu/index.js").DropdownMenuPortalProps) => import("react").JSX.Element;
|
|
65
|
+
Content: import("react").ForwardRefExoticComponent<DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
66
|
+
Item: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
67
|
+
CheckboxItem: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
+
RadioItem: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
69
|
+
Label: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
70
|
+
Separator: import("react").ForwardRefExoticComponent<import("../dropdown-menu/index.js").DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
71
|
+
Group: import("react").ForwardRefExoticComponent<Primitive.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
72
|
+
RadioGroup: import("react").ForwardRefExoticComponent<Primitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
73
|
+
Sub: import("react").FC<Primitive.DropdownMenuSubProps>;
|
|
74
|
+
SubTrigger: import("react").ForwardRefExoticComponent<ContextMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
75
|
+
SubContent: import("react").ForwardRefExoticComponent<ContextMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
76
|
+
}>;
|