bonkers-ui 1.0.26 → 1.0.28

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.26",
3
+ "version": "1.0.28",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "storybook": "start-storybook -p 6006",
@@ -1,10 +1,11 @@
1
1
  <template>
2
2
  <button
3
- class="ui-button justify-center grid text-base rounded-lg whitespace-nowrap font-bold leading-none touch-manipulation items-center"
3
+ class="ui-button grid justify-center items-center grid-flow-col text-base rounded-lg whitespace-nowrap font-bold leading-none touch-manipulation "
4
4
  :disabled="disabled"
5
5
  :class="[
6
6
  (!kind || kind === EButtonTypes.PRIMARY) && [primaryColor, primaryColorHover, primaryColorActive].join(' '),
7
- kind === EButtonTypes.SECONDARY && 'text-white bg-secondary hover:bg-secondary-600 active:bg-secondary-700 disabled:bg-secondary-300',
7
+ kind === EButtonTypes.SECONDARY
8
+ && 'text-white bg-secondary hover:bg-secondary-600 active:bg-secondary-700 disabled:bg-secondary-300',
8
9
  kind === EButtonTypes.WARNING && 'text-white bg-warning hover:bg-warning-600 active:bg-warning-700 disabled:bg-warning-300',
9
10
  kind === EButtonTypes.ERROR && 'text-white bg-error hover:bg-error-600 active:bg-error-700 disabled:bg-error-300',
10
11
  kind === EButtonTypes.PRIMARY_OVERLAY
@@ -20,35 +21,22 @@
20
21
  size === EButtonSizes.SMALL && 'py-xs px-md',
21
22
  size === EButtonSizes.MEDIUM && 'py-sm px-sm',
22
23
  size === EButtonSizes.LARGE && 'py-md px-md',
24
+ ($slots.default || $slots.postfix) && 'gap-sm',
23
25
  fullWidth && 'w-full',
24
26
  disabled && 'pointer-events-none',
25
27
  ]"
26
28
  >
27
- <span
28
- v-if="slots.prefix"
29
- class="ui-button__prefix"
30
- :class="(slots.default || slots.postfix) && 'mr-sm'"
31
- >
32
- <slot name="prefix" />
33
- </span>
29
+ <slot name="prefix" />
34
30
 
35
- <span>
36
- <slot />
37
- </span>
31
+ <slot />
38
32
 
39
- <span
40
- v-if="slots.postfix"
41
- class="ui-button__postfix"
42
- :class="(slots.default || slots.prefix) && 'ml-sm'"
43
- >
44
- <slot name="postfix" />
45
- </span>
33
+ <slot name="postfix" />
46
34
  </button>
47
35
  </template>
48
36
 
49
37
  <script lang="ts" setup>
50
38
  import { EButtonSizes, EButtonTypes } from "./_typings";
51
- import { useSlots } from "vue";
39
+
52
40
  type TProps = {
53
41
  kind?: EButtonTypes;
54
42
  size?: EButtonSizes;
@@ -56,17 +44,14 @@
56
44
  disabled?: boolean;
57
45
  }
58
46
 
59
- const slots = useSlots();
60
-
61
47
  const primaryColor = "text-white bg-primary disabled:bg-primary-300";
62
48
  const primaryColorHover = "hover:bg-primary-600 ";
63
49
  const primaryColorActive = "active:bg-primary-700 ";
64
50
 
65
- defineProps<TProps>();
51
+ withDefaults( defineProps<TProps>(), {
52
+ kind: EButtonTypes.PRIMARY,
53
+ size: EButtonSizes.DEFAULT,
54
+ fullWidth: false,
55
+ disabled: false,
56
+ });
66
57
  </script>
67
-
68
- <style>
69
- .ui-button {
70
- grid-template-columns: auto auto auto;
71
- }
72
- </style>
@@ -1 +1 @@
1
- export { default } from "./ui-card-simple.vue";
1
+ export { default } from "./ui-result-card.vue";
@@ -18,8 +18,10 @@
18
18
  import { ESize } from "../../_types/sizing";
19
19
  import type { TIconName } from "./_typings";
20
20
 
21
- defineProps<{
22
- size: ESize;
21
+ withDefaults(defineProps<{
22
+ size?: ESize;
23
23
  iconName: TIconName;
24
- }>();
24
+ }>(), {
25
+ size: ESize.SM
26
+ });
25
27
  </script>
