@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,300 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, watch, computed } from "vue";
|
|
3
|
+
import "../theme.css";
|
|
4
|
+
import { RippleAnimOutlineIcon, LockIcon } from "@umbra-ui/icons";
|
|
5
|
+
|
|
6
|
+
export interface Props {
|
|
7
|
+
value?: number;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
label?: string;
|
|
12
|
+
state?: "normal" | "active" | "disabled" | "readonly" | "error";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
+
value: undefined,
|
|
17
|
+
placeholder: "0",
|
|
18
|
+
min: undefined,
|
|
19
|
+
max: undefined,
|
|
20
|
+
state: "normal",
|
|
21
|
+
label: undefined,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits<{
|
|
25
|
+
"update:value": [value: number];
|
|
26
|
+
}>();
|
|
27
|
+
|
|
28
|
+
const internalValue = ref(props.value);
|
|
29
|
+
const isOutOfRange = ref(false);
|
|
30
|
+
const rangeErrorMessage = ref("");
|
|
31
|
+
|
|
32
|
+
// Computed property to determine the actual state
|
|
33
|
+
const actualState = computed(() => {
|
|
34
|
+
if (isOutOfRange.value) return "error";
|
|
35
|
+
return props.state;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Get the appropriate text color for icons based on state
|
|
39
|
+
const getIconColor = () => {
|
|
40
|
+
return "var(--input-text-filled)";
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Watch for changes to value prop
|
|
44
|
+
watch(
|
|
45
|
+
() => props.value,
|
|
46
|
+
(newValue) => {
|
|
47
|
+
internalValue.value = newValue;
|
|
48
|
+
checkRange(newValue);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const checkRange = (value: number | undefined) => {
|
|
53
|
+
if (value === undefined) {
|
|
54
|
+
isOutOfRange.value = false;
|
|
55
|
+
rangeErrorMessage.value = "";
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (props.min !== undefined && value < props.min) {
|
|
60
|
+
isOutOfRange.value = true;
|
|
61
|
+
rangeErrorMessage.value = `Value must be at least ${props.min}`;
|
|
62
|
+
} else if (props.max !== undefined && value > props.max) {
|
|
63
|
+
isOutOfRange.value = true;
|
|
64
|
+
rangeErrorMessage.value = `Value must be no more than ${props.max}`;
|
|
65
|
+
} else {
|
|
66
|
+
isOutOfRange.value = false;
|
|
67
|
+
rangeErrorMessage.value = "";
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const handleInput = (event: Event) => {
|
|
72
|
+
const target = event.target as HTMLInputElement;
|
|
73
|
+
const numValue = target.value === "" ? undefined : Number(target.value);
|
|
74
|
+
internalValue.value = numValue;
|
|
75
|
+
checkRange(numValue);
|
|
76
|
+
emit("update:value", numValue || 0);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const getPlaceholder = computed(() => {
|
|
80
|
+
if (props.state === "readonly") {
|
|
81
|
+
return "Field Cannot Be Edited";
|
|
82
|
+
}
|
|
83
|
+
return props.placeholder;
|
|
84
|
+
});
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<div :class="$style.container">
|
|
89
|
+
<div :class="[$style.input_container, $style[actualState]]">
|
|
90
|
+
<input
|
|
91
|
+
class="body"
|
|
92
|
+
type="number"
|
|
93
|
+
:placeholder="getPlaceholder"
|
|
94
|
+
:value="internalValue"
|
|
95
|
+
:min="min"
|
|
96
|
+
:max="max"
|
|
97
|
+
@input="handleInput"
|
|
98
|
+
:disabled="state === 'disabled'"
|
|
99
|
+
:readonly="state === 'readonly'"
|
|
100
|
+
/>
|
|
101
|
+
<RippleAnimOutlineIcon
|
|
102
|
+
v-if="state === 'active' && !isOutOfRange"
|
|
103
|
+
:class="$style.icon"
|
|
104
|
+
:size="16"
|
|
105
|
+
:color="getIconColor()"
|
|
106
|
+
/>
|
|
107
|
+
<LockIcon
|
|
108
|
+
v-if="state === 'readonly'"
|
|
109
|
+
:class="$style.icon"
|
|
110
|
+
:size="16"
|
|
111
|
+
:color="getIconColor()"
|
|
112
|
+
/>
|
|
113
|
+
<span v-if="label" :class="$style.units"
|
|
114
|
+
><p class="footnote">{{ label }}</p></span
|
|
115
|
+
>
|
|
116
|
+
</div>
|
|
117
|
+
<p
|
|
118
|
+
v-if="actualState === 'error'"
|
|
119
|
+
:class="[$style.error_message, 'footnote']"
|
|
120
|
+
>
|
|
121
|
+
{{ rangeErrorMessage || "Information About The Error" }}
|
|
122
|
+
</p>
|
|
123
|
+
</div>
|
|
124
|
+
</template>
|
|
125
|
+
|
|
126
|
+
<style module>
|
|
127
|
+
.container {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
gap: 0.588rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.input_container {
|
|
134
|
+
width: 100%;
|
|
135
|
+
padding-left: 0.882rem;
|
|
136
|
+
padding-right: 0.882rem;
|
|
137
|
+
padding-top: 0.588rem;
|
|
138
|
+
padding-bottom: 0.588rem;
|
|
139
|
+
border: var(--input-border);
|
|
140
|
+
border-radius: var(--input-border-radius);
|
|
141
|
+
transition: background-color 0.3s ease, border 0.3s ease;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: space-between;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.input_container:focus-within {
|
|
148
|
+
border: 1px solid var(--input-focus-border);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.input_container input {
|
|
152
|
+
border: none;
|
|
153
|
+
background: transparent;
|
|
154
|
+
outline: none;
|
|
155
|
+
width: 100%;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* State-based styling using CSS variables */
|
|
159
|
+
.input_container.normal:has(input:placeholder-shown),
|
|
160
|
+
.input_container.active:has(input:placeholder-shown) {
|
|
161
|
+
background-color: var(--input-background-normal);
|
|
162
|
+
color: var(--input-text-empty);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.input_container.normal:has(input:not(:placeholder-shown)),
|
|
166
|
+
.input_container.active:has(input:not(:placeholder-shown)) {
|
|
167
|
+
background-color: var(--input-background-filled);
|
|
168
|
+
color: var(--input-text-filled);
|
|
169
|
+
border-color: var(--input-border-filled);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.input_container.normal input:placeholder-shown,
|
|
173
|
+
.input_container.active input:placeholder-shown {
|
|
174
|
+
color: var(--input-text-empty);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.input_container.normal input:not(:placeholder-shown),
|
|
178
|
+
.input_container.active input:not(:placeholder-shown) {
|
|
179
|
+
color: var(--input-text-filled);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.input_container.disabled:has(input:placeholder-shown),
|
|
183
|
+
.input_container.disabled:has(input:not(:placeholder-shown)) {
|
|
184
|
+
background-color: var(--input-disabled-bg);
|
|
185
|
+
color: var(--input-disabled-text);
|
|
186
|
+
border-color: var(--input-disabled-border);
|
|
187
|
+
cursor: not-allowed;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.input_container.disabled input:placeholder-shown,
|
|
191
|
+
.input_container.disabled input:not(:placeholder-shown) {
|
|
192
|
+
color: var(--input-disabled-text);
|
|
193
|
+
cursor: not-allowed;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.input_container.readonly:has(input:placeholder-shown),
|
|
197
|
+
.input_container.readonly:has(input:not(:placeholder-shown)) {
|
|
198
|
+
background-color: var(--input-readonly-bg);
|
|
199
|
+
color: var(--input-readonly-text);
|
|
200
|
+
border-color: var(--input-readonly-border);
|
|
201
|
+
cursor: not-allowed;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.input_container.readonly input:placeholder-shown,
|
|
205
|
+
.input_container.readonly input:not(:placeholder-shown) {
|
|
206
|
+
color: var(--input-readonly-text);
|
|
207
|
+
cursor: not-allowed;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.input_container.error:has(input:placeholder-shown),
|
|
211
|
+
.input_container.error:has(input:not(:placeholder-shown)) {
|
|
212
|
+
background-color: var(--input-error-bg);
|
|
213
|
+
color: var(--input-error-text);
|
|
214
|
+
border-color: var(--input-error-border);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.input_container.error input:placeholder-shown,
|
|
218
|
+
.input_container.error input:not(:placeholder-shown) {
|
|
219
|
+
color: var(--input-error-text);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.input_container.active {
|
|
223
|
+
pointer-events: none;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.error_message {
|
|
227
|
+
color: var(--input-text-error);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Hide increment/decrement controls in most modern browsers */
|
|
231
|
+
input[type="number"]::-webkit-outer-spin-button,
|
|
232
|
+
input[type="number"]::-webkit-inner-spin-button {
|
|
233
|
+
-webkit-appearance: none;
|
|
234
|
+
margin: 0;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
input[type="number"] {
|
|
238
|
+
-moz-appearance: textfield; /* For Firefox */
|
|
239
|
+
appearance: textfield; /* Standard property */
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.input_container input::placeholder {
|
|
243
|
+
color: var(--input-placeholder);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.input_container:has(input:not(:placeholder-shown)) input::placeholder {
|
|
247
|
+
color: var(--input-placeholder-filled);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.input_container.readonly input::placeholder {
|
|
251
|
+
color: var(--input-readonly-placeholder);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.input_container.disabled input::placeholder {
|
|
255
|
+
color: var(--input-disabled-placeholder);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* Responsive adjustments */
|
|
259
|
+
@media (max-width: 480px) {
|
|
260
|
+
.input_container input {
|
|
261
|
+
font-size: 16px; /* Prevents zoom on iOS */
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
.units {
|
|
265
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
266
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
267
|
+
border-radius: 0.588rem;
|
|
268
|
+
padding: 0.235rem 0.588rem;
|
|
269
|
+
color: var(--input-text-empty);
|
|
270
|
+
transition: background-color 0.3s ease, color 0.3s ease;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* Update units styling when input has text */
|
|
274
|
+
.input_container:has(input:not(:placeholder-shown)) .units {
|
|
275
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
276
|
+
border: 1px solid rgba(0, 0, 0, 0.25);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.input_container:has(input:not(:placeholder-shown)) .units p {
|
|
280
|
+
color: var(--input-text-filled);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Keep units styling when input is empty */
|
|
284
|
+
.input_container:has(input:placeholder-shown) .units {
|
|
285
|
+
background-color: var(--input-background-normal);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.input_container:has(input:placeholder-shown) .units p {
|
|
289
|
+
color: var(--input-text-empty);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* Error state styling for units when input has text */
|
|
293
|
+
.input_container.error:has(input:not(:placeholder-shown)) .units {
|
|
294
|
+
background-color: rgba(var(--error-rgb), 0.1);
|
|
295
|
+
border-color: rgba(var(--error-rgb), 0.25);
|
|
296
|
+
}
|
|
297
|
+
.input_container.error:has(input:not(:placeholder-shown)) .units p {
|
|
298
|
+
color: var(--input-error-text);
|
|
299
|
+
}
|
|
300
|
+
</style>
|