bonkers-ui 1.0.21 → 1.0.23

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.21",
3
+ "version": "1.0.23",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "storybook": "start-storybook -p 6006",
@@ -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";
@@ -20,14 +20,13 @@
20
20
  <slot name="prefix-icon" />
21
21
 
22
22
  <input
23
- class="bg-transparent border-0 outline-none w-full"
23
+ v-model="inputModel"
24
+ class="bg-transparent border-0 outline-none w-full placeholder:text-secondary-alt placeholder:italic"
24
25
  :type="type || 'text'"
25
26
  :placeholder="placeholder"
26
- :value="modelValue"
27
27
  :pattern="pattern"
28
28
  :maxlength="maxlength"
29
29
  :minlength="minlength"
30
- @input="$emit('update:modelValue', ($event.target as HTMLTextAreaElement)?.value)"
31
30
  >
32
31
 
33
32
  <slot name="postfix-icon" />
@@ -43,10 +42,11 @@
43
42
  </template>
44
43
 
45
44
  <script lang="ts" setup>
45
+ import { computed } from "vue";
46
46
  import { EInputKinds, EInputType } from "./_typings";
47
47
  import UiTypography, { ETypographySizes, ETextWeight } from "../ui-typography";
48
48
 
49
- defineProps<{
49
+ const props = defineProps<{
50
50
  placeholder?: string;
51
51
  modelValue: string;
52
52
  disabled?: boolean;
@@ -59,12 +59,15 @@
59
59
  minlength?: string;
60
60
  }>();
61
61
 
62
- defineEmits(["update:modelValue"]);
63
- </script>
62
+ const emit = defineEmits(["update:modelValue"]);
63
+
64
+ const inputModel = computed({
65
+ get() {
66
+ return props.modelValue;
67
+ },
68
+ set(value) {
69
+ emit("update:modelValue", value);
70
+ }
71
+ });
64
72
 
65
- <style scoped>
66
- .ui-input__wrapper input::placeholder {
67
- color: var(--color-secondary-alt-500);
68
- font-style: italic;
69
- }
70
- </style>
73
+ </script>
@@ -1,4 +1,8 @@
1
1
  export enum EListItemTypes {
2
+ DEFAULT = "DEFAULT",
3
+ PROGRESS = "PROGRESS"
4
+ }
5
+ export enum EListItemSizes {
2
6
  DEFAULT = "DEFAULT",
3
- PROGRESS = "PROGRESS"
7
+ COMPACT = "COMPACT"
4
8
  }
@@ -1,2 +1,3 @@
1
1
  export { default } from "./ui-list-item.vue";
2
2
  export { EListItemTypes } from "./_types";
3
+ export { EListItemSizes } from "./_types";
@@ -1,6 +1,6 @@
1
1
  import UiListItem from "./ui-list-item.vue";
2
2
  import type { Story } from "@storybook/vue3";
3
- import { EListItemTypes } from "./_types";
3
+ import { EListItemSizes, EListItemTypes } from "./_types";
4
4
 
5
5
  export default {
6
6
  title: "Components/ui-list-item",
@@ -9,12 +9,27 @@ export default {
9
9
  kind: {
10
10
  control: { type: "select" },
11
11
  options: Object.values(EListItemTypes),
12
- description: "The Element title",
13
- }
12
+ description: "The Element kind",
13
+ },
14
+ size: {
15
+ control: { type: "select" },
16
+ options: Object.values(EListItemSizes),
17
+ description: "The Element size"
18
+ },
19
+ title: {
20
+ control: { type: "text" },
21
+ description: "The Element title"
22
+ },
23
+ slot: {
24
+ control: { type: "text" },
25
+ description: "The slot text or component",
26
+ },
14
27
  },
15
28
  args: {
16
29
  title: "default text",
17
- kind: EListItemTypes.DEFAULT
30
+ kind: EListItemTypes.DEFAULT,
31
+ size: EListItemSizes.COMPACT,
32
+ slot: "default slot"
18
33
  },
19
34
  };
20
35
 
@@ -27,9 +42,18 @@ const Template: Story<TComponentProps> = (args) => ({
27
42
  },
28
43
  template:/*html*/`
29
44
  <ul>
30
- <ui-list-item v-for= "item in 5" :key="item" :icon="['far', 'face-smile']" :title="args.title" :kind="args.kind" class="pb-md">
45
+ <ui-list-item :icon="['far', 'face-smile']" title="title only" :kind="args.kind" :size="args.size">
46
+ {{args.slot}}
47
+ </ui-list-item>
48
+
49
+ <ui-list-item :icon="['far', 'face-smile']" :kind="args.kind" :size="args.size">
50
+ text only
51
+ </ui-list-item>
52
+
53
+ <ui-list-item v-for= "item in 5" :key="item" :icon="['far', 'face-smile']" :title="args.title" :kind="args.kind" :size="args.size">
31
54
  {{ args.title }}
32
55
  </ui-list-item>
56
+ <ui-list-item class="compact-list-item" :icon="['far', 'face-smile']" :size="args.size" :title="args.title">
33
57
  </ul>
34
58
  `,
35
59
  });
@@ -1,10 +1,17 @@
1
1
 
2
2
  <template>
3
- <li class="ui-list-item flex gap-xs relative group">
3
+ <li
4
+ class="ui-list-item flex gap-xs relative group"
5
+ :class="[
6
+ size === EListItemSizes.DEFAULT && 'pb-md',
7
+ size === EListItemSizes.COMPACT && 'pb-xs'
8
+ ]"
9
+ >
4
10
  <div
5
11
  v-if="kind===EListItemTypes.PROGRESS"
6
12
  class="ui-list-item__line bg-primary-300 h-full absolute w-xxs left-xs -translate-x-2/4 top-sm group-last:hidden"
7
13
  />
14
+
8
15
  <ui-icon
9
16
  v-if="icon"
10
17
  :kind="pickKind"
@@ -12,14 +19,15 @@
12
19
  :icon-name="icon"
13
20
  :size="ESize.SM"
14
21
  />
15
-
16
- <slot>
22
+ <div>
17
23
  <ui-typography
24
+ v-if="title"
18
25
  :weight="ETextWeight.SEMI_BOLD"
19
26
  >
20
27
  {{ title }}
21
28
  </ui-typography>
22
- </slot>
29
+ <slot />
30
+ </div>
23
31
  </li>
24
32
  </template>
25
33
 
@@ -29,13 +37,17 @@
29
37
  import UiTypography, { ETextWeight } from "../ui-typography";
30
38
  import { ESize } from "../../_types/sizing";
31
39
  import { EListItemTypes } from "./_types";
40
+ import { EListItemSizes } from "./_types";
32
41
 
33
42
  const props = withDefaults(defineProps<{
34
- icon: TIconName;
35
- title: string;
36
- kind?:EListItemTypes;
43
+ icon: TIconName
44
+ title?: string
45
+ kind?: EListItemTypes
46
+ size: EListItemSizes
37
47
  }>(), {
38
- kind: EListItemTypes.DEFAULT
48
+ kind: EListItemTypes.DEFAULT,
49
+ size: EListItemSizes.COMPACT,
50
+ title: ""
39
51
  });
40
52
 
41
53
  const pickKind = computed(()=>{