@@ -9,7 +9,6 @@
9
9
  :name="name"
10
10
  :value="value"
11
11
  class="peer group appearance-none absolute"
12
- :class="disabled && 'pointer-events-none opacity-50'"
13
12
  >
14
13
  <div
15
14
  class="
@@ -0,0 +1,8 @@
1
+ export enum EResultCardRangeSizes {
2
+ DEFAULT = "DEFAULT",
3
+ }
4
+
5
+ export enum EResultCardRangeTypes {
6
+ DEFAULT = "DEFAULT",
7
+ FULL = "FULL",
8
+ }
@@ -0,0 +1 @@
1
+ export { default } from "./ui-result-card-range.vue";
@@ -0,0 +1,68 @@
1
+ import UiResultCardRange from "../ui-result-card-range";
2
+
3
+ export default {
4
+ title: "Components/ui-result-card-range",
5
+ component: UiResultCardRange,
6
+ argTypes: {
7
+ slot: {
8
+ control: { type: "text" },
9
+ description: "The slot text or component",
10
+ },
11
+ title: {
12
+ control: { type: "text" },
13
+ description: "The title text",
14
+ },
15
+ },
16
+ args: {
17
+ title: "This is a Title",
18
+ slot: "This is the body",
19
+ },
20
+ };
21
+
22
+ const Template = (args) => ({
23
+ components: { UiResultCardRange },
24
+ setup() {
25
+ return { args };
26
+ },
27
+ template:/*html*/`
28
+ <ui-result-card-range :icon-name="['far', 'fa-face-smile']" :title="args.title">
29
+ {{args.slot}}
30
+ </ui-result-card-range>
31
+ `,
32
+ });
33
+
34
+ const TemplateAll = (args) => ({
35
+ components: { UiResultCardRange },
36
+ setup() {
37
+ return { args };
38
+ },
39
+ template:/*html*/`
40
+ <div class="ui-result-card-range grid gap-sm w-full">
41
+
42
+ <ui-result-card-range style="grid-column: 1 / 1"
43
+ :icon-name="['far', 'fa-face-smile']" :title="args.title">
44
+ {{args.slot}}
45
+ </ui-result-card-range>
46
+
47
+ <ui-result-card-range style="grid-column: 2 / 2"
48
+ :icon-name="['far', 'fa-face-smile']" :title="args.title">
49
+ {{args.slot}}
50
+
51
+ </ui-result-card-range>
52
+
53
+ <ui-result-card-range style="grid-column: 1 / 3; flex-direction: row; justify-content: space-between;">
54
+
55
+ <b>25/02/2022</b>
56
+ <b>→</b>
57
+ <b>26/01/2023</b>
58
+
59
+ </ui-result-card-range>
60
+ </div>
61
+ `,
62
+ });
63
+
64
+ export const singleCard = Template.bind({
65
+
66
+ });
67
+
68
+ export const FullCard = TemplateAll.bind({});
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <div
3
+ class="
4
+ ui-result-card-range
5
+ w-full
6
+ flex
7
+ flex-col
8
+ items-center
9
+ border
10
+ border-secondary-alt-300
11
+ bg-secondary-alt-200
12
+ rounded-2xl
13
+ text-secondary-500 p-md"
14
+ >
15
+ <ui-icon
16
+ v-if="iconName"
17
+ class="rounded-full mb-md"
18
+ :size="ESize.MD"
19
+ :icon-name="iconName"
20
+ />
21
+ <ui-typography
22
+ v-if="title"
23
+ class="mb-xs"
24
+ :size="ETypographySizes.MD"
25
+ :weight="ETextWeight.BOLD"
26
+ :align="ETextAlign.CENTER"
27
+ >
28
+ {{ title }}
29
+ </ui-typography>
30
+
31
+ <slot />
32
+ </div>
33
+ </template>
34
+
35
+ <script lang="ts" setup>
36
+ import uiIcon, { ESize, type TIconName } from "../ui-icon";
37
+ import UiTypography, { ETextWeight, ETypographySizes, ETextAlign } from "../ui-typography";
38
+
39
+ defineProps<{
40
+ iconName?: TIconName;
41
+ title?: string;
42
+ size?: string;
43
+ description?: string;
44
+ }>();
45
+
46
+ </script>