@examplary/ui 1.55.0 → 1.58.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/dist/components/ai/ai-icon.js +2 -25
- package/dist/components/ai/ai-prompt-suggestion.js +3 -26
- package/dist/components/brand/tick-icon.js +2 -25
- package/dist/components/chat/chat-input.js +8 -31
- package/dist/components/chat/chat-typing-indicator.js +2 -2
- package/dist/components/chat/chat-view.js +6 -34
- package/dist/components/loading/ai-spinner.js +2 -13
- package/dist/components/loading/tick-loader.js +39 -104
- package/dist/components/print/answer-box.js +2 -25
- package/dist/components/question-types/fetch-component.js +65 -106
- package/dist/components/question-types/format-question-type.d.ts +41 -41
- package/dist/components/question-types/format-question-type.js +36 -37
- package/dist/components/rich-text/minimal-rich-text-field.d.ts +2 -2
- package/dist/components/rich-text/minimal-rich-text-field.js +47 -85
- package/dist/components/rich-text/rich-text-display.js +15 -33
- package/dist/components/rich-text/rich-text-field.js +2 -25
- package/dist/components/rich-text/rich-text-toolbar.d.ts +3 -2
- package/dist/components/rich-text/rich-text-toolbar.js +5 -6
- package/dist/components/rich-text/tiptap/collaboration-caret.js +24 -34
- package/dist/components/rich-text/tiptap/comments/comment-bubble.d.ts +1 -1
- package/dist/components/rich-text/tiptap/comments/comment-bubble.js +36 -41
- package/dist/components/rich-text/tiptap/content-reference.js +6 -7
- package/dist/components/rich-text/tiptap/crop-page-clipping-modal.d.ts +3 -3
- package/dist/components/rich-text/tiptap/crop-page-clipping-modal.js +20 -25
- package/dist/components/rich-text/tiptap/extensions.d.ts +2 -2
- package/dist/components/rich-text/tiptap/extensions.js +6 -16
- package/dist/components/rich-text/tiptap/file-attachment.js +9 -11
- package/dist/components/rich-text/tiptap/file-handler.d.ts +2 -2
- package/dist/components/rich-text/tiptap/file-handler.js +110 -185
- package/dist/components/rich-text/tiptap/image.js +18 -23
- package/dist/components/rich-text/tiptap/mathematics-component.js +25 -30
- package/dist/components/rich-text/tiptap/mathematics.js +56 -82
- package/dist/components/rich-text/tiptap/page-clipping.js +3 -4
- package/dist/components/rich-text/tiptap/png-scanner.js +63 -108
- package/dist/components/rich-text/tiptap/rich-text-formatting-menu.d.ts +1 -1
- package/dist/components/rich-text/tiptap/rich-text-formatting-menu.js +31 -46
- package/dist/components/ui/alert.d.ts +3 -3
- package/dist/components/ui/alert.js +7 -32
- package/dist/components/ui/avatar.js +18 -14
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.js +4 -27
- package/dist/components/ui/button.d.ts +4 -4
- package/dist/components/ui/button.js +4 -27
- package/dist/components/ui/card.js +6 -46
- package/dist/components/ui/checkbox.js +1 -26
- package/dist/components/ui/color-picker.js +11 -22
- package/dist/components/ui/command-palette.d.ts +2 -2
- package/dist/components/ui/command-palette.js +38 -72
- package/dist/components/ui/command.js +18 -49
- package/dist/components/ui/comments.js +37 -107
- package/dist/components/ui/context-menu.js +30 -67
- package/dist/components/ui/dialog.js +15 -61
- package/dist/components/ui/dropdown.js +17 -64
- package/dist/components/ui/floating-menu.js +2 -25
- package/dist/components/ui/floating-resizable.d.ts +5 -0
- package/dist/components/ui/floating-resizable.js +24 -0
- package/dist/components/ui/help-icon.js +1 -2
- package/dist/components/ui/icon-picker.js +50 -130
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/input.js +2 -25
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/label.js +2 -27
- package/dist/components/ui/popover.d.ts +2 -2
- package/dist/components/ui/popover.js +4 -32
- package/dist/components/ui/progress-bar.js +2 -3
- package/dist/components/ui/radio-group.js +4 -28
- package/dist/components/ui/resizable.d.ts +6 -9
- package/dist/components/ui/resizable.js +13 -60
- package/dist/components/ui/select.js +12 -55
- package/dist/components/ui/separator.js +1 -26
- package/dist/components/ui/sheet.d.ts +3 -3
- package/dist/components/ui/sheet.js +11 -51
- package/dist/components/ui/skeleton.js +2 -25
- package/dist/components/ui/slider.js +7 -32
- package/dist/components/ui/sortable.d.ts +1 -1
- package/dist/components/ui/sortable.js +131 -155
- package/dist/components/ui/switch.d.ts +3 -3
- package/dist/components/ui/switch.js +3 -28
- package/dist/components/ui/table.js +8 -54
- package/dist/components/ui/tabs.js +8 -34
- package/dist/components/ui/text-selection-menu.d.ts +1 -1
- package/dist/components/ui/text-selection-menu.js +19 -25
- package/dist/components/ui/textarea.js +7 -30
- package/dist/components/ui/tooltip.js +4 -29
- package/dist/components/web-components/content-reference.js +81 -106
- package/dist/components/web-components/file-attachment.js +9 -30
- package/dist/components/web-components/index.js +1 -1
- package/dist/components/web-components/inline-comment-reply.js +3 -24
- package/dist/components/web-components/inline-comment.js +3 -24
- package/dist/components/web-components/inline-math.js +14 -36
- package/dist/components/web-components/page-clipping.js +13 -34
- package/dist/lib/compose-refs.js +10 -18
- package/dist/lib/use-spin-loop.js +19 -69
- package/dist/src/global.css +2 -2
- package/dist/utils.js +1 -5
- package/package.json +7 -6
- package/src/global.css +6 -1
- package/dist/components/rich-text/tiptap/comments/comment-reply.d.ts +0 -21
- package/dist/components/rich-text/tiptap/comments/comment-reply.js +0 -230
- package/dist/components/rich-text/tiptap/comments/comment.d.ts +0 -22
- package/dist/components/rich-text/tiptap/comments/comment.js +0 -199
- package/dist/components/rich-text/tiptap/comments/helpers.d.ts +0 -19
- package/dist/components/rich-text/tiptap/comments/helpers.js +0 -95
- package/dist/components/rich-text/tiptap/comments/types.d.ts +0 -29
- package/dist/components/rich-text/tiptap/comments/types.js +0 -1
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
3
|
import * as React from "react";
|
|
26
4
|
import * as ReactDOM from "react-dom";
|
|
@@ -31,7 +9,7 @@ import { CSS } from "@dnd-kit/utilities";
|
|
|
31
9
|
import { Slot } from "@radix-ui/react-slot";
|
|
32
10
|
import { useComposedRefs } from "../../lib/compose-refs";
|
|
33
11
|
import { cn } from "../../utils";
|
|
34
|
-
|
|
12
|
+
const orientationConfig = {
|
|
35
13
|
vertical: {
|
|
36
14
|
modifiers: [restrictToVerticalAxis, restrictToParentElement],
|
|
37
15
|
strategy: verticalListSortingStrategy,
|
|
@@ -48,28 +26,28 @@ var orientationConfig = {
|
|
|
48
26
|
collisionDetection: closestCorners,
|
|
49
27
|
},
|
|
50
28
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
29
|
+
const ROOT_NAME = "Sortable";
|
|
30
|
+
const CONTENT_NAME = "SortableContent";
|
|
31
|
+
const ITEM_NAME = "SortableItem";
|
|
32
|
+
const ITEM_HANDLE_NAME = "SortableItemHandle";
|
|
33
|
+
const OVERLAY_NAME = "SortableOverlay";
|
|
34
|
+
const SortableRootContext = React.createContext(null);
|
|
57
35
|
function useSortableContext(consumerName) {
|
|
58
|
-
|
|
36
|
+
const context = React.useContext(SortableRootContext);
|
|
59
37
|
if (!context) {
|
|
60
|
-
throw new Error(
|
|
38
|
+
throw new Error(`\`${consumerName}\` must be used within \`${ROOT_NAME}\``);
|
|
61
39
|
}
|
|
62
40
|
return context;
|
|
63
41
|
}
|
|
64
42
|
function Sortable(props) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
43
|
+
const { value, onValueChange, collisionDetection, modifiers, strategy, onMove, orientation = "vertical", flatCursor = false, getItemValue: getItemValueProp, accessibility, ...sortableProps } = props;
|
|
44
|
+
const id = React.useId();
|
|
45
|
+
const [activeId, setActiveId] = React.useState(null);
|
|
46
|
+
const sensors = useSensors(useSensor(MouseSensor), useSensor(TouchSensor), useSensor(KeyboardSensor, {
|
|
69
47
|
coordinateGetter: sortableKeyboardCoordinates,
|
|
70
48
|
}));
|
|
71
|
-
|
|
72
|
-
|
|
49
|
+
const config = React.useMemo(() => orientationConfig[orientation], [orientation]);
|
|
50
|
+
const getItemValue = React.useCallback((item) => {
|
|
73
51
|
if (typeof item === "object" && !getItemValueProp) {
|
|
74
52
|
throw new Error("`getItemValue` is required when using array of objects");
|
|
75
53
|
}
|
|
@@ -77,109 +55,100 @@ function Sortable(props) {
|
|
|
77
55
|
? getItemValueProp(item)
|
|
78
56
|
: item;
|
|
79
57
|
}, [getItemValueProp]);
|
|
80
|
-
|
|
81
|
-
return value.map(
|
|
58
|
+
const items = React.useMemo(() => {
|
|
59
|
+
return value.map((item) => getItemValue(item));
|
|
82
60
|
}, [value, getItemValue]);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(_a = sortableProps.onDragStart) === null || _a === void 0 ? void 0 : _a.call(sortableProps, event);
|
|
61
|
+
const onDragStart = React.useCallback((event) => {
|
|
62
|
+
sortableProps.onDragStart?.(event);
|
|
86
63
|
if (event.activatorEvent.defaultPrevented)
|
|
87
64
|
return;
|
|
88
65
|
setActiveId(event.active.id);
|
|
89
66
|
},
|
|
90
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91
68
|
[sortableProps.onDragStart]);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
(_a = sortableProps.onDragEnd) === null || _a === void 0 ? void 0 : _a.call(sortableProps, event);
|
|
69
|
+
const onDragEnd = React.useCallback((event) => {
|
|
70
|
+
sortableProps.onDragEnd?.(event);
|
|
95
71
|
if (event.activatorEvent.defaultPrevented)
|
|
96
72
|
return;
|
|
97
|
-
|
|
98
|
-
if (over && active.id !==
|
|
99
|
-
|
|
100
|
-
|
|
73
|
+
const { active, over } = event;
|
|
74
|
+
if (over && active.id !== over?.id) {
|
|
75
|
+
const activeIndex = value.findIndex((item) => getItemValue(item) === active.id);
|
|
76
|
+
const overIndex = value.findIndex((item) => getItemValue(item) === over.id);
|
|
101
77
|
if (onMove) {
|
|
102
|
-
onMove(
|
|
78
|
+
onMove({ ...event, activeIndex, overIndex });
|
|
103
79
|
}
|
|
104
80
|
else {
|
|
105
|
-
onValueChange
|
|
81
|
+
onValueChange?.(arrayMove(value, activeIndex, overIndex));
|
|
106
82
|
}
|
|
107
83
|
}
|
|
108
84
|
setActiveId(null);
|
|
109
85
|
},
|
|
110
86
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
87
|
[value, onValueChange, onMove, getItemValue, sortableProps.onDragEnd]);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
(_a = sortableProps.onDragCancel) === null || _a === void 0 ? void 0 : _a.call(sortableProps, event);
|
|
88
|
+
const onDragCancel = React.useCallback((event) => {
|
|
89
|
+
sortableProps.onDragCancel?.(event);
|
|
115
90
|
if (event.activatorEvent.defaultPrevented)
|
|
116
91
|
return;
|
|
117
92
|
setActiveId(null);
|
|
118
93
|
},
|
|
119
94
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
120
95
|
[sortableProps.onDragCancel]);
|
|
121
|
-
|
|
122
|
-
onDragStart
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var activeValue = active.id.toString();
|
|
126
|
-
return "Grabbed sortable item \"".concat(activeValue, "\". Current position is ").concat(((_b = active.data.current) === null || _b === void 0 ? void 0 : _b.sortable.index) + 1, " of ").concat(value.length, ". Use arrow keys to move, space to drop.");
|
|
96
|
+
const announcements = React.useMemo(() => ({
|
|
97
|
+
onDragStart({ active }) {
|
|
98
|
+
const activeValue = active.id.toString();
|
|
99
|
+
return `Grabbed sortable item "${activeValue}". Current position is ${active.data.current?.sortable.index + 1} of ${value.length}. Use arrow keys to move, space to drop.`;
|
|
127
100
|
},
|
|
128
|
-
onDragOver
|
|
129
|
-
var _b, _c, _d, _e;
|
|
130
|
-
var active = _a.active, over = _a.over;
|
|
101
|
+
onDragOver({ active, over }) {
|
|
131
102
|
if (over) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return
|
|
103
|
+
const overIndex = over.data.current?.sortable.index ?? 0;
|
|
104
|
+
const activeIndex = active.data.current?.sortable.index ?? 0;
|
|
105
|
+
const moveDirection = overIndex > activeIndex ? "down" : "up";
|
|
106
|
+
const activeValue = active.id.toString();
|
|
107
|
+
return `Sortable item "${activeValue}" moved ${moveDirection} to position ${overIndex + 1} of ${value.length}.`;
|
|
137
108
|
}
|
|
138
109
|
return "Sortable item is no longer over a droppable area. Press escape to cancel.";
|
|
139
110
|
},
|
|
140
|
-
onDragEnd
|
|
141
|
-
|
|
142
|
-
var active = _a.active, over = _a.over;
|
|
143
|
-
var activeValue = active.id.toString();
|
|
111
|
+
onDragEnd({ active, over }) {
|
|
112
|
+
const activeValue = active.id.toString();
|
|
144
113
|
if (over) {
|
|
145
|
-
|
|
146
|
-
return
|
|
114
|
+
const overIndex = over.data.current?.sortable.index ?? 0;
|
|
115
|
+
return `Sortable item "${activeValue}" dropped at position ${overIndex + 1} of ${value.length}.`;
|
|
147
116
|
}
|
|
148
|
-
return
|
|
117
|
+
return `Sortable item "${activeValue}" dropped. No changes were made.`;
|
|
149
118
|
},
|
|
150
|
-
onDragCancel
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
var activeValue = active.id.toString();
|
|
155
|
-
return "Sorting cancelled. Sortable item \"".concat(activeValue, "\" returned to position ").concat(activeIndex + 1, " of ").concat(value.length, ".");
|
|
119
|
+
onDragCancel({ active }) {
|
|
120
|
+
const activeIndex = active.data.current?.sortable.index ?? 0;
|
|
121
|
+
const activeValue = active.id.toString();
|
|
122
|
+
return `Sorting cancelled. Sortable item "${activeValue}" returned to position ${activeIndex + 1} of ${value.length}.`;
|
|
156
123
|
},
|
|
157
|
-
onDragMove
|
|
158
|
-
var _b, _c, _d, _e;
|
|
159
|
-
var active = _a.active, over = _a.over;
|
|
124
|
+
onDragMove({ active, over }) {
|
|
160
125
|
if (over) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return
|
|
126
|
+
const overIndex = over.data.current?.sortable.index ?? 0;
|
|
127
|
+
const activeIndex = active.data.current?.sortable.index ?? 0;
|
|
128
|
+
const moveDirection = overIndex > activeIndex ? "down" : "up";
|
|
129
|
+
const activeValue = active.id.toString();
|
|
130
|
+
return `Sortable item "${activeValue}" is moving ${moveDirection} to position ${overIndex + 1} of ${value.length}.`;
|
|
166
131
|
}
|
|
167
132
|
return "Sortable item is no longer over a droppable area. Press escape to cancel.";
|
|
168
133
|
},
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
draggable:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
134
|
+
}), [value]);
|
|
135
|
+
const screenReaderInstructions = React.useMemo(() => ({
|
|
136
|
+
draggable: `
|
|
137
|
+
To pick up a sortable item, press space or enter.
|
|
138
|
+
While dragging, use the ${orientation === "vertical" ? "up and down" : orientation === "horizontal" ? "left and right" : "arrow"} keys to move the item.
|
|
139
|
+
Press space or enter again to drop the item in its new position, or press escape to cancel.
|
|
140
|
+
`,
|
|
141
|
+
}), [orientation]);
|
|
142
|
+
const contextValue = React.useMemo(() => ({
|
|
143
|
+
id,
|
|
144
|
+
items,
|
|
145
|
+
modifiers: modifiers ?? config.modifiers,
|
|
146
|
+
strategy: strategy ?? config.strategy,
|
|
147
|
+
activeId,
|
|
148
|
+
setActiveId,
|
|
149
|
+
getItemValue,
|
|
150
|
+
flatCursor,
|
|
151
|
+
}), [
|
|
183
152
|
id,
|
|
184
153
|
items,
|
|
185
154
|
modifiers,
|
|
@@ -190,81 +159,89 @@ function Sortable(props) {
|
|
|
190
159
|
getItemValue,
|
|
191
160
|
flatCursor,
|
|
192
161
|
]);
|
|
193
|
-
return (_jsx(SortableRootContext.Provider, { value: contextValue, children: _jsx(DndContext,
|
|
162
|
+
return (_jsx(SortableRootContext.Provider, { value: contextValue, children: _jsx(DndContext, { collisionDetection: collisionDetection ?? config.collisionDetection, modifiers: modifiers ?? config.modifiers, sensors: sensors, ...sortableProps, id: id, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragCancel: onDragCancel, accessibility: {
|
|
163
|
+
announcements,
|
|
164
|
+
screenReaderInstructions,
|
|
165
|
+
...accessibility,
|
|
166
|
+
} }) }));
|
|
194
167
|
}
|
|
195
|
-
|
|
168
|
+
const SortableContentContext = React.createContext(false);
|
|
196
169
|
function SortableContent(props) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return (_jsx(SortableContentContext.Provider, { value: true, children: _jsx(SortableContext, { items: context.items, strategy: strategyProp
|
|
170
|
+
const { strategy: strategyProp, asChild, withoutSlot, children, ref, ...contentProps } = props;
|
|
171
|
+
const context = useSortableContext(CONTENT_NAME);
|
|
172
|
+
const ContentPrimitive = asChild ? Slot : "div";
|
|
173
|
+
return (_jsx(SortableContentContext.Provider, { value: true, children: _jsx(SortableContext, { items: context.items, strategy: strategyProp ?? context.strategy, children: withoutSlot ? (children) : (_jsx(ContentPrimitive, { "data-slot": "sortable-content", ...contentProps, ref: ref, children: children })) }) }));
|
|
201
174
|
}
|
|
202
|
-
|
|
175
|
+
const SortableItemContext = React.createContext(null);
|
|
203
176
|
function useSortableItemContext(consumerName) {
|
|
204
|
-
|
|
177
|
+
const context = React.useContext(SortableItemContext);
|
|
205
178
|
if (!context) {
|
|
206
|
-
throw new Error(
|
|
179
|
+
throw new Error(`\`${consumerName}\` must be used within \`${ITEM_NAME}\``);
|
|
207
180
|
}
|
|
208
181
|
return context;
|
|
209
182
|
}
|
|
210
183
|
function SortableItem(props) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
184
|
+
const { value, style, asHandle, asChild, disabled, className, ref, ...itemProps } = props;
|
|
185
|
+
const inSortableContent = React.useContext(SortableContentContext);
|
|
186
|
+
const inSortableOverlay = React.useContext(SortableOverlayContext);
|
|
214
187
|
if (!inSortableContent && !inSortableOverlay) {
|
|
215
|
-
throw new Error(
|
|
188
|
+
throw new Error(`\`${ITEM_NAME}\` must be used within \`${CONTENT_NAME}\` or \`${OVERLAY_NAME}\``);
|
|
216
189
|
}
|
|
217
190
|
if (value === "") {
|
|
218
|
-
throw new Error(
|
|
191
|
+
throw new Error(`\`${ITEM_NAME}\` value cannot be an empty string`);
|
|
219
192
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
193
|
+
const context = useSortableContext(ITEM_NAME);
|
|
194
|
+
const id = React.useId();
|
|
195
|
+
const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging, } = useSortable({ id: value, disabled });
|
|
196
|
+
const composedRef = useComposedRefs(ref, (node) => {
|
|
224
197
|
if (disabled)
|
|
225
198
|
return;
|
|
226
199
|
setNodeRef(node);
|
|
227
200
|
if (asHandle)
|
|
228
201
|
setActivatorNodeRef(node);
|
|
229
202
|
});
|
|
230
|
-
|
|
231
|
-
return
|
|
203
|
+
const composedStyle = React.useMemo(() => {
|
|
204
|
+
return {
|
|
205
|
+
transform: CSS.Translate.toString(transform),
|
|
206
|
+
transition,
|
|
207
|
+
...style,
|
|
208
|
+
};
|
|
232
209
|
}, [transform, transition, style]);
|
|
233
|
-
|
|
234
|
-
id
|
|
235
|
-
attributes
|
|
236
|
-
listeners
|
|
237
|
-
setActivatorNodeRef
|
|
238
|
-
isDragging
|
|
239
|
-
disabled
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
return (_jsx(SortableItemContext.Provider, { value: itemContext, children: _jsx(ItemPrimitive,
|
|
243
|
-
"touch-none select-none": asHandle,
|
|
210
|
+
const itemContext = React.useMemo(() => ({
|
|
211
|
+
id,
|
|
212
|
+
attributes,
|
|
213
|
+
listeners,
|
|
214
|
+
setActivatorNodeRef,
|
|
215
|
+
isDragging,
|
|
216
|
+
disabled,
|
|
217
|
+
}), [id, attributes, listeners, setActivatorNodeRef, isDragging, disabled]);
|
|
218
|
+
const ItemPrimitive = asChild ? Slot : "div";
|
|
219
|
+
return (_jsx(SortableItemContext.Provider, { value: itemContext, children: _jsx(ItemPrimitive, { id: id, "data-disabled": disabled, "data-dragging": isDragging ? "" : undefined, "data-slot": "sortable-item", ...itemProps, ...(asHandle && !disabled ? attributes : {}), ...(asHandle && !disabled ? listeners : {}), ref: composedRef, style: composedStyle, className: cn("focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:ring-offset-1 dark:focus-visible:ring-neutral-300", {
|
|
220
|
+
"touch-none select-none": !!asHandle,
|
|
244
221
|
"cursor-default": context.flatCursor,
|
|
245
222
|
"data-dragging:cursor-grabbing": !context.flatCursor,
|
|
246
|
-
"cursor-grab": !isDragging && asHandle && !context.flatCursor,
|
|
223
|
+
"cursor-grab": !isDragging && !!asHandle && !context.flatCursor,
|
|
247
224
|
"opacity-50": isDragging,
|
|
248
|
-
"pointer-events-none opacity-50": disabled,
|
|
249
|
-
}, className) })
|
|
225
|
+
"pointer-events-none opacity-50": !!disabled,
|
|
226
|
+
}, className) }) }));
|
|
250
227
|
}
|
|
251
228
|
function SortableItemHandle(props) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
229
|
+
const { asChild, disabled, className, ref, ...itemHandleProps } = props;
|
|
230
|
+
const context = useSortableContext(ITEM_HANDLE_NAME);
|
|
231
|
+
const itemContext = useSortableItemContext(ITEM_HANDLE_NAME);
|
|
232
|
+
const isDisabled = disabled ?? itemContext.disabled;
|
|
233
|
+
const composedRef = useComposedRefs(ref, (node) => {
|
|
257
234
|
if (!isDisabled)
|
|
258
235
|
return;
|
|
259
236
|
itemContext.setActivatorNodeRef(node);
|
|
260
237
|
});
|
|
261
|
-
|
|
262
|
-
return (_jsx(HandlePrimitive,
|
|
238
|
+
const HandlePrimitive = asChild ? Slot : "button";
|
|
239
|
+
return (_jsx(HandlePrimitive, { type: "button", "aria-controls": itemContext.id, "data-disabled": isDisabled, "data-dragging": itemContext.isDragging ? "" : undefined, "data-slot": "sortable-item-handle", ...itemHandleProps, ...(isDisabled ? {} : itemContext.attributes), ...(isDisabled ? {} : itemContext.listeners), ref: composedRef, className: cn("select-none disabled:pointer-events-none disabled:opacity-50", context.flatCursor
|
|
263
240
|
? "cursor-default"
|
|
264
|
-
: "cursor-grab data-dragging:cursor-grabbing", className), disabled: isDisabled }))
|
|
241
|
+
: "cursor-grab data-dragging:cursor-grabbing", className), disabled: isDisabled }));
|
|
265
242
|
}
|
|
266
|
-
|
|
267
|
-
|
|
243
|
+
const SortableOverlayContext = React.createContext(false);
|
|
244
|
+
const dropAnimation = {
|
|
268
245
|
sideEffects: defaultDropAnimationSideEffects({
|
|
269
246
|
styles: {
|
|
270
247
|
active: {
|
|
@@ -274,18 +251,17 @@ var dropAnimation = {
|
|
|
274
251
|
}),
|
|
275
252
|
};
|
|
276
253
|
function SortableOverlay(props) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
var container = containerProp !== null && containerProp !== void 0 ? containerProp : (mounted ? (_a = globalThis.document) === null || _a === void 0 ? void 0 : _a.body : null);
|
|
254
|
+
const { container: containerProp, children, ...overlayProps } = props;
|
|
255
|
+
const context = useSortableContext(OVERLAY_NAME);
|
|
256
|
+
const [mounted, setMounted] = React.useState(false);
|
|
257
|
+
React.useLayoutEffect(() => setMounted(true), []);
|
|
258
|
+
const container = containerProp ?? (mounted ? globalThis.document?.body : null);
|
|
283
259
|
if (!container)
|
|
284
260
|
return null;
|
|
285
|
-
return ReactDOM.createPortal(_jsx(DragOverlay,
|
|
261
|
+
return ReactDOM.createPortal(_jsx(DragOverlay, { dropAnimation: dropAnimation, modifiers: context.modifiers, className: cn(!context.flatCursor && "cursor-grabbing"), ...overlayProps, children: _jsx(SortableOverlayContext.Provider, { value: true, children: context.activeId
|
|
286
262
|
? typeof children === "function"
|
|
287
263
|
? children({ value: context.activeId })
|
|
288
264
|
: children
|
|
289
|
-
: null }) })
|
|
265
|
+
: null }) }), container);
|
|
290
266
|
}
|
|
291
267
|
export { Sortable, SortableContent, SortableItem, SortableItemHandle, SortableOverlay, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
3
|
import { type VariantProps } from "class-variance-authority";
|
|
4
|
-
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: {
|
|
5
|
-
size?: "default" | "sm";
|
|
6
|
-
} & import("class-variance-authority/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
5
|
+
size?: "default" | "sm" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
export { Switch };
|
|
@@ -1,32 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
3
|
import * as React from "react";
|
|
26
4
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
27
5
|
import { cva } from "class-variance-authority";
|
|
28
6
|
import { cn } from "../../utils";
|
|
29
|
-
|
|
7
|
+
const switchVariants = cva("peer inline-flex h-6 w-12 shrink-0 cursor-pointer items-center rounded-full border-black transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-bright data-[state=unchecked]:bg-white", {
|
|
30
8
|
variants: {
|
|
31
9
|
size: {
|
|
32
10
|
default: "h-6 w-12 border-2",
|
|
@@ -37,7 +15,7 @@ var switchVariants = cva("peer inline-flex h-6 w-12 shrink-0 cursor-pointer item
|
|
|
37
15
|
size: "default",
|
|
38
16
|
},
|
|
39
17
|
});
|
|
40
|
-
|
|
18
|
+
const switchThumbVariants = cva("pointer-events-none block rounded-full border-black bg-white ring-0 transition-transform", {
|
|
41
19
|
variants: {
|
|
42
20
|
size: {
|
|
43
21
|
default: "h-4 w-4 data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-1 border-2",
|
|
@@ -48,9 +26,6 @@ var switchThumbVariants = cva("pointer-events-none block rounded-full border-bla
|
|
|
48
26
|
size: "default",
|
|
49
27
|
},
|
|
50
28
|
});
|
|
51
|
-
|
|
52
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
53
|
-
return (_jsx(SwitchPrimitives.Root, __assign({ className: cn(switchVariants(props), className) }, props, { ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn(switchThumbVariants(props)) }) })));
|
|
54
|
-
});
|
|
29
|
+
const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn(switchVariants(props), className), ...props, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn(switchThumbVariants(props)) }) })));
|
|
55
30
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
56
31
|
export { Switch };
|
|
@@ -1,66 +1,20 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
2
|
import * as React from "react";
|
|
25
3
|
import { cn } from "../../utils";
|
|
26
|
-
|
|
27
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
28
|
-
return (_jsx("div", { className: cn("relative w-full overflow-auto bg-white rounded-xl border border-border", className), children: _jsx("table", __assign({ ref: ref, className: "w-full caption-bottom text-sm border-collapse border-0" }, props)) }));
|
|
29
|
-
});
|
|
4
|
+
const Table = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { className: cn("relative w-full overflow-auto bg-white rounded-xl border border-border", className), children: _jsx("table", { ref: ref, className: "w-full caption-bottom text-sm border-collapse border-0", ...props }) })));
|
|
30
5
|
Table.displayName = "Table";
|
|
31
|
-
|
|
32
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
33
|
-
return (_jsx("thead", __assign({ ref: ref, className: cn("bg-accent [&_tr:last-child]:border-0", className) }, props)));
|
|
34
|
-
});
|
|
6
|
+
const TableHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("thead", { ref: ref, className: cn("bg-accent [&_tr:last-child]:border-0", className), ...props })));
|
|
35
7
|
TableHeader.displayName = "TableHeader";
|
|
36
|
-
|
|
37
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
38
|
-
return (_jsx("tbody", __assign({ ref: ref, className: cn("[&_tr:last-child]:border-0", className) }, props)));
|
|
39
|
-
});
|
|
8
|
+
const TableBody = React.forwardRef(({ className, ...props }, ref) => (_jsx("tbody", { ref: ref, className: cn("[&_tr:last-child]:border-0", className), ...props })));
|
|
40
9
|
TableBody.displayName = "TableBody";
|
|
41
|
-
|
|
42
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
43
|
-
return (_jsx("tfoot", __assign({ ref: ref, className: cn("border-t border-t-border bg-main font-base [&>tr]:last:border-b-0", className) }, props)));
|
|
44
|
-
});
|
|
10
|
+
const TableFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("tfoot", { ref: ref, className: cn("border-t border-t-border bg-main font-base [&>tr]:last:border-b-0", className), ...props })));
|
|
45
11
|
TableFooter.displayName = "TableFooter";
|
|
46
|
-
|
|
47
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
48
|
-
return (_jsx("tr", __assign({ ref: ref, className: cn("border-b border-border text-text transition-colors bg-main font-base data-[state=selected]:bg-white data-[state=selected]:text-text", className) }, props)));
|
|
49
|
-
});
|
|
12
|
+
const TableRow = React.forwardRef(({ className, ...props }, ref) => (_jsx("tr", { ref: ref, className: cn("border-b border-border text-text transition-colors bg-main font-base data-[state=selected]:bg-white data-[state=selected]:text-text", className), ...props })));
|
|
50
13
|
TableRow.displayName = "TableRow";
|
|
51
|
-
|
|
52
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
53
|
-
return (_jsx("th", __assign({ ref: ref, className: cn("h-10 px-4 text-left align-middle text-sm font-normal [&:has([role=checkbox])]:pr-0", className) }, props)));
|
|
54
|
-
});
|
|
14
|
+
const TableHead = React.forwardRef(({ className, ...props }, ref) => (_jsx("th", { ref: ref, className: cn("h-10 px-4 text-left align-middle text-sm font-normal [&:has([role=checkbox])]:pr-0", className), ...props })));
|
|
55
15
|
TableHead.displayName = "TableHead";
|
|
56
|
-
|
|
57
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
58
|
-
return (_jsx("td", __assign({ ref: ref, className: cn("p-4 align-middle font-base [&:has([role=checkbox])]:pr-0", className) }, props)));
|
|
59
|
-
});
|
|
16
|
+
const TableCell = React.forwardRef(({ className, ...props }, ref) => (_jsx("td", { ref: ref, className: cn("p-4 align-middle font-base [&:has([role=checkbox])]:pr-0", className), ...props })));
|
|
60
17
|
TableCell.displayName = "TableCell";
|
|
61
|
-
|
|
62
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
63
|
-
return (_jsx("caption", __assign({ ref: ref, className: cn("mt-4 text-sm text-text font-base", className) }, props)));
|
|
64
|
-
});
|
|
18
|
+
const TableCaption = React.forwardRef(({ className, ...props }, ref) => (_jsx("caption", { ref: ref, className: cn("mt-4 text-sm text-text font-base", className), ...props })));
|
|
65
19
|
TableCaption.displayName = "TableCaption";
|
|
66
20
|
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -1,43 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
3
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
26
4
|
import { cn } from "../../utils";
|
|
27
|
-
function Tabs(
|
|
28
|
-
|
|
29
|
-
return (_jsx(TabsPrimitive.Root, __assign({ "data-slot": "tabs", className: cn("group/tabs", className) }, props)));
|
|
5
|
+
function Tabs({ className, ...props }) {
|
|
6
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", className: cn("group/tabs", className), ...props }));
|
|
30
7
|
}
|
|
31
|
-
function TabsList(
|
|
32
|
-
|
|
33
|
-
return (_jsx(TabsPrimitive.List, __assign({ "data-slot": "tabs-list", className: cn("bg-accent rounded-full inline-flex", className) }, props)));
|
|
8
|
+
function TabsList({ className, ...props }) {
|
|
9
|
+
return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", className: cn("bg-accent rounded-full inline-flex", className), ...props }));
|
|
34
10
|
}
|
|
35
|
-
function TabsTrigger(
|
|
36
|
-
|
|
37
|
-
return (_jsx(TabsPrimitive.Trigger, __assign({ "data-slot": "tabs-trigger", className: cn("px-3 py-1 transition-shadow rounded-full border border-transparent text-sm", "data-[state=active]:border-black data-[state=active]:shadow-light data-[state=active]:bg-white data-[state=active]:font-medium", "cursor-pointer data-[state=active]:cursor-default outline-none", className) }, props)));
|
|
11
|
+
function TabsTrigger({ className, ...props }) {
|
|
12
|
+
return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", className: cn("px-3 py-1 transition-shadow rounded-full border border-transparent text-sm", "data-[state=active]:border-black data-[state=active]:shadow-light data-[state=active]:bg-white data-[state=active]:font-medium", "cursor-pointer data-[state=active]:cursor-default outline-none", className), ...props }));
|
|
38
13
|
}
|
|
39
|
-
function TabsContent(
|
|
40
|
-
|
|
41
|
-
return (_jsx(TabsPrimitive.Content, __assign({ "data-slot": "tabs-content", className: cn("pt-4 md:pt-5 text-sm flex-1 outline-none", className) }, props)));
|
|
14
|
+
function TabsContent({ className, ...props }) {
|
|
15
|
+
return (_jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("pt-4 md:pt-5 text-sm flex-1 outline-none", className), ...props }));
|
|
42
16
|
}
|
|
43
17
|
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -13,5 +13,5 @@ type Selection = {
|
|
|
13
13
|
rect: DOMRect;
|
|
14
14
|
};
|
|
15
15
|
export declare const TextSelectionContainer: ({ children, enabled, }: TextSelectionContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare const TextSelectionMenu: ({ children, placement, }: TextSelectionMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const TextSelectionMenu: ({ children, placement, }: TextSelectionMenuProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
17
|
export {};
|