@rotki/ui-library 2.1.0 → 2.2.1

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.
Files changed (32) hide show
  1. package/README.md +1 -0
  2. package/dist/__test__/transition-group-stub.d.ts +2 -0
  3. package/dist/components/date-time-picker/RuiDateTimePicker.vue.d.ts +79 -0
  4. package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue.d.ts +48 -0
  5. package/dist/components/date-time-picker/timezones.d.ts +1 -0
  6. package/dist/components/date-time-picker/types.d.ts +5 -0
  7. package/dist/components/date-time-picker/use-input-handler.d.ts +9 -0
  8. package/dist/components/date-time-picker/use-keyboard-handler.d.ts +29 -0
  9. package/dist/components/date-time-picker/utils.d.ts +4 -0
  10. package/dist/components/index.d.ts +2 -1
  11. package/dist/components/index.es.js +5063 -3815
  12. package/dist/components/time-picker/RuiTimePicker.vue.d.ts +16 -0
  13. package/dist/composables/{index-DOuH9rdn.js → index-DLKNQD1b.js} +68 -67
  14. package/dist/composables/index.es.js +1 -1
  15. package/dist/icons/icons_1.d.ts +4 -4
  16. package/dist/icons/icons_1.es.js +388 -388
  17. package/dist/icons/icons_2.d.ts +7 -7
  18. package/dist/icons/icons_2.es.js +1024 -1024
  19. package/dist/icons/icons_3.d.ts +9 -9
  20. package/dist/icons/icons_3.es.js +1035 -1035
  21. package/dist/icons/icons_4.d.ts +9 -0
  22. package/dist/icons/icons_4.es.js +320 -284
  23. package/dist/icons/index.d.ts +1 -1
  24. package/dist/icons/index.es.js +1348 -1339
  25. package/dist/index-hpmutpFo.js +32 -0
  26. package/dist/index.es.js +1478 -1482
  27. package/dist/style.css +1 -1
  28. package/dist/utils/{index-CxHG7aHQ.js → index-BOcQQzr3.js} +4 -4
  29. package/dist/vendor-1jxxZILY.js +2051 -0
  30. package/dist/web-types.json +480 -1
  31. package/package.json +31 -35
  32. package/dist/vendor-BeEprDAU.js +0 -1624
package/README.md CHANGED
@@ -5,6 +5,7 @@ A Vue component library and design system for rotki
5
5
  [![npm (scoped)](https://img.shields.io/npm/v/@rotki/ui-library?style=flat-square)](https://www.npmjs.com/package/@rotki/ui-library)
6
6
  [![ci](https://github.com/rotki/ui-library/actions/workflows/ci.yml/badge.svg)](https://github.com/rotki/ui-library/actions/workflows/ci.yml)
7
7
  [![codecov](https://codecov.io/gh/rotki/ui-library/graph/badge.svg?token=9PIS7KMFC7)](https://codecov.io/gh/rotki/ui-library)
8
+ [![license](https://img.shields.io/github/license/rotki/ui-library)](https://github.com/rotki/ui-library/blob/main/LICENSE.md)
8
9
 
9
10
  ## Getting started
10
11
 
@@ -0,0 +1,2 @@
1
+ import type { ComponentOptions } from 'vue';
2
+ export declare const TransitionGroupStub: ComponentOptions;
@@ -0,0 +1,79 @@
1
+ import type { TimeAccuracy } from '../../consts/time-accuracy';
2
+ type DateFormat = 'year-first' | 'month-first' | 'day-first';
3
+ type DateTimeModelType = 'date' | 'epoch-ms' | 'epoch';
4
+ type ModelValueType<T extends DateTimeModelType> = T extends 'date' ? Date | undefined : T extends 'epoch-ms' ? number | undefined : T extends 'epoch' ? number | undefined : Date | number | undefined;
5
+ export interface RuiDateTimePickerProps {
6
+ minDate?: Date | number;
7
+ maxDate?: Date | number;
8
+ format?: DateFormat;
9
+ type?: DateTimeModelType;
10
+ accuracy?: TimeAccuracy;
11
+ disabled?: boolean;
12
+ allowEmpty?: boolean;
13
+ readonly?: boolean;
14
+ dense?: boolean;
15
+ label?: string;
16
+ variant?: 'default' | 'filled' | 'outlined';
17
+ hint?: string;
18
+ errorMessages?: string | string[];
19
+ successMessages?: string | string[];
20
+ hideDetails?: boolean;
21
+ }
22
+ type __VLS_Props = RuiDateTimePickerProps;
23
+ declare const props: Readonly<{}> & {
24
+ readonly disabled: boolean;
25
+ readonly readonly: boolean;
26
+ readonly allowEmpty: boolean;
27
+ readonly dense: boolean;
28
+ readonly type: DateTimeModelType;
29
+ readonly hideDetails: boolean;
30
+ readonly label: string;
31
+ readonly variant: "default" | "outlined" | "filled";
32
+ readonly hint: string | undefined;
33
+ readonly maxDate: number | Date | undefined;
34
+ readonly minDate: number | Date | undefined;
35
+ readonly format: DateFormat;
36
+ readonly accuracy: TimeAccuracy;
37
+ readonly errorMessages: string | string[];
38
+ readonly successMessages: string | string[];
39
+ } & {
40
+ readonly readonly: boolean;
41
+ readonly disabled: boolean;
42
+ readonly hideDetails: boolean;
43
+ readonly dense: boolean;
44
+ readonly allowEmpty: boolean;
45
+ };
46
+ type __VLS_Slots = {
47
+ 'menu-content': () => any;
48
+ };
49
+ type __VLS_PublicProps = __VLS_Props & {
50
+ modelValue: ModelValueType<typeof props.type>;
51
+ };
52
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
53
+ "update:modelValue": (value: number | Date | undefined) => any;
54
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
55
+ "onUpdate:modelValue"?: ((value: number | Date | undefined) => any) | undefined;
56
+ }>, {
57
+ readonly: boolean;
58
+ variant: "default" | "filled" | "outlined";
59
+ type: DateTimeModelType;
60
+ label: string;
61
+ disabled: boolean;
62
+ errorMessages: string | string[];
63
+ successMessages: string | string[];
64
+ hint: string;
65
+ hideDetails: boolean;
66
+ dense: boolean;
67
+ maxDate: Date | number;
68
+ minDate: Date | number;
69
+ allowEmpty: boolean;
70
+ accuracy: TimeAccuracy;
71
+ format: DateFormat;
72
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
73
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
74
+ export default _default;
75
+ type __VLS_WithSlots<T, S> = T & {
76
+ new (): {
77
+ $slots: S;
78
+ };
79
+ };
@@ -0,0 +1,48 @@
1
+ import type { TimeAccuracy } from '../../consts/time-accuracy';
2
+ import { type TimePickerSelection } from '../../components/time-picker/RuiTimePicker.vue';
3
+ type __VLS_Props = {
4
+ accuracy: TimeAccuracy;
5
+ maxDate?: Date | number;
6
+ minDate?: Date | number;
7
+ };
8
+ type __VLS_Slots = {
9
+ default: () => any;
10
+ };
11
+ type __VLS_PublicProps = __VLS_Props & {
12
+ 'selectedDate': Date | undefined;
13
+ 'selectedTime': Date | undefined;
14
+ 'selectedHour': number | undefined;
15
+ 'selectedMinute': number | undefined;
16
+ 'selectedSecond': number | undefined;
17
+ 'selectedMillisecond': number | undefined;
18
+ 'timeSelection': TimePickerSelection;
19
+ 'selectedTimezone': string | undefined;
20
+ };
21
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
+ "set-now": () => any;
23
+ "update:selectedDate": (value: Date | undefined) => any;
24
+ "update:selectedTime": (value: Date | undefined) => any;
25
+ "update:selectedHour": (value: number | undefined) => any;
26
+ "update:selectedMinute": (value: number | undefined) => any;
27
+ "update:selectedSecond": (value: number | undefined) => any;
28
+ "update:selectedMillisecond": (value: number | undefined) => any;
29
+ "update:timeSelection": (value: TimePickerSelection) => any;
30
+ "update:selectedTimezone": (value: string | undefined) => any;
31
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
32
+ "onSet-now"?: (() => any) | undefined;
33
+ "onUpdate:selectedDate"?: ((value: Date | undefined) => any) | undefined;
34
+ "onUpdate:selectedTime"?: ((value: Date | undefined) => any) | undefined;
35
+ "onUpdate:selectedHour"?: ((value: number | undefined) => any) | undefined;
36
+ "onUpdate:selectedMinute"?: ((value: number | undefined) => any) | undefined;
37
+ "onUpdate:selectedSecond"?: ((value: number | undefined) => any) | undefined;
38
+ "onUpdate:selectedMillisecond"?: ((value: number | undefined) => any) | undefined;
39
+ "onUpdate:timeSelection"?: ((value: TimePickerSelection) => any) | undefined;
40
+ "onUpdate:selectedTimezone"?: ((value: string | undefined) => any) | undefined;
41
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
43
+ export default _default;
44
+ type __VLS_WithSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1 @@
1
+ export declare const timezones: string[];
@@ -0,0 +1,5 @@
1
+ import type { Ref } from 'vue';
2
+ export declare const DATE_TIME_SEGMENT_TYPES: readonly ["DD", "MM", "YYYY", "hh", "mm", "ss", "SSS"];
3
+ export type DateTimeSegmentType = typeof DATE_TIME_SEGMENT_TYPES[number];
4
+ export declare function isDateTimeSegmentType(value: string): value is DateTimeSegmentType;
5
+ export type SegmentData = Record<DateTimeSegmentType, Ref<number | undefined>>;
@@ -0,0 +1,9 @@
1
+ import type { DateTimeSegmentType, SegmentData } from '../../components/date-time-picker/types';
2
+ import type { TimeAccuracy } from '../../consts/time-accuracy';
3
+ import type { Dayjs } from 'dayjs';
4
+ import type { Ref } from 'vue';
5
+ export declare function useInputHandler(data: SegmentData, currentValue: Ref<number | undefined>): {
6
+ getCurrent: (segment: DateTimeSegmentType) => number | undefined;
7
+ setValue: (segment: DateTimeSegmentType, value?: number) => void;
8
+ update: (date: Dayjs, accuracy: TimeAccuracy) => void;
9
+ };
@@ -0,0 +1,29 @@
1
+ import type { Dayjs } from 'dayjs';
2
+ import type { Ref } from 'vue';
3
+ import { type DateTimeSegmentType } from '../../components/date-time-picker/types';
4
+ interface Segment {
5
+ start: number;
6
+ end: number;
7
+ type: DateTimeSegmentType;
8
+ }
9
+ interface KeyboardHandlerOptions {
10
+ dateFormat: Ref<string>;
11
+ cursorPosition: Ref<number>;
12
+ currentValue: Ref<number | undefined>;
13
+ textInput: Ref<HTMLInputElement | undefined>;
14
+ setValue: (segment: DateTimeSegmentType, value?: number) => void;
15
+ getCurrent: (segment: DateTimeSegmentType) => number | undefined;
16
+ getDateTime: () => Dayjs;
17
+ disabled: boolean;
18
+ readonly: boolean;
19
+ }
20
+ export declare function useKeyboardHandler(options: KeyboardHandlerOptions): {
21
+ clear: (segmentType?: string) => void;
22
+ getCurrentSegment: (position?: number) => Segment | undefined;
23
+ handleClick: (event: MouseEvent) => void;
24
+ handleFocus: () => void;
25
+ handleInputSelection: (event: Event) => void;
26
+ handleKeyDown: (event: KeyboardEvent) => void;
27
+ setSegment: (segmentType: DateTimeSegmentType) => void;
28
+ };
29
+ export {};
@@ -0,0 +1,4 @@
1
+ import { TimeAccuracy } from '../../consts/time-accuracy';
2
+ export declare function guessTimezone(): string | undefined;
3
+ export declare function includeSeconds(accuracy: TimeAccuracy): boolean;
4
+ export declare function includeMilliseconds(accuracy: TimeAccuracy): boolean;
@@ -9,6 +9,7 @@ import RuiCard, { type Props as CardProps } from '../components/cards/RuiCard.vu
9
9
  import RuiCardHeader, { type Props as CardHeaderProps } from '../components/cards/RuiCardHeader.vue';
10
10
  import RuiChip, { type Props as ChipProps } from '../components/chips/RuiChip.vue';
11
11
  import RuiColorPicker, { type Props as ColorPickerProps } from '../components/color-picker/RuiColorPicker.vue';
12
+ import RuiDateTimePicker, { type RuiDateTimePickerProps } from '../components/date-time-picker/RuiDateTimePicker.vue';
12
13
  import RuiDivider, { type Props as DividerProps } from '../components/divider/RuiDivider.vue';
13
14
  import RuiAutoComplete, { type AutoCompleteProps } from '../components/forms/auto-complete/RuiAutoComplete.vue';
14
15
  import RuiCheckbox, { type Props as CheckboxProps } from '../components/forms/checkbox/RuiCheckbox.vue';
@@ -42,4 +43,4 @@ import RuiTabItems, { type Props as TabItemsProps } from '../components/tabs/tab
42
43
  import RuiTab, { type Props as TabProps } from '../components/tabs/tab/RuiTab.vue';
43
44
  import RuiTabs, { type Props as TabsProps } from '../components/tabs/tabs/RuiTabs.vue';
44
45
  import RuiTimePicker, { type RuiTimePickerProps } from '../components/time-picker/RuiTimePicker.vue';
45
- export { AccordionProps, AccordionsProps, AlertProps, AutoCompleteProps, BadgeProps, BottomSheetProps, ButtonGroupProps, ButtonProps, CalendarProps, CardHeaderProps, CardProps, CheckboxProps, ChipProps, ColorPickerProps, DataTableColumn, DataTableGroupKeys, DataTableOptions, DataTableProps, DataTableSortColumn, DataTableSortData, DialogProps, DividerProps, ExpandButtonProps, FooterStepperProps, IconProps, LogoProps, MenuProps, MenuSelectProps, NavigationDrawerProps, NotificationProps, ProgressProps, RadioGroupProps, RadioProps, RevealableTextFieldProps, RuiAccordion, RuiAccordions, RuiAlert, RuiAutoComplete, RuiBadge, RuiBottomSheet, RuiButton, RuiButtonGroup, RuiCalendar, RuiCard, RuiCardHeader, RuiCheckbox, RuiChip, RuiColorPicker, RuiDataTable, RuiDialog, RuiDivider, RuiFooterStepper, RuiIcon, RuiLogo, RuiMenu, RuiMenuSelect, RuiNavigationDrawer, RuiNotification, RuiProgress, RuiRadio, RuiRadioGroup, RuiRevealableTextField, RuiSimpleSelect, RuiSkeletonLoader, RuiSlider, RuiStepper, RuiSwitch, RuiTab, RuiTabItem, RuiTabItems, RuiTablePagination, RuiTableRowExpander, RuiTabs, RuiTextArea, RuiTextField, RuiTimePicker, RuiTimePickerProps, RuiTooltip, SimpleSelectProps, SkeletonLoaderProps, SliderProps, StepperProps, SwitchProps, TabItemProps, TabItemsProps, TablePaginationData, TablePaginationProps, TabProps, TabsProps, TextAreaProps, TextFieldProps, TooltipProps, };
46
+ export { AccordionProps, AccordionsProps, AlertProps, AutoCompleteProps, BadgeProps, BottomSheetProps, ButtonGroupProps, ButtonProps, CalendarProps, CardHeaderProps, CardProps, CheckboxProps, ChipProps, ColorPickerProps, DataTableColumn, DataTableGroupKeys, DataTableOptions, DataTableProps, DataTableSortColumn, DataTableSortData, DialogProps, DividerProps, ExpandButtonProps, FooterStepperProps, IconProps, LogoProps, MenuProps, MenuSelectProps, NavigationDrawerProps, NotificationProps, ProgressProps, RadioGroupProps, RadioProps, RevealableTextFieldProps, RuiAccordion, RuiAccordions, RuiAlert, RuiAutoComplete, RuiBadge, RuiBottomSheet, RuiButton, RuiButtonGroup, RuiCalendar, RuiCard, RuiCardHeader, RuiCheckbox, RuiChip, RuiColorPicker, RuiDataTable, RuiDateTimePicker, RuiDateTimePickerProps, RuiDialog, RuiDivider, RuiFooterStepper, RuiIcon, RuiLogo, RuiMenu, RuiMenuSelect, RuiNavigationDrawer, RuiNotification, RuiProgress, RuiRadio, RuiRadioGroup, RuiRevealableTextField, RuiSimpleSelect, RuiSkeletonLoader, RuiSlider, RuiStepper, RuiSwitch, RuiTab, RuiTabItem, RuiTabItems, RuiTablePagination, RuiTableRowExpander, RuiTabs, RuiTextArea, RuiTextField, RuiTimePicker, RuiTimePickerProps, RuiTooltip, SimpleSelectProps, SkeletonLoaderProps, SliderProps, StepperProps, SwitchProps, TabItemProps, TabItemsProps, TablePaginationData, TablePaginationProps, TabProps, TabsProps, TextAreaProps, TextFieldProps, TooltipProps, };