ropav 0.0.8 → 0.0.10
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/accordion.css +10 -10
- package/dist/accordion.js +2 -2
- package/dist/alert.css +109 -0
- package/dist/alert.js +168 -0
- package/dist/aspect-ratio.css +17 -0
- package/dist/aspect-ratio.js +26 -0
- package/dist/avatar.css +97 -0
- package/dist/avatar.js +161 -0
- package/dist/badge.css +40 -115
- package/dist/badge.js +19 -16
- package/dist/base.css +609 -180
- package/dist/button-link.css +161 -0
- package/dist/button-link.js +108 -0
- package/dist/button.css +50 -229
- package/dist/button.js +7 -9
- package/dist/card.css +12 -12
- package/dist/check.js +12 -0
- package/dist/checkbox.css +16 -57
- package/dist/checkbox.js +14 -31
- package/dist/collapse.css +2 -2
- package/dist/collapse.js +1 -1
- package/dist/color-input.css +108 -0
- package/dist/color-input.js +349 -0
- package/dist/color-picker.css +304 -0
- package/dist/color-picker.js +797 -0
- package/dist/color-picker2.js +18 -0
- package/dist/color-swatch.css +50 -0
- package/dist/color-swatch.js +73 -0
- package/dist/color.js +190 -0
- package/dist/componentColors.js +206 -13
- package/dist/components/accordion/accordion-item.d.ts +4 -4
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/index.d.ts +4 -4
- package/dist/components/accordion/types.d.ts +1 -1
- package/dist/components/accordion/useAccordion.d.ts +1 -1
- package/dist/components/alert/alert.d.ts +30 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/alert/index.js +2 -0
- package/dist/components/alert/types.d.ts +20 -0
- package/dist/components/alert/useAlertColor.d.ts +3 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +21 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/aspect-ratio/index.js +2 -0
- package/dist/components/aspect-ratio/types.d.ts +3 -0
- package/dist/components/avatar/avatar.d.ts +24 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/avatar/types.d.ts +20 -0
- package/dist/components/avatar/useAvatarColor.d.ts +3 -0
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/index.d.ts +3 -3
- package/dist/components/badge/types.d.ts +3 -2
- package/dist/components/badge/useBadgeColor.d.ts +3 -8
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/types.d.ts +2 -1
- package/dist/components/button/useButtonColor.d.ts +3 -13
- package/dist/components/button-group/button-group.d.ts +1 -1
- package/dist/components/button-group/index.d.ts +2 -2
- package/dist/components/button-link/button-link.d.ts +27 -0
- package/dist/components/button-link/index.d.ts +2 -0
- package/dist/components/button-link/index.js +2 -0
- package/dist/components/button-link/types.d.ts +20 -0
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/types.d.ts +2 -1
- package/dist/components/checkbox/useCheckbox.d.ts +4 -6
- package/dist/components/collapse/collapse.d.ts +2 -2
- package/dist/components/collapse/index.d.ts +3 -3
- package/dist/components/collapse/useCollapse.d.ts +1 -1
- package/dist/components/color-input/color-input.d.ts +29 -0
- package/dist/components/color-input/index.d.ts +2 -0
- package/dist/components/color-input/index.js +2 -0
- package/dist/components/color-input/types.d.ts +35 -0
- package/dist/components/color-input/useColorInput.d.ts +27 -0
- package/dist/components/color-input/useColorInputEyeDropper.d.ts +13 -0
- package/dist/components/color-input/useColorInputPopover.d.ts +11 -0
- package/dist/components/color-input/useColorInputValue.d.ts +8 -0
- package/dist/components/color-picker/color-picker-saturation.d.ts +21 -0
- package/dist/components/color-picker/color-picker-slider.d.ts +21 -0
- package/dist/components/color-picker/color-picker-utils.d.ts +23 -0
- package/dist/components/color-picker/color-picker.d.ts +23 -0
- package/dist/components/color-picker/index.d.ts +3 -0
- package/dist/components/color-picker/index.js +3 -0
- package/dist/components/color-picker/types.d.ts +39 -0
- package/dist/components/color-picker/useColorPickerDrag.d.ts +16 -0
- package/dist/components/color-picker/useColorPickerSwatches.d.ts +21 -0
- package/dist/components/color-picker/useColorPickerValue.d.ts +15 -0
- package/dist/components/color-swatch/color-swatch.d.ts +21 -0
- package/dist/components/color-swatch/index.d.ts +2 -0
- package/dist/components/color-swatch/index.js +2 -0
- package/dist/components/color-swatch/types.d.ts +6 -0
- package/dist/components/color-swatch/useColorSwatchColor.d.ts +5 -0
- package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +15 -6
- package/dist/components/dropdown-menu/dropdown-menu-utils.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +3 -3
- package/dist/components/dropdown-menu/index.d.ts +3 -3
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +11 -10
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenuHoverIntent.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenuNavigation.d.ts +3 -3
- package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +12 -4
- package/dist/components/dropdown-menu/useDropdownSubmenus.d.ts +3 -3
- package/dist/components/field/field.d.ts +2 -2
- package/dist/components/field/index.d.ts +2 -2
- package/dist/components/field/types.d.ts +0 -2
- package/dist/components/field/useField.d.ts +1 -3
- package/dist/components/icon-button/icon-button.d.ts +1 -1
- package/dist/components/icon-button/index.d.ts +2 -2
- package/dist/components/icon-button/types.d.ts +2 -1
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/types.d.ts +3 -0
- package/dist/components/input/useInput.d.ts +2 -2
- package/dist/components/modal/index.d.ts +2 -2
- package/dist/components/modal/modal.d.ts +1 -1
- package/dist/components/modal/types.d.ts +1 -1
- package/dist/components/modal/useModal.d.ts +1 -1
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-input/index.js +2 -0
- package/dist/components/number-input/number-input.d.ts +29 -0
- package/dist/components/number-input/types.d.ts +34 -0
- package/dist/components/number-input/useNumberInput.d.ts +31 -0
- package/dist/components/overlay/index.d.ts +2 -2
- package/dist/components/overlay/overlay.d.ts +1 -1
- package/dist/components/overlay/useOverlay.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -2
- package/dist/components/popover/index.js +2 -1
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popover/types.d.ts +3 -1
- package/dist/components/popover/usePopover.d.ts +2 -1
- package/dist/components/progress/index.d.ts +3 -3
- package/dist/components/progress/progress.d.ts +1 -1
- package/dist/components/progress/types.d.ts +2 -2
- package/dist/components/progress/useProgress.d.ts +2 -2
- package/dist/components/radio/index.d.ts +3 -3
- package/dist/components/radio/radio-group.d.ts +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/types.d.ts +4 -1
- package/dist/components/radio/useRadio.d.ts +4 -6
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/types.d.ts +3 -0
- package/dist/components/select/useSelect.d.ts +2 -2
- package/dist/components/slider/index.d.ts +4 -3
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/range-slider-tooltip.d.ts +34 -0
- package/dist/components/slider/range-slider.d.ts +37 -0
- package/dist/components/slider/slider.d.ts +1 -1
- package/dist/components/slider/sliderCore.d.ts +35 -0
- package/dist/components/slider/types.d.ts +15 -6
- package/dist/components/slider/useRangeSlider.d.ts +57 -0
- package/dist/components/slider/useRangeSliderPointer.d.ts +19 -0
- package/dist/components/slider/useRangeSliderTooltipCollision.d.ts +36 -0
- package/dist/components/slider/useRangeSliderTooltipState.d.ts +23 -0
- package/dist/components/slider/useSlider.d.ts +11 -15
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/types.d.ts +1 -1
- package/dist/components/switch/useSwitch.d.ts +4 -5
- package/dist/components/tabs/index.d.ts +6 -6
- package/dist/components/tabs/tabs-content.d.ts +2 -2
- package/dist/components/tabs/tabs-list.d.ts +4 -4
- package/dist/components/tabs/tabs-trigger.d.ts +5 -5
- package/dist/components/tabs/tabs.d.ts +5 -5
- package/dist/components/tabs/useTabs.d.ts +1 -1
- package/dist/components/textarea/index.d.ts +2 -2
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textarea/useTextarea.d.ts +2 -2
- package/dist/components/toast/defaults.d.ts +7 -0
- package/dist/components/toast/index.d.ts +7 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toast/toast-provider.d.ts +21 -0
- package/dist/components/toast/toast-viewport.d.ts +34 -0
- package/dist/components/toast/toast.d.ts +31 -0
- package/dist/components/toast/types.d.ts +106 -0
- package/dist/components/toast/useToast.d.ts +4 -0
- package/dist/components/toast/useToastColor.d.ts +3 -0
- package/dist/components/toast/useToastState.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/types.d.ts +2 -1
- package/dist/components/tooltip/useTooltip.d.ts +3 -1
- package/dist/dropdown-menu.css +17 -17
- package/dist/dropdown-menu.js +160 -39
- package/dist/field.css +15 -18
- package/dist/field.js +17 -35
- package/dist/icon-button.css +57 -236
- package/dist/icon-button.js +5 -6
- package/dist/index.d.ts +31 -22
- package/dist/index.js +17 -4
- package/dist/input.css +40 -46
- package/dist/input.js +39 -21
- package/dist/minus.js +12 -0
- package/dist/modal.css +9 -9
- package/dist/modal.js +1 -1
- package/dist/number-input.css +86 -0
- package/dist/number-input.js +350 -0
- package/dist/overlay.css +5 -5
- package/dist/overlay.js +3 -3
- package/dist/popover.css +62 -29
- package/dist/popover.js +33 -19
- package/dist/popover2.js +17 -0
- package/dist/progress.css +9 -30
- package/dist/progress.js +3 -6
- package/dist/radio.css +34 -62
- package/dist/radio.js +28 -16
- package/dist/rafScheduler.js +34 -0
- package/dist/select.css +105 -61
- package/dist/select.js +12 -8
- package/dist/slider.css +719 -125
- package/dist/slider.js +1251 -149
- package/dist/switch.css +19 -44
- package/dist/switch.js +4 -5
- package/dist/tabs.css +36 -36
- package/dist/tabs.js +1 -1
- package/dist/textarea.css +33 -25
- package/dist/textarea.js +8 -2
- package/dist/toast.css +232 -0
- package/dist/toast.js +679 -0
- package/dist/tooltip.css +7 -35
- package/dist/tooltip.js +30 -18
- package/dist/useButtonColor.js +16 -14
- package/dist/utils/componentColors.d.ts +60 -0
- package/package.json +55 -15
- package/src/styles/_mixins.scss +25 -41
- package/src/styles/_tokens.scss +615 -182
- package/src/styles/_variables.scss +177 -49
package/dist/tooltip.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.rp-tooltip[data-v-13c39164] {
|
|
2
2
|
--_rp-tooltip-main-axis-offset: var(--rp-spacing-2);
|
|
3
3
|
--_rp-tooltip-cross-axis-offset: 0px;
|
|
4
|
-
--_rp-tooltip-arrow-size: 0.
|
|
5
|
-
--_rp-tooltip-bg: var(--
|
|
6
|
-
--_rp-tooltip-fg: var(--
|
|
4
|
+
--_rp-tooltip-arrow-size: 0.4375rem;
|
|
5
|
+
--_rp-tooltip-bg: var(--rp-color-bright);
|
|
6
|
+
--_rp-tooltip-fg: var(--rp-color-default);
|
|
7
7
|
position: relative;
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
font-family: var(--rp-font-family);
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
z-index: 1000;
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
width: max-content;
|
|
17
|
-
max-width: min(
|
|
18
|
-
padding:
|
|
17
|
+
max-width: min(18rem, 100vw - var(--rp-spacing-6));
|
|
18
|
+
padding: 0.375rem 0.625rem;
|
|
19
19
|
color: var(--_rp-tooltip-fg);
|
|
20
|
-
font-size:
|
|
20
|
+
font-size: 0.8125rem;
|
|
21
21
|
font-weight: var(--rp-font-weight-medium);
|
|
22
|
-
line-height: var(--rp-line-height-
|
|
22
|
+
line-height: var(--rp-line-height-md);
|
|
23
23
|
text-align: center;
|
|
24
24
|
white-space: normal;
|
|
25
25
|
overflow-wrap: anywhere;
|
|
@@ -36,34 +36,6 @@
|
|
|
36
36
|
background-color: inherit;
|
|
37
37
|
rotate: 45deg;
|
|
38
38
|
}
|
|
39
|
-
.rp-tooltip--color-primary[data-v-13c39164] {
|
|
40
|
-
--_rp-tooltip-bg: var(--rp-color-primary);
|
|
41
|
-
--_rp-tooltip-fg: var(--rp-color-on-primary);
|
|
42
|
-
}
|
|
43
|
-
.rp-tooltip--color-secondary[data-v-13c39164] {
|
|
44
|
-
--_rp-tooltip-bg: var(--rp-color-secondary);
|
|
45
|
-
--_rp-tooltip-fg: var(--rp-color-on-secondary);
|
|
46
|
-
}
|
|
47
|
-
.rp-tooltip--color-success[data-v-13c39164] {
|
|
48
|
-
--_rp-tooltip-bg: var(--rp-color-success);
|
|
49
|
-
--_rp-tooltip-fg: var(--rp-color-on-success);
|
|
50
|
-
}
|
|
51
|
-
.rp-tooltip--color-warning[data-v-13c39164] {
|
|
52
|
-
--_rp-tooltip-bg: var(--rp-color-warning);
|
|
53
|
-
--_rp-tooltip-fg: var(--rp-color-on-warning);
|
|
54
|
-
}
|
|
55
|
-
.rp-tooltip--color-danger[data-v-13c39164] {
|
|
56
|
-
--_rp-tooltip-bg: var(--rp-color-danger);
|
|
57
|
-
--_rp-tooltip-fg: var(--rp-color-on-danger);
|
|
58
|
-
}
|
|
59
|
-
.rp-tooltip--color-info[data-v-13c39164] {
|
|
60
|
-
--_rp-tooltip-bg: var(--rp-color-info);
|
|
61
|
-
--_rp-tooltip-fg: var(--rp-color-on-info);
|
|
62
|
-
}
|
|
63
|
-
.rp-tooltip--color-neutral[data-v-13c39164] {
|
|
64
|
-
--_rp-tooltip-bg: var(--rp-color-neutral);
|
|
65
|
-
--_rp-tooltip-fg: var(--rp-color-on-neutral);
|
|
66
|
-
}
|
|
67
39
|
.rp-tooltip--placement-top .rp-tooltip__content[data-v-13c39164] {
|
|
68
40
|
bottom: calc(100% + var(--_rp-tooltip-main-axis-offset));
|
|
69
41
|
left: calc(50% + var(--_rp-tooltip-cross-axis-offset));
|
package/dist/tooltip.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './tooltip.css';
|
|
2
2
|
import { t as bem } from "./bem.js";
|
|
3
|
+
import { i as getComponentVariantColorRoles } from "./componentColors.js";
|
|
3
4
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
4
|
-
import {
|
|
5
|
+
import { t as createRafScheduler } from "./rafScheduler.js";
|
|
5
6
|
import { VaporTransition, applyVShow, computed, createComponent, createIf, createInvoker, createSlot, defineVaporComponent, delegateEvents, extend, isRef, on, onBeforeUnmount, onMounted, ref, renderEffect, setAttr, setClass, setInsertionState, setProp, setStyle, setText, template, toDisplayString, unref, useId, useSlots, watch } from "vue";
|
|
6
7
|
//#region src/composables/useDelayedOpen.ts
|
|
7
8
|
function readOption(value, fallback) {
|
|
@@ -77,7 +78,7 @@ function getTargetPosition(rect, placement) {
|
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function resolveTooltipOffsetStyle(offset) {
|
|
81
82
|
if (offset == null) return void 0;
|
|
82
83
|
if (typeof offset === "number") return { "--_rp-tooltip-main-axis-offset": `${offset}px` };
|
|
83
84
|
const style = {};
|
|
@@ -85,12 +86,17 @@ function resolveOffsetStyle(offset) {
|
|
|
85
86
|
if (offset.crossAxis != null) style["--_rp-tooltip-cross-axis-offset"] = `${offset.crossAxis}px`;
|
|
86
87
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
function resolveTooltipColorStyleWithContrast(color, autoContrast) {
|
|
90
|
+
if (!color) return void 0;
|
|
91
|
+
const roles = getComponentVariantColorRoles({
|
|
92
|
+
color,
|
|
93
|
+
variant: "solid",
|
|
94
|
+
autoContrast
|
|
95
|
+
});
|
|
96
|
+
if (!roles) return void 0;
|
|
91
97
|
return {
|
|
92
|
-
"--_rp-tooltip-bg":
|
|
93
|
-
"--_rp-tooltip-fg":
|
|
98
|
+
"--_rp-tooltip-bg": roles.background,
|
|
99
|
+
"--_rp-tooltip-fg": roles.color
|
|
94
100
|
};
|
|
95
101
|
}
|
|
96
102
|
function useTooltip(props, emitOpenChange) {
|
|
@@ -98,6 +104,7 @@ function useTooltip(props, emitOpenChange) {
|
|
|
98
104
|
const generatedId = useId();
|
|
99
105
|
const targetElement = ref(null);
|
|
100
106
|
const targetPosition = ref(null);
|
|
107
|
+
const positionScheduler = createRafScheduler(updateTargetPosition, () => targetElement.value?.ownerDocument.defaultView);
|
|
101
108
|
let isMounted = false;
|
|
102
109
|
let removeTargetListeners;
|
|
103
110
|
let removePositionListeners;
|
|
@@ -120,7 +127,6 @@ function useTooltip(props, emitOpenChange) {
|
|
|
120
127
|
const isVisible = computed(() => isOpen.value && !isDisabled.value);
|
|
121
128
|
const rootClass = computed(() => bem("rp-tooltip", {
|
|
122
129
|
[`placement-${placement.value}`]: true,
|
|
123
|
-
[`color-${props.color}`]: isComponentPresetColor(props.color),
|
|
124
130
|
arrow: props.arrow,
|
|
125
131
|
target: isTargetMode.value,
|
|
126
132
|
open: isVisible.value,
|
|
@@ -131,8 +137,8 @@ function useTooltip(props, emitOpenChange) {
|
|
|
131
137
|
const contentAriaHidden = computed(() => isDecorative.value ? "true" : void 0);
|
|
132
138
|
const contentStyle = computed(() => {
|
|
133
139
|
const style = {
|
|
134
|
-
...
|
|
135
|
-
...
|
|
140
|
+
...resolveTooltipOffsetStyle(props.offset),
|
|
141
|
+
...resolveTooltipColorStyleWithContrast(props.color, props.autoContrast)
|
|
136
142
|
};
|
|
137
143
|
if (!isTargetMode.value || !targetPosition.value) return Object.keys(style).length > 0 ? style : void 0;
|
|
138
144
|
return {
|
|
@@ -191,7 +197,6 @@ function useTooltip(props, emitOpenChange) {
|
|
|
191
197
|
targetPosition.value = getTargetPosition(targetElement.value.getBoundingClientRect(), placement.value);
|
|
192
198
|
}
|
|
193
199
|
function onTargetOpen() {
|
|
194
|
-
updateTargetPosition();
|
|
195
200
|
openTooltip();
|
|
196
201
|
}
|
|
197
202
|
function bindTargetListeners(element) {
|
|
@@ -213,17 +218,20 @@ function useTooltip(props, emitOpenChange) {
|
|
|
213
218
|
function removeViewportListeners() {
|
|
214
219
|
removePositionListeners?.();
|
|
215
220
|
removePositionListeners = void 0;
|
|
221
|
+
positionScheduler.cancel();
|
|
216
222
|
}
|
|
217
223
|
function bindViewportListeners() {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
const view = targetElement.value?.ownerDocument.defaultView;
|
|
225
|
+
if (!view || removePositionListeners) return;
|
|
226
|
+
view.addEventListener("resize", positionScheduler.schedule);
|
|
227
|
+
view.addEventListener("scroll", positionScheduler.schedule, true);
|
|
221
228
|
removePositionListeners = () => {
|
|
222
|
-
|
|
223
|
-
|
|
229
|
+
view.removeEventListener("resize", positionScheduler.schedule);
|
|
230
|
+
view.removeEventListener("scroll", positionScheduler.schedule, true);
|
|
224
231
|
};
|
|
225
232
|
}
|
|
226
233
|
function syncTarget() {
|
|
234
|
+
positionScheduler.cancel();
|
|
227
235
|
if (!isTargetMode.value) {
|
|
228
236
|
removeTargetListeners?.();
|
|
229
237
|
removeViewportListeners();
|
|
@@ -236,6 +244,7 @@ function useTooltip(props, emitOpenChange) {
|
|
|
236
244
|
if (targetElement.value === nextTarget) {
|
|
237
245
|
syncTargetDescription();
|
|
238
246
|
updateTargetPosition();
|
|
247
|
+
if (isVisible.value) bindViewportListeners();
|
|
239
248
|
return;
|
|
240
249
|
}
|
|
241
250
|
removeTargetListeners?.();
|
|
@@ -249,6 +258,7 @@ function useTooltip(props, emitOpenChange) {
|
|
|
249
258
|
bindTargetListeners(nextTarget);
|
|
250
259
|
syncTargetDescription();
|
|
251
260
|
updateTargetPosition();
|
|
261
|
+
if (isVisible.value) bindViewportListeners();
|
|
252
262
|
}
|
|
253
263
|
watch(isDisabled, (disabled) => {
|
|
254
264
|
if (disabled) closeTooltip();
|
|
@@ -263,12 +273,13 @@ function useTooltip(props, emitOpenChange) {
|
|
|
263
273
|
], () => {
|
|
264
274
|
if (isMounted) syncTargetDescription();
|
|
265
275
|
});
|
|
266
|
-
watch(
|
|
276
|
+
watch(placement, () => {
|
|
267
277
|
if (isMounted && isVisible.value) updateTargetPosition();
|
|
268
278
|
});
|
|
269
279
|
watch(isVisible, (visible) => {
|
|
270
280
|
if (!isMounted || !isTargetMode.value) return;
|
|
271
281
|
if (visible) {
|
|
282
|
+
positionScheduler.cancel();
|
|
272
283
|
updateTargetPosition();
|
|
273
284
|
bindViewportListeners();
|
|
274
285
|
} else removeViewportListeners();
|
|
@@ -316,6 +327,7 @@ var tooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
316
327
|
target: {},
|
|
317
328
|
placement: { default: "top" },
|
|
318
329
|
color: {},
|
|
330
|
+
autoContrast: { type: Boolean },
|
|
319
331
|
offset: {},
|
|
320
332
|
open: {
|
|
321
333
|
type: Boolean,
|
|
@@ -380,4 +392,4 @@ var tooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
380
392
|
}
|
|
381
393
|
}), [["__scopeId", "data-v-13c39164"]]);
|
|
382
394
|
//#endregion
|
|
383
|
-
export { useDelayedOpen as n, tooltip_default as t };
|
|
395
|
+
export { useDelayedOpen as i, resolveTooltipColorStyleWithContrast as n, resolveTooltipOffsetStyle as r, tooltip_default as t };
|
package/dist/useButtonColor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as getComponentVariantColorRoles } from "./componentColors.js";
|
|
2
2
|
import { defineVaporComponent, markRaw, template } from "vue";
|
|
3
3
|
//#region ~icons/lucide/loader-circle
|
|
4
4
|
var t0 = template("<svg viewBox=\"0 0 24 24\"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d=\"M21 12a9 9 0 1 1-6.219-8.56\">", 3, 1);
|
|
@@ -11,20 +11,22 @@ var loader_circle_default = markRaw(defineVaporComponent({
|
|
|
11
11
|
}));
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/components/button/useButtonColor.ts
|
|
14
|
-
function getButtonColorStyle(color) {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function getButtonColorStyle(color, variant, autoContrast) {
|
|
15
|
+
if (!color && !variant) return void 0;
|
|
16
|
+
const roles = getComponentVariantColorRoles({
|
|
17
|
+
color,
|
|
18
|
+
variant,
|
|
19
|
+
autoContrast
|
|
20
|
+
});
|
|
21
|
+
if (!roles) return void 0;
|
|
17
22
|
return {
|
|
18
|
-
"--_rp-button-
|
|
19
|
-
"--_rp-button-
|
|
20
|
-
"--_rp-button-
|
|
21
|
-
"--_rp-button-
|
|
22
|
-
"--_rp-button-
|
|
23
|
-
"--_rp-button-
|
|
24
|
-
"--_rp-button-
|
|
25
|
-
"--_rp-button-custom-border": `color-mix(in srgb, ${customColor} 45%, transparent)`,
|
|
26
|
-
"--_rp-button-custom-border-hover": `color-mix(in srgb, ${customColor} 62%, transparent)`,
|
|
27
|
-
"--_rp-button-custom-fg": customColor
|
|
23
|
+
"--_rp-button-bg": roles.background,
|
|
24
|
+
"--_rp-button-bg-hover": roles.hover,
|
|
25
|
+
"--_rp-button-bg-active": roles.active,
|
|
26
|
+
"--_rp-button-border": roles.border,
|
|
27
|
+
"--_rp-button-border-hover": roles.borderHover,
|
|
28
|
+
"--_rp-button-border-active": roles.borderActive,
|
|
29
|
+
"--_rp-button-fg": roles.color
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
//#endregion
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const componentColors: readonly ["dark", "gray", "red", "pink", "grape", "violet", "indigo", "blue", "cyan", "teal", "green", "lime", "yellow", "orange"];
|
|
2
|
+
export declare const componentColorShades: readonly ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
3
|
+
export type ComponentColor = (typeof componentColors)[number];
|
|
4
|
+
export type ComponentColorShade = (typeof componentColorShades)[number];
|
|
5
|
+
export type ComponentColorShadeValue = `${ComponentColor}.${ComponentColorShade}`;
|
|
6
|
+
export type ComponentColorValue = ComponentColor | ComponentColorShadeValue | (string & {});
|
|
7
|
+
export type ComponentColorVariant = 'solid' | 'subtle' | 'surface' | 'outline' | 'ghost' | 'plain';
|
|
8
|
+
export interface ComponentColorRoles {
|
|
9
|
+
filled: string;
|
|
10
|
+
hover: string;
|
|
11
|
+
active: string;
|
|
12
|
+
contrast: string;
|
|
13
|
+
light: string;
|
|
14
|
+
lightHover: string;
|
|
15
|
+
lightActive: string;
|
|
16
|
+
outline: string;
|
|
17
|
+
outlineHover: string;
|
|
18
|
+
foreground: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ComponentVariantColorRoles {
|
|
21
|
+
background: string;
|
|
22
|
+
hover: string;
|
|
23
|
+
active: string;
|
|
24
|
+
color: string;
|
|
25
|
+
border: string;
|
|
26
|
+
borderHover: string;
|
|
27
|
+
borderActive: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ComponentContrastColorOptions {
|
|
30
|
+
autoContrast?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ComponentVariantColorOptions extends ComponentContrastColorOptions {
|
|
33
|
+
color: ComponentColorValue | undefined;
|
|
34
|
+
variant: ComponentColorVariant | undefined;
|
|
35
|
+
defaultColor?: ComponentColorValue;
|
|
36
|
+
}
|
|
37
|
+
export type ParsedComponentColor = {
|
|
38
|
+
kind: 'empty';
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'preset';
|
|
41
|
+
color: ComponentColor;
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'primary';
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'shade';
|
|
46
|
+
color: ComponentColor;
|
|
47
|
+
shade: ComponentColorShade;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'custom';
|
|
50
|
+
value: string;
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'invalid';
|
|
53
|
+
value: string;
|
|
54
|
+
};
|
|
55
|
+
export declare function isComponentPresetColor(color: ComponentColorValue | undefined): color is ComponentColor;
|
|
56
|
+
export declare function parseComponentColor(color: ComponentColorValue | undefined): ParsedComponentColor;
|
|
57
|
+
export declare function getComponentColorValue(color: ComponentColorValue | undefined): string | undefined;
|
|
58
|
+
export declare function getComponentContrastColor(color: ComponentColorValue | undefined, options?: ComponentContrastColorOptions): string;
|
|
59
|
+
export declare function getComponentColorRoles(color: ComponentColorValue | undefined): ComponentColorRoles | undefined;
|
|
60
|
+
export declare function getComponentVariantColorRoles({ color, variant, defaultColor, autoContrast, }: ComponentVariantColorOptions): ComponentVariantColorRoles | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ropav",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"packageManager": "pnpm@11.10.0",
|
|
6
6
|
"engines": {
|
|
@@ -21,10 +21,22 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"import": "./dist/index.js"
|
|
23
23
|
},
|
|
24
|
+
"./alert": {
|
|
25
|
+
"types": "./dist/components/alert/index.d.ts",
|
|
26
|
+
"import": "./dist/components/alert/index.js"
|
|
27
|
+
},
|
|
24
28
|
"./accordion": {
|
|
25
29
|
"types": "./dist/components/accordion/index.d.ts",
|
|
26
30
|
"import": "./dist/components/accordion/index.js"
|
|
27
31
|
},
|
|
32
|
+
"./aspect-ratio": {
|
|
33
|
+
"types": "./dist/components/aspect-ratio/index.d.ts",
|
|
34
|
+
"import": "./dist/components/aspect-ratio/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./avatar": {
|
|
37
|
+
"types": "./dist/components/avatar/index.d.ts",
|
|
38
|
+
"import": "./dist/components/avatar/index.js"
|
|
39
|
+
},
|
|
28
40
|
"./badge": {
|
|
29
41
|
"types": "./dist/components/badge/index.d.ts",
|
|
30
42
|
"import": "./dist/components/badge/index.js"
|
|
@@ -33,6 +45,10 @@
|
|
|
33
45
|
"types": "./dist/components/button/index.d.ts",
|
|
34
46
|
"import": "./dist/components/button/index.js"
|
|
35
47
|
},
|
|
48
|
+
"./button-link": {
|
|
49
|
+
"types": "./dist/components/button-link/index.d.ts",
|
|
50
|
+
"import": "./dist/components/button-link/index.js"
|
|
51
|
+
},
|
|
36
52
|
"./button-group": {
|
|
37
53
|
"types": "./dist/components/button-group/index.d.ts",
|
|
38
54
|
"import": "./dist/components/button-group/index.js"
|
|
@@ -49,6 +65,18 @@
|
|
|
49
65
|
"types": "./dist/components/collapse/index.d.ts",
|
|
50
66
|
"import": "./dist/components/collapse/index.js"
|
|
51
67
|
},
|
|
68
|
+
"./color-input": {
|
|
69
|
+
"types": "./dist/components/color-input/index.d.ts",
|
|
70
|
+
"import": "./dist/components/color-input/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./color-picker": {
|
|
73
|
+
"types": "./dist/components/color-picker/index.d.ts",
|
|
74
|
+
"import": "./dist/components/color-picker/index.js"
|
|
75
|
+
},
|
|
76
|
+
"./color-swatch": {
|
|
77
|
+
"types": "./dist/components/color-swatch/index.d.ts",
|
|
78
|
+
"import": "./dist/components/color-swatch/index.js"
|
|
79
|
+
},
|
|
52
80
|
"./dropdown-menu": {
|
|
53
81
|
"types": "./dist/components/dropdown-menu/index.d.ts",
|
|
54
82
|
"import": "./dist/components/dropdown-menu/index.js"
|
|
@@ -69,6 +97,10 @@
|
|
|
69
97
|
"types": "./dist/components/modal/index.d.ts",
|
|
70
98
|
"import": "./dist/components/modal/index.js"
|
|
71
99
|
},
|
|
100
|
+
"./number-input": {
|
|
101
|
+
"types": "./dist/components/number-input/index.d.ts",
|
|
102
|
+
"import": "./dist/components/number-input/index.js"
|
|
103
|
+
},
|
|
72
104
|
"./overlay": {
|
|
73
105
|
"types": "./dist/components/overlay/index.d.ts",
|
|
74
106
|
"import": "./dist/components/overlay/index.js"
|
|
@@ -105,6 +137,10 @@
|
|
|
105
137
|
"types": "./dist/components/textarea/index.d.ts",
|
|
106
138
|
"import": "./dist/components/textarea/index.js"
|
|
107
139
|
},
|
|
140
|
+
"./toast": {
|
|
141
|
+
"types": "./dist/components/toast/index.d.ts",
|
|
142
|
+
"import": "./dist/components/toast/index.js"
|
|
143
|
+
},
|
|
108
144
|
"./tooltip": {
|
|
109
145
|
"types": "./dist/components/tooltip/index.d.ts",
|
|
110
146
|
"import": "./dist/components/tooltip/index.js"
|
|
@@ -123,13 +159,17 @@
|
|
|
123
159
|
"format": "oxfmt",
|
|
124
160
|
"format:check": "oxfmt --check",
|
|
125
161
|
"test": "vitest run --project=unit",
|
|
126
|
-
"test:
|
|
162
|
+
"test:consumer-types": "pnpm run test:package",
|
|
163
|
+
"test:consumer-types:built": "tsc -p tests/fixtures/consumer-types/tsconfig.bundler.json && tsc -p tests/fixtures/consumer-types/tsconfig.nodenext.json",
|
|
164
|
+
"test:exports": "pnpm run test:package",
|
|
165
|
+
"test:exports:built": "node scripts/check-exports.mjs",
|
|
166
|
+
"test:package": "pnpm run build && pnpm run test:exports:built && pnpm run test:consumer-types:built",
|
|
127
167
|
"test:watch": "vitest --project=unit",
|
|
128
168
|
"test:typecheck": "vitest run --project=unit --typecheck",
|
|
129
169
|
"test:storybook": "vitest run --project=storybook",
|
|
130
170
|
"test:all": "pnpm run tokens:check && pnpm test && pnpm test:storybook",
|
|
131
171
|
"build": "pnpm run tokens:build && pnpm run tokens:check && pnpm run typecheck && vite build",
|
|
132
|
-
"prepublishOnly": "pnpm run
|
|
172
|
+
"prepublishOnly": "pnpm run test:package",
|
|
133
173
|
"preview": "vite preview",
|
|
134
174
|
"storybook": "pnpm run tokens:build && storybook dev -p 6006 --no-open",
|
|
135
175
|
"build-storybook": "pnpm run tokens:build && pnpm run tokens:check && pnpm run typecheck:storybook && storybook build",
|
|
@@ -142,31 +182,31 @@
|
|
|
142
182
|
},
|
|
143
183
|
"devDependencies": {
|
|
144
184
|
"@iconify-json/lucide": "^1.2.116",
|
|
145
|
-
"@storybook/addon-themes": "^10.
|
|
146
|
-
"@storybook/addon-vitest": "^10.
|
|
147
|
-
"@storybook/vue3-vite": "^10.
|
|
148
|
-
"@types/node": "^
|
|
185
|
+
"@storybook/addon-themes": "^10.5.0",
|
|
186
|
+
"@storybook/addon-vitest": "^10.5.0",
|
|
187
|
+
"@storybook/vue3-vite": "^10.5.0",
|
|
188
|
+
"@types/node": "^26.1.1",
|
|
149
189
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
150
190
|
"@vitest/browser-playwright": "^4.1.10",
|
|
151
191
|
"@vue/compiler-vapor": "3.6.0-beta.17",
|
|
152
192
|
"@vue/tsconfig": "^0.9.1",
|
|
153
193
|
"bumpp": "^11.1.0",
|
|
154
|
-
"conventional-changelog": "^
|
|
155
|
-
"conventional-changelog-conventionalcommits": "^
|
|
194
|
+
"conventional-changelog": "^8.1.0",
|
|
195
|
+
"conventional-changelog-conventionalcommits": "^10.2.1",
|
|
156
196
|
"jsdom": "^29.1.1",
|
|
157
|
-
"oxfmt": "^0.
|
|
158
|
-
"oxlint": "^1.
|
|
197
|
+
"oxfmt": "^0.58.0",
|
|
198
|
+
"oxlint": "^1.73.0",
|
|
159
199
|
"playwright": "^1.61.1",
|
|
160
200
|
"sass-embedded": "^1.100.0",
|
|
161
|
-
"storybook": "^10.
|
|
201
|
+
"storybook": "^10.5.0",
|
|
162
202
|
"style-dictionary": "5.5.0",
|
|
163
203
|
"typescript": "~6.0.3",
|
|
164
204
|
"unplugin-icons": "^23.0.1",
|
|
165
|
-
"vite": "^8.1.
|
|
205
|
+
"vite": "^8.1.4",
|
|
166
206
|
"vite-plugin-dts": "^5.0.3",
|
|
167
207
|
"vitest": "^4.1.10",
|
|
168
|
-
"vue": "beta",
|
|
169
|
-
"vue-tsc": "^3.3.
|
|
208
|
+
"vue": "3.6.0-beta.17",
|
|
209
|
+
"vue-tsc": "^3.3.7"
|
|
170
210
|
},
|
|
171
211
|
"repository": {
|
|
172
212
|
"type": "git",
|
package/src/styles/_mixins.scss
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
@use 'variables' as *;
|
|
2
2
|
|
|
3
|
+
$rp-component-colors:
|
|
4
|
+
'dark', 'gray', 'red', 'pink', 'grape', 'violet', 'indigo', 'blue', 'cyan', 'teal', 'green',
|
|
5
|
+
'lime', 'yellow', 'orange';
|
|
6
|
+
|
|
3
7
|
@mixin flex-center {
|
|
4
8
|
display: inline-flex;
|
|
5
9
|
align-items: center;
|
|
@@ -7,7 +11,7 @@
|
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
@mixin focus-ring {
|
|
10
|
-
border-color: var(--rp-color-
|
|
14
|
+
border-color: var(--rp-color-control-border-focus);
|
|
11
15
|
box-shadow: 0 0 0 var(--rp-border-width-medium) var(--rp-color-focus-ring);
|
|
12
16
|
}
|
|
13
17
|
|
|
@@ -55,36 +59,50 @@
|
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
@mixin control-size-vars($prefix) {
|
|
62
|
+
&--xs {
|
|
63
|
+
#{$prefix}-height: var(--rp-size-control-xs);
|
|
64
|
+
#{$prefix}-font: var(--rp-font-size-xs);
|
|
65
|
+
#{$prefix}-px: calc(var(--rp-size-control-xs) / 3);
|
|
66
|
+
#{$prefix}-radius: var(--rp-radius-sm);
|
|
67
|
+
}
|
|
68
|
+
|
|
58
69
|
&--sm {
|
|
59
70
|
#{$prefix}-height: var(--rp-size-control-sm);
|
|
60
71
|
#{$prefix}-font: var(--rp-font-size-sm);
|
|
61
|
-
#{$prefix}-px: var(--rp-
|
|
72
|
+
#{$prefix}-px: calc(var(--rp-size-control-sm) / 3);
|
|
62
73
|
#{$prefix}-radius: var(--rp-radius-md);
|
|
63
74
|
}
|
|
64
75
|
|
|
65
76
|
&--md {
|
|
66
77
|
#{$prefix}-height: var(--rp-size-control-md);
|
|
67
|
-
#{$prefix}-font: var(--rp-font-size-
|
|
68
|
-
#{$prefix}-px: var(--rp-
|
|
78
|
+
#{$prefix}-font: var(--rp-font-size-md);
|
|
79
|
+
#{$prefix}-px: calc(var(--rp-size-control-md) / 3);
|
|
69
80
|
#{$prefix}-radius: var(--rp-radius-lg);
|
|
70
81
|
}
|
|
71
82
|
|
|
72
83
|
&--lg {
|
|
73
84
|
#{$prefix}-height: var(--rp-size-control-lg);
|
|
74
85
|
#{$prefix}-font: var(--rp-font-size-lg);
|
|
75
|
-
#{$prefix}-px: var(--rp-
|
|
86
|
+
#{$prefix}-px: calc(var(--rp-size-control-lg) / 3);
|
|
87
|
+
#{$prefix}-radius: var(--rp-radius-lg);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--xl {
|
|
91
|
+
#{$prefix}-height: var(--rp-size-control-xl);
|
|
92
|
+
#{$prefix}-font: var(--rp-font-size-xl);
|
|
93
|
+
#{$prefix}-px: calc(var(--rp-size-control-xl) / 3);
|
|
76
94
|
#{$prefix}-radius: var(--rp-radius-lg);
|
|
77
95
|
}
|
|
78
96
|
}
|
|
79
97
|
|
|
80
98
|
@mixin menu-surface(
|
|
81
99
|
$z-index: $z-index-dropdown,
|
|
82
|
-
$surface: var(--rp-color-
|
|
100
|
+
$surface: var(--rp-color-default),
|
|
83
101
|
$radius: var(--rp-radius-lg)
|
|
84
102
|
) {
|
|
85
103
|
z-index: $z-index;
|
|
86
104
|
background-color: $surface;
|
|
87
|
-
border: var(--rp-border-width-thin) solid var(--rp-color-border);
|
|
105
|
+
border: var(--rp-border-width-thin) solid var(--rp-color-default-border);
|
|
88
106
|
border-radius: $radius;
|
|
89
107
|
box-shadow: var(--rp-shadow-md);
|
|
90
108
|
padding: var(--rp-spacing-1) 0;
|
|
@@ -119,37 +137,3 @@
|
|
|
119
137
|
}
|
|
120
138
|
}
|
|
121
139
|
}
|
|
122
|
-
|
|
123
|
-
@mixin semantic-colors($var-name) {
|
|
124
|
-
@each $name in primary, secondary, success, warning, danger, info, neutral {
|
|
125
|
-
&--#{$name} {
|
|
126
|
-
#{$var-name}: var(--rp-color-#{$name}-fg);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
@mixin semantic-color-pair($color-var, $foreground-var) {
|
|
132
|
-
@each $name in primary, secondary, success, warning, danger, info, neutral {
|
|
133
|
-
&--#{$name} {
|
|
134
|
-
#{$color-var}: var(--rp-color-#{$name});
|
|
135
|
-
#{$foreground-var}: var(--rp-color-on-#{$name});
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
@mixin semantic-state-colors($prefix) {
|
|
141
|
-
@each $name in primary, secondary, success, warning, danger, info, neutral {
|
|
142
|
-
&--#{$name} {
|
|
143
|
-
#{$prefix}-bg: var(--rp-color-#{$name});
|
|
144
|
-
#{$prefix}-bg-hover: var(--rp-color-#{$name}-hover);
|
|
145
|
-
#{$prefix}-bg-active: var(--rp-color-#{$name}-active);
|
|
146
|
-
#{$prefix}-subtle-bg: var(--rp-color-#{$name}-subtle-bg);
|
|
147
|
-
#{$prefix}-subtle-bg-hover: var(--rp-color-#{$name}-subtle-bg-hover);
|
|
148
|
-
#{$prefix}-subtle-bg-active: var(--rp-color-#{$name}-subtle-bg-active);
|
|
149
|
-
#{$prefix}-border: var(--rp-color-#{$name}-border);
|
|
150
|
-
#{$prefix}-border-hover: var(--rp-color-#{$name}-border-hover);
|
|
151
|
-
#{$prefix}-fg: var(--rp-color-#{$name}-fg);
|
|
152
|
-
#{$prefix}-on-bg: var(--rp-color-on-#{$name});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|