bonkers-ui 1.0.56 → 1.0.57
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/.eslintrc.js
CHANGED
package/package.json
CHANGED
|
@@ -1,65 +1,81 @@
|
|
|
1
1
|
import { ERadioSizes } from "./_typings";
|
|
2
|
-
import { ref } from "vue";
|
|
3
2
|
import UiRadioFancy from "../ui-radio-fancy";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import { ICON_DEFAULT } from "./../../CONSTANTS";
|
|
4
|
+
import UiTypography, { ETypographySizes } from "../ui-typography";
|
|
5
|
+
import type { Meta } from "@storybook/vue3";
|
|
6
|
+
import { ref } from "vue";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
const meta: Meta<typeof UiRadioFancy> = {
|
|
8
9
|
title: "Components/ui-radio-fancy",
|
|
9
10
|
component: UiRadioFancy,
|
|
10
11
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
11
12
|
argTypes: {
|
|
12
|
-
invertOrder: {
|
|
13
|
-
control: {
|
|
14
|
-
type: "boolean"
|
|
15
|
-
},
|
|
16
|
-
description: "The Element order",
|
|
17
|
-
},
|
|
18
13
|
disabled: {
|
|
19
14
|
control: {
|
|
20
|
-
type: "boolean"
|
|
15
|
+
type: "boolean"
|
|
21
16
|
},
|
|
22
17
|
description: "The full width size",
|
|
23
18
|
},
|
|
24
19
|
radioSize: {
|
|
25
20
|
control: {
|
|
26
|
-
type: "select"
|
|
21
|
+
type: "select"
|
|
27
22
|
},
|
|
28
23
|
options: Object.values(ERadioSizes),
|
|
29
24
|
description: "The radio kinds",
|
|
30
25
|
},
|
|
31
26
|
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
export const Default = {
|
|
32
32
|
args: {
|
|
33
|
-
|
|
33
|
+
iconName: ICON_DEFAULT,
|
|
34
|
+
default: "Description",
|
|
34
35
|
invertOrder: false,
|
|
35
36
|
disabled: false,
|
|
36
37
|
radioSize: ERadioSizes.DEFAULT
|
|
37
38
|
},
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
UiRadioFancy
|
|
41
|
+
export const Compact = {
|
|
42
|
+
args: {
|
|
43
|
+
default: "1",
|
|
44
|
+
radioSize: ERadioSizes.COMPACT
|
|
45
45
|
},
|
|
46
|
-
setup() {
|
|
47
|
-
const modelValue = ref("1");
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
render: (args) => ({
|
|
48
|
+
components: {
|
|
49
|
+
UiRadioFancy,
|
|
50
|
+
UiTypography
|
|
51
|
+
},
|
|
52
|
+
setup() {
|
|
53
|
+
const modelValue = ref("1");
|
|
54
|
+
return {
|
|
55
|
+
args,
|
|
56
|
+
ETypographySizes,
|
|
57
|
+
modelValue
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
template: /*html*/`
|
|
61
|
+
<div class="flex gap-sm" :style="{}">
|
|
62
|
+
<ui-radio-fancy v-for="item in 2"
|
|
63
|
+
:key="item"
|
|
64
|
+
:value="String(item)"
|
|
65
|
+
v-model="modelValue"
|
|
66
|
+
name="radio" title="title"
|
|
67
|
+
:radioSize="args.radioSize"
|
|
68
|
+
:disabled="args.disabled"
|
|
69
|
+
>
|
|
70
|
+
<ui-typography :size="ETypographySizes.MD">
|
|
71
|
+
{{item}}
|
|
72
|
+
</ui-typography>
|
|
60
73
|
</ui-radio-fancy>
|
|
61
74
|
</div>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
`,
|
|
76
|
+
args: {
|
|
77
|
+
default: "1",
|
|
78
|
+
radioSize: ERadioSizes.COMPACT
|
|
79
|
+
},
|
|
80
|
+
}),
|
|
81
|
+
};
|
|
@@ -57,12 +57,13 @@
|
|
|
57
57
|
:class="[
|
|
58
58
|
disabled
|
|
59
59
|
&& 'pointer-events-none border-secondary-alt-400 peer-checked:shadow-border-primary-disabled',
|
|
60
|
-
radioSize === ERadioSizes.
|
|
61
|
-
radioSize === ERadioSizes.
|
|
60
|
+
radioSize === ERadioSizes.MINIMAL && 'flex gap-sm align-middle',
|
|
61
|
+
radioSize === ERadioSizes.COMPACT && 'grid cursor-pointer grid-flow-col px-md'
|
|
62
|
+
|
|
62
63
|
]"
|
|
63
64
|
>
|
|
64
65
|
<div
|
|
65
|
-
v-if="radioSize === ERadioSizes.DEFAULT"
|
|
66
|
+
v-if="radioSize === ERadioSizes.DEFAULT && iconName"
|
|
66
67
|
>
|
|
67
68
|
<ui-icon
|
|
68
69
|
:icon-name="iconName"
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
]"
|
|
75
76
|
/>
|
|
76
77
|
</div>
|
|
77
|
-
<div v-else-if="radioSize === ERadioSizes.MINIMAL">
|
|
78
|
+
<div v-else-if="radioSize === ERadioSizes.MINIMAL && iconName">
|
|
78
79
|
<ui-icon
|
|
79
80
|
:icon-name="iconName"
|
|
80
81
|
:size="ESize.MD"
|
|
@@ -85,6 +86,9 @@
|
|
|
85
86
|
/>
|
|
86
87
|
|
|
87
88
|
</div>
|
|
89
|
+
<div
|
|
90
|
+
v-else-if="radioSize === ERadioSizes.COMPACT"
|
|
91
|
+
/>
|
|
88
92
|
<ui-typography
|
|
89
93
|
:size="ETypographySizes.SM"
|
|
90
94
|
:kind="EColors.SECONDARY"
|
|
@@ -109,11 +113,12 @@
|
|
|
109
113
|
modelValue: string | number | boolean;
|
|
110
114
|
name: string;
|
|
111
115
|
value: string | number | boolean;
|
|
112
|
-
iconName
|
|
116
|
+
iconName?: TIconName;
|
|
113
117
|
disabled?: boolean;
|
|
114
118
|
radioSize?: ERadioSizes;
|
|
115
119
|
}>(), {
|
|
116
|
-
radioSize: ERadioSizes.DEFAULT
|
|
120
|
+
radioSize: ERadioSizes.DEFAULT,
|
|
121
|
+
iconName: undefined
|
|
117
122
|
});
|
|
118
123
|
const emit = defineEmits(["update:modelValue"]);
|
|
119
124
|
const radioModel = computed({
|