bonkers-ui 1.0.15 → 1.0.17
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 +3 -0
- package/package.json +2 -2
- package/src/components/ui-input/_typings.ts +9 -1
- package/src/components/ui-input/index.ts +2 -1
- package/src/components/ui-input/ui-input.stories.ts +8 -2
- package/src/components/ui-input/ui-input.vue +11 -8
- package/src/components/ui-input-range/ui-input-range.vue +2 -2
- package/src/components/ui-select/ui-select.stories.ts +1 -2
- package/src/components/ui-select/ui-select.vue +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,9 @@ This template should help get you started developing with Vue 3 and TypeScript i
|
|
|
6
6
|
- [webstorm](https://www.jetbrains.com/webstorm/)
|
|
7
7
|
- [VS Code](https://code.visualstudio.com/)
|
|
8
8
|
- [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
|
|
9
|
+
- [Volar-ts](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)
|
|
9
10
|
- [editorconfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)
|
|
11
|
+
- [tilewind](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)
|
|
10
12
|
|
|
11
13
|
## Setup project
|
|
12
14
|
- `yarn i` to install all dependencies
|
|
@@ -32,3 +34,4 @@ This template should help get you started developing with Vue 3 and TypeScript i
|
|
|
32
34
|
|
|
33
35
|
## Flow to deploy github
|
|
34
36
|
- To deploy github-pages use `yarn build-storybook` + `yarn deploy`
|
|
37
|
+
v.1.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bonkers-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"storybook": "start-storybook -p 6006",
|
|
6
6
|
"build-storybook": "build-storybook",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@vue/test-utils": "^2.0.0",
|
|
36
36
|
"@vue/vue3-jest": "^27.0.0",
|
|
37
37
|
"babel-jest": "27",
|
|
38
|
-
"eslint": "
|
|
38
|
+
"eslint": "8.22.0",
|
|
39
39
|
"eslint-plugin-vue": "^9.4.0",
|
|
40
40
|
"gh-pages": "^4.0.0",
|
|
41
41
|
"husky": "^8.0.1",
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from "./ui-input.vue";
|
|
2
|
+
export { EInputType, EInputKinds } from "./_typings";
|
|
@@ -2,7 +2,7 @@ import type { Story } from "@storybook/vue3";
|
|
|
2
2
|
import UiInput from "./ui-input.vue";
|
|
3
3
|
import Icon from "../../_samples/icon.vue";
|
|
4
4
|
import { ref } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { EInputKinds, EInputType } from "./_typings";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: "Components/ui-input",
|
|
@@ -15,9 +15,14 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
kind: {
|
|
17
17
|
control: { type: "select" },
|
|
18
|
-
options: Object.values(
|
|
18
|
+
options: Object.values(EInputKinds),
|
|
19
19
|
description: "The input kinds",
|
|
20
20
|
},
|
|
21
|
+
type: {
|
|
22
|
+
control: { type: "select" },
|
|
23
|
+
options: Object.values(EInputType),
|
|
24
|
+
description: "The input type",
|
|
25
|
+
},
|
|
21
26
|
disabled: {
|
|
22
27
|
control: { type: "boolean" },
|
|
23
28
|
description: "The Element disabled state",
|
|
@@ -27,6 +32,7 @@ export default {
|
|
|
27
32
|
placeholder: "Placeholder",
|
|
28
33
|
kind: undefined,
|
|
29
34
|
disabled: false,
|
|
35
|
+
type: EInputType.TEXT
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
EInputKinds<template>
|
|
2
2
|
<div class="ui-input">
|
|
3
3
|
<ui-typography
|
|
4
4
|
v-if="heading"
|
|
@@ -11,22 +11,23 @@
|
|
|
11
11
|
class="ui-input__wrapper flex w-full rounded-lg border bg-white items-center p-sm gap-xs"
|
|
12
12
|
:class="[
|
|
13
13
|
!kind && 'border-secondary-alt-500 hover:border-secondary-alt-700',
|
|
14
|
-
kind ===
|
|
15
|
-
kind ===
|
|
14
|
+
kind === EInputKinds.PRIMARY && 'border-primary',
|
|
15
|
+
kind === EInputKinds.ERROR && 'border-error',
|
|
16
16
|
|
|
17
17
|
disabled && 'border-secondary-alt-300 bg-secondary-alt-200',
|
|
18
18
|
]"
|
|
19
19
|
>
|
|
20
20
|
<slot name="prefix-icon" />
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
<input
|
|
23
23
|
class="bg-transparent border-0 outline-none w-full"
|
|
24
|
-
type="text"
|
|
24
|
+
:type="type || 'text'"
|
|
25
25
|
:placeholder="placeholder"
|
|
26
26
|
:value="modelValue"
|
|
27
|
+
:pattern="pattern"
|
|
27
28
|
@input="$emit('update:modelValue', ($event.target as HTMLTextAreaElement)?.value)"
|
|
28
29
|
>
|
|
29
|
-
|
|
30
|
+
|
|
30
31
|
<slot name="postfix-icon" />
|
|
31
32
|
</div>
|
|
32
33
|
<ui-typography
|
|
@@ -40,16 +41,18 @@
|
|
|
40
41
|
</template>
|
|
41
42
|
|
|
42
43
|
<script lang="ts" setup>
|
|
43
|
-
import {
|
|
44
|
+
import { EInputKinds, EInputType } from "./_typings";
|
|
44
45
|
import UiTypography, { ETypographySizes, ETextWeight } from "../ui-typography";
|
|
45
46
|
|
|
46
47
|
defineProps<{
|
|
47
48
|
placeholder?: string;
|
|
48
49
|
modelValue: string;
|
|
49
50
|
disabled?: boolean;
|
|
50
|
-
kind?:
|
|
51
|
+
kind?: EInputKinds;
|
|
51
52
|
heading?: string;
|
|
52
53
|
subLabel?: string;
|
|
54
|
+
type?: EInputType;
|
|
55
|
+
pattern?: string;
|
|
53
56
|
}>();
|
|
54
57
|
|
|
55
58
|
defineEmits(["update:modelValue"]);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="ui-input-range relative h-
|
|
3
|
+
class="ui-input-range relative h-lg mx-xs py-xs box-content"
|
|
4
4
|
>
|
|
5
5
|
<input
|
|
6
6
|
ref="track"
|
|
7
7
|
v-model="rangeModel"
|
|
8
|
-
class="appearance-none absolute cursor-pointer bg-transparent w-full h-full"
|
|
8
|
+
class="appearance-none absolute top-0 left-0 cursor-pointer bg-transparent w-full h-full"
|
|
9
9
|
type="range"
|
|
10
10
|
:min="min"
|
|
11
11
|
:max="max"
|
|
@@ -26,9 +26,8 @@ const Template: Story<TComponentProps> = (args) => ({
|
|
|
26
26
|
const valueModel = ref(list[0]);
|
|
27
27
|
return { args, valueModel, list };
|
|
28
28
|
},
|
|
29
|
-
template:
|
|
29
|
+
template: /*html*/`
|
|
30
30
|
<ui-select v-bind="args" :list="list" v-model:value="valueModel" heading="heading" subLabel="subLabel">
|
|
31
|
-
{{ args.slot }}
|
|
32
31
|
<template #postfix-icon>
|
|
33
32
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
34
33
|
<path d="M13.25 6.8125L8.5 11.2812C8.34375 11.4375 8.15625 11.5 8 11.5C7.8125 11.5 7.625 11.4375 7.46875 11.3125L2.71875 6.8125C2.40625 6.53125 2.40625 6.0625 2.6875 5.75C2.96875 5.4375 3.4375 5.4375 3.75 5.71875L8 9.71875L12.2188 5.71875C12.5312 5.4375 13 5.4375 13.2812 5.75C13.5625 6.0625 13.5625 6.53125 13.25 6.8125Z" fill="currentColor"/>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
>
|
|
14
14
|
<select
|
|
15
15
|
v-model="localModel"
|
|
16
|
-
class="appearance-none
|
|
16
|
+
class="appearance-none bg-transparent border-0 m-0 outline-0 w-full p-sm cursor-pointer italic text-secondary-alt"
|
|
17
17
|
@change=" $emit('update:value', ($event.target as HTMLTextAreaElement)?.value)"
|
|
18
18
|
>
|
|
19
19
|
<option
|