@dolanske/vui 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -99
- package/dist/components/Accordion/Accordion.vue.d.ts +1 -0
- package/dist/components/Avatar/Avatar.vue.d.ts +4 -2
- package/dist/components/Divider/Divider.vue.d.ts +2 -4
- package/dist/components/Dropdown/Dropdown.vue.d.ts +105 -0
- package/dist/components/Input/Dropzone.vue.d.ts +1 -0
- package/dist/components/Input/Input.vue.d.ts +1 -0
- package/dist/components/Popout/Popout.vue.d.ts +3 -3
- package/dist/components/Radio/Radio.vue.d.ts +1 -1
- package/dist/components/Radio/RadioGroup.vue.d.ts +3 -12
- package/dist/components/Tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/shared/helpers.d.ts +6 -0
- package/dist/shared/types.d.ts +3 -0
- package/dist/style.css +1 -1
- package/dist/vui.js +3922 -3842
- package/package.json +1 -1
- package/src/App.vue +7 -19
- package/src/components/Accordion/Accordion.vue +8 -4
- package/src/components/Accordion/accordion.scss +38 -2
- package/src/components/Avatar/Avatar.vue +25 -4
- package/src/components/Avatar/avatar.scss +5 -5
- package/src/components/Button/Button.vue +4 -4
- package/src/components/Calendar/Calendar.vue +10 -8
- package/src/components/Card/Card.vue +2 -2
- package/src/components/Checkbox/Checkbox.vue +4 -1
- package/src/components/Checkbox/checkbox.scss +12 -6
- package/src/components/Divider/Divider.vue +22 -12
- package/src/components/Drawer/Drawer.vue +6 -8
- package/src/components/Drawer/drawer.scss +0 -13
- package/src/components/Dropdown/Dropdown.vue +13 -8
- package/src/components/Input/Input.vue +4 -1
- package/src/components/Input/Textarea.vue +11 -6
- package/src/components/Input/input.scss +13 -4
- package/src/components/Popout/Popout.vue +3 -3
- package/src/components/Progress/Progress.vue +19 -11
- package/src/components/Progress/progress.scss +1 -1
- package/src/components/Radio/Radio.vue +1 -1
- package/src/components/Radio/RadioGroup.vue +10 -5
- package/src/components/Sheet/Sheet.vue +16 -15
- package/src/components/Sheet/sheet.scss +4 -0
- package/src/components/Skeleton/Skeleton.vue +19 -20
- package/src/components/Spinner/Spinner.vue +5 -5
- package/src/components/Table/table.ts +2 -1
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/shared/helpers.ts +15 -0
- package/src/shared/types.ts +6 -0
- package/src/style/core.scss +4 -1
- package/src/style/layout.scss +4 -0
package/README.md
CHANGED
|
@@ -5,114 +5,42 @@
|
|
|
5
5
|
3. Build your thing bro
|
|
6
6
|
|
|
7
7
|
---
|
|
8
|
-
Dev stuff dont look
|
|
9
|
-
|
|
10
|
-
Opinionated vue UI library for building personal applications. Completely from scratch (besides some libraries later on ig xd).
|
|
11
|
-
|
|
12
|
-
#### Components
|
|
13
|
-
|
|
14
|
-
- [x] Breadcrumbs
|
|
15
|
-
- [x] File input
|
|
16
|
-
- [x] Style normal input
|
|
17
|
-
- [x] Dropzone (its own component)
|
|
18
|
-
- [x] Confirm dialog
|
|
19
|
-
- [x] 4 props (title, description, onCancel, onOk)
|
|
20
|
-
- [x] description is a slot
|
|
21
|
-
- [x] Date picker
|
|
22
|
-
- [x] Input Password
|
|
23
|
-
- [x] Wrapper around input with an eye icon which changes type to text
|
|
24
|
-
- [x] Number field (+ and -)
|
|
25
|
-
- [x] This could be implemented once Input improvements are in
|
|
26
|
-
- [x] Input improvements
|
|
27
|
-
- [x] Errors slot (border is red (maybe) and render red text before "after" slot). Prop is string[]
|
|
28
|
-
- [x] Prefix / suffix slots. Allow non-editable text/slots "within" the input component. This will require some styling changes as the input element itself cant use the border anymore
|
|
29
|
-
- [x] Progress Bar
|
|
30
|
-
- [x] Skeleton
|
|
31
|
-
- [x] Button
|
|
32
|
-
- [x] Add `accent` button variant
|
|
33
|
-
- [x] ButtonGroup
|
|
34
|
-
- [x] Merges buttons together vertically or horizontally (merged border radius etc)
|
|
35
|
-
- [x] Toast
|
|
36
|
-
- [x] Grid
|
|
37
|
-
- [x] Flex
|
|
38
|
-
- [x] Input
|
|
39
|
-
- [x] Switch (like iOS)
|
|
40
|
-
- [x] Radio button group
|
|
41
|
-
- [x] Tabs
|
|
42
|
-
- [x] Filled
|
|
43
|
-
- [x] Card
|
|
44
|
-
- [x] Textarea
|
|
45
|
-
- [x] Autoexpand
|
|
46
|
-
- [x] Modal
|
|
47
|
-
- [x] Checkbox
|
|
48
|
-
- [x] Select
|
|
49
|
-
- [x] Depends on <Dropdown />
|
|
50
|
-
- [x] Single select
|
|
51
|
-
- [x] Multiselect
|
|
52
|
-
- [x] With search
|
|
53
|
-
- [x] Clearing
|
|
54
|
-
- [x] Accordion
|
|
55
|
-
- [x] Alert
|
|
56
|
-
- [x] Divider
|
|
57
|
-
- [x] Badge
|
|
58
|
-
- [x] Avatar
|
|
59
|
-
- [x] Content - It's a class called `.article` (can also use the <article /> HTML element)
|
|
60
|
-
- [x] Copy clipboard button
|
|
61
|
-
- [x] Renderless component consuming button props + copy prop
|
|
62
|
-
- [x] Copied text ()
|
|
63
|
-
- [x] Kbd
|
|
64
|
-
- [x] Option to highlight if key is pressed
|
|
65
|
-
- [x] Sheet
|
|
66
|
-
- [x] Size
|
|
67
|
-
- [x] Location
|
|
68
|
-
- [x] Tooltip
|
|
69
|
-
- [x] Custom placement
|
|
70
|
-
- [x] Show up delay
|
|
71
|
-
- [x] Dropdown
|
|
72
|
-
- [x] Dropdown itme
|
|
73
|
-
- [x] Dropdown title
|
|
74
|
-
- [x] Table
|
|
75
|
-
- [x] Header & sorting
|
|
76
|
-
- [X] Pagination
|
|
77
|
-
- [x] Row select
|
|
78
|
-
- [x] Reactive options (ability to alter functionality without having to re-render whole table)
|
|
79
|
-
- [x] Interactivity
|
|
80
|
-
- [x] Drawer
|
|
81
|
-
- [x] Pagination
|
|
82
|
-
- [x] Popout (https://floating-ui.com/)
|
|
83
|
-
- [x] Anchoring to a Component or element
|
|
84
|
-
- [x] Input Slider
|
|
85
|
-
- [x] Just style normal input slider
|
|
86
8
|
|
|
87
9
|
## 1.0 Checklist
|
|
88
|
-
- [x] Tweak all colors
|
|
89
|
-
- [ ] Tweak all spacing
|
|
90
|
-
- [ ] Move style attribute assignments to scoped style element instead (flex, grid etc)
|
|
91
|
-
- [x] Add generic outline
|
|
92
|
-
- [ ] Accessibility test
|
|
93
|
-
- [ ] Document how to
|
|
94
|
-
- [ ] Set up fonts for the library (global and global mono)
|
|
95
|
-
- [ ] Document how to set up --color-accent
|
|
96
|
-
- [ ] If something interactive is disabled, add disabled cursor
|
|
97
|
-
- [ ] Make sure all components have their variables localized so that they can be changed on a component level
|
|
98
|
-
- [ ] Create documentation site
|
|
99
|
-
- [ ] Check how everything looks on mobile
|
|
100
|
-
- [ ] Fix everything down to 300px
|
|
101
|
-
- [ ] Make some tweaks for typography sizing
|
|
102
10
|
|
|
11
|
+
- [ ] Real life test
|
|
12
|
+
- [ ] Might be useful to build this in the hivecom project
|
|
13
|
+
- [ ] Build an example page with 100% of the components
|
|
14
|
+
- [ ] Run accessibility tools on it
|
|
15
|
+
- [ ] Run color contrast test
|
|
16
|
+
- [ ] Make sure it works on mobile down to 340px
|
|
17
|
+
- [ ] Components
|
|
18
|
+
- [ ] Scale down Typography
|
|
103
19
|
---
|
|
104
20
|
|
|
105
|
-
|
|
21
|
+
## 1.1
|
|
22
|
+
|
|
23
|
+
- [ ] Improve customization
|
|
24
|
+
- [ ] Test how easy it is to modify values
|
|
25
|
+
- [ ] Explore option to provide styling using CSS modules?
|
|
26
|
+
- [ ] Make sure all components have their variables localized so that they can be changed on a component level (ugh what a bother)
|
|
27
|
+
|
|
28
|
+
### Post 1.2 components
|
|
106
29
|
|
|
107
|
-
- [ ] Add Accordion style "card" to match styling of card (hoverable header + border under header with border around the whole thing)
|
|
108
30
|
- [ ] Carousel (slider)
|
|
109
|
-
- [x] InputOTP
|
|
110
|
-
- [x] Wrapper
|
|
111
|
-
- [x] Slot
|
|
112
|
-
- [x] Fix not working with components inbetween??
|
|
113
|
-
- [x] Paste
|
|
114
31
|
- [ ] CodeBlock
|
|
115
32
|
- [ ] Code highlighting
|
|
116
33
|
- [ ] Copy code
|
|
117
34
|
- [ ] Type, padding, etc
|
|
118
35
|
- [ ] Command dropdown
|
|
36
|
+
- [ ] Documentation
|
|
37
|
+
- [ ] Design my own documentation site (GENERIC?!)
|
|
38
|
+
- [ ] Pages
|
|
39
|
+
- [ ] CSS variable setup, accent, fonts
|
|
40
|
+
- [ ] CSS helpers
|
|
41
|
+
- [ ] Components
|
|
42
|
+
- [ ] Typography page
|
|
43
|
+
|
|
44
|
+
### Whenever
|
|
45
|
+
|
|
46
|
+
- [ ] Bump target from ES2022 whenever vite-plugin-dts is fixed
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Sizes } from '../../shared/types';
|
|
2
2
|
interface Props {
|
|
3
|
-
size?: Sizes;
|
|
3
|
+
size?: Sizes | number;
|
|
4
4
|
url?: string;
|
|
5
5
|
fallback?: string;
|
|
6
6
|
icon?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
8
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
9
|
+
avatar: HTMLDivElement;
|
|
10
|
+
}, any>;
|
|
9
11
|
export default _default;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Placement } from '../../shared/types';
|
|
2
|
+
export interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Tooltip placement related to the anchor
|
|
5
|
+
*/
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
/**
|
|
8
|
+
* Set the minimum width of the dropdown element
|
|
9
|
+
*/
|
|
10
|
+
minWidth?: number | string;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the width of the dropdown to the width of its anchor
|
|
13
|
+
*/
|
|
14
|
+
expand?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function open(): void;
|
|
17
|
+
declare function close(): void;
|
|
18
|
+
declare function toggle(): void;
|
|
19
|
+
declare function __VLS_template(): {
|
|
20
|
+
slots: {
|
|
21
|
+
trigger?(_: {
|
|
22
|
+
open: typeof open;
|
|
23
|
+
isOpen: boolean;
|
|
24
|
+
close: typeof close;
|
|
25
|
+
toggle: typeof toggle;
|
|
26
|
+
}): any;
|
|
27
|
+
default?(_: {
|
|
28
|
+
open: typeof open;
|
|
29
|
+
close: typeof close;
|
|
30
|
+
toggle: typeof toggle;
|
|
31
|
+
isOpen: true;
|
|
32
|
+
}): any;
|
|
33
|
+
};
|
|
34
|
+
refs: {
|
|
35
|
+
anchor: HTMLDivElement;
|
|
36
|
+
dropdown: ({
|
|
37
|
+
$: import('vue').ComponentInternalInstance;
|
|
38
|
+
$data: {};
|
|
39
|
+
$props: {
|
|
40
|
+
readonly anchor: import('../../shared/types').PopoutMaybeElement<HTMLElement>;
|
|
41
|
+
readonly placement?: Placement | undefined;
|
|
42
|
+
readonly offset?: number | undefined;
|
|
43
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
44
|
+
$attrs: {
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
};
|
|
47
|
+
$refs: {
|
|
48
|
+
[x: string]: unknown;
|
|
49
|
+
} & {
|
|
50
|
+
popout: HTMLDivElement;
|
|
51
|
+
};
|
|
52
|
+
$slots: Readonly<{
|
|
53
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
56
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
57
|
+
$host: Element | null;
|
|
58
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
59
|
+
$el: any;
|
|
60
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('../Popout/Popout.vue').Props> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
61
|
+
offset: number;
|
|
62
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
63
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
64
|
+
created?: (() => void) | (() => void)[];
|
|
65
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
66
|
+
mounted?: (() => void) | (() => void)[];
|
|
67
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
68
|
+
updated?: (() => void) | (() => void)[];
|
|
69
|
+
activated?: (() => void) | (() => void)[];
|
|
70
|
+
deactivated?: (() => void) | (() => void)[];
|
|
71
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
72
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
73
|
+
destroyed?: (() => void) | (() => void)[];
|
|
74
|
+
unmounted?: (() => void) | (() => void)[];
|
|
75
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
76
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
77
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
78
|
+
};
|
|
79
|
+
$forceUpdate: () => void;
|
|
80
|
+
$nextTick: typeof import('vue').nextTick;
|
|
81
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
82
|
+
} & Readonly<{
|
|
83
|
+
offset: number;
|
|
84
|
+
}> & Omit<Readonly<import('../Popout/Popout.vue').Props> & Readonly<{}>, "offset"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
85
|
+
$slots: {
|
|
86
|
+
default?(_: {}): any;
|
|
87
|
+
};
|
|
88
|
+
}) | null;
|
|
89
|
+
};
|
|
90
|
+
attrs: Partial<{}>;
|
|
91
|
+
};
|
|
92
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
93
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
94
|
+
open: typeof open;
|
|
95
|
+
close: typeof close;
|
|
96
|
+
toggle: typeof toggle;
|
|
97
|
+
isOpen: import('vue').Ref<boolean, boolean>;
|
|
98
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
99
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
100
|
+
export default _default;
|
|
101
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
102
|
+
new (): {
|
|
103
|
+
$slots: S;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
@@ -26,6 +26,7 @@ declare function __VLS_template(): {
|
|
|
26
26
|
readonly multiple?: boolean | undefined;
|
|
27
27
|
readonly min?: number | undefined;
|
|
28
28
|
readonly max?: number | undefined;
|
|
29
|
+
readonly disabled?: boolean | undefined;
|
|
29
30
|
readonly "onUpdate:modelValue"?: ((modelValue: string | number) => any) | undefined;
|
|
30
31
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
31
32
|
$attrs: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface Props {
|
|
3
|
-
anchor:
|
|
1
|
+
import { Placement, PopoutMaybeElement } from '../../shared/types';
|
|
2
|
+
export interface Props {
|
|
3
|
+
anchor: PopoutMaybeElement<HTMLElement>;
|
|
4
4
|
/**
|
|
5
5
|
* Override the autoPlacement option
|
|
6
6
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { VNode } from 'vue';
|
|
2
1
|
import { FlexProps } from '../Flex/Flex.vue';
|
|
3
|
-
import {
|
|
2
|
+
import { default as Radio } from './Radio.vue';
|
|
4
3
|
interface Props extends FlexProps {
|
|
5
4
|
disabled?: boolean;
|
|
6
5
|
}
|
|
@@ -10,17 +9,9 @@ type __VLS_PublicProps = {
|
|
|
10
9
|
} & typeof __VLS_typeProps;
|
|
11
10
|
declare function __VLS_template(): {
|
|
12
11
|
slots: Readonly<{
|
|
13
|
-
default: () =>
|
|
14
|
-
children: Array<VNode & {
|
|
15
|
-
props: RadioProps;
|
|
16
|
-
}>;
|
|
17
|
-
}[];
|
|
12
|
+
default: () => Array<typeof Radio>;
|
|
18
13
|
}> & {
|
|
19
|
-
default: () =>
|
|
20
|
-
children: Array<VNode & {
|
|
21
|
-
props: RadioProps;
|
|
22
|
-
}>;
|
|
23
|
-
}[];
|
|
14
|
+
default: () => Array<typeof Radio>;
|
|
24
15
|
};
|
|
25
16
|
refs: {};
|
|
26
17
|
attrs: Partial<{}>;
|
package/dist/shared/helpers.d.ts
CHANGED
|
@@ -15,3 +15,9 @@ export declare function stringRgbToValues(rgbString: string): [number, number, n
|
|
|
15
15
|
export declare function randomMinMax(min: number, max: number): number;
|
|
16
16
|
export declare function delay(amount: number): Promise<any>;
|
|
17
17
|
export declare function setCharAt(str: string, char: string | number, index: number): string;
|
|
18
|
+
/**
|
|
19
|
+
* Takes in a value and if it is a number, appends "px" to it, otherwise returns
|
|
20
|
+
* the original value.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatUnitValue(value: string | number, unit?: string): string;
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentPublicInstance } from 'vue';
|
|
1
2
|
export declare enum Size {
|
|
2
3
|
s = "s",
|
|
3
4
|
m = "m",
|
|
@@ -8,3 +9,5 @@ export type DeepRequired<T> = {
|
|
|
8
9
|
[K in keyof T]: DeepRequired<T[K]>;
|
|
9
10
|
} & Required<T>;
|
|
10
11
|
export type VueClass = string | Record<string, boolean> | Array<string | Record<string, string | boolean>>;
|
|
12
|
+
export type PopoutMaybeElement<T> = T | ComponentPublicInstance | null | undefined;
|
|
13
|
+
export type Placement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|