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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bonkers-ui",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "storybook": "start-storybook -p 6006",
@@ -1,4 +1,6 @@
1
1
  {
2
2
  "md": "var(--shadow-size-md)",
3
- "border-primary": "var(--shadow-border-primary)"
3
+ "border-primary": "var(--shadow-border-primary)",
4
+ "border-selected": "var(--shadow-border-selected)",
5
+ "selected-shadow": "var(--shadow-selected-shadow)"
4
6
  }
@@ -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
  }
@@ -24,7 +24,7 @@
24
24
  <slot name="sidebar" />
25
25
  </div>
26
26
 
27
- <main class="p-sm bg-white w-full">
27
+ <main class="p-sm bg-white w-full overflow-hidden">
28
28
  <ui-typography
29
29
  v-if="header"
30
30
  class="mb-xs"
@@ -1 +1,2 @@
1
1
  export { default } from "./ui-icon-wrapper.vue";
2
+ export { EIconWrapperTypes } from "./_typings";
@@ -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
- args: {},
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-for="item in 3" :key="item" :value="String(item)" v-model="modelValue" name="radio" title="title" :icon-name="[EIconType.FAR, 'face-smile']">
26
- {{args.slot}}
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-item block p-sm border rounded-2xl hover:border-primary cursor-pointer bg-white"
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="appearance-none absolute"
11
+ class="peer group fixed w-0"
12
+ :class="disabled && 'pointer-events-none opacity-50'"
14
13
  >
15
-
16
- <ui-icon
17
- :icon-name="iconName"
18
- :size="ESize.MD"
19
- class="mb-md"
20
- :class="isActive && 'text-primary'"
21
- />
22
- <ui-typography
23
- :size="ETypographySizes.SM"
24
- :kind="EColors.SECONDARY"
25
- :weight="ETextWeight.SEMI_BOLD"
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
- {{ title }}
28
- </ui-typography>
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
- title: string;
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>