bonkers-ui 1.0.22 → 1.0.24
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/package.json +1 -1
- package/src/_styles/classTypes/_shadow.json +3 -1
- package/src/_styles/variables/shadow.css +2 -0
- package/src/components/ui-card-result/ui-card-result.vue +1 -1
- package/src/components/ui-icon-wrapper/index.ts +1 -0
- package/src/components/ui-radio-fancy/ui-radio-fancy.stories.ts +25 -6
- package/src/components/ui-radio-fancy/ui-radio-fancy.vue +44 -24
package/package.json
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
/* shadow sizes */
|
|
4
4
|
--shadow-size-md: 0 2px 4px 0 rgb(180 184 205 / 50%);
|
|
5
5
|
--shadow-border-primary: 0 0 0 4px rgb(69 158 74 / 50%);
|
|
6
|
+
--shadow-border-selected: 0 0 0 4px rgb(69 158 74 / 100%);
|
|
7
|
+
--shadow-selected-shadow: 0 0 0 4px var(--color-primary-500);
|
|
6
8
|
--shadow-border-secondary: 0 0 0 4px rgb(223 225 233 / 50%);
|
|
7
9
|
}
|
|
8
10
|
}
|
|
@@ -7,23 +7,42 @@ export default {
|
|
|
7
7
|
title: "Components/ui-radio-fancy",
|
|
8
8
|
component: UiRadioFancy,
|
|
9
9
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
10
|
-
argTypes: {
|
|
11
|
-
|
|
10
|
+
argTypes: {
|
|
11
|
+
invertOrder: {
|
|
12
|
+
control: { type: "boolean" },
|
|
13
|
+
description: "The Element order",
|
|
14
|
+
},
|
|
15
|
+
disabled: {
|
|
16
|
+
control: { type: "boolean" },
|
|
17
|
+
description: "The full width size",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
slot: "Description",
|
|
22
|
+
invertOrder: false,
|
|
23
|
+
disabled: false
|
|
24
|
+
},
|
|
12
25
|
};
|
|
13
26
|
|
|
14
27
|
type TComponentProps = InstanceType<typeof UiRadioFancy>["$props"];
|
|
15
28
|
|
|
16
|
-
const Template: Story<TComponentProps> = () => ({
|
|
29
|
+
const Template: Story<TComponentProps> = (args) => ({
|
|
17
30
|
components: { UiRadioFancy },
|
|
18
31
|
setup() {
|
|
19
32
|
const modelValue = ref("1");
|
|
20
33
|
|
|
21
|
-
return { modelValue, EIconType };
|
|
34
|
+
return { modelValue, EIconType, args };
|
|
22
35
|
},
|
|
23
36
|
template: /*html*/`
|
|
24
37
|
<div class="grid gap-sm" :style="{'grid-template-columns': 'repeat(auto-fit, minmax(160px, 1fr))'}">
|
|
25
|
-
<ui-radio-fancy v-
|
|
26
|
-
|
|
38
|
+
<ui-radio-fancy v-bind="args" :key="key" value="1" v-model="modelValue" name="radio" :icon-name="[EIconType.FAR, 'face-smile']">
|
|
39
|
+
Banana
|
|
40
|
+
</ui-radio-fancy>
|
|
41
|
+
<ui-radio-fancy v-bind="args" :key="key" value="2" v-model="modelValue" name="radio" :icon-name="[EIconType.FAR, 'face-smile']">
|
|
42
|
+
Apple
|
|
43
|
+
</ui-radio-fancy>
|
|
44
|
+
<ui-radio-fancy v-bind="args" :key="key" value="3" v-model="modelValue" name="radio" :icon-name="[EIconType.FAR, 'face-smile']">
|
|
45
|
+
Orange
|
|
27
46
|
</ui-radio-fancy>
|
|
28
47
|
</div>
|
|
29
48
|
`,
|
|
@@ -1,31 +1,55 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<label
|
|
3
|
-
class="ui-radio-
|
|
4
|
-
:class="
|
|
5
|
-
isActive ? 'border-primary pointer-events-none':'border-secondary-alt',
|
|
6
|
-
]"
|
|
3
|
+
class="ui-radio-fancy"
|
|
4
|
+
:class="disabled && 'pointer-events-none opacity-50'"
|
|
7
5
|
>
|
|
8
6
|
<input
|
|
9
7
|
v-model="radioModel"
|
|
10
8
|
type="radio"
|
|
11
9
|
:name="name"
|
|
12
10
|
:value="value"
|
|
13
|
-
class="
|
|
11
|
+
class="peer group fixed w-0"
|
|
12
|
+
:class="disabled && 'pointer-events-none opacity-50'"
|
|
14
13
|
>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
<div
|
|
15
|
+
class="
|
|
16
|
+
ui-radio-fancy__content
|
|
17
|
+
box-border
|
|
18
|
+
w-full
|
|
19
|
+
py-sm px-sm
|
|
20
|
+
border
|
|
21
|
+
border-secondary-alt-500
|
|
22
|
+
hover:border-secondary-alt-700
|
|
23
|
+
cursor-pointer
|
|
24
|
+
rounded-xl
|
|
25
|
+
active:border-sm
|
|
26
|
+
active:bg-secondary-alt-200
|
|
27
|
+
peer-checked:active:outline-4
|
|
28
|
+
peer-checked:active:outline
|
|
29
|
+
peer-checked:active:outline-offset-4
|
|
30
|
+
peer-checked:border-transparent
|
|
31
|
+
active:outline
|
|
32
|
+
active:outline-4
|
|
33
|
+
active:outline-primary
|
|
34
|
+
active:border-secondary-alt
|
|
35
|
+
peer-checked:hover:shadow-border-selected
|
|
36
|
+
peer-checked:shadow-selected-shadow"
|
|
37
|
+
:class="disabled && 'pointer-events-none opacity-50'"
|
|
26
38
|
>
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
<ui-icon
|
|
40
|
+
:icon-name="iconName"
|
|
41
|
+
:size="ESize.MD"
|
|
42
|
+
class="mb-md group-checked:text-primary-500"
|
|
43
|
+
:class="value === modelValue && 'text-primary'"
|
|
44
|
+
/>
|
|
45
|
+
<ui-typography
|
|
46
|
+
:size="ETypographySizes.SM"
|
|
47
|
+
:kind="EColors.SECONDARY"
|
|
48
|
+
:weight="ETextWeight.SEMI_BOLD"
|
|
49
|
+
>
|
|
50
|
+
<slot />
|
|
51
|
+
</ui-typography>
|
|
52
|
+
</div>
|
|
29
53
|
</label>
|
|
30
54
|
</template>
|
|
31
55
|
|
|
@@ -35,17 +59,15 @@
|
|
|
35
59
|
import UiIcon, { type TIconName } from "../ui-icon";
|
|
36
60
|
import { ESize } from "../../_types/sizing";
|
|
37
61
|
import { EColors } from "../../_types/colors";
|
|
38
|
-
|
|
39
62
|
const props = defineProps<{
|
|
40
63
|
modelValue: string;
|
|
41
64
|
name: string;
|
|
42
65
|
value: string | number;
|
|
43
|
-
|
|
66
|
+
id: string;
|
|
44
67
|
iconName: TIconName;
|
|
68
|
+
disabled?: boolean;
|
|
45
69
|
}>();
|
|
46
|
-
|
|
47
70
|
const emit = defineEmits(["update:modelValue"]);
|
|
48
|
-
|
|
49
71
|
const radioModel = computed({
|
|
50
72
|
get() {
|
|
51
73
|
return props.modelValue;
|
|
@@ -54,6 +76,4 @@
|
|
|
54
76
|
emit("update:modelValue", value);
|
|
55
77
|
}
|
|
56
78
|
});
|
|
57
|
-
|
|
58
|
-
const isActive = computed(()=>props.modelValue === props.value);
|
|
59
79
|
</script>
|