ropav 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/alert.css +18 -18
- package/dist/alert.js +15 -10
- package/dist/avatar.css +19 -19
- package/dist/avatar.js +14 -9
- package/dist/badge.css +16 -16
- package/dist/badge.js +12 -7
- package/dist/base.css +196 -56
- package/dist/button-link.css +32 -28
- package/dist/button-link.js +9 -5
- package/dist/button.css +32 -28
- package/dist/button.js +9 -5
- package/dist/checkbox.css +32 -32
- package/dist/checkbox.js +17 -9
- package/dist/chevron-right.js +12 -0
- package/dist/collectionNavigation.js +120 -0
- package/dist/color-input.js +2 -1
- package/dist/componentColors.js +94 -22
- package/dist/components/alert/types.d.ts +1 -0
- package/dist/components/alert/useAlertColor.d.ts +1 -1
- package/dist/components/avatar/types.d.ts +1 -0
- package/dist/components/avatar/useAvatarColor.d.ts +1 -1
- package/dist/components/badge/types.d.ts +1 -0
- package/dist/components/badge/useBadgeColor.d.ts +1 -1
- package/dist/components/button/types.d.ts +1 -0
- package/dist/components/button/useButtonColor.d.ts +1 -1
- package/dist/components/button-link/types.d.ts +1 -0
- package/dist/components/checkbox/types.d.ts +1 -0
- package/dist/components/dropdown-menu/dropdown-menu-primitive-core.d.ts +1 -0
- package/dist/components/dropdown-menu/dropdown-menu-utils.d.ts +0 -2
- package/dist/components/dropdown-menu/index.d.ts +1 -0
- package/dist/components/dropdown-menu/types.d.ts +4 -0
- package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +2 -1
- package/dist/components/dropdown-menu/useDropdownMenuNavigation.d.ts +1 -0
- package/dist/components/icon-button/types.d.ts +1 -0
- package/dist/components/pagination/index.d.ts +4 -0
- package/dist/components/pagination/index.js +2 -0
- package/dist/components/pagination/pagination.d.ts +49 -0
- package/dist/components/pagination/types.d.ts +54 -0
- package/dist/components/pagination/usePagination.d.ts +19 -0
- package/dist/components/radio/types.d.ts +3 -0
- package/dist/components/select/useSelect.d.ts +1 -1
- package/dist/components/slider/range-slider-tooltip.d.ts +2 -0
- package/dist/components/slider/types.d.ts +1 -1
- package/dist/components/slider/useRangeSlider.d.ts +2 -0
- package/dist/components/slider/useSlider.d.ts +2 -0
- package/dist/components/toast/types.d.ts +2 -0
- package/dist/components/toast/useToastColor.d.ts +1 -1
- package/dist/components/tooltip/types.d.ts +1 -0
- package/dist/components/tooltip/useTooltip.d.ts +1 -1
- package/dist/dropdown-menu.js +55 -30
- package/dist/icon-button.css +39 -35
- package/dist/icon-button.js +9 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/input.js +2 -1
- package/dist/number-input.js +2 -1
- package/dist/pagination.css +140 -0
- package/dist/pagination.js +442 -0
- package/dist/radio.js +15 -5
- package/dist/select.js +65 -46
- package/dist/slider.css +191 -191
- package/dist/slider.js +49 -31
- package/dist/switch.js +2 -1
- package/dist/textarea.js +2 -1
- package/dist/toast.css +26 -26
- package/dist/toast.js +16 -9
- package/dist/tooltip.css +12 -12
- package/dist/tooltip.js +13 -8
- package/dist/unplugin-icons.js +38 -25
- package/dist/useButtonColor.js +6 -3
- package/dist/useControllableValue.js +27 -0
- package/dist/useFormControl.js +2 -27
- package/dist/utils/componentColors.d.ts +14 -1
- package/docs/public-styles-api.md +1 -1
- package/docs/public-tokens.md +648 -508
- package/package.json +7 -1
- package/src/styles/_tokens.scss +459 -319
- package/src/styles/styles-manifest.json +1122 -2
package/dist/useButtonColor.js
CHANGED
|
@@ -11,12 +11,13 @@ var loader_circle_default = markRaw(defineVaporComponent({
|
|
|
11
11
|
}));
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/components/button/useButtonColor.ts
|
|
14
|
-
function getButtonColorStyle(color, variant, autoContrast) {
|
|
14
|
+
function getButtonColorStyle(color, variant, autoContrast, contrastColor) {
|
|
15
15
|
if (!color && !variant) return void 0;
|
|
16
16
|
const roles = getComponentVariantColorRoles({
|
|
17
17
|
color,
|
|
18
18
|
variant,
|
|
19
|
-
autoContrast
|
|
19
|
+
autoContrast,
|
|
20
|
+
contrastColor
|
|
20
21
|
});
|
|
21
22
|
if (!roles) return void 0;
|
|
22
23
|
return {
|
|
@@ -26,7 +27,9 @@ function getButtonColorStyle(color, variant, autoContrast) {
|
|
|
26
27
|
"--_rp-button-border": roles.border,
|
|
27
28
|
"--_rp-button-border-hover": roles.borderHover,
|
|
28
29
|
"--_rp-button-border-active": roles.borderActive,
|
|
29
|
-
"--_rp-button-fg": roles.color
|
|
30
|
+
"--_rp-button-fg": roles.color,
|
|
31
|
+
"--_rp-button-fg-hover": roles.colorHover,
|
|
32
|
+
"--_rp-button-fg-active": roles.colorActive
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
//#endregion
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { computed, shallowRef, watch } from "vue";
|
|
2
|
+
//#region src/composables/useControllableValue.ts
|
|
3
|
+
function useControllableValue(options) {
|
|
4
|
+
const initialValue = options.defaultValue();
|
|
5
|
+
const uncontrolledValue = shallowRef(initialValue);
|
|
6
|
+
const isControlled = computed(() => options.modelValue() !== void 0);
|
|
7
|
+
watch(options.modelValue, (value) => {
|
|
8
|
+
if (value !== void 0) uncontrolledValue.value = value;
|
|
9
|
+
}, { immediate: true });
|
|
10
|
+
const value = computed(() => options.modelValue() ?? uncontrolledValue.value);
|
|
11
|
+
function setValue(nextValue) {
|
|
12
|
+
if (!isControlled.value) uncontrolledValue.value = nextValue;
|
|
13
|
+
options.onChange(nextValue);
|
|
14
|
+
}
|
|
15
|
+
function resetValue(nextValue = initialValue) {
|
|
16
|
+
if (!isControlled.value) uncontrolledValue.value = nextValue;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
initialValue,
|
|
20
|
+
isControlled,
|
|
21
|
+
value,
|
|
22
|
+
setValue,
|
|
23
|
+
resetValue
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { useControllableValue as t };
|
package/dist/useFormControl.js
CHANGED
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/composables/useControllableValue.ts
|
|
3
|
-
function useControllableValue(options) {
|
|
4
|
-
const initialValue = options.defaultValue();
|
|
5
|
-
const uncontrolledValue = shallowRef(initialValue);
|
|
6
|
-
const isControlled = computed(() => options.modelValue() !== void 0);
|
|
7
|
-
watch(options.modelValue, (value) => {
|
|
8
|
-
if (value !== void 0) uncontrolledValue.value = value;
|
|
9
|
-
}, { immediate: true });
|
|
10
|
-
const value = computed(() => options.modelValue() ?? uncontrolledValue.value);
|
|
11
|
-
function setValue(nextValue) {
|
|
12
|
-
if (!isControlled.value) uncontrolledValue.value = nextValue;
|
|
13
|
-
options.onChange(nextValue);
|
|
14
|
-
}
|
|
15
|
-
function resetValue(nextValue = initialValue) {
|
|
16
|
-
if (!isControlled.value) uncontrolledValue.value = nextValue;
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
initialValue,
|
|
20
|
-
isControlled,
|
|
21
|
-
value,
|
|
22
|
-
setValue,
|
|
23
|
-
resetValue
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
1
|
+
import { inject, provide, watchEffect } from "vue";
|
|
27
2
|
//#region src/composables/useFormControl.ts
|
|
28
3
|
var nestedFormControlOwnerKey = Symbol("nestedFormControlOwner");
|
|
29
4
|
function provideNestedFormControlOwner() {
|
|
@@ -104,4 +79,4 @@ function useCheckedFormControl(element, controllable, validationMessage) {
|
|
|
104
79
|
});
|
|
105
80
|
}
|
|
106
81
|
//#endregion
|
|
107
|
-
export { useTextFormControl as a, useFormControl as i, provideNestedFormControlOwner as n,
|
|
82
|
+
export { useTextFormControl as a, useFormControl as i, provideNestedFormControlOwner as n, useCheckedFormControl as r, claimNestedFormControlOwner as t };
|
|
@@ -10,6 +10,8 @@ export interface ComponentColorRoles {
|
|
|
10
10
|
hover: string;
|
|
11
11
|
active: string;
|
|
12
12
|
contrast: string;
|
|
13
|
+
contrastHover: string;
|
|
14
|
+
contrastActive: string;
|
|
13
15
|
light: string;
|
|
14
16
|
lightHover: string;
|
|
15
17
|
lightActive: string;
|
|
@@ -22,12 +24,22 @@ export interface ComponentVariantColorRoles {
|
|
|
22
24
|
hover: string;
|
|
23
25
|
active: string;
|
|
24
26
|
color: string;
|
|
27
|
+
colorHover: string;
|
|
28
|
+
colorActive: string;
|
|
25
29
|
border: string;
|
|
26
30
|
borderHover: string;
|
|
27
31
|
borderActive: string;
|
|
28
32
|
}
|
|
29
33
|
export interface ComponentContrastColorOptions {
|
|
34
|
+
/** Automatically selects a readable foreground for preset and opaque custom colors. */
|
|
30
35
|
autoContrast?: boolean;
|
|
36
|
+
/** Required when an automatically contrasted custom color is translucent. */
|
|
37
|
+
contrastColor?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ComponentContrastColorRoles {
|
|
40
|
+
color: string;
|
|
41
|
+
hover: string;
|
|
42
|
+
active: string;
|
|
31
43
|
}
|
|
32
44
|
export interface ComponentVariantColorOptions extends ComponentContrastColorOptions {
|
|
33
45
|
color: ComponentColorValue | undefined;
|
|
@@ -56,5 +68,6 @@ export declare function isComponentPresetColor(color: ComponentColorValue | unde
|
|
|
56
68
|
export declare function parseComponentColor(color: ComponentColorValue | undefined): ParsedComponentColor;
|
|
57
69
|
export declare function getComponentColorValue(color: ComponentColorValue | undefined): string | undefined;
|
|
58
70
|
export declare function getComponentContrastColor(color: ComponentColorValue | undefined, options?: ComponentContrastColorOptions): string;
|
|
71
|
+
export declare function getComponentContrastColorRoles(color: ComponentColorValue | undefined, options?: ComponentContrastColorOptions): ComponentContrastColorRoles;
|
|
59
72
|
export declare function getComponentColorRoles(color: ComponentColorValue | undefined): ComponentColorRoles | undefined;
|
|
60
|
-
export declare function getComponentVariantColorRoles({ color, variant, defaultColor, autoContrast, }: ComponentVariantColorOptions): ComponentVariantColorRoles | undefined;
|
|
73
|
+
export declare function getComponentVariantColorRoles({ color, variant, defaultColor, autoContrast, contrastColor, }: ComponentVariantColorOptions): ComponentVariantColorRoles | undefined;
|
|
@@ -111,7 +111,7 @@ The exact entries in [`styles-manifest.json`](../src/styles/styles-manifest.json
|
|
|
111
111
|
|
|
112
112
|
The manifest contains design tokens plus a deliberately small component-geometry allowlist. Slider and RangeSlider share the `--rp-slider-*` namespace. Size presets provide fallbacks, while a consumer value wins for the individual dimension. See the generated [token table](./public-tokens.md).
|
|
113
113
|
|
|
114
|
-
Palette shades and their `*-contrast` companions are required override groups because `autoContrast` consumes
|
|
114
|
+
Palette shades and their normal and active `*-contrast` companions are required override groups because `autoContrast` consumes state-specific companions selected at build time. The [color override contract](./public-tokens.md#color-override-contract) documents the state pairings and preset-role requirements.
|
|
115
115
|
|
|
116
116
|
## Cascade layers and migration
|
|
117
117
|
|