@vuer-ai/vuer-uikit 0.0.96 → 0.0.98
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/README.md +106 -7
- package/cli/dial-cli.js +49 -7
- package/dist/SyncScroll/SyncScroll.cjs +10 -10
- package/dist/SyncScroll/SyncScroll.mjs +3 -3
- package/dist/SyncScroll/index.cjs +10 -10
- package/dist/SyncScroll/index.mjs +3 -3
- package/dist/chunk-3HEZVWRW.mjs +62 -0
- package/dist/chunk-4KWGGESI.cjs +494 -0
- package/dist/{chunk-CCMKL2OA.cjs → chunk-7GWDO25E.cjs} +2 -2
- package/dist/chunk-A5LCX2UQ.cjs +208 -0
- package/dist/chunk-BEJIZ56L.mjs +300 -0
- package/dist/chunk-C7VGRU3O.mjs +283 -0
- package/dist/{chunk-LONOMMFA.cjs → chunk-LJMNHTTG.cjs} +21 -21
- package/dist/chunk-O66RESRR.cjs +285 -0
- package/dist/{chunk-RINTUFYQ.cjs → chunk-RMK6W774.cjs} +24 -19
- package/dist/{chunk-BFQ2WL5U.mjs → chunk-TTYSYGVE.mjs} +2 -2
- package/dist/chunk-VA3PEYFM.mjs +489 -0
- package/dist/chunk-VBBJSIY7.cjs +308 -0
- package/dist/{chunk-AIINOWEH.mjs → chunk-W4JCKCW7.mjs} +5 -5
- package/dist/chunk-WWGF6TBZ.mjs +206 -0
- package/dist/chunk-ZGN4UEJR.cjs +679 -0
- package/dist/chunk-ZQLRMOUW.mjs +661 -0
- package/dist/dial/DialPanel.cjs +24 -24
- package/dist/dial/DialPanel.mjs +23 -23
- package/dist/dial/DialProvider.cjs +3 -3
- package/dist/dial/DialProvider.d.cts +1 -0
- package/dist/dial/DialProvider.d.ts +1 -0
- package/dist/dial/DialProvider.example.cjs +72 -0
- package/dist/dial/DialProvider.example.d.cts +7 -0
- package/dist/dial/DialProvider.example.d.ts +7 -0
- package/dist/dial/DialProvider.example.mjs +68 -0
- package/dist/dial/DialProvider.mjs +1 -1
- package/dist/dial/index.cjs +42 -42
- package/dist/dial/index.mjs +23 -23
- package/dist/dial/wrapped-inputs/ControlledInputs.cjs +27 -27
- package/dist/dial/wrapped-inputs/ControlledInputs.mjs +23 -23
- package/dist/dial/wrapped-inputs/DialInputs.cjs +34 -34
- package/dist/dial/wrapped-inputs/DialInputs.mjs +23 -23
- package/dist/dial/wrapped-inputs/DialVectorInput.cjs +24 -24
- package/dist/dial/wrapped-inputs/DialVectorInput.mjs +23 -23
- package/dist/dial/wrapped-inputs/index.cjs +39 -39
- package/dist/dial/wrapped-inputs/index.mjs +23 -23
- package/dist/highlight-cursor/cursor-provider.cjs +3 -3
- package/dist/highlight-cursor/cursor-provider.mjs +2 -2
- package/dist/highlight-cursor/enhanced-components.cjs +10 -10
- package/dist/highlight-cursor/enhanced-components.mjs +5 -5
- package/dist/highlight-cursor/index.cjs +16 -16
- package/dist/highlight-cursor/index.mjs +6 -6
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.cjs +190 -190
- package/dist/index.mjs +23 -23
- package/dist/ui/UIKitBadge.cjs +6 -6
- package/dist/ui/UIKitBadge.mjs +2 -2
- package/dist/ui/avatar.cjs +1 -1
- package/dist/ui/avatar.mjs +1 -1
- package/dist/ui/badge.cjs +1 -1
- package/dist/ui/badge.d.cts +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.mjs +1 -1
- package/dist/ui/button.cjs +1 -1
- package/dist/ui/button.mjs +1 -1
- package/dist/ui/card.cjs +1 -1
- package/dist/ui/card.mjs +1 -1
- package/dist/ui/checkbox.cjs +1 -1
- package/dist/ui/checkbox.mjs +1 -1
- package/dist/ui/collapsible.cjs +1 -1
- package/dist/ui/collapsible.mjs +1 -1
- package/dist/ui/drawer.cjs +1 -1
- package/dist/ui/drawer.mjs +1 -1
- package/dist/ui/dropdown.cjs +1 -1
- package/dist/ui/dropdown.mjs +1 -1
- package/dist/ui/index.cjs +107 -107
- package/dist/ui/index.mjs +17 -17
- package/dist/ui/inputs/color-input.cjs +1 -1
- package/dist/ui/inputs/color-input.mjs +1 -1
- package/dist/ui/inputs/index.cjs +11 -11
- package/dist/ui/inputs/index.mjs +3 -3
- package/dist/ui/inputs/input-numbers.cjs +1 -1
- package/dist/ui/inputs/input-numbers.mjs +1 -1
- package/dist/ui/inputs/input.cjs +1 -1
- package/dist/ui/inputs/input.d.cts +1 -1
- package/dist/ui/inputs/input.d.ts +1 -1
- package/dist/ui/inputs/input.mjs +1 -1
- package/dist/ui/inputs/number-inputs/CmInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/CmInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/DegInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/DegInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerDegInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerDegInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerRadInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerRadInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/InchInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/InchInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/IntInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/IntInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/KVectorInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/KVectorInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/QuaternionInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/QuaternionInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/RadInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/RadInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/TimeInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/TimeInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/Vec3Input.cjs +1 -1
- package/dist/ui/inputs/number-inputs/Vec3Input.mjs +1 -1
- package/dist/ui/inputs/number-inputs/VectorInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/VectorInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/index.cjs +11 -11
- package/dist/ui/inputs/number-inputs/index.mjs +3 -3
- package/dist/ui/inputs/presets-input.cjs +1 -1
- package/dist/ui/inputs/presets-input.mjs +1 -1
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.mjs +1 -1
- package/dist/ui/layout.cjs +1 -1
- package/dist/ui/layout.mjs +1 -1
- package/dist/ui/layouts/dock-layout/DockLayoutView.cjs +1 -1
- package/dist/ui/layouts/dock-layout/DockLayoutView.mjs +1 -1
- package/dist/ui/layouts/dock-layout/LayoutSlots.cjs +1 -1
- package/dist/ui/layouts/dock-layout/LayoutSlots.mjs +1 -1
- package/dist/ui/layouts/dock-layout/index.cjs +1 -1
- package/dist/ui/layouts/dock-layout/index.mjs +1 -1
- package/dist/ui/layouts/index.cjs +2 -2
- package/dist/ui/layouts/index.mjs +2 -2
- package/dist/ui/layouts/liquid-layout/LayoutSlots.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/LayoutSlots.mjs +1 -1
- package/dist/ui/layouts/liquid-layout/LiquidLayoutView.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/LiquidLayoutView.mjs +1 -1
- package/dist/ui/layouts/liquid-layout/index.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/index.mjs +1 -1
- package/dist/ui/modal.cjs +1 -1
- package/dist/ui/modal.mjs +1 -1
- package/dist/ui/navigation.cjs +1 -1
- package/dist/ui/navigation.mjs +1 -1
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.mjs +1 -1
- package/dist/ui/panel.cjs +1 -1
- package/dist/ui/panel.mjs +1 -1
- package/dist/ui/popover.cjs +1 -1
- package/dist/ui/popover.mjs +1 -1
- package/dist/ui/radio-group.cjs +1 -1
- package/dist/ui/radio-group.mjs +1 -1
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.mjs +1 -1
- package/dist/ui/select.cjs +1 -1
- package/dist/ui/select.d.cts +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.mjs +1 -1
- package/dist/ui/separator.cjs +1 -1
- package/dist/ui/separator.mjs +1 -1
- package/dist/ui/sheet.cjs +1 -1
- package/dist/ui/sheet.mjs +1 -1
- package/dist/ui/sidebar.cjs +26 -26
- package/dist/ui/sidebar.mjs +2 -2
- package/dist/ui/simple-tree-view.cjs +1 -1
- package/dist/ui/simple-tree-view.mjs +1 -1
- package/dist/ui/skeleton.cjs +1 -1
- package/dist/ui/skeleton.mjs +1 -1
- package/dist/ui/slider.cjs +1 -1
- package/dist/ui/slider.mjs +1 -1
- package/dist/ui/switch.cjs +1 -1
- package/dist/ui/switch.mjs +1 -1
- package/dist/ui/table.cjs +1 -1
- package/dist/ui/table.mjs +1 -1
- package/dist/ui/tabs.cjs +1 -1
- package/dist/ui/tabs.mjs +1 -1
- package/dist/ui/textarea.cjs +1 -1
- package/dist/ui/textarea.d.cts +1 -1
- package/dist/ui/textarea.d.ts +1 -1
- package/dist/ui/textarea.mjs +1 -1
- package/dist/ui/theme/ThemeToggles.cjs +1 -1
- package/dist/ui/theme/ThemeToggles.mjs +1 -1
- package/dist/ui/theme/index.cjs +1 -1
- package/dist/ui/theme/index.mjs +1 -1
- package/dist/ui/toggle-buttons.cjs +1 -1
- package/dist/ui/toggle-buttons.mjs +1 -1
- package/dist/ui/toggle-group.cjs +1 -1
- package/dist/ui/toggle-group.mjs +1 -1
- package/dist/ui/toggle.cjs +1 -1
- package/dist/ui/toggle.mjs +1 -1
- package/dist/ui/toolbar.cjs +1 -1
- package/dist/ui/toolbar.mjs +1 -1
- package/dist/ui/tooltip.cjs +1 -1
- package/dist/ui/tooltip.mjs +1 -1
- package/dist/ui/tree-view/TreeSearchBar.cjs +1 -1
- package/dist/ui/tree-view/TreeSearchBar.mjs +1 -1
- package/dist/ui/tree-view/TreeView.cjs +1 -1
- package/dist/ui/tree-view/TreeView.mjs +1 -1
- package/dist/ui/tree-view/index.cjs +6 -6
- package/dist/ui/tree-view/index.mjs +2 -2
- package/dist/ui/tree-view-legacy.cjs +9 -9
- package/dist/ui/tree-view-legacy.mjs +5 -5
- package/dist/ui/waterfall/CursorOverlay.cjs +1 -1
- package/dist/ui/waterfall/CursorOverlay.mjs +1 -1
- package/dist/ui/waterfall/TimelineEvent.cjs +1 -1
- package/dist/ui/waterfall/TimelineEvent.mjs +1 -1
- package/dist/ui/waterfall/TimelineProcessBar.cjs +1 -1
- package/dist/ui/waterfall/TimelineProcessBar.mjs +1 -1
- package/dist/ui/waterfall/Wedges.cjs +1 -1
- package/dist/ui/waterfall/Wedges.mjs +1 -1
- package/dist/ui/waterfall/index.cjs +8 -8
- package/dist/ui/waterfall/index.mjs +7 -7
- package/package.json +28 -2
- package/src/SyncScroll/README.md +283 -0
- package/src/SyncScroll/SyncScroll.tsx +361 -0
- package/src/SyncScroll/index.ts +22 -0
- package/src/SyncScroll/useSyncScroll.tsx +226 -0
- package/src/cli/dial-cli.ts +1133 -0
- package/src/dial/DialPanel.tsx +208 -0
- package/src/dial/DialProvider.example.tsx +80 -0
- package/src/dial/DialProvider.tsx +138 -0
- package/src/dial/index.ts +26 -0
- package/src/dial/wrapped-inputs/ControlledInputs.tsx +176 -0
- package/src/dial/wrapped-inputs/DialInputs.tsx +401 -0
- package/src/dial/wrapped-inputs/DialVectorInput.tsx +125 -0
- package/src/dial/wrapped-inputs/index.ts +25 -0
- package/src/highlight-cursor/cursor-context.tsx +23 -0
- package/src/highlight-cursor/cursor-provider.tsx +264 -0
- package/src/highlight-cursor/enhanced-components.tsx +16 -0
- package/src/highlight-cursor/index.ts +21 -0
- package/src/highlight-cursor/tabs-cursor-context.tsx +121 -0
- package/src/highlight-cursor/types.ts +40 -0
- package/src/highlight-cursor/with-cursor.tsx +144 -0
- package/src/hooks/clientOnly.tsx +54 -0
- package/src/hooks/cn.ts +33 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useDocument.tsx +18 -0
- package/src/hooks/useDragSelect.ts +116 -0
- package/src/hooks/useIsMobile.ts +35 -0
- package/src/hooks/useLocalStorage.ts +122 -0
- package/src/hooks/useLocation.tsx +95 -0
- package/src/hooks/useQueryParams.tsx +31 -0
- package/src/hooks/useWindow.tsx +18 -0
- package/src/index.css +5 -0
- package/src/index.ts +5 -0
- package/src/styles/.editorconfig +0 -0
- package/src/styles/theme.css +152 -0
- package/src/styles/toast.css +67 -0
- package/src/styles/variables.css +229 -0
- package/src/ui/UIKitBadge.tsx +171 -0
- package/src/ui/avatar.tsx +221 -0
- package/src/ui/badge.tsx +74 -0
- package/src/ui/button.tsx +143 -0
- package/src/ui/card.tsx +146 -0
- package/src/ui/checkbox.tsx +78 -0
- package/src/ui/collapsible.tsx +43 -0
- package/src/ui/drag-selectable/DragSelectProvider.tsx +178 -0
- package/src/ui/drag-selectable/createSelectable.tsx +43 -0
- package/src/ui/drag-selectable/index.ts +2 -0
- package/src/ui/drawer.tsx +137 -0
- package/src/ui/dropdown.tsx +707 -0
- package/src/ui/icons/MouseCursorIcons.tsx +39 -0
- package/src/ui/icons/cursor.tsx +38 -0
- package/src/ui/icons/index.ts +2 -0
- package/src/ui/index.ts +45 -0
- package/src/ui/inputs/color-input.tsx +61 -0
- package/src/ui/inputs/index.tsx +5 -0
- package/src/ui/inputs/input-numbers.tsx +394 -0
- package/src/ui/inputs/input.tsx +155 -0
- package/src/ui/inputs/number-inputs/CmInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/DegInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/EulerDegInput.tsx +14 -0
- package/src/ui/inputs/number-inputs/EulerInput.tsx +30 -0
- package/src/ui/inputs/number-inputs/EulerRadInput.tsx +14 -0
- package/src/ui/inputs/number-inputs/InchInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/IntInput.tsx +46 -0
- package/src/ui/inputs/number-inputs/KVectorInput.tsx +20 -0
- package/src/ui/inputs/number-inputs/QuaternionInput.tsx +27 -0
- package/src/ui/inputs/number-inputs/RadInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/TimeInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/Vec3Input.tsx +26 -0
- package/src/ui/inputs/number-inputs/VectorInput.tsx +38 -0
- package/src/ui/inputs/number-inputs/index.ts +38 -0
- package/src/ui/inputs/presets-input.tsx +59 -0
- package/src/ui/label.tsx +35 -0
- package/src/ui/layout.tsx +43 -0
- package/src/ui/layouts/dock-layout/DockLayoutView.tsx +128 -0
- package/src/ui/layouts/dock-layout/LayoutSlots.tsx +85 -0
- package/src/ui/layouts/dock-layout/index.tsx +2 -0
- package/src/ui/layouts/index.ts +2 -0
- package/src/ui/layouts/liquid-layout/LayoutSlots.tsx +82 -0
- package/src/ui/layouts/liquid-layout/LiquidLayoutView.tsx +76 -0
- package/src/ui/layouts/liquid-layout/index.ts +1 -0
- package/src/ui/modal.tsx +211 -0
- package/src/ui/navigation.tsx +86 -0
- package/src/ui/pagination.tsx +129 -0
- package/src/ui/panel.tsx +146 -0
- package/src/ui/popover.tsx +112 -0
- package/src/ui/radio-group.tsx +63 -0
- package/src/ui/resizable.tsx +52 -0
- package/src/ui/select.tsx +365 -0
- package/src/ui/separator.tsx +26 -0
- package/src/ui/sheet.tsx +257 -0
- package/src/ui/sidebar.tsx +695 -0
- package/src/ui/simple-tree-view.tsx +604 -0
- package/src/ui/skeleton.tsx +15 -0
- package/src/ui/slider.tsx +204 -0
- package/src/ui/switch.tsx +45 -0
- package/src/ui/table.tsx +99 -0
- package/src/ui/tabs.tsx +192 -0
- package/src/ui/textarea.tsx +55 -0
- package/src/ui/theme/ThemeProvider.tsx +319 -0
- package/src/ui/theme/ThemeToggles.tsx +84 -0
- package/src/ui/theme/index.ts +21 -0
- package/src/ui/theme/themeScript.tsx +179 -0
- package/src/ui/theme/types.ts +61 -0
- package/src/ui/toast.tsx +30 -0
- package/src/ui/toggle-buttons.tsx +290 -0
- package/src/ui/toggle-group.tsx +236 -0
- package/src/ui/toggle.tsx +94 -0
- package/src/ui/toolbar.tsx +54 -0
- package/src/ui/tooltip.tsx +171 -0
- package/src/ui/tree-view/TreeSearchBar.tsx +88 -0
- package/src/ui/tree-view/TreeView.tsx +232 -0
- package/src/ui/tree-view/hooks.tsx +289 -0
- package/src/ui/tree-view/index.ts +4 -0
- package/src/ui/tree-view/types.ts +23 -0
- package/src/ui/tree-view-legacy.tsx +644 -0
- package/src/ui/version-badge.tsx +0 -0
- package/src/ui/waterfall/CursorOverlay.tsx +96 -0
- package/src/ui/waterfall/NavigationControls.tsx +42 -0
- package/src/ui/waterfall/Tick.tsx +51 -0
- package/src/ui/waterfall/TimeRuleEventDot.tsx +19 -0
- package/src/ui/waterfall/TimelineEvent.tsx +60 -0
- package/src/ui/waterfall/TimelineProcessBar.tsx +207 -0
- package/src/ui/waterfall/Wedges.tsx +67 -0
- package/src/ui/waterfall/WheelZoomContext.tsx +128 -0
- package/src/ui/waterfall/hooks/useTimelineState.tsx +134 -0
- package/src/ui/waterfall/hooks/useViewport.tsx +293 -0
- package/src/ui/waterfall/index.tsx +326 -0
- package/src/ui/waterfall/types.ts +20 -0
- package/src/ui/waterfall/utils.ts +91 -0
- package/dist/chunk-W2YAQV5N.mjs +0 -57
- package/dist/{chunk-QLCEHV4Q.mjs → chunk-2OZK5DY5.mjs} +2 -2
- package/dist/{chunk-Z35DNFRZ.cjs → chunk-7IS37C3P.cjs} +2 -2
- package/dist/{chunk-4AOAH77D.mjs → chunk-A2PCEL5S.mjs} +2 -2
- package/dist/{chunk-K4VD5PPY.mjs → chunk-BIUDC66P.mjs} +1 -1
- package/dist/{chunk-RKJR6RZU.cjs → chunk-OYNLQTHW.cjs} +1 -1
- package/dist/{chunk-VE3XLQLO.cjs → chunk-QUFZWF4E.cjs} +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
|
|
3
|
+
function subscribe() {
|
|
4
|
+
// Document object doesn't change, but we need a subscription for the hook
|
|
5
|
+
return () => {};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function getSnapshot() {
|
|
9
|
+
return typeof document !== "undefined" ? document : undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getServerSnapshot() {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function useDocument() {
|
|
17
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
18
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { useState, useCallback, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
export interface UseDragSelectOptions {
|
|
4
|
+
onSelectionChange?: (selectedItems: Set<string>) => void;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function useDragSelect(options: UseDragSelectOptions = {}) {
|
|
8
|
+
const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set());
|
|
9
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
10
|
+
const [dragMode, setDragMode] = useState<"toggle" | "replace">("toggle");
|
|
11
|
+
const [dragStartItem, setDragStartItem] = useState<string | null>(null);
|
|
12
|
+
|
|
13
|
+
// Notify when selection changes
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
options.onSelectionChange?.(selectedItems);
|
|
16
|
+
}, [selectedItems, options.onSelectionChange, options]);
|
|
17
|
+
|
|
18
|
+
const handleMouseDown = useCallback((id: string, e: React.MouseEvent) => {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
setIsDragging(true);
|
|
21
|
+
setDragStartItem(id);
|
|
22
|
+
|
|
23
|
+
// Determine drag mode based on modifier keys
|
|
24
|
+
const mode = e.ctrlKey || e.metaKey ? "replace" : "toggle";
|
|
25
|
+
setDragMode(mode);
|
|
26
|
+
|
|
27
|
+
if (mode === "replace") {
|
|
28
|
+
// In replace mode, start fresh selection
|
|
29
|
+
setSelectedItems(new Set([id]));
|
|
30
|
+
} else {
|
|
31
|
+
// In toggle mode, toggle the starting item
|
|
32
|
+
setSelectedItems((prev) => {
|
|
33
|
+
const newSet = new Set(prev);
|
|
34
|
+
if (newSet.has(id)) {
|
|
35
|
+
newSet.delete(id);
|
|
36
|
+
} else {
|
|
37
|
+
newSet.add(id);
|
|
38
|
+
}
|
|
39
|
+
return newSet;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
const handleMouseEnter = useCallback(
|
|
45
|
+
(id: string) => {
|
|
46
|
+
if (!isDragging) return;
|
|
47
|
+
if (id === dragStartItem) return; // Don't re-process the starting item
|
|
48
|
+
|
|
49
|
+
if (dragMode === "replace") {
|
|
50
|
+
setSelectedItems((prev) => new Set([...prev, id]));
|
|
51
|
+
} else {
|
|
52
|
+
// In toggle mode, each item toggles its own state
|
|
53
|
+
setSelectedItems((prev) => {
|
|
54
|
+
const newSet = new Set(prev);
|
|
55
|
+
if (newSet.has(id)) {
|
|
56
|
+
newSet.delete(id);
|
|
57
|
+
} else {
|
|
58
|
+
newSet.add(id);
|
|
59
|
+
}
|
|
60
|
+
return newSet;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
[isDragging, dragMode, dragStartItem],
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
// const handleMouseUp = useCallback(() => {
|
|
68
|
+
// setIsDragging(false);
|
|
69
|
+
// setDragStartItem(null);
|
|
70
|
+
// }, []);
|
|
71
|
+
|
|
72
|
+
const clearSelection = useCallback(() => {
|
|
73
|
+
setSelectedItems(new Set());
|
|
74
|
+
}, []);
|
|
75
|
+
|
|
76
|
+
const isSelected = useCallback((id: string) => selectedItems.has(id), [selectedItems]);
|
|
77
|
+
|
|
78
|
+
const getItemProps = useCallback(
|
|
79
|
+
(id: string) => ({
|
|
80
|
+
"data-selected": selectedItems.has(id),
|
|
81
|
+
onMouseDown: (e: React.MouseEvent) => handleMouseDown(id, e),
|
|
82
|
+
onMouseEnter: () => handleMouseEnter(id),
|
|
83
|
+
}),
|
|
84
|
+
[selectedItems, handleMouseDown, handleMouseEnter],
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// Handle global mouse up and escape key
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (typeof document === "undefined") return;
|
|
90
|
+
|
|
91
|
+
const handleGlobalMouseUp = () => {
|
|
92
|
+
setIsDragging(false);
|
|
93
|
+
setDragStartItem(null);
|
|
94
|
+
};
|
|
95
|
+
const handleEscape = (e: KeyboardEvent) => {
|
|
96
|
+
if (e.key === "Escape") {
|
|
97
|
+
clearSelection();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
document.addEventListener("mouseup", handleGlobalMouseUp);
|
|
102
|
+
document.addEventListener("keydown", handleEscape);
|
|
103
|
+
|
|
104
|
+
return () => {
|
|
105
|
+
document.removeEventListener("mouseup", handleGlobalMouseUp);
|
|
106
|
+
document.removeEventListener("keydown", handleEscape);
|
|
107
|
+
};
|
|
108
|
+
}, [clearSelection]);
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
selectedItems,
|
|
112
|
+
isSelected,
|
|
113
|
+
clearSelection,
|
|
114
|
+
getItemProps,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
|
|
3
|
+
const MOBILE_BREAKPOINT = 768;
|
|
4
|
+
|
|
5
|
+
function subscribe(callback: () => void) {
|
|
6
|
+
if (typeof window === "undefined") {
|
|
7
|
+
return () => {};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
11
|
+
|
|
12
|
+
// Modern browsers
|
|
13
|
+
if (mql.addEventListener) {
|
|
14
|
+
mql.addEventListener("change", callback);
|
|
15
|
+
return () => mql.removeEventListener("change", callback);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Fallback for older browsers
|
|
19
|
+
mql.addListener(callback);
|
|
20
|
+
return () => mql.removeListener(callback);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getSnapshot() {
|
|
24
|
+
if (typeof window === "undefined") return false;
|
|
25
|
+
return window.innerWidth < MOBILE_BREAKPOINT;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getServerSnapshot() {
|
|
29
|
+
// Return false on server - most users are on desktop
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function useIsMobile() {
|
|
34
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
35
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { useCallback, useSyncExternalStore, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
// Store for managing localStorage state
|
|
4
|
+
const localStorageStore = (() => {
|
|
5
|
+
const listeners = new Map<string, Set<() => void>>();
|
|
6
|
+
|
|
7
|
+
function subscribe(key: string, callback: () => void) {
|
|
8
|
+
if (!listeners.has(key)) {
|
|
9
|
+
listeners.set(key, new Set());
|
|
10
|
+
}
|
|
11
|
+
listeners.get(key)!.add(callback);
|
|
12
|
+
|
|
13
|
+
// Listen for storage events from other tabs/windows
|
|
14
|
+
const handleStorageChange = (e: StorageEvent) => {
|
|
15
|
+
if (e.key === key && e.storageArea === localStorage) {
|
|
16
|
+
listeners.get(key)?.forEach((listener) => listener());
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
if (typeof window !== "undefined") {
|
|
21
|
+
window.addEventListener("storage", handleStorageChange);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
listeners.get(key)?.delete(callback);
|
|
26
|
+
if (listeners.get(key)?.size === 0) {
|
|
27
|
+
listeners.delete(key);
|
|
28
|
+
}
|
|
29
|
+
if (typeof window !== "undefined") {
|
|
30
|
+
window.removeEventListener("storage", handleStorageChange);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function notifyListeners(key: string) {
|
|
36
|
+
listeners.get(key)?.forEach((listener) => listener());
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return { subscribe, notifyListeners };
|
|
40
|
+
})();
|
|
41
|
+
|
|
42
|
+
export function useLocalStorage<T>(
|
|
43
|
+
key: string,
|
|
44
|
+
initialValue: T,
|
|
45
|
+
): [T, (value: T | ((val: T) => T)) => void] {
|
|
46
|
+
// Use refs to store stable references
|
|
47
|
+
const keyRef = useRef(key);
|
|
48
|
+
const initialValueRef = useRef(initialValue);
|
|
49
|
+
|
|
50
|
+
// Update refs when props change
|
|
51
|
+
keyRef.current = key;
|
|
52
|
+
initialValueRef.current = initialValue;
|
|
53
|
+
|
|
54
|
+
const subscribe = useCallback(
|
|
55
|
+
(callback: () => void) => localStorageStore.subscribe(keyRef.current, callback),
|
|
56
|
+
[],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const getSnapshot = useCallback((): T => {
|
|
60
|
+
if (typeof window === "undefined") {
|
|
61
|
+
return initialValueRef.current;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
const item = window.localStorage.getItem(keyRef.current);
|
|
66
|
+
if (item === null) return initialValueRef.current;
|
|
67
|
+
|
|
68
|
+
// Handle different data types
|
|
69
|
+
if (typeof initialValueRef.current === "string") {
|
|
70
|
+
return item as T;
|
|
71
|
+
} else if (typeof initialValueRef.current === "number") {
|
|
72
|
+
return (parseFloat(item) || initialValueRef.current) as T;
|
|
73
|
+
} else if (typeof initialValueRef.current === "boolean") {
|
|
74
|
+
return (item === "true") as T;
|
|
75
|
+
} else {
|
|
76
|
+
// For objects and arrays, parse JSON
|
|
77
|
+
return JSON.parse(item);
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.warn(`Error reading localStorage key "${keyRef.current}":`, error);
|
|
81
|
+
return initialValueRef.current;
|
|
82
|
+
}
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
const getServerSnapshot = useCallback((): T => {
|
|
86
|
+
return initialValueRef.current;
|
|
87
|
+
}, []);
|
|
88
|
+
|
|
89
|
+
const storedValue = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
90
|
+
|
|
91
|
+
const setValue = useCallback(
|
|
92
|
+
(value: T | ((val: T) => T)) => {
|
|
93
|
+
try {
|
|
94
|
+
// Get current value for functional updates
|
|
95
|
+
const currentValue = getSnapshot();
|
|
96
|
+
// Allow value to be a function for functional updates
|
|
97
|
+
const valueToStore = value instanceof Function ? value(currentValue) : value;
|
|
98
|
+
|
|
99
|
+
// Save to localStorage only on client
|
|
100
|
+
if (typeof window !== "undefined") {
|
|
101
|
+
let stringValue: string;
|
|
102
|
+
if (typeof valueToStore === "string") {
|
|
103
|
+
stringValue = valueToStore;
|
|
104
|
+
} else if (typeof valueToStore === "number" || typeof valueToStore === "boolean") {
|
|
105
|
+
stringValue = valueToStore.toString();
|
|
106
|
+
} else {
|
|
107
|
+
stringValue = JSON.stringify(valueToStore);
|
|
108
|
+
}
|
|
109
|
+
window.localStorage.setItem(keyRef.current, stringValue);
|
|
110
|
+
|
|
111
|
+
// Notify all listeners for this key
|
|
112
|
+
localStorageStore.notifyListeners(keyRef.current);
|
|
113
|
+
}
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.warn(`Error setting localStorage key "${keyRef.current}":`, error);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
[getSnapshot],
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
return [storedValue, setValue];
|
|
122
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
|
|
3
|
+
interface LocationState {
|
|
4
|
+
href?: string;
|
|
5
|
+
pathname?: string;
|
|
6
|
+
search?: string;
|
|
7
|
+
hash?: string;
|
|
8
|
+
host?: string;
|
|
9
|
+
hostname?: string;
|
|
10
|
+
port?: string;
|
|
11
|
+
protocol?: string;
|
|
12
|
+
origin?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let listeners: Array<() => void> = [];
|
|
16
|
+
let currentSnapshot: LocationState | undefined = undefined;
|
|
17
|
+
|
|
18
|
+
function updateSnapshot() {
|
|
19
|
+
if (typeof window === "undefined") {
|
|
20
|
+
currentSnapshot = undefined;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
currentSnapshot = {
|
|
25
|
+
href: window.location.href,
|
|
26
|
+
pathname: window.location.pathname,
|
|
27
|
+
search: window.location.search,
|
|
28
|
+
hash: window.location.hash,
|
|
29
|
+
host: window.location.host,
|
|
30
|
+
hostname: window.location.hostname,
|
|
31
|
+
port: window.location.port,
|
|
32
|
+
protocol: window.location.protocol,
|
|
33
|
+
origin: window.location.origin,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Initialize snapshot
|
|
38
|
+
updateSnapshot();
|
|
39
|
+
|
|
40
|
+
function subscribe(callback: () => void) {
|
|
41
|
+
listeners.push(callback);
|
|
42
|
+
|
|
43
|
+
if (typeof window === "undefined") {
|
|
44
|
+
return () => {
|
|
45
|
+
listeners = listeners.filter((l) => l !== callback);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const notifyListeners = () => {
|
|
50
|
+
updateSnapshot();
|
|
51
|
+
listeners.forEach((listener) => listener());
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Listen to navigation events
|
|
55
|
+
window.addEventListener("popstate", notifyListeners);
|
|
56
|
+
window.addEventListener("hashchange", notifyListeners);
|
|
57
|
+
|
|
58
|
+
// Intercept pushState and replaceState
|
|
59
|
+
const originalPushState = window.history.pushState;
|
|
60
|
+
const originalReplaceState = window.history.replaceState;
|
|
61
|
+
|
|
62
|
+
window.history.pushState = function (...args) {
|
|
63
|
+
originalPushState.apply(window.history, args);
|
|
64
|
+
notifyListeners();
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
window.history.replaceState = function (...args) {
|
|
68
|
+
originalReplaceState.apply(window.history, args);
|
|
69
|
+
notifyListeners();
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return () => {
|
|
73
|
+
listeners = listeners.filter((l) => l !== callback);
|
|
74
|
+
window.removeEventListener("popstate", notifyListeners);
|
|
75
|
+
window.removeEventListener("hashchange", notifyListeners);
|
|
76
|
+
|
|
77
|
+
// Restore original methods if no more listeners
|
|
78
|
+
if (listeners.length === 0) {
|
|
79
|
+
window.history.pushState = originalPushState;
|
|
80
|
+
window.history.replaceState = originalReplaceState;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function getSnapshot(): LocationState | undefined {
|
|
86
|
+
return currentSnapshot;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function getServerSnapshot(): LocationState | undefined {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function useLocation() {
|
|
94
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
95
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { atom, useAtom } from "jotai";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
import { useLocation } from "./useLocation";
|
|
5
|
+
import { useWindow } from "./useWindow";
|
|
6
|
+
|
|
7
|
+
const queryParamsAtom = atom<Record<string, string>>({});
|
|
8
|
+
|
|
9
|
+
export function useQueryParams(key?: string) {
|
|
10
|
+
const [queryParams, setQueryParams] = useAtom(queryParamsAtom);
|
|
11
|
+
|
|
12
|
+
const window = useWindow();
|
|
13
|
+
const location = useLocation();
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!window) return;
|
|
17
|
+
|
|
18
|
+
const updateParams = () => {
|
|
19
|
+
const queries = new URLSearchParams(location?.search);
|
|
20
|
+
const params = Object.fromEntries(queries);
|
|
21
|
+
setQueryParams(params);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
updateParams();
|
|
25
|
+
window.addEventListener("popstate", updateParams);
|
|
26
|
+
return () => window.removeEventListener("popstate", updateParams);
|
|
27
|
+
}, [window, location, setQueryParams]);
|
|
28
|
+
|
|
29
|
+
if (!window) return key ? null : {};
|
|
30
|
+
return key ? queryParams[key] || null : queryParams;
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
|
|
3
|
+
function subscribe() {
|
|
4
|
+
// Window object doesn't change, but we need a subscription for the hook
|
|
5
|
+
return () => {};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function getSnapshot() {
|
|
9
|
+
return typeof window !== "undefined" ? window : undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getServerSnapshot() {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function useWindow() {
|
|
17
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
18
|
+
}
|
package/src/index.css
ADDED
package/src/index.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
@import "./variables.css";
|
|
2
|
+
|
|
3
|
+
@custom-variant liquid (&:is(.liquid-dark *, .liquid-light *));
|
|
4
|
+
|
|
5
|
+
@utility liquid-bg {
|
|
6
|
+
background: linear-gradient(
|
|
7
|
+
147.1deg,
|
|
8
|
+
rgba(172, 172, 172, 0.1) 0%,
|
|
9
|
+
rgba(74, 74, 74, 0.1) 105.28%
|
|
10
|
+
) !important;
|
|
11
|
+
backdrop-filter: blur(20px) !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@utility liquid-bg-tooltip-arrow {
|
|
15
|
+
background: rgba(74, 74, 74, 0.1) !important;
|
|
16
|
+
backdrop-filter: blur(2px) !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@utility liquid-bg-tooltip-content {
|
|
20
|
+
background: rgba(74, 74, 74, 0.1) !important;
|
|
21
|
+
backdrop-filter: blur(2px) !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@utility liquid-bg-tooltip-top {
|
|
25
|
+
background: linear-gradient(
|
|
26
|
+
to bottom,
|
|
27
|
+
rgba(172, 172, 172, 0.1) 0%,
|
|
28
|
+
rgba(74, 74, 74, 0.1) 100%
|
|
29
|
+
) !important;
|
|
30
|
+
backdrop-filter: blur(2px) !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@utility liquid-bg-tooltip-bottom {
|
|
34
|
+
background: linear-gradient(
|
|
35
|
+
to top,
|
|
36
|
+
rgba(172, 172, 172, 0.1) 0%,
|
|
37
|
+
rgba(74, 74, 74, 0.1) 100%
|
|
38
|
+
) !important;
|
|
39
|
+
backdrop-filter: blur(2px) !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@utility liquid-bg-tooltip-left {
|
|
43
|
+
background: linear-gradient(
|
|
44
|
+
to right,
|
|
45
|
+
rgba(172, 172, 172, 0.1) 0%,
|
|
46
|
+
rgba(74, 74, 74, 0.1) 100%
|
|
47
|
+
) !important;
|
|
48
|
+
backdrop-filter: blur(2px) !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@utility liquid-bg-tooltip-right {
|
|
52
|
+
background: linear-gradient(
|
|
53
|
+
to left,
|
|
54
|
+
rgba(172, 172, 172, 0.1),
|
|
55
|
+
rgba(74, 74, 74, 0.1)
|
|
56
|
+
) !important;
|
|
57
|
+
backdrop-filter: blur(2px) !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@utility scrollbar-hide {
|
|
61
|
+
scrollbar-width: none;
|
|
62
|
+
&::-webkit-scrollbar {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@utility scrollbar-track-transparent {
|
|
68
|
+
scrollbar-color: var(--bg-tertiary) transparent;
|
|
69
|
+
|
|
70
|
+
&::-webkit-scrollbar-track {
|
|
71
|
+
background: transparent;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&::-webkit-scrollbar-thumb {
|
|
75
|
+
background: var(--bg-tertiary);
|
|
76
|
+
border-radius: 4px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@theme inline {
|
|
81
|
+
--font-sans: Inter;
|
|
82
|
+
--font-number-input: "Fira Mono";
|
|
83
|
+
|
|
84
|
+
/* color */
|
|
85
|
+
--color-brand-primary: var(--brand-primary);
|
|
86
|
+
--color-brand-hover: var(--brand-hover);
|
|
87
|
+
--color-brand-pressed: var(--brand-pressed);
|
|
88
|
+
--color-alt-primary: var(--alt-primary);
|
|
89
|
+
--color-alt-hover: var(--alt-hover);
|
|
90
|
+
--color-alt-pressed: var(--alt-pressed);
|
|
91
|
+
--color-group-primary: var(--group-primary);
|
|
92
|
+
--color-group-hover: var(--group-hover);
|
|
93
|
+
--color-group-pressed: var(--group-pressed);
|
|
94
|
+
--color-text-highlight: var(--text-highlight);
|
|
95
|
+
--color-text-primary: var(--text-primary);
|
|
96
|
+
--color-text-secondary: var(--text-secondary);
|
|
97
|
+
--color-text-tertiary: var(--text-tertiary);
|
|
98
|
+
--color-text-withbg: var(--text-withbg);
|
|
99
|
+
--color-bg-primary: var(--bg-primary);
|
|
100
|
+
--color-bg-secondary: var(--bg-secondary);
|
|
101
|
+
--color-bg-tertiary: var(--bg-tertiary);
|
|
102
|
+
--color-bg-quaternary: var(--bg-quaternary);
|
|
103
|
+
--color-bg-mask: var(--bg-mask);
|
|
104
|
+
--color-icon-highlight: var(--icon-highlight);
|
|
105
|
+
--color-icon-primary: var(--icon-primary);
|
|
106
|
+
--color-icon-secondary: var(--icon-secondary);
|
|
107
|
+
--color-icon-tertiary: var(--icon-tertiary);
|
|
108
|
+
--color-icon-withbg: var(--icon-withbg);
|
|
109
|
+
--color-danger-primary: var(--danger-primary);
|
|
110
|
+
--color-danger-secondary: var(--danger-secondary);
|
|
111
|
+
--color-danger-tertiary: var(--danger-tertiary);
|
|
112
|
+
--color-accent-warning: var(--accent-warning);
|
|
113
|
+
--color-accent-success: var(--accent-success);
|
|
114
|
+
--color-line-primary: var(--line-primary);
|
|
115
|
+
--color-line-secondary: var(--line-secondary);
|
|
116
|
+
--color-shadow-primary: var(--shadow-primary);
|
|
117
|
+
--color-shadow-secondary: var(--shadow-secondary);
|
|
118
|
+
--color-select-secondary: var(--select-secondary);
|
|
119
|
+
/* radius */
|
|
120
|
+
--radius-uk-xs: var(--radius); /* 4px */
|
|
121
|
+
--radius-uk-sm: calc(var(--radius) + 2px); /* 6px */
|
|
122
|
+
--radius-uk-md: calc(var(--radius) + 4px); /* 8px */
|
|
123
|
+
--radius-uk-lg: calc(var(--radius) + 10px); /* 12px */
|
|
124
|
+
--radius-uk-xl: calc(var(--radius) + 13px); /* 16px */
|
|
125
|
+
/* spacing */
|
|
126
|
+
--spacing-xxs: calc(var(--spacing) - 2px); /* 2px */
|
|
127
|
+
--spacing-xs: var(--spacing); /* 4px */
|
|
128
|
+
--spacing-sm: calc(var(--spacing) + 2px); /* 6px */
|
|
129
|
+
--spacing-md: calc(var(--spacing) + 4px); /* 8px */
|
|
130
|
+
--spacing-lg: calc(var(--spacing) + 9px); /* 12px */
|
|
131
|
+
--spacing-xl: calc(var(--spacing) + 12px); /* 16px */
|
|
132
|
+
/* font-size */
|
|
133
|
+
--text-uk-hint: 10px; /* hint text */
|
|
134
|
+
--text-uk-xs: 11px; /* primary text, input title */
|
|
135
|
+
--text-uk-sm: 12px; /* tab, highlight text, numbers */
|
|
136
|
+
--text-uk-subtitle: 13px; /* subtitle */
|
|
137
|
+
--text-uk-md: 14px; /* primary body, panel title */
|
|
138
|
+
--text-uk-lg: 16px; /* page title */
|
|
139
|
+
--text-uk-h3: 20px; /* heading 3 */
|
|
140
|
+
--text-uk-h2: 24px; /* heading 2 */
|
|
141
|
+
--text-uk-h1: 30px; /* heading 1 */
|
|
142
|
+
/* line-height */
|
|
143
|
+
--leading-uk-hint: 12px; /* hint text */
|
|
144
|
+
--leading-uk-xs: 14px; /* primary text, input title */
|
|
145
|
+
--leading-uk-sm: 16px; /* tab, highlight text, numbers */
|
|
146
|
+
--leading-uk-subtitle: 18px; /* subtitle */
|
|
147
|
+
--leading-uk-md: 20px; /* primary body, panel title */
|
|
148
|
+
--leading-uk-lg: 24px; /* page title */
|
|
149
|
+
--leading-uk-h3: 28px; /* heading 3 */
|
|
150
|
+
--leading-uk-h2: 32px; /* heading 2 */
|
|
151
|
+
--leading-uk-h1: 36px; /* heading 1 */
|
|
152
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.vk-toast,
|
|
2
|
+
[data-sonner-toast].vk-toast {
|
|
3
|
+
background: var(--color-bg-primary) !important;
|
|
4
|
+
border: none !important;
|
|
5
|
+
border-radius: var(--radius-uk-md) !important;
|
|
6
|
+
padding: var(--spacing-lg) !important;
|
|
7
|
+
box-shadow: 0px 4px 16px 0px var(--color-shadow-secondary) !important;
|
|
8
|
+
padding-right: 60px !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.vk-toast [data-title] {
|
|
12
|
+
color: var(--color-text-primary) !important;
|
|
13
|
+
font-size: var(--text-uk-md) !important;
|
|
14
|
+
line-height: var(--leading-uk-md) !important;
|
|
15
|
+
font-weight: 500 !important;
|
|
16
|
+
display: -webkit-box;
|
|
17
|
+
line-clamp: 1;
|
|
18
|
+
box-orient: vertical;
|
|
19
|
+
-webkit-line-clamp: 1;
|
|
20
|
+
-webkit-box-orient: vertical;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.vk-toast-description {
|
|
26
|
+
color: var(--color-text-secondary) !important;
|
|
27
|
+
font-size: var(--text-uk-sm) !important;
|
|
28
|
+
line-height: var(--leading-uk-sm) !important;
|
|
29
|
+
font-weight: 400 !important;
|
|
30
|
+
display: -webkit-box;
|
|
31
|
+
line-clamp: 3;
|
|
32
|
+
box-orient: vertical;
|
|
33
|
+
-webkit-line-clamp: 3;
|
|
34
|
+
-webkit-box-orient: vertical;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.vk-toast button[data-button] {
|
|
40
|
+
background: transparent !important;
|
|
41
|
+
color: var(--color-text-primary) !important;
|
|
42
|
+
border: none !important;
|
|
43
|
+
font-size: var(--text-uk-sm) !important;
|
|
44
|
+
line-height: var(--leading-uk-sm) !important;
|
|
45
|
+
font-weight: 400 !important;
|
|
46
|
+
border-top-right-radius: var(--radius-uk-md) !important;
|
|
47
|
+
border-bottom-right-radius: var(--radius-uk-md) !important;
|
|
48
|
+
border-top-left-radius: 0 !important;
|
|
49
|
+
border-bottom-left-radius: 0 !important;
|
|
50
|
+
text-decoration: none !important;
|
|
51
|
+
cursor: pointer !important;
|
|
52
|
+
position: absolute !important;
|
|
53
|
+
right: 0 !important;
|
|
54
|
+
top: 0 !important;
|
|
55
|
+
height: 100% !important;
|
|
56
|
+
width: 60px !important;
|
|
57
|
+
display: flex !important;
|
|
58
|
+
align-items: center !important;
|
|
59
|
+
justify-content: center !important;
|
|
60
|
+
text-overflow: ellipsis !important;
|
|
61
|
+
overflow: hidden !important;
|
|
62
|
+
white-space: nowrap !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.vk-toast button[data-button]:hover {
|
|
66
|
+
background: var(--color-bg-secondary) !important;
|
|
67
|
+
}
|