ropav 0.0.4 → 0.0.6
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 +21 -43
- package/dist/base.css +36 -14
- package/dist/button-group.css +50 -0
- package/dist/button-group.js +49 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.css +73 -43
- package/dist/button.js +41 -40
- package/dist/button.js.map +1 -1
- package/dist/card.css +88 -0
- package/dist/card.js +71 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.css +108 -94
- package/dist/checkbox.js +18 -6
- package/dist/checkbox.js.map +1 -1
- package/dist/componentColors.js +22 -0
- package/dist/componentColors.js.map +1 -0
- package/dist/components/button/button.d.ts +2 -0
- package/dist/components/button/types.d.ts +2 -1
- package/dist/components/button/useButtonColor.d.ts +13 -0
- package/dist/components/button-group/button-group.d.ts +21 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +2 -0
- package/dist/components/button-group/types.d.ts +10 -0
- package/dist/components/card/card.d.ts +21 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +2 -0
- package/dist/components/card/types.d.ts +11 -0
- package/dist/components/checkbox/types.d.ts +2 -1
- package/dist/components/checkbox/useCheckbox.d.ts +4 -0
- package/dist/components/field/field.d.ts +35 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.js +2 -0
- package/dist/components/field/types.d.ts +21 -0
- package/dist/components/icon-button/icon-button.d.ts +21 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +2 -0
- package/dist/components/icon-button/types.d.ts +15 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/index.js +2 -0
- package/dist/components/progress/progress.d.ts +27 -0
- package/dist/components/progress/types.d.ts +24 -0
- package/dist/components/progress/useProgress.d.ts +28 -0
- package/dist/components/radio/types.d.ts +2 -1
- package/dist/components/radio/useRadio.d.ts +4 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/slider/slider.d.ts +35 -0
- package/dist/components/slider/types.d.ts +50 -0
- package/dist/components/slider/useSlider.d.ts +50 -0
- package/dist/components/switch/types.d.ts +2 -1
- package/dist/components/switch/useSwitch.d.ts +3 -0
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/textarea/types.d.ts +5 -0
- package/dist/components/textarea/useTextarea.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/components/tooltip/tooltip.d.ts +27 -0
- package/dist/components/tooltip/types.d.ts +29 -0
- package/dist/components/tooltip/useTooltip.d.ts +17 -0
- package/dist/field.css +40 -0
- package/dist/field.js +128 -0
- package/dist/field.js.map +1 -0
- package/dist/icon-button.css +372 -0
- package/dist/icon-button.js +67 -0
- package/dist/icon-button.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -1
- package/dist/input.css +2 -2
- package/dist/progress.css +125 -0
- package/dist/progress.js +177 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio.css +83 -83
- package/dist/radio.js +18 -6
- package/dist/radio.js.map +1 -1
- package/dist/select.css +16 -4
- package/dist/select.js +7 -0
- package/dist/select.js.map +1 -1
- package/dist/slider.css +438 -0
- package/dist/slider.js +412 -0
- package/dist/slider.js.map +1 -0
- package/dist/switch.css +79 -70
- package/dist/switch.js +15 -6
- package/dist/switch.js.map +1 -1
- package/dist/textarea.css +35 -28
- package/dist/textarea.js +106 -15
- package/dist/textarea.js.map +1 -1
- package/dist/tooltip.css +136 -0
- package/dist/tooltip.js +384 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/useButtonColor.js +33 -0
- package/dist/useButtonColor.js.map +1 -0
- package/package.json +30 -2
- package/src/styles/_mixins.scss +17 -0
- package/src/styles/_tokens.scss +14 -13
- package/src/styles/_utilities.scss +13 -0
- package/src/styles/_variables.scss +2 -1
- package/src/styles/base.scss +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ButtonColor } from './types';
|
|
2
|
+
export declare function getButtonColorStyle(color: ButtonColor | undefined): {
|
|
3
|
+
'--_rp-button-custom-color': string & {};
|
|
4
|
+
'--_rp-button-custom-hover': string;
|
|
5
|
+
'--_rp-button-custom-active': string;
|
|
6
|
+
'--_rp-button-custom-on': string;
|
|
7
|
+
'--_rp-button-custom-subtle-bg': string;
|
|
8
|
+
'--_rp-button-custom-subtle-bg-hover': string;
|
|
9
|
+
'--_rp-button-custom-subtle-bg-active': string;
|
|
10
|
+
'--_rp-button-custom-border': string;
|
|
11
|
+
'--_rp-button-custom-border-hover': string;
|
|
12
|
+
'--_rp-button-custom-fg': string & {};
|
|
13
|
+
} | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ButtonGroupProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<ButtonGroupProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
emit: {};
|
|
12
|
+
}>) => import('vue').VNode & {
|
|
13
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} : {
|
|
20
|
+
[K in keyof T as K]: T[K];
|
|
21
|
+
}) & {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
2
|
+
export interface ButtonGroupProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
orientation?: ButtonGroupOrientation;
|
|
5
|
+
attached?: boolean;
|
|
6
|
+
wrap?: boolean;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
describedby?: string;
|
|
9
|
+
labelledby?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CardProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<CardProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
emit: {};
|
|
12
|
+
}>) => import('vue').VNode & {
|
|
13
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} : {
|
|
20
|
+
[K in keyof T as K]: T[K];
|
|
21
|
+
}) & {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type CardPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
2
|
+
export type CardRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type CardLayer = 'base' | 'surface' | 'raised';
|
|
4
|
+
export interface CardProps {
|
|
5
|
+
layer?: CardLayer;
|
|
6
|
+
padding?: CardPadding;
|
|
7
|
+
radius?: CardRadius;
|
|
8
|
+
border?: boolean;
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComponentColorValue } from '../../utils/componentColors';
|
|
2
|
+
export type CheckboxColor = ComponentColorValue;
|
|
2
3
|
export type CheckboxSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
4
|
export type CheckboxRadius = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
5
|
export type CheckboxVariant = 'solid' | 'outline';
|
|
@@ -2,5 +2,9 @@ import { CheckboxProps } from './types';
|
|
|
2
2
|
export declare function useCheckbox(props: Readonly<CheckboxProps>, emitUpdate: (value: boolean) => void): {
|
|
3
3
|
control: import('../../composables/useControlState').ControlState;
|
|
4
4
|
rootClass: import('vue').ComputedRef<string[]>;
|
|
5
|
+
rootStyle: import('vue').ComputedRef<{
|
|
6
|
+
'--_rp-checkbox-custom-color': string & {};
|
|
7
|
+
'--_rp-checkbox-custom-on-color': string;
|
|
8
|
+
} | undefined>;
|
|
5
9
|
onChange: (e: Event) => void;
|
|
6
10
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FieldControlProps, FieldProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<FieldProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
label?: (props: {}) => any;
|
|
10
|
+
} & {
|
|
11
|
+
default?: (props: {
|
|
12
|
+
id: string;
|
|
13
|
+
disabled: true | undefined;
|
|
14
|
+
required: true | undefined;
|
|
15
|
+
invalid: true | undefined;
|
|
16
|
+
labelledby: string | undefined;
|
|
17
|
+
describedby: string | undefined;
|
|
18
|
+
controlProps: FieldControlProps;
|
|
19
|
+
}) => any;
|
|
20
|
+
} & {
|
|
21
|
+
description?: (props: {}) => any;
|
|
22
|
+
} & {
|
|
23
|
+
message?: (props: {}) => any;
|
|
24
|
+
};
|
|
25
|
+
emit: {};
|
|
26
|
+
}>) => import('vue').VNode & {
|
|
27
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
28
|
+
};
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} : {
|
|
34
|
+
[K in keyof T as K]: T[K];
|
|
35
|
+
}) & {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface FieldControlProps {
|
|
2
|
+
id: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
labelledby?: string;
|
|
7
|
+
describedby?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FieldSlotProps extends FieldControlProps {
|
|
10
|
+
controlProps: FieldControlProps;
|
|
11
|
+
}
|
|
12
|
+
export interface FieldProps {
|
|
13
|
+
id?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
message?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IconButtonProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<IconButtonProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
emit: {};
|
|
12
|
+
}>) => import('vue').VNode & {
|
|
13
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} : {
|
|
20
|
+
[K in keyof T as K]: T[K];
|
|
21
|
+
}) & {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ButtonColor, ButtonRadius, ButtonSize, ButtonVariant } from '../button/types';
|
|
2
|
+
export type IconButtonColor = ButtonColor;
|
|
3
|
+
export type IconButtonSize = ButtonSize;
|
|
4
|
+
export type IconButtonRadius = ButtonRadius;
|
|
5
|
+
export type IconButtonVariant = ButtonVariant;
|
|
6
|
+
export interface IconButtonProps {
|
|
7
|
+
ariaLabel: string;
|
|
8
|
+
variant?: IconButtonVariant;
|
|
9
|
+
color?: IconButtonColor;
|
|
10
|
+
size?: IconButtonSize;
|
|
11
|
+
radius?: IconButtonRadius;
|
|
12
|
+
type?: 'button' | 'submit' | 'reset';
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ProgressProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<ProgressProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: (props: {}) => any;
|
|
10
|
+
} & {
|
|
11
|
+
value?: (props: {
|
|
12
|
+
value: number;
|
|
13
|
+
formattedValue: string | number;
|
|
14
|
+
percent: number;
|
|
15
|
+
}) => any;
|
|
16
|
+
};
|
|
17
|
+
emit: {};
|
|
18
|
+
}>) => import('vue').VNode & {
|
|
19
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
20
|
+
};
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
24
|
+
[K in keyof T]: T[K];
|
|
25
|
+
} : {
|
|
26
|
+
[K in keyof T as K]: T[K];
|
|
27
|
+
}) & {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentColorValue } from '../../utils/componentColors';
|
|
2
|
+
export declare const progressColors: readonly ["primary", "secondary", "success", "warning", "danger", "info", "neutral"];
|
|
3
|
+
export declare const progressSizes: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
4
|
+
export declare const progressRadiuses: readonly ["none", "xs", "sm", "md", "lg", "xl", "full"];
|
|
5
|
+
export type ProgressColor = ComponentColorValue;
|
|
6
|
+
export type ProgressSize = (typeof progressSizes)[number];
|
|
7
|
+
export type ProgressRadius = (typeof progressRadiuses)[number];
|
|
8
|
+
export type ProgressValueFormatter = (value: number, percent: number) => string | number;
|
|
9
|
+
export interface ProgressProps {
|
|
10
|
+
id?: string;
|
|
11
|
+
value?: number | null;
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
color?: ProgressColor;
|
|
15
|
+
size?: ProgressSize;
|
|
16
|
+
radius?: ProgressRadius;
|
|
17
|
+
indeterminate?: boolean;
|
|
18
|
+
showValue?: boolean;
|
|
19
|
+
formatValue?: ProgressValueFormatter;
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
ariaValueText?: string | ProgressValueFormatter;
|
|
22
|
+
describedby?: string;
|
|
23
|
+
labelledby?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
import { ProgressProps } from './types';
|
|
3
|
+
type ProgressStateProps = Readonly<ProgressProps & {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
indeterminate: boolean;
|
|
7
|
+
showValue: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function normalizeProgressBounds(min: number, max: number): {
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function normalizeProgressValue(value: number | null | undefined, min: number, max: number): number;
|
|
14
|
+
export declare function getProgressValuePercent(value: number, min: number, max: number): number;
|
|
15
|
+
export declare function useProgress(props: ProgressStateProps): {
|
|
16
|
+
control: import('../../composables/useControlState').ControlState;
|
|
17
|
+
rootClass: import('vue').ComputedRef<string[]>;
|
|
18
|
+
rootStyle: import('vue').ComputedRef<CSSProperties>;
|
|
19
|
+
isIndeterminate: import('vue').ComputedRef<boolean>;
|
|
20
|
+
normalizedValue: import('vue').ComputedRef<number>;
|
|
21
|
+
valuePercent: import('vue').ComputedRef<number>;
|
|
22
|
+
formattedValue: import('vue').ComputedRef<string | number>;
|
|
23
|
+
ariaValueText: import('vue').ComputedRef<string | undefined>;
|
|
24
|
+
ariaValueMin: import('vue').ComputedRef<number | undefined>;
|
|
25
|
+
ariaValueMax: import('vue').ComputedRef<number | undefined>;
|
|
26
|
+
ariaValueNow: import('vue').ComputedRef<number | undefined>;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InjectionKey } from 'vue';
|
|
2
|
-
|
|
2
|
+
import { ComponentColorValue } from '../../utils/componentColors';
|
|
3
|
+
export type RadioColor = ComponentColorValue;
|
|
3
4
|
export type RadioSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
5
|
export type RadioVariant = 'solid' | 'outline';
|
|
5
6
|
export interface RadioProps {
|
|
@@ -4,6 +4,10 @@ export declare function useRadio(props: Readonly<RadioProps>): {
|
|
|
4
4
|
isChecked: import('vue').ComputedRef<boolean>;
|
|
5
5
|
isDisabled: import('vue').ComputedRef<boolean>;
|
|
6
6
|
rootClass: import('vue').ComputedRef<string[]>;
|
|
7
|
+
rootStyle: import('vue').ComputedRef<{
|
|
8
|
+
'--_rp-radio-custom-color': string & {};
|
|
9
|
+
'--_rp-radio-custom-on-color': string;
|
|
10
|
+
} | undefined>;
|
|
7
11
|
onSelect: () => void;
|
|
8
12
|
};
|
|
9
13
|
export declare function useRadioGroup(props: Readonly<RadioGroupProps>, emitUpdate: (value: string | number | null) => void): {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as Slider } from './slider';
|
|
2
|
+
export { sliderColors, sliderOrientations, sliderSizes } from './types';
|
|
3
|
+
export type { SliderColor, SliderMark, SliderMarkColor, SliderMarkInput, SliderOrientation, SliderProps, SliderPresetColor, SliderSize, SliderThumbStyle, SliderTooltip, SliderTooltipMode, SliderTooltipOptions, SliderValueFormatter, } from './types';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SliderProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<SliderProps & {
|
|
4
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
5
|
+
}> & (typeof globalThis extends {
|
|
6
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
7
|
+
} ? P : {});
|
|
8
|
+
expose: (exposed: {}) => void;
|
|
9
|
+
attrs: any;
|
|
10
|
+
slots: {
|
|
11
|
+
default?: (props: {}) => any;
|
|
12
|
+
} & {
|
|
13
|
+
value?: (props: {
|
|
14
|
+
value: number;
|
|
15
|
+
formattedValue: string | number;
|
|
16
|
+
percent: number;
|
|
17
|
+
}) => any;
|
|
18
|
+
} & {
|
|
19
|
+
thumb?: (props: {
|
|
20
|
+
value: number;
|
|
21
|
+
formattedValue: string | number;
|
|
22
|
+
percent: number;
|
|
23
|
+
}) => any;
|
|
24
|
+
};
|
|
25
|
+
emit: (evt: "update:modelValue", value: number) => void;
|
|
26
|
+
}>) => import('vue').VNode & {
|
|
27
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
28
|
+
};
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} : {
|
|
34
|
+
[K in keyof T as K]: T[K];
|
|
35
|
+
}) & {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TooltipProps } from '../tooltip/types';
|
|
2
|
+
export declare const sliderColors: readonly ["primary", "secondary", "success", "warning", "danger", "info", "neutral"];
|
|
3
|
+
export declare const sliderSizes: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
4
|
+
export declare const sliderOrientations: readonly ["horizontal", "vertical"];
|
|
5
|
+
export type SliderPresetColor = (typeof sliderColors)[number];
|
|
6
|
+
export type SliderColor = SliderPresetColor | (string & {});
|
|
7
|
+
export type SliderSize = (typeof sliderSizes)[number];
|
|
8
|
+
export type SliderOrientation = (typeof sliderOrientations)[number];
|
|
9
|
+
export type SliderValueFormatter = (value: number) => string | number;
|
|
10
|
+
export type SliderTooltipMode = 'hover' | 'always';
|
|
11
|
+
export type SliderTooltipOptions = Pick<TooltipProps, 'id' | 'placement' | 'color' | 'offset' | 'openDelay' | 'arrow'> & {
|
|
12
|
+
mode?: SliderTooltipMode;
|
|
13
|
+
};
|
|
14
|
+
export type SliderTooltip = false | SliderTooltipMode | SliderTooltipOptions;
|
|
15
|
+
export type SliderMarkColor = SliderColor;
|
|
16
|
+
export interface SliderMark {
|
|
17
|
+
value: number;
|
|
18
|
+
label?: string | number;
|
|
19
|
+
color?: SliderMarkColor;
|
|
20
|
+
hidden?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type SliderMarkInput = number | SliderMark;
|
|
23
|
+
export interface SliderThumbStyle {
|
|
24
|
+
size?: number | string;
|
|
25
|
+
border?: number | string;
|
|
26
|
+
padding?: number | string;
|
|
27
|
+
}
|
|
28
|
+
export interface SliderProps {
|
|
29
|
+
id?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
modelValue: number;
|
|
32
|
+
min?: number;
|
|
33
|
+
max?: number;
|
|
34
|
+
step?: number | 'any';
|
|
35
|
+
marks?: SliderMarkInput[];
|
|
36
|
+
thumbStyle?: SliderThumbStyle;
|
|
37
|
+
tooltip?: SliderTooltip;
|
|
38
|
+
formatValue?: SliderValueFormatter;
|
|
39
|
+
color?: SliderColor;
|
|
40
|
+
size?: SliderSize;
|
|
41
|
+
orientation?: SliderOrientation;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
required?: boolean;
|
|
44
|
+
invalid?: boolean;
|
|
45
|
+
valid?: boolean;
|
|
46
|
+
ariaLabel?: string;
|
|
47
|
+
ariaValueText?: string | SliderValueFormatter;
|
|
48
|
+
describedby?: string;
|
|
49
|
+
labelledby?: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
import { SliderProps } from './types';
|
|
3
|
+
type SliderStateProps = Readonly<SliderProps & {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step: number | 'any';
|
|
7
|
+
tooltip: NonNullable<SliderProps['tooltip']>;
|
|
8
|
+
orientation: NonNullable<SliderProps['orientation']>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function normalizeSliderValue(value: number, min: number, max: number, step: number | 'any'): number;
|
|
11
|
+
export declare function normalizeSliderBounds(min: number, max: number): {
|
|
12
|
+
min: number;
|
|
13
|
+
max: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function normalizeSliderStep(step: number | 'any'): number | "any";
|
|
16
|
+
export declare function getSliderValuePercent(value: number, min: number, max: number): number;
|
|
17
|
+
export declare function useSlider(props: SliderStateProps, emitUpdate: (value: number) => void): {
|
|
18
|
+
control: import('../../composables/useControlState').ControlState;
|
|
19
|
+
nativeMin: import('vue').ComputedRef<number>;
|
|
20
|
+
nativeMax: import('vue').ComputedRef<number>;
|
|
21
|
+
nativeStep: import('vue').ComputedRef<number | "any">;
|
|
22
|
+
rootClass: import('vue').ComputedRef<string[]>;
|
|
23
|
+
normalizedValue: import('vue').ComputedRef<number>;
|
|
24
|
+
valuePercent: import('vue').ComputedRef<number>;
|
|
25
|
+
formattedValue: import('vue').ComputedRef<string | number>;
|
|
26
|
+
ariaValueText: import('vue').ComputedRef<string | undefined>;
|
|
27
|
+
markItems: import('vue').ComputedRef<{
|
|
28
|
+
key: string;
|
|
29
|
+
value: number;
|
|
30
|
+
label: string | number | undefined;
|
|
31
|
+
hasLabel: boolean;
|
|
32
|
+
filled: boolean;
|
|
33
|
+
style: CSSProperties;
|
|
34
|
+
}[]>;
|
|
35
|
+
trackStyle: import('vue').ComputedRef<CSSProperties>;
|
|
36
|
+
tooltipVisible: import('vue').ComputedRef<boolean>;
|
|
37
|
+
tooltipOpen: import('vue').ComputedRef<boolean>;
|
|
38
|
+
tooltipPlacement: import('vue').ComputedRef<import('../tooltip').TooltipPlacement>;
|
|
39
|
+
tooltipId: import('vue').ComputedRef<string | undefined>;
|
|
40
|
+
tooltipColor: import('vue').ComputedRef<import('../../utils/componentColors').ComponentColorValue | undefined>;
|
|
41
|
+
tooltipOffset: import('vue').ComputedRef<import('../tooltip').TooltipOffset | undefined>;
|
|
42
|
+
tooltipOpenDelay: import('vue').ComputedRef<number>;
|
|
43
|
+
tooltipArrow: import('vue').ComputedRef<boolean>;
|
|
44
|
+
tooltipContent: import('vue').ComputedRef<string>;
|
|
45
|
+
onInput: (e: Event) => void;
|
|
46
|
+
openTooltip: () => void;
|
|
47
|
+
closeTooltip: () => void;
|
|
48
|
+
onTooltipKeydown: (event: KeyboardEvent) => void;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComponentColorValue } from '../../utils/componentColors';
|
|
2
|
+
export type SwitchColor = ComponentColorValue;
|
|
2
3
|
export type SwitchSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
4
|
export interface SwitchProps {
|
|
4
5
|
id?: string;
|
|
@@ -2,5 +2,8 @@ import { SwitchProps } from './types';
|
|
|
2
2
|
export declare function useSwitch(props: Readonly<SwitchProps>, emitUpdate: (value: boolean) => void): {
|
|
3
3
|
control: import('../../composables/useControlState').ControlState;
|
|
4
4
|
rootClass: import('vue').ComputedRef<string[]>;
|
|
5
|
+
rootStyle: import('vue').ComputedRef<{
|
|
6
|
+
'--_rp-switch-custom-color': string & {};
|
|
7
|
+
} | undefined>;
|
|
5
8
|
onChange: (e: Event) => void;
|
|
6
9
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Textarea } from './textarea';
|
|
2
|
-
export type { TextareaProps, TextareaRadius, TextareaSize } from './types';
|
|
2
|
+
export type { TextareaProps, TextareaRadius, TextareaResize, TextareaSize } from './types';
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export type TextareaRadius = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
2
|
export type TextareaSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type TextareaResize = 'none' | 'vertical' | 'both';
|
|
3
4
|
export interface TextareaProps {
|
|
4
5
|
id?: string;
|
|
5
6
|
name?: string;
|
|
6
7
|
modelValue: string;
|
|
7
8
|
size?: TextareaSize;
|
|
8
9
|
radius?: TextareaRadius;
|
|
10
|
+
resize?: TextareaResize;
|
|
11
|
+
autosize?: boolean;
|
|
12
|
+
minRows?: number;
|
|
13
|
+
maxRows?: number;
|
|
9
14
|
placeholder?: string;
|
|
10
15
|
rows?: number;
|
|
11
16
|
disabled?: boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { TextareaProps } from './types';
|
|
2
2
|
export declare function useTextarea(props: Readonly<TextareaProps>, emitUpdate: (value: string) => void): {
|
|
3
|
+
textareaRef: import('vue').Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
|
|
3
4
|
control: import('../../composables/useControlState').ControlState;
|
|
4
5
|
rootClass: import('vue').ComputedRef<string[]>;
|
|
6
|
+
nativeRows: import('vue').ComputedRef<number | undefined>;
|
|
5
7
|
onInput: (e: Event) => void;
|
|
6
8
|
focusTextarea: (e: MouseEvent) => void;
|
|
7
9
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TooltipProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<TooltipProps & {
|
|
4
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
5
|
+
}> & (typeof globalThis extends {
|
|
6
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
7
|
+
} ? P : {});
|
|
8
|
+
expose: (exposed: {}) => void;
|
|
9
|
+
attrs: any;
|
|
10
|
+
slots: {
|
|
11
|
+
default?: (props: {
|
|
12
|
+
triggerProps: import('./types').TooltipTriggerProps;
|
|
13
|
+
}) => any;
|
|
14
|
+
} & {
|
|
15
|
+
content?: (props: {}) => any;
|
|
16
|
+
};
|
|
17
|
+
emit: (evt: "update:open", value: boolean) => void;
|
|
18
|
+
}>) => import('vue').VNode & {
|
|
19
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
20
|
+
};
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
24
|
+
[K in keyof T]: T[K];
|
|
25
|
+
} : {
|
|
26
|
+
[K in keyof T as K]: T[K];
|
|
27
|
+
}) & {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ComponentColorValue } from '../../utils/componentColors';
|
|
3
|
+
export type TooltipPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
export type TooltipColor = ComponentColorValue;
|
|
5
|
+
export type TooltipTarget = string | HTMLElement | Ref<HTMLElement | null | undefined>;
|
|
6
|
+
export interface TooltipOffsetOptions {
|
|
7
|
+
mainAxis?: number;
|
|
8
|
+
crossAxis?: number;
|
|
9
|
+
}
|
|
10
|
+
export type TooltipOffset = number | TooltipOffsetOptions;
|
|
11
|
+
export interface TooltipTriggerProps {
|
|
12
|
+
'aria-describedby'?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TooltipSlotProps {
|
|
15
|
+
triggerProps: TooltipTriggerProps;
|
|
16
|
+
}
|
|
17
|
+
export interface TooltipProps {
|
|
18
|
+
id?: string;
|
|
19
|
+
content?: string;
|
|
20
|
+
target?: TooltipTarget | null;
|
|
21
|
+
placement?: TooltipPlacement;
|
|
22
|
+
color?: TooltipColor;
|
|
23
|
+
offset?: TooltipOffset;
|
|
24
|
+
open?: boolean;
|
|
25
|
+
openDelay?: number;
|
|
26
|
+
arrow?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
decorative?: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
import { TooltipProps, TooltipTriggerProps } from './types';
|
|
3
|
+
export declare function useTooltip(props: Readonly<TooltipProps>, emitOpenChange?: (open: boolean) => void): {
|
|
4
|
+
tooltipId: import('vue').ComputedRef<string>;
|
|
5
|
+
isOpen: import('vue').ComputedRef<boolean>;
|
|
6
|
+
isVisible: import('vue').ComputedRef<boolean>;
|
|
7
|
+
isTargetMode: import('vue').ComputedRef<boolean>;
|
|
8
|
+
shouldRenderContent: import('vue').ComputedRef<boolean>;
|
|
9
|
+
rootClass: import('vue').ComputedRef<string[]>;
|
|
10
|
+
triggerProps: import('vue').ComputedRef<TooltipTriggerProps>;
|
|
11
|
+
contentRole: import('vue').ComputedRef<"tooltip" | undefined>;
|
|
12
|
+
contentAriaHidden: import('vue').ComputedRef<"true" | undefined>;
|
|
13
|
+
contentStyle: import('vue').ComputedRef<CSSProperties | undefined>;
|
|
14
|
+
openTooltip: () => void;
|
|
15
|
+
closeTooltip: () => void;
|
|
16
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
17
|
+
};
|