bonkers-ui 1.0.40 → 1.0.42

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.40",
3
+ "version": "1.0.42",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "storybook": "start-storybook -p 6006",
@@ -1,8 +1,4 @@
1
1
  import UiCardCta from "../ui-card-cta";
2
- import UiIcon from "../ui-icon";
3
- import UiIconWrapper from "../ui-icon-wrapper";
4
- import { ESize } from "../../_types/sizing";
5
- import UiTypography from "../ui-typography";
6
2
  import type { Story } from "@storybook/vue3";
7
3
 
8
4
  export default {
@@ -29,18 +25,12 @@ export default {
29
25
  type TComponentProps = InstanceType<typeof UiCardCta>["$props"];
30
26
 
31
27
  const Template: Story<TComponentProps> = (args) => ({
32
- components: { UiCardCta, UiIcon, UiTypography, UiIconWrapper },
28
+ components: { UiCardCta },
33
29
  setup() {
34
- return { args, ESize };
30
+ return { args };
35
31
  },
36
32
  template: /*html*/ `
37
- <ui-card-cta v-bind="args">
38
- <template #icon>
39
- <ui-icon-wrapper>
40
- <ui-icon :icon-name="['far', 'face-smile']" :size=ESize.MD />
41
- </ui-icon-wrapper>
42
- </template>
43
-
33
+ <ui-card-cta v-bind="args" :icon-name="['far', 'face-smile']">
44
34
  <template #title>
45
35
  Title
46
36
  </template>
@@ -1,6 +1,20 @@
1
1
  <template>
2
2
  <button
3
- class="ui-card-cta w-full outline-0 border border-secondary-alt-500 rounded-2xl p-sm shadow-md hover:border-secondary-700 focus:shadow-border-primary active:bg-secondary-alt-200 disabled:bg-secondary-alt-200 disabled:pointer-events-none"
3
+ class="
4
+ ui-card-cta
5
+ w-full
6
+ outline-0
7
+ border
8
+ border-secondary-alt-500
9
+ rounded-2xl
10
+ p-sm
11
+ shadow-md
12
+ bg-white
13
+ hover:border-secondary-700
14
+ focus:shadow-border-primary
15
+ active:bg-secondary-alt-200
16
+ disabled:bg-secondary-alt-200
17
+ disabled:pointer-events-none"
4
18
  :disabled="disabled"
5
19
  >
6
20
  <span
@@ -9,7 +23,16 @@
9
23
  invertOrder && 'ui-card-cta_inverted',
10
24
  ]"
11
25
  >
12
- <slot name="icon" />
26
+ <slot name="icon">
27
+ <ui-icon-wrapper>
28
+ <ui-icon
29
+ v-if="iconName"
30
+ :icon-name="iconName"
31
+ :size="ESize.MD"
32
+ class="text-secondary-700"
33
+ />
34
+ </ui-icon-wrapper>
35
+ </slot>
13
36
  <span
14
37
  v-if="$slots.title && $slots.description"
15
38
  class="w-full"
@@ -38,12 +61,17 @@
38
61
 
39
62
  <script lang="ts" setup>
40
63
  import UiTypography from "../ui-typography";
64
+ import UiIcon from "../ui-icon";
65
+ import UiIconWrapper from "../ui-icon-wrapper";
41
66
  import { ETypographySizes, ETextWeight } from "../ui-typography";
42
67
  import { EColors } from "../../_types/colors";
68
+ import type { TIconName } from "../ui-icon";
69
+ import { ESize } from "../../_types/sizing";
43
70
 
44
71
  defineProps<{
45
72
  invertOrder?: boolean;
46
73
  disabled?: boolean;
74
+ iconName?: TIconName
47
75
  }>();
48
76
 
49
77
  </script>
@@ -21,7 +21,7 @@
21
21
  <ui-typography
22
22
  v-if="header"
23
23
  line-height
24
- class="flex-1 truncate"
24
+ class="flex-1 line-clamp"
25
25
  :size="ETypographySizes.SM"
26
26
  :weight="ETextWeight.SEMI_BOLD"
27
27
  >
@@ -72,4 +72,11 @@
72
72
  .ui-card-result__header {
73
73
  grid-template-columns: 1fr auto;
74
74
  }
75
+
76
+ .line-clamp {
77
+ display: -webkit-box;
78
+ overflow: hidden;
79
+ -webkit-line-clamp: 2;
80
+ -webkit-box-orient: vertical;
81
+ }
75
82
  </style>
@@ -1,6 +1,7 @@
1
1
  export enum EIconWrapperTypes {
2
- PRIMARY = "primary",
3
- SECONDARY = "secondary",
2
+ DEFAULT = "DEFAULT",
3
+ PRIMARY = "PRIMARY",
4
+ SECONDARY = "SECONDARY",
4
5
  }
5
6
  export enum EIconWrapperSizes {
6
7
  DEFAULT = "default",
@@ -2,7 +2,6 @@ import UiIconWrapper from "../ui-icon-wrapper";
2
2
  import UiIcon from "../ui-icon";
3
3
  import UiNotificationBadge, { EBadgeOrigin } from "../ui-notification-badge";
4
4
  import { EIconWrapperSizes, EIconWrapperTypes } from "./_typings";
5
- import { ESize } from "../../_types/sizing";
6
5
  import type { Story } from "@storybook/vue3";
7
6
 
8
7
  export default {
@@ -31,24 +30,24 @@ type TComponentProps = InstanceType<typeof UiIconWrapper>["$props"];
31
30
  const Template: Story<TComponentProps> = (args) => ({
32
31
  components: { UiIconWrapper, UiIcon, UiNotificationBadge },
33
32
  setup() {
34
- return { args, ESize, EBadgeOrigin };
33
+ return { args, EBadgeOrigin, EIconWrapperSizes, EIconWrapperTypes };
35
34
  },
36
35
  template: /*html*/`
37
- <ui-icon-wrapper kind="primary" v-bind="args" class="mb-sm">
36
+ <ui-icon-wrapper :kind="EIconWrapperTypes.PRIMARY" v-bind="args" class="mb-sm">
38
37
  <p> ${args.slot} </p>
39
38
  <UiNotificationBadge :origin=EBadgeOrigin.OFFSET_TOP_RIGHT>
40
39
  1
41
40
  </UiNotificationBadge>
42
41
  </ui-icon-wrapper>
43
42
 
44
- <ui-icon-wrapper kind="secondary" v-bind="args" class="mb-sm">
43
+ <ui-icon-wrapper :kind="EIconWrapperTypes.SECONDARY" v-bind="args" class="mb-sm">
45
44
  <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d8/Emblem-person-blue.svg/640px-Emblem-person-blue.svg.png" width="20" height="20" />
46
45
  </ui-icon-wrapper>
47
46
 
48
- <ui-icon-wrapper kind="primary" v-bind="args">
49
- <ui-icon :icon-name="['far', 'face-smile']" :size=ESize.LG />
47
+ <ui-icon-wrapper v-bind="args">
48
+ <ui-icon :icon-name="['far', 'face-smile']" :size=EIconWrapperSizes.SM :style="{color: 'black'}" />
50
49
  <UiNotificationBadge slot="badge" :origin=EBadgeOrigin.DEFAULT>
51
- 2
50
+ 2
52
51
  </UiNotificationBadge>
53
52
  </ui-icon-wrapper>
54
53
  `
@@ -1,9 +1,11 @@
1
1
  <template>
2
2
  <div
3
- class="icon-wrapper w-fit h-fit grid place-items-center relative rounded-3xl"
3
+ class="icon-wrapper w-fit h-fit grid place-items-center relative rounded-2xl"
4
4
  :class="[
5
5
  kind === EIconWrapperTypes.PRIMARY && 'text-white bg-primary',
6
6
  kind === EIconWrapperTypes.SECONDARY && 'text-black bg-secondary-alt-200',
7
+ kind === EIconWrapperTypes.DEFAULT && 'text-primary bg-white border-2 border-primary ',
8
+
7
9
  size === EIconWrapperSizes.DEFAULT && 'py-sm px-sm',
8
10
  size === EIconWrapperSizes.SMALL && 'py-xs px-xs',
9
11
  size === EIconWrapperSizes.MEDIUM && 'py-md px-md icon-wrapper_offset-md',
@@ -23,7 +25,7 @@
23
25
  }
24
26
 
25
27
  withDefaults(defineProps<TProps>(),{
26
- kind: EIconWrapperTypes.PRIMARY,
28
+ kind: EIconWrapperTypes.DEFAULT,
27
29
  size: EIconWrapperSizes.DEFAULT,
28
30
  });
29
31
 
@@ -39,5 +41,4 @@
39
41
  top: 8px;
40
42
  right: 8px;
41
43
  }
42
-
43
44
  </style>
@@ -1,6 +1,7 @@
1
1
  export enum EInputKinds {
2
- PRIMARY = "primary",
3
- ERROR = "error",
2
+ PRIMARY = "PRIMARY",
3
+ SECONDARY = "SECONDARY",
4
+ ERROR = "ERROR",
4
5
  }
5
6
 
6
7
  export enum EInputType {
@@ -50,8 +50,7 @@ const Template: Story<MyComponentProps> = (args: MyComponentProps) => ({
50
50
  };
51
51
  },
52
52
  template: /*html*/`
53
- <ui-input v-bind="args" v-model="valueModel" heading="heading" sub-label="subLabel" pattern="[\\d]{9}"
54
- />
53
+ <ui-input v-bind="args" v-model="valueModel" heading="Heading" sub-label="Sub Label" pattern="[\\d]{9}" />
55
54
  `
56
55
  });
57
56
 
@@ -74,16 +73,18 @@ const TemplateAll: Story<MyComponentProps> = (args: MyComponentProps) => ({
74
73
  gridGap: '12px'
75
74
  }">
76
75
  <ui-input v-bind="args" v-model="valueModel">
77
- <template v-slot:prefix-icon> € </template>
76
+ <template v-slot:prefix-icon>
77
+ <span class="text-secondary-alt"> € </span>
78
+ </template>
78
79
  </ui-input>
79
80
  <ui-input v-bind="args" v-model="valueModel">
80
81
  <template v-slot:prefix-icon>
81
- <Icon :size="16" />
82
+ <Icon :size="16" class="text-secondary-alt" />
82
83
  </template>
83
84
  </ui-input>
84
85
  <ui-input v-bind="args" v-model="valueModel">
85
86
  <template v-slot:postfix-icon>
86
- <Icon :size="16" />
87
+ <Icon :size="16" class="text-secondary-alt" />
87
88
  </template>
88
89
  </ui-input>
89
90
  </div>
@@ -3,8 +3,8 @@
3
3
  <slot name="header">
4
4
  <ui-typography
5
5
  v-if="heading"
6
- :weight="ETextWeight.BOLD"
7
- class="mb-sm"
6
+ class="mb-xs"
7
+ :size="ETypographySizes.MD"
8
8
  >
9
9
  {{ heading }}
10
10
  </ui-typography>
@@ -12,7 +12,7 @@
12
12
  <label
13
13
  class="ui-input__wrapper flex w-full rounded-lg border bg-white items-center p-sm gap-xs"
14
14
  :class="[
15
- !kind && 'border-secondary-alt-500 hover:border-secondary-alt-700',
15
+ kind === EInputKinds.SECONDARY && 'border-secondary-alt-500 hover:border-secondary-alt-700',
16
16
  kind === EInputKinds.PRIMARY && 'border-primary',
17
17
  kind === EInputKinds.ERROR && 'border-error',
18
18
 
@@ -25,7 +25,7 @@
25
25
  :value="modelValue"
26
26
  :pattern="pattern"
27
27
  class="bg-transparent border-0 outline-none w-full placeholder:text-secondary-alt placeholder:italic"
28
- :type="type || 'text'"
28
+ :type="type"
29
29
  :placeholder="placeholder"
30
30
  :maxlength="maxlength"
31
31
  :minlength="minlength"
@@ -40,7 +40,8 @@
40
40
  <ui-typography
41
41
  v-if="subLabel"
42
42
  :size="ETypographySizes.SM"
43
- class="mt-sm"
43
+ :kind="EColors.SECONDARY_ALT"
44
+ class="mt-xs"
44
45
  >
45
46
  {{ subLabel }}
46
47
  </ui-typography>
@@ -50,7 +51,7 @@
50
51
 
51
52
  <script lang="ts" setup>
52
53
  import { EInputKinds, EInputType } from "./_typings";
53
- import UiTypography, { ETypographySizes, ETextWeight } from "../ui-typography";
54
+ import UiTypography, { ETypographySizes, EColors } from "../ui-typography";
54
55
 
55
56
  withDefaults(defineProps<{
56
57
  placeholder?: string;
@@ -65,7 +66,16 @@
65
66
  minlength?: string;
66
67
  focusHandler?: (e:FocusEvent) => void;
67
68
  }>(), {
68
- modelValue: ""
69
+ modelValue: "",
70
+ placeholder: "",
71
+ heading: "",
72
+ subLabel: "",
73
+ pattern: "",
74
+ maxlength: undefined,
75
+ minlength: undefined,
76
+ type: EInputType.TEXT,
77
+ focusHandler: ()=>undefined,
78
+ kind: EInputKinds.SECONDARY
69
79
  });
70
80
 
71
81
  defineEmits(["update:modelValue"]);
@@ -23,7 +23,7 @@
23
23
  />
24
24
 
25
25
  <div
26
- class="ui-input-range__thumb bg-primary absolute border-8 border-white rounded-full box-content -translate-y-1/2 -translate-x-1/2 pointer-events-none"
26
+ class="ui-input-range__thumb bg-primary absolute border-white rounded-full box-content -translate-y-1/2 -translate-x-1/2 pointer-events-none"
27
27
  :style="{left: getPercentage + '%'}"
28
28
  />
29
29
  </div>
@@ -89,9 +89,9 @@
89
89
  <style scoped>
90
90
  input[type="range"]::-webkit-slider-thumb {
91
91
  appearance: none;
92
- height: 8px;
93
- width: 8px;
94
- transform: scale(5);
92
+ height: 10px;
93
+ width: 10px;
94
+ transform: scale(4);
95
95
  background-color: transparent;
96
96
  border: 0;
97
97
  box-shadow: none;
@@ -110,8 +110,9 @@
110
110
 
111
111
  .ui-input-range__thumb {
112
112
  top: 50%;
113
- height: 13px;
114
- width: 13px;
113
+ height: var(--xs);
114
+ width: var(--xs);
115
+ border-width: 12px;
115
116
  box-shadow: 0 0 0 4px var(--color-primary);
116
117
  }
117
118
  </style>
@@ -2,7 +2,12 @@ export enum EListItemTypes {
2
2
  DEFAULT = "DEFAULT",
3
3
  PROGRESS = "PROGRESS"
4
4
  }
5
- export enum EListItemSizes {
5
+ export enum EListItemSpacing {
6
6
  DEFAULT = "DEFAULT",
7
7
  COMPACT = "COMPACT"
8
8
  }
9
+
10
+ export enum EListItemSize {
11
+ SM = "SM",
12
+ MD = "MD"
13
+ }
@@ -1,3 +1,2 @@
1
1
  export { default } from "./ui-list-item.vue";
2
- export { EListItemTypes } from "./_types";
3
- export { EListItemSizes } from "./_types";
2
+ export { EListItemTypes, EListItemSpacing, EListItemSize } 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 { EListItemSizes, EListItemTypes } from "./_types";
3
+ import { EListItemSize, EListItemSpacing, EListItemTypes } from "./_types";
4
4
 
5
5
  export default {
6
6
  title: "Components/ui-list-item",
@@ -13,9 +13,14 @@ export default {
13
13
  },
14
14
  size: {
15
15
  control: { type: "select" },
16
- options: Object.values(EListItemSizes),
16
+ options: Object.values(EListItemSize),
17
17
  description: "The Element size"
18
18
  },
19
+ spacing: {
20
+ control: { type: "select" },
21
+ options: Object.values(EListItemSpacing),
22
+ description: "The Element spacing"
23
+ },
19
24
  title: {
20
25
  control: { type: "text" },
21
26
  description: "The Element title"
@@ -28,7 +33,8 @@ export default {
28
33
  args: {
29
34
  title: "default text",
30
35
  kind: EListItemTypes.DEFAULT,
31
- size: EListItemSizes.COMPACT,
36
+ size: EListItemSize.SM,
37
+ spacing: EListItemSpacing.DEFAULT,
32
38
  slot: "default slot"
33
39
  },
34
40
  };
@@ -3,8 +3,10 @@
3
3
  <li
4
4
  class="ui-list-item grid grid-flow-col justify-start gap-xs relative group"
5
5
  :class="[
6
- size === EListItemSizes.DEFAULT && 'pb-md',
7
- size === EListItemSizes.COMPACT && 'pb-xs'
6
+ size === EListItemSize.SM && 'text-sm',
7
+ size === EListItemSize.MD && 'text-md',
8
+ spacing === EListItemSpacing.DEFAULT && 'pb-sm',
9
+ spacing === EListItemSpacing.COMPACT && 'pb-xs'
8
10
  ]"
9
11
  >
10
12
  <div
@@ -16,7 +18,6 @@
16
18
  <ui-icon
17
19
  v-if="icon"
18
20
  class="bg-white z-[1]"
19
- :class="iconClass"
20
21
  :icon-name="icon"
21
22
  :size="ESize.SM"
22
23
  />
@@ -39,19 +40,19 @@
39
40
  import UiIcon, { type TIconName } from "../ui-icon";
40
41
  import UiTypography, { ETextWeight } from "../ui-typography";
41
42
  import { ESize } from "../../_types/sizing";
42
- import { EListItemTypes, EListItemSizes } from "./_types";
43
+ import { EListItemTypes, EListItemSpacing, EListItemSize } from "./_types";
43
44
 
44
45
  withDefaults(defineProps<{
45
46
  icon?: TIconName
46
47
  title?: string
47
48
  kind?: EListItemTypes
48
- size?: EListItemSizes
49
- iconClass?: string
49
+ size?: EListItemSize
50
+ spacing?: EListItemSpacing
50
51
  }>(), {
51
52
  kind: EListItemTypes.DEFAULT,
52
- size: EListItemSizes.COMPACT,
53
+ size: EListItemSize.SM,
54
+ spacing: EListItemSpacing.COMPACT,
53
55
  title: "",
54
- iconClass: "text-secondary-alt",
55
56
  icon: undefined
56
57
  });
57
58
 
@@ -62,7 +62,7 @@
62
62
  >
63
63
  <ui-radio
64
64
  v-model="radioModel"
65
- :value="value"
65
+ :value="value.toString()"
66
66
  :name="name"
67
67
  :disabled="disabled"
68
68
  class="pointer-events-none"
@@ -99,11 +99,11 @@
99
99
  import UiTypography, { ETypographySizes, EColors, ETextWeight } from "../ui-typography";
100
100
 
101
101
  const props = defineProps<{
102
- modelValue: string;
102
+ modelValue: string | number | boolean;
103
103
  header?: string;
104
104
  subHeader?: string;
105
105
  name: string;
106
- value: string;
106
+ value: string | number | boolean;
107
107
  disabled?: boolean;
108
108
  }>();
109
109
 
@@ -16,7 +16,7 @@
16
16
  :id="value"
17
17
  v-model="radioModel"
18
18
  type="radio"
19
- :name="name"
19
+ :name="name.toString()"
20
20
  :value="value"
21
21
  :disabled="disabled"
22
22
  class="appearance-none absolute peer"
@@ -64,8 +64,8 @@
64
64
  import { EJustify } from "../../_types/align";
65
65
  const slots = useSlots();
66
66
  const props = defineProps<{
67
- modelValue: string;
68
- name: string;
67
+ modelValue: string | number | boolean;
68
+ name: string | number | boolean;
69
69
  value: string;
70
70
  justify?: EJustify;
71
71
  invertOrder?: boolean;
@@ -105,9 +105,9 @@
105
105
  import uiIcon from "../ui-icon";
106
106
 
107
107
  const props = withDefaults(defineProps<{
108
- modelValue: string;
108
+ modelValue: string | number | boolean;
109
109
  name: string;
110
- value: string | number;
110
+ value: string | number | boolean;
111
111
  iconName: TIconName;
112
112
  disabled?: boolean;
113
113
  radioSize?: ERadioSizes;
@@ -26,7 +26,7 @@ const Template: Story<TComponentProps> = (args) => ({
26
26
  return { args, valueModel, list };
27
27
  },
28
28
  template: /*html*/`
29
- <ui-select v-bind="args" v-model="valueModel" heading="heading" subLabel="subLabel">
29
+ <ui-select v-bind="args" v-model="valueModel" heading="Heading" subLabel="Sub Label">
30
30
  <template #postfix-icon>
31
31
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
32
32
  <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"/>
@@ -3,8 +3,8 @@
3
3
  <slot name="heading">
4
4
  <ui-typography
5
5
  v-if="heading"
6
- :weight="ETextWeight.SEMI_BOLD"
7
- class="mb-sm"
6
+ class="mb-xs"
7
+ :size="ETypographySizes.MD"
8
8
  >
9
9
  {{ heading }}
10
10
  </ui-typography>
@@ -28,7 +28,8 @@
28
28
  <ui-typography
29
29
  v-if="subLabel"
30
30
  :size="ETypographySizes.SM"
31
- class="mt-sm"
31
+ :kind="EColors.SECONDARY_ALT"
32
+ class="mt-xs"
32
33
  >
33
34
  {{ subLabel }}
34
35
  </ui-typography>
@@ -38,7 +39,7 @@
38
39
 
39
40
  <script lang="ts" setup>
40
41
  import { computed } from "vue";
41
- import UiTypography, { ETypographySizes, ETextWeight } from "../ui-typography";
42
+ import UiTypography, { ETypographySizes, EColors } from "../ui-typography";
42
43
 
43
44
  const props = defineProps<{
44
45
  modelValue: string;