@umbra.ui/core 0.1.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/controls/Dropdown/types.d.ts +5 -0
- package/dist/components/controls/Dropdown/types.d.ts.map +1 -0
- package/dist/components/controls/Dropdown/types.js +1 -0
- package/dist/components/controls/SegmentedControl/types.d.ts +6 -0
- package/dist/components/controls/SegmentedControl/types.d.ts.map +1 -0
- package/dist/components/controls/SegmentedControl/types.js +1 -0
- package/dist/components/dialogs/Alert/types.d.ts +7 -0
- package/dist/components/dialogs/Alert/types.d.ts.map +1 -0
- package/dist/components/dialogs/Alert/types.js +1 -0
- package/dist/components/dialogs/Toast/types.d.ts +34 -0
- package/dist/components/dialogs/Toast/types.d.ts.map +1 -0
- package/dist/components/dialogs/Toast/types.js +10 -0
- package/dist/components/dialogs/Toast/useToast.d.ts +36 -0
- package/dist/components/dialogs/Toast/useToast.d.ts.map +1 -0
- package/dist/components/dialogs/Toast/useToast.js +90 -0
- package/dist/components/indicators/Tooltip/tooltip.d.ts +3 -0
- package/dist/components/indicators/Tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/tooltip.js +33 -0
- package/dist/components/indicators/Tooltip/types.d.ts +14 -0
- package/dist/components/indicators/Tooltip/types.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/types.js +1 -0
- package/dist/components/indicators/Tooltip/useTooltip.d.ts +18 -0
- package/dist/components/indicators/Tooltip/useTooltip.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/useTooltip.js +57 -0
- package/dist/components/inputs/Tags/tag-bar-styles.d.ts +14 -0
- package/dist/components/inputs/Tags/tag-bar-styles.d.ts.map +1 -0
- package/dist/components/inputs/Tags/tag-bar-styles.js +313 -0
- package/dist/components/inputs/Tags/types.d.ts +93 -0
- package/dist/components/inputs/Tags/types.d.ts.map +1 -0
- package/dist/components/inputs/Tags/types.js +216 -0
- package/dist/components/inputs/search/types.d.ts +9 -0
- package/dist/components/inputs/search/types.d.ts.map +1 -0
- package/dist/components/inputs/search/types.js +1 -0
- package/dist/components/navigation/adaptive/types.d.ts +16 -0
- package/dist/components/navigation/adaptive/types.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/types.js +1 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.d.ts +27 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.js +40 -0
- package/dist/components/navigation/adaptive/useBreakpoints.d.ts +6 -0
- package/dist/components/navigation/adaptive/useBreakpoints.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useBreakpoints.js +37 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.d.ts +93 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.js +145 -0
- package/dist/components/navigation/adaptive/useViewAnimation.d.ts +31 -0
- package/dist/components/navigation/adaptive/useViewAnimation.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useViewAnimation.js +591 -0
- package/dist/components/navigation/adaptive/useViewResize.d.ts +52 -0
- package/dist/components/navigation/adaptive/useViewResize.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useViewResize.js +146 -0
- package/dist/components/navigation/navstack/useNavigationStack.d.ts +25 -0
- package/dist/components/navigation/navstack/useNavigationStack.d.ts.map +1 -0
- package/dist/components/navigation/navstack/useNavigationStack.js +133 -0
- package/dist/components/navigation/slideover/useSlideoverController.d.ts +20 -0
- package/dist/components/navigation/slideover/useSlideoverController.d.ts.map +1 -0
- package/dist/components/navigation/slideover/useSlideoverController.js +267 -0
- package/dist/components/navigation/splitview/useSplitViewController.d.ts +20 -0
- package/dist/components/navigation/splitview/useSplitViewController.d.ts.map +1 -0
- package/dist/components/navigation/splitview/useSplitViewController.js +325 -0
- package/dist/components/navigation/tabcontroller/types.d.ts +21 -0
- package/dist/components/navigation/tabcontroller/types.d.ts.map +1 -0
- package/dist/components/navigation/tabcontroller/types.js +1 -0
- package/dist/components/navigation/tabcontroller/useTabController.d.ts +5 -0
- package/dist/components/navigation/tabcontroller/useTabController.d.ts.map +1 -0
- package/dist/components/navigation/tabcontroller/useTabController.js +10 -0
- package/dist/components/navigation/types.d.ts +8 -0
- package/dist/components/navigation/types.d.ts.map +1 -0
- package/dist/components/navigation/types.js +1 -0
- package/dist/components/pickers/CollectionPicker/types.d.ts +11 -0
- package/dist/components/pickers/CollectionPicker/types.d.ts.map +1 -0
- package/dist/components/pickers/CollectionPicker/types.js +1 -0
- package/dist/components/pickers/ColorPicker/colors.d.ts +13 -0
- package/dist/components/pickers/ColorPicker/colors.d.ts.map +1 -0
- package/dist/components/pickers/ColorPicker/colors.js +266 -0
- package/dist/components/pickers/FilePicker/types.d.ts +10 -0
- package/dist/components/pickers/FilePicker/types.d.ts.map +1 -0
- package/dist/components/pickers/FilePicker/types.js +1 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +196 -0
- package/dist/theme.d.ts +73 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +279 -0
- package/dist/themes/blank.d.ts +7 -0
- package/dist/themes/blank.d.ts.map +1 -0
- package/dist/themes/blank.js +543 -0
- package/dist/themes/crimson-dark.d.ts +4 -0
- package/dist/themes/crimson-dark.d.ts.map +1 -0
- package/dist/themes/crimson-dark.js +552 -0
- package/dist/themes/cyan-light.d.ts +4 -0
- package/dist/themes/cyan-light.d.ts.map +1 -0
- package/dist/themes/cyan-light.js +552 -0
- package/dist/themes/dark.d.ts +4 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/dark.js +551 -0
- package/dist/themes/gold-dark.d.ts +4 -0
- package/dist/themes/gold-dark.d.ts.map +1 -0
- package/dist/themes/gold-dark.js +552 -0
- package/dist/themes/grass-dark.d.ts +4 -0
- package/dist/themes/grass-dark.d.ts.map +1 -0
- package/dist/themes/grass-dark.js +552 -0
- package/dist/themes/indigo.d.ts +4 -0
- package/dist/themes/indigo.d.ts.map +1 -0
- package/dist/themes/indigo.js +552 -0
- package/dist/themes/light.d.ts +4 -0
- package/dist/themes/light.d.ts.map +1 -0
- package/dist/themes/light.js +551 -0
- package/dist/themes/orange-dark.d.ts +4 -0
- package/dist/themes/orange-dark.d.ts.map +1 -0
- package/dist/themes/orange-dark.js +551 -0
- package/dist/themes/orange-light.d.ts +4 -0
- package/dist/themes/orange-light.d.ts.map +1 -0
- package/dist/themes/orange-light.js +551 -0
- package/package.json +62 -0
- package/src/components/controls/Button/Button.vue +417 -0
- package/src/components/controls/Button/README.md +348 -0
- package/src/components/controls/Button/theme.css +200 -0
- package/src/components/controls/Checkbox/Checkbox.vue +164 -0
- package/src/components/controls/Checkbox/README.md +441 -0
- package/src/components/controls/Checkbox/theme.css +36 -0
- package/src/components/controls/Dropdown/Dropdown.vue +476 -0
- package/src/components/controls/Dropdown/README.md +370 -0
- package/src/components/controls/Dropdown/theme.css +50 -0
- package/src/components/controls/Dropdown/types.ts +6 -0
- package/src/components/controls/IconButton/IconButton.vue +267 -0
- package/src/components/controls/IconButton/README.md +502 -0
- package/src/components/controls/IconButton/theme.css +89 -0
- package/src/components/controls/Radio/README.md +591 -0
- package/src/components/controls/Radio/Radio.vue +89 -0
- package/src/components/controls/Radio/theme.css +14 -0
- package/src/components/controls/RangeSlider/README.md +608 -0
- package/src/components/controls/RangeSlider/RangeSlider.vue +535 -0
- package/src/components/controls/RangeSlider/theme.css +80 -0
- package/src/components/controls/SegmentedControl/README.md +587 -0
- package/src/components/controls/SegmentedControl/SegmentedControl.vue +284 -0
- package/src/components/controls/SegmentedControl/theme.css +60 -0
- package/src/components/controls/SegmentedControl/types.ts +5 -0
- package/src/components/controls/Slider/README.md +627 -0
- package/src/components/controls/Slider/Slider.vue +260 -0
- package/src/components/controls/Slider/theme.css +74 -0
- package/src/components/controls/Stepper/README.md +601 -0
- package/src/components/controls/Stepper/Stepper.vue +103 -0
- package/src/components/controls/Stepper/theme.css +53 -0
- package/src/components/controls/Switch/README.md +667 -0
- package/src/components/controls/Switch/Switch.vue +127 -0
- package/src/components/controls/Switch/theme.css +42 -0
- package/src/components/dialogs/Alert/Alert.vue +218 -0
- package/src/components/dialogs/Alert/README.md +450 -0
- package/src/components/dialogs/Alert/theme.css +44 -0
- package/src/components/dialogs/Alert/types.ts +11 -0
- package/src/components/dialogs/Toast/README.md +522 -0
- package/src/components/dialogs/Toast/Toast.vue +296 -0
- package/src/components/dialogs/Toast/ToastContainer.vue +330 -0
- package/src/components/dialogs/Toast/theme.css +44 -0
- package/src/components/dialogs/Toast/types.ts +46 -0
- package/src/components/dialogs/Toast/useToast.ts +127 -0
- package/src/components/indicators/ProgressBar/ProgressBar.vue +98 -0
- package/src/components/indicators/ProgressBar/README.md +744 -0
- package/src/components/indicators/ProgressBar/theme.css +36 -0
- package/src/components/indicators/Tooltip/README.md +723 -0
- package/src/components/indicators/Tooltip/TooltipProvider.vue +142 -0
- package/src/components/indicators/Tooltip/theme.css +18 -0
- package/src/components/indicators/Tooltip/tooltip.ts +48 -0
- package/src/components/indicators/Tooltip/types.ts +15 -0
- package/src/components/indicators/Tooltip/useTooltip.ts +71 -0
- package/src/components/inputs/AutogrowTextView/AutogrowTextView.vue +110 -0
- package/src/components/inputs/AutogrowTextView/README.md +643 -0
- package/src/components/inputs/AutogrowTextView/theme.css +28 -0
- package/src/components/inputs/InputCard/InputCard.vue +600 -0
- package/src/components/inputs/InputCard/README.md +636 -0
- package/src/components/inputs/InputEmail/InputEmail.vue +698 -0
- package/src/components/inputs/InputEmail/README.md +764 -0
- package/src/components/inputs/InputNumber/InputNumber.vue +300 -0
- package/src/components/inputs/InputNumber/README.md +749 -0
- package/src/components/inputs/InputPhone/InputPhone.vue +645 -0
- package/src/components/inputs/InputPhone/README.md +636 -0
- package/src/components/inputs/InputSecure/InputSecure.vue +646 -0
- package/src/components/inputs/InputSecure/README.md +771 -0
- package/src/components/inputs/InputText/InputText.vue +225 -0
- package/src/components/inputs/InputText/README.md +844 -0
- package/src/components/inputs/OTP/OTP.vue +349 -0
- package/src/components/inputs/OTP/README.md +736 -0
- package/src/components/inputs/OTP/theme.css +50 -0
- package/src/components/inputs/StringCapture/README.md +718 -0
- package/src/components/inputs/StringCapture/StringCapture.vue +315 -0
- package/src/components/inputs/StringCapture/theme.css +86 -0
- package/src/components/inputs/Tags/README.md +897 -0
- package/src/components/inputs/Tags/TagBar.vue +793 -0
- package/src/components/inputs/Tags/TagCreation.vue +219 -0
- package/src/components/inputs/Tags/TagPicker.vue +380 -0
- package/src/components/inputs/Tags/tag-bar-styles.ts +354 -0
- package/src/components/inputs/Tags/theme.css +121 -0
- package/src/components/inputs/Tags/types.ts +346 -0
- package/src/components/inputs/search/README.md +759 -0
- package/src/components/inputs/search/SearchBar.vue +394 -0
- package/src/components/inputs/search/SearchResults.vue +310 -0
- package/src/components/inputs/search/theme.css +187 -0
- package/src/components/inputs/search/types.ts +8 -0
- package/src/components/inputs/theme.css +102 -0
- package/src/components/menus/ActionMenu/ActionMenu.vue +383 -0
- package/src/components/menus/ActionMenu/README.md +825 -0
- package/src/components/menus/ActionMenu/theme.css +93 -0
- package/src/components/models/Popover/Popover.vue +551 -0
- package/src/components/models/Popover/README.md +885 -0
- package/src/components/models/Popover/theme.css +52 -0
- package/src/components/models/Sheet/README.md +1159 -0
- package/src/components/models/Sheet/Sheet.vue +465 -0
- package/src/components/models/Sheet/theme.css +72 -0
- package/src/components/models/Sidebar/README.md +1228 -0
- package/src/components/models/Sidebar/Sidebar.vue +480 -0
- package/src/components/models/Sidebar/theme.css +90 -0
- package/src/components/navigation/adaptive/AdaptiveLayout.vue +779 -0
- package/src/components/navigation/adaptive/AdaptiveLayoutBreadcrumbs.vue +192 -0
- package/src/components/navigation/adaptive/AdaptiveLayoutMenuButton.vue +149 -0
- package/src/components/navigation/adaptive/README.md +768 -0
- package/src/components/navigation/adaptive/types.ts +19 -0
- package/src/components/navigation/adaptive/useAdaptiveLayout.ts +89 -0
- package/src/components/navigation/adaptive/useBreakpoints.ts +41 -0
- package/src/components/navigation/adaptive/useContainerMonitor.ts +214 -0
- package/src/components/navigation/adaptive/useViewAnimation.ts +721 -0
- package/src/components/navigation/adaptive/useViewResize.ts +211 -0
- package/src/components/navigation/navstack/NavigationStack.vue +180 -0
- package/src/components/navigation/navstack/README.md +994 -0
- package/src/components/navigation/navstack/useNavigationStack.ts +164 -0
- package/src/components/navigation/slideover/README.md +1275 -0
- package/src/components/navigation/slideover/SlideoverController.vue +287 -0
- package/src/components/navigation/slideover/useSlideoverController.ts +320 -0
- package/src/components/navigation/splitview/README.md +1115 -0
- package/src/components/navigation/splitview/SplitViewController.vue +176 -0
- package/src/components/navigation/splitview/useSplitViewController.ts +388 -0
- package/src/components/navigation/tabcontroller/README.md +919 -0
- package/src/components/navigation/tabcontroller/TabController.vue +307 -0
- package/src/components/navigation/tabcontroller/TabItem.vue +57 -0
- package/src/components/navigation/tabcontroller/types.ts +24 -0
- package/src/components/navigation/tabcontroller/useTabController.ts +18 -0
- package/src/components/navigation/theme.css +91 -0
- package/src/components/navigation/types.ts +7 -0
- package/src/components/pickers/CollectionPicker/CollectionPicker.vue +398 -0
- package/src/components/pickers/CollectionPicker/README.md +1115 -0
- package/src/components/pickers/CollectionPicker/theme.css +14 -0
- package/src/components/pickers/CollectionPicker/types.ts +11 -0
- package/src/components/pickers/ColorPicker/ColorPicker.vue +376 -0
- package/src/components/pickers/ColorPicker/README.md +1439 -0
- package/src/components/pickers/ColorPicker/colors.ts +299 -0
- package/src/components/pickers/ColorPicker/theme.css +32 -0
- package/src/components/pickers/DatePicker/DatePicker.vue +660 -0
- package/src/components/pickers/DatePicker/README.md +1195 -0
- package/src/components/pickers/DatePicker/theme.css +22 -0
- package/src/components/pickers/FilePicker/FilePicker.vue +534 -0
- package/src/components/pickers/FilePicker/README.md +1542 -0
- package/src/components/pickers/FilePicker/theme.css +48 -0
- package/src/components/pickers/FilePicker/types.ts +10 -0
- package/src/components/pickers/IconPicker/IconPicker.vue +327 -0
- package/src/components/pickers/IconPicker/README.md +1161 -0
- package/src/components/pickers/IconPicker/theme.css +28 -0
- package/src/components/pickers/theme.css +82 -0
- package/src/components/views/MarkdownViewer/MarkdownViewer.vue +442 -0
- package/src/components/views/MarkdownViewer/README.md +833 -0
- package/src/components/views/MarkdownViewer/theme.css +130 -0
- package/src/index.ts +263 -0
- package/src/theme.ts +378 -0
- package/src/themes/crimson-dark.ts +556 -0
- package/src/themes/cyan-light.ts +556 -0
- package/src/themes/dark.ts +557 -0
- package/src/themes/gold-dark.ts +556 -0
- package/src/themes/grass-dark.ts +556 -0
- package/src/themes/indigo.ts +556 -0
- package/src/themes/light.ts +557 -0
- package/src/themes/orange-dark.ts +557 -0
- package/src/themes/orange-light.ts +557 -0
- package/src/vue.d.ts +45 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, onMounted, nextTick, onUnmounted, watch } from "vue";
|
|
3
|
+
import { IconButton } from "@umbra-ui/core";
|
|
4
|
+
import {
|
|
5
|
+
offset,
|
|
6
|
+
flip,
|
|
7
|
+
shift,
|
|
8
|
+
size,
|
|
9
|
+
computePosition,
|
|
10
|
+
autoUpdate,
|
|
11
|
+
} from "@floating-ui/vue";
|
|
12
|
+
import "./theme.css";
|
|
13
|
+
|
|
14
|
+
// Props
|
|
15
|
+
export interface Props {
|
|
16
|
+
modelValue?: string;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
headerLabel?: string;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
23
|
+
modelValue: "",
|
|
24
|
+
placeholder: "Enter text...",
|
|
25
|
+
headerLabel: "Enter Text",
|
|
26
|
+
loading: false,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Emits
|
|
30
|
+
const emits = defineEmits<{
|
|
31
|
+
"update:modelValue": [value: string];
|
|
32
|
+
submit: [value: string];
|
|
33
|
+
cancel: [];
|
|
34
|
+
}>();
|
|
35
|
+
|
|
36
|
+
// State
|
|
37
|
+
const showPopover = ref<boolean>(false);
|
|
38
|
+
const inputValue = ref<string>(props.modelValue || "");
|
|
39
|
+
|
|
40
|
+
// Watch for changes to modelValue prop
|
|
41
|
+
watch(
|
|
42
|
+
() => props.modelValue,
|
|
43
|
+
(newValue) => {
|
|
44
|
+
inputValue.value = newValue || "";
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// Element references
|
|
49
|
+
const trigger = ref<HTMLElement | null>(null);
|
|
50
|
+
const popup = ref<HTMLElement | null>(null);
|
|
51
|
+
const overlay = ref<HTMLElement | null>(null);
|
|
52
|
+
const input = ref<HTMLInputElement | null>(null);
|
|
53
|
+
|
|
54
|
+
// Position tracking
|
|
55
|
+
let cleanupAutoUpdate: (() => void) | null = null;
|
|
56
|
+
|
|
57
|
+
// Lifecycle
|
|
58
|
+
onUnmounted(() => {
|
|
59
|
+
if (cleanupAutoUpdate) {
|
|
60
|
+
cleanupAutoUpdate();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Event handlers
|
|
65
|
+
const onSubmit = () => {
|
|
66
|
+
if (!inputValue.value.trim()) return;
|
|
67
|
+
|
|
68
|
+
emits("update:modelValue", inputValue.value);
|
|
69
|
+
emits("submit", inputValue.value);
|
|
70
|
+
togglePopover();
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const onCancel = () => {
|
|
74
|
+
inputValue.value = props.modelValue || "";
|
|
75
|
+
emits("cancel");
|
|
76
|
+
togglePopover();
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const onInputKeydown = (event: KeyboardEvent) => {
|
|
80
|
+
if (event.key === "Enter") {
|
|
81
|
+
onSubmit();
|
|
82
|
+
} else if (event.key === "Escape") {
|
|
83
|
+
onCancel();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// Popover management
|
|
88
|
+
const togglePopover = () => {
|
|
89
|
+
showPopover.value = !showPopover.value;
|
|
90
|
+
if (showPopover.value) {
|
|
91
|
+
inputValue.value = props.modelValue || "";
|
|
92
|
+
nextTick(() => {
|
|
93
|
+
updatePopoverPosition();
|
|
94
|
+
input.value?.focus();
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
if (cleanupAutoUpdate) {
|
|
98
|
+
cleanupAutoUpdate();
|
|
99
|
+
cleanupAutoUpdate = null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const updatePopoverPosition = async () => {
|
|
105
|
+
if (!trigger.value || !popup.value) return;
|
|
106
|
+
|
|
107
|
+
await nextTick();
|
|
108
|
+
|
|
109
|
+
if (cleanupAutoUpdate) {
|
|
110
|
+
cleanupAutoUpdate();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
cleanupAutoUpdate = autoUpdate(trigger.value, popup.value, () => {
|
|
114
|
+
computePosition(trigger.value!, popup.value!, {
|
|
115
|
+
placement: "bottom-start",
|
|
116
|
+
middleware: [
|
|
117
|
+
offset(4),
|
|
118
|
+
flip(),
|
|
119
|
+
shift(),
|
|
120
|
+
size({
|
|
121
|
+
padding: 20,
|
|
122
|
+
apply({
|
|
123
|
+
availableWidth,
|
|
124
|
+
availableHeight,
|
|
125
|
+
elements,
|
|
126
|
+
}: {
|
|
127
|
+
availableWidth: number;
|
|
128
|
+
availableHeight: number;
|
|
129
|
+
elements: {
|
|
130
|
+
floating: {
|
|
131
|
+
style: {
|
|
132
|
+
maxWidth: string;
|
|
133
|
+
maxHeight: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
}) {
|
|
138
|
+
Object.assign(elements.floating.style, {
|
|
139
|
+
maxWidth: `${availableWidth}px`,
|
|
140
|
+
maxHeight: `${availableHeight}px`,
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
],
|
|
145
|
+
}).then(({ x, y }) => {
|
|
146
|
+
if (popup.value) {
|
|
147
|
+
Object.assign(popup.value.style, {
|
|
148
|
+
left: `${x}px`,
|
|
149
|
+
top: `${y}px`,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const handleOverlayClick = () => {
|
|
157
|
+
togglePopover();
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// Expose togglePopover for external use
|
|
161
|
+
defineExpose({
|
|
162
|
+
togglePopover,
|
|
163
|
+
});
|
|
164
|
+
</script>
|
|
165
|
+
|
|
166
|
+
<template>
|
|
167
|
+
<div :class="$style.container">
|
|
168
|
+
<!-- Slot for the trigger button -->
|
|
169
|
+
<div
|
|
170
|
+
ref="trigger"
|
|
171
|
+
@click="togglePopover"
|
|
172
|
+
:class="showPopover ? $style.triggerActive : null"
|
|
173
|
+
>
|
|
174
|
+
<slot />
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<!-- Teleport the overlay and popup to body -->
|
|
178
|
+
<Teleport to="body">
|
|
179
|
+
<Transition name="overlay">
|
|
180
|
+
<div
|
|
181
|
+
v-if="showPopover"
|
|
182
|
+
:class="$style.overlay"
|
|
183
|
+
ref="overlay"
|
|
184
|
+
@click="handleOverlayClick"
|
|
185
|
+
></div>
|
|
186
|
+
</Transition>
|
|
187
|
+
<div v-if="showPopover" :class="$style.popup" ref="popup">
|
|
188
|
+
<div :class="$style.header">
|
|
189
|
+
<p class="callout">{{ headerLabel }}</p>
|
|
190
|
+
</div>
|
|
191
|
+
<div :class="$style.input_container">
|
|
192
|
+
<input
|
|
193
|
+
class="callout"
|
|
194
|
+
type="text"
|
|
195
|
+
v-model="inputValue"
|
|
196
|
+
:placeholder="placeholder"
|
|
197
|
+
@keydown="onInputKeydown"
|
|
198
|
+
ref="input"
|
|
199
|
+
/>
|
|
200
|
+
<IconButton
|
|
201
|
+
iconName="circle-check"
|
|
202
|
+
:buttonSize="18"
|
|
203
|
+
buttonType="plain"
|
|
204
|
+
buttonStyle="#eeeeee"
|
|
205
|
+
@click="onSubmit"
|
|
206
|
+
:style="{
|
|
207
|
+
opacity: inputValue.length > 0 ? 1 : 0.33,
|
|
208
|
+
pointerEvents: inputValue.length > 0 ? 'auto' : 'none',
|
|
209
|
+
}"
|
|
210
|
+
/>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</Teleport>
|
|
214
|
+
</div>
|
|
215
|
+
</template>
|
|
216
|
+
|
|
217
|
+
<style module>
|
|
218
|
+
.container {
|
|
219
|
+
display: inline-block;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.triggerActive {
|
|
223
|
+
position: relative;
|
|
224
|
+
z-index: 1000; /* Ensure trigger appears above the overlay (z-index: 999) */
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.popup {
|
|
228
|
+
position: absolute;
|
|
229
|
+
top: 0;
|
|
230
|
+
left: 0;
|
|
231
|
+
background-color: var(--stringcapture-popup-bg);
|
|
232
|
+
border-radius: 0.353rem;
|
|
233
|
+
min-width: 18.824rem;
|
|
234
|
+
overflow: hidden;
|
|
235
|
+
z-index: 1001;
|
|
236
|
+
box-shadow: 0px 1px 0px 0px var(--stringcapture-popup-shadow),
|
|
237
|
+
inset 0px 1px 0px 0px var(--stringcapture-popup-inset-shadow);
|
|
238
|
+
animation: popupFadeIn 0.2s ease-out;
|
|
239
|
+
border: var(--stringcapture-popup-border);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@keyframes popupFadeIn {
|
|
243
|
+
from {
|
|
244
|
+
opacity: 0;
|
|
245
|
+
transform: translateY(-8px) scale(0.95);
|
|
246
|
+
}
|
|
247
|
+
to {
|
|
248
|
+
opacity: 1;
|
|
249
|
+
transform: translateY(0) scale(1);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.header {
|
|
254
|
+
background-color: var(--stringcapture-header-bg);
|
|
255
|
+
border-bottom: 1px solid var(--stringcapture-header-border);
|
|
256
|
+
padding-left: 0.706rem;
|
|
257
|
+
padding-right: 0.706rem;
|
|
258
|
+
min-height: 2rem;
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
justify-content: start;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.header p {
|
|
265
|
+
opacity: 1;
|
|
266
|
+
color: var(--stringcapture-header-text);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.input_container {
|
|
270
|
+
background-color: var(--stringcapture-input-container-bg);
|
|
271
|
+
display: flex;
|
|
272
|
+
align-items: center;
|
|
273
|
+
justify-content: space-between;
|
|
274
|
+
gap: 0.706rem;
|
|
275
|
+
padding-left: 0.706rem;
|
|
276
|
+
padding-right: 0.706rem;
|
|
277
|
+
padding-top: 0.5rem;
|
|
278
|
+
padding-bottom: 0.5rem;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.input_container input {
|
|
282
|
+
background-color: transparent;
|
|
283
|
+
border: none;
|
|
284
|
+
outline: none;
|
|
285
|
+
color: var(--stringcapture-input-text);
|
|
286
|
+
width: 100%;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.overlay {
|
|
290
|
+
position: fixed;
|
|
291
|
+
top: 0;
|
|
292
|
+
left: 0;
|
|
293
|
+
width: 100%;
|
|
294
|
+
height: 100%;
|
|
295
|
+
background-color: var(--stringcapture-overlay-bg);
|
|
296
|
+
opacity: 0.7;
|
|
297
|
+
z-index: 999;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* Transition classes for overlay (use global since we're in CSS modules) */
|
|
301
|
+
:global(.overlay-enter-active),
|
|
302
|
+
:global(.overlay-leave-active) {
|
|
303
|
+
transition: opacity 0.2s ease-out;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
:global(.overlay-enter-from),
|
|
307
|
+
:global(.overlay-leave-to) {
|
|
308
|
+
opacity: 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
:global(.overlay-enter-to),
|
|
312
|
+
:global(.overlay-leave-from) {
|
|
313
|
+
opacity: 0.7;
|
|
314
|
+
}
|
|
315
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* Light theme using Colors */
|
|
2
|
+
:root {
|
|
3
|
+
/* StringCapture popup colors */
|
|
4
|
+
--stringcapture-popup-bg: #ffffff; /* white - light background for light mode */
|
|
5
|
+
--stringcapture-popup-border: 1px solid rgba(0, 0, 0, 0.1); /* border for light mode */
|
|
6
|
+
--stringcapture-popup-shadow: transparent;
|
|
7
|
+
--stringcapture-popup-inset-shadow: rgba(
|
|
8
|
+
255,
|
|
9
|
+
255,
|
|
10
|
+
255,
|
|
11
|
+
0.8
|
|
12
|
+
); /* whiteA8 - inset highlight for light mode */
|
|
13
|
+
|
|
14
|
+
/* StringCapture header colors */
|
|
15
|
+
--stringcapture-header-bg: rgba(
|
|
16
|
+
0,
|
|
17
|
+
0,
|
|
18
|
+
0,
|
|
19
|
+
0.05
|
|
20
|
+
); /* blackA6 - very light background for light mode */
|
|
21
|
+
--stringcapture-header-border: rgba(
|
|
22
|
+
0,
|
|
23
|
+
0,
|
|
24
|
+
0,
|
|
25
|
+
0.1
|
|
26
|
+
); /* blackA6 - lighter border for light mode */
|
|
27
|
+
--stringcapture-header-text: #1f2937; /* gray8 - dark text for light mode */
|
|
28
|
+
|
|
29
|
+
/* StringCapture input container colors */
|
|
30
|
+
--stringcapture-input-container-bg: #ffffff; /* white - light background for light mode */
|
|
31
|
+
|
|
32
|
+
/* StringCapture input colors */
|
|
33
|
+
--stringcapture-input-text: #1f2937; /* gray8 - dark text for light mode */
|
|
34
|
+
|
|
35
|
+
/* StringCapture overlay colors */
|
|
36
|
+
--stringcapture-overlay-bg: rgba(
|
|
37
|
+
0,
|
|
38
|
+
0,
|
|
39
|
+
0,
|
|
40
|
+
0.4
|
|
41
|
+
); /* blackA8 - lighter overlay for light mode */
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Dark theme */
|
|
45
|
+
.dark,
|
|
46
|
+
.dark-theme {
|
|
47
|
+
/* StringCapture popup colors */
|
|
48
|
+
--stringcapture-popup-bg: #484848; /* Original dark mode value */
|
|
49
|
+
--stringcapture-popup-border: none; /* no border for dark mode */
|
|
50
|
+
--stringcapture-popup-shadow: rgba(
|
|
51
|
+
0,
|
|
52
|
+
0,
|
|
53
|
+
0,
|
|
54
|
+
0.21
|
|
55
|
+
); /* Original dark mode value */
|
|
56
|
+
--stringcapture-popup-inset-shadow: rgba(
|
|
57
|
+
255,
|
|
58
|
+
255,
|
|
59
|
+
255,
|
|
60
|
+
0.1
|
|
61
|
+
); /* Original dark mode value */
|
|
62
|
+
|
|
63
|
+
/* StringCapture header colors */
|
|
64
|
+
--stringcapture-header-bg: rgba(
|
|
65
|
+
255,
|
|
66
|
+
255,
|
|
67
|
+
255,
|
|
68
|
+
0.1
|
|
69
|
+
); /* Original dark mode value */
|
|
70
|
+
--stringcapture-header-border: rgba(
|
|
71
|
+
0,
|
|
72
|
+
0,
|
|
73
|
+
0,
|
|
74
|
+
0.25
|
|
75
|
+
); /* Original dark mode value */
|
|
76
|
+
--stringcapture-header-text: #eeeeee; /* Original dark mode value */
|
|
77
|
+
|
|
78
|
+
/* StringCapture input container colors */
|
|
79
|
+
--stringcapture-input-container-bg: #484848; /* Original dark mode value */
|
|
80
|
+
|
|
81
|
+
/* StringCapture input colors */
|
|
82
|
+
--stringcapture-input-text: #eeeeee; /* Original dark mode value */
|
|
83
|
+
|
|
84
|
+
/* StringCapture overlay colors */
|
|
85
|
+
--stringcapture-overlay-bg: rgba(0, 0, 0, 0.7); /* Original dark mode value */
|
|
86
|
+
}
|