bonkers-ui 1.0.17 → 1.0.19

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.
Files changed (53) hide show
  1. package/package.json +28 -25
  2. package/src/_styles/classTypes/_spacing.json +2 -0
  3. package/src/_styles/variables/spacing.css +2 -0
  4. package/src/components/ui-alert/ui-alert.vue +1 -1
  5. package/src/components/ui-button/ui-button.test.ts +1 -1
  6. package/src/components/ui-card-cta/ui-card-cta.stories.ts +9 -6
  7. package/src/components/ui-card-cta/ui-card-cta.vue +6 -17
  8. package/src/components/ui-card-result/ui-card-result.stories.ts +3 -1
  9. package/src/components/ui-card-simple/ui-card-simple.stories.ts +2 -1
  10. package/src/components/ui-icon/index.ts +1 -0
  11. package/src/components/ui-icon/ui-icon.stories.ts +0 -5
  12. package/src/components/ui-icon/ui-icon.vue +0 -2
  13. package/src/components/ui-icon-wrapper/_typings.ts +10 -0
  14. package/src/components/ui-icon-wrapper/index.ts +1 -0
  15. package/src/components/ui-icon-wrapper/ui-icon-wrapper.stories.ts +57 -0
  16. package/src/components/ui-icon-wrapper/ui-icon-wrapper.vue +43 -0
  17. package/src/components/ui-input/ui-input.stories.ts +6 -5
  18. package/src/components/ui-input/ui-input.vue +7 -3
  19. package/src/components/ui-list-item/_types.ts +5 -0
  20. package/src/components/ui-list-item/index.ts +1 -0
  21. package/src/components/ui-list-item/ui-list-item.stories.ts +14 -16
  22. package/src/components/ui-list-item/ui-list-item.vue +40 -20
  23. package/src/components/ui-notification-badge/_types.ts +11 -0
  24. package/src/components/ui-notification-badge/index.ts +2 -0
  25. package/src/components/ui-notification-badge/ui-notification-badge.stories.ts +38 -0
  26. package/src/components/ui-notification-badge/ui-notification-badge.vue +28 -0
  27. package/src/components/ui-order-card/_types.ts +4 -0
  28. package/src/components/ui-order-card/index.ts +1 -0
  29. package/src/components/ui-order-card/ui-order-card.stories.ts +51 -0
  30. package/src/components/ui-order-card/ui-order-card.vue +83 -0
  31. package/src/components/ui-radio/ui-radio.vue +9 -9
  32. package/src/components/ui-radio-fancy/index.ts +1 -0
  33. package/src/components/ui-radio-fancy/ui-radio-fancy.stories.ts +32 -0
  34. package/src/components/ui-radio-fancy/ui-radio-fancy.vue +59 -0
  35. package/src/components/ui-select/ui-select.stories.ts +9 -2
  36. package/src/components/ui-select/ui-select.vue +12 -17
  37. package/src/components/ui-table/index.ts +4 -0
  38. package/src/components/ui-table/ui-table-cell/index.ts +1 -0
  39. package/src/components/ui-table/ui-table-cell/ui-table-cell.vue +33 -0
  40. package/src/components/ui-table/ui-table-row/_typings.ts +3 -0
  41. package/src/components/ui-table/ui-table-row/index.ts +2 -0
  42. package/src/components/ui-table/ui-table-row/ui-table-row.vue +31 -0
  43. package/src/components/ui-table/ui-table.stories.ts +83 -0
  44. package/src/components/ui-tabs/ui-tabs.vue +17 -15
  45. package/src/components/ui-typography/index.ts +1 -0
  46. package/src/components/ui-typography/ui-typography.vue +3 -3
  47. package/src/main.css +4 -4
  48. package/tailwind.config.js +8 -1
  49. package/src/components/ui-radio-list-fancy/index.ts +0 -1
  50. package/src/components/ui-radio-list-fancy/ui-radio-item/index.ts +0 -1
  51. package/src/components/ui-radio-list-fancy/ui-radio-item/ui-radio-item.vue +0 -65
  52. package/src/components/ui-radio-list-fancy/ui-radio-list-fancy.stories.ts +0 -32
  53. package/src/components/ui-radio-list-fancy/ui-radio-list-fancy.vue +0 -59
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "bonkers-ui",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
+ "private": false,
4
5
  "scripts": {
5
6
  "storybook": "start-storybook -p 6006",
6
7
  "build-storybook": "build-storybook",
@@ -10,7 +11,8 @@
10
11
  "test": "jest",
11
12
  "deploy": "gh-pages -d storybook-static",
12
13
  "typecheck": "tsc --noEmit && vue-tsc --noEmit",
13
- "i": "yarn install --frozen-lockfile"
14
+ "i": "yarn install --frozen-lockfile",
15
+ "postinstall": "husky install"
14
16
  },
15
17
  "dependencies": {
16
18
  "@fortawesome/fontawesome-svg-core": "^6.2.0",
@@ -18,43 +20,44 @@
18
20
  "@fortawesome/free-regular-svg-icons": "^6.2.0",
19
21
  "@fortawesome/free-solid-svg-icons": "^6.2.0",
20
22
  "@fortawesome/vue-fontawesome": "^3.0.1",
21
- "vue": "^3.2.38"
23
+ "vue": "^3.2.41"
22
24
  },
23
25
  "devDependencies": {
24
- "@storybook/addon-actions": "^6.5.10",
25
- "@storybook/addon-essentials": "^6.5.10",
26
- "@storybook/addon-links": "^6.5.10",
26
+ "@storybook/addon-actions": "^6.5.13",
27
+ "@storybook/addon-essentials": "^6.5.13",
28
+ "@storybook/addon-links": "^6.5.13",
27
29
  "@storybook/addon-postcss": "^2.0.0",
28
- "@storybook/builder-vite": "^0.2.2",
29
- "@storybook/vue3": "^6.5.10",
30
- "@types/jest": "^28.1.3",
31
- "@typescript-eslint/eslint-plugin": "^5.36.1",
32
- "@typescript-eslint/parser": "^5.36.1",
33
- "@vitejs/plugin-vue": "^3.0.3",
34
- "@vue/eslint-config-typescript": "^11.0.0",
35
- "@vue/test-utils": "^2.0.0",
30
+ "@storybook/builder-vite": "^0.2.4",
31
+ "@storybook/vue3": "^6.5.13",
32
+ "@types/jest": "^29.2.0",
33
+ "@typescript-eslint/eslint-plugin": "^5.41.0",
34
+ "@typescript-eslint/parser": "^5.41.0",
35
+ "@vitejs/plugin-vue": "^3.2.0",
36
+ "@vue/eslint-config-typescript": "^11.0.2",
37
+ "@vue/test-utils": "^2.2.0",
36
38
  "@vue/vue3-jest": "^27.0.0",
37
39
  "babel-jest": "27",
38
- "eslint": "8.22.0",
39
- "eslint-plugin-vue": "^9.4.0",
40
+ "eslint": "8.26.0",
41
+ "eslint-plugin-vue": "^9.6.0",
40
42
  "gh-pages": "^4.0.0",
41
43
  "husky": "^8.0.1",
42
44
  "jest": "27.3.1",
43
45
  "lint-staged": "^13.0.2",
44
- "postcss": "^8.4.16",
46
+ "postcss": "^8.4.18",
45
47
  "postcss-html": "^1.4.1",
46
- "storybook-tailwind-dark-mode": "^1.0.13",
47
- "stylelint": "^14.11.0",
48
+ "storybook-tailwind-dark-mode": "^1.0.15",
49
+ "stylelint": "^14.14.0",
48
50
  "stylelint-config-recommended": "^9.0.0",
49
51
  "stylelint-config-recommended-vue": "^1.4.0",
50
- "stylelint-config-standard": "^28.0.0",
51
- "tailwindcss": "^3.1.8",
52
+ "stylelint-config-standard": "^29.0.0",
53
+ "tailwindcss": "^3.2.1",
52
54
  "ts-jest": "^27.0.7",
53
- "typescript": "^4.8.2",
54
- "vite": "^3.0.9",
55
- "vue-eslint-parser": "^9.0.3",
55
+ "ts-node": "^10.9.1",
56
+ "typescript": "^4.8.4",
57
+ "vite": "^3.2.0",
58
+ "vue-eslint-parser": "^9.1.0",
56
59
  "vue-loader": "^17.0.0",
57
- "vue-tsc": "^0.40.5"
60
+ "vue-tsc": "^1.0.9"
58
61
  },
59
62
  "jest": {
60
63
  "preset": "ts-jest",
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "0": "var(--zero)",
3
+ "px": "var(--px)",
4
+ "auto": "var(--auto)",
3
5
  "xxs": "var(--xxs)",
4
6
  "xs": "var(--xs)",
5
7
  "sm": "var(--sm)",
@@ -1,7 +1,9 @@
1
1
  @layer base {
2
2
  :root {
3
3
  /* spacing */
4
+ --auto: auto;
4
5
  --zero: 0;
6
+ --px: 1px;
5
7
  --xxs: 4px;
6
8
  --xs: 8px;
7
9
  --sm: 16px;
@@ -5,7 +5,7 @@
5
5
  (!kind || kind === EAlertTypes.PRIMARY) && 'border-primary',
6
6
  kind === EAlertTypes.WARNING && 'border-warning',
7
7
  kind === EAlertTypes.ERROR && 'border-error',
8
- kind === EAlertTypes.SECONDARY && 'border-secondary',
8
+ kind === EAlertTypes.SECONDARY && 'border-secondary'
9
9
  ]"
10
10
  >
11
11
  <ui-icon
@@ -1,4 +1,4 @@
1
- import { mount, } from "@vue/test-utils";
1
+ import { mount } from "@vue/test-utils";
2
2
  import UiButton from "./ui-button.vue";
3
3
 
4
4
  describe("VButton.test.ts", () => {
@@ -1,5 +1,6 @@
1
1
  import UiCardCta from "../ui-card-cta";
2
2
  import UiIcon from "../ui-icon";
3
+ import UiIconWrapper from "../ui-icon-wrapper";
3
4
  import { ESize } from "../../_types/sizing";
4
5
  import UiTypography from "../ui-typography";
5
6
  import type { Story } from "@storybook/vue3";
@@ -28,21 +29,23 @@ export default {
28
29
  type TComponentProps = InstanceType<typeof UiCardCta>["$props"];
29
30
 
30
31
  const Template: Story<TComponentProps> = (args) => ({
31
- components: { UiCardCta, UiIcon, UiTypography },
32
+ components: { UiCardCta, UiIcon, UiTypography, UiIconWrapper },
32
33
  setup() {
33
34
  return { args, ESize };
34
35
  },
35
- template: `
36
+ template: /*html*/ `
36
37
  <ui-card-cta v-bind="args">
37
- <template v-slot:icon>
38
- <ui-icon :size="ESize.MD" has-wrapper class="text-white" :icon-name="['far', 'fa-face-smile']" />
38
+ <template #icon>
39
+ <ui-icon-wrapper>
40
+ <ui-icon :icon-name="['far', 'fa-face-smile']" :size=ESize.MD />
41
+ </ui-icon-wrapper>
39
42
  </template>
40
43
 
41
- <template v-slot:title>
44
+ <template #title>
42
45
  Title
43
46
  </template>
44
47
 
45
- <template v-slot:description>
48
+ <template #description>
46
49
  {{args.slot}}
47
50
  </template>
48
51
  </ui-card-cta>
@@ -1,24 +1,25 @@
1
1
  <template>
2
2
  <button
3
- class="ui-card-cta 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"
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"
4
4
  :disabled="disabled"
5
5
  >
6
6
  <span
7
- class="ui-card-cta__wrapper grid gap-sm items-center"
7
+ class="ui-card-cta__wrapper w-full grid gap-sm items-center"
8
8
  :class="[
9
9
  invertOrder && 'ui-card-cta_inverted',
10
10
  ]"
11
11
  >
12
12
  <slot name="icon" />
13
13
  <span
14
- v-if="slots.title && slots.description"
15
- class="ui-card-cta__text-wrapper"
14
+ v-if="$slots.title && $slots.description"
15
+ class="w-full"
16
16
  :class="invertOrder && 'order-first'"
17
17
  >
18
18
  <ui-typography
19
19
  :kind="EColors.SECONDARY"
20
20
  :weight="ETextWeight.SEMI_BOLD"
21
21
  class="mb-xxs"
22
+ line-height
22
23
  >
23
24
  <slot name="title" />
24
25
  </ui-typography>
@@ -26,6 +27,7 @@
26
27
  <ui-typography
27
28
  :kind="EColors.SECONDARY_300"
28
29
  :size="ETypographySizes.SM"
30
+ line-height
29
31
  >
30
32
  <slot name="description" />
31
33
  </ui-typography>
@@ -35,13 +37,10 @@
35
37
  </template>
36
38
 
37
39
  <script lang="ts" setup>
38
- import { useSlots } from "vue";
39
40
  import UiTypography from "../ui-typography";
40
41
  import { ETypographySizes, ETextWeight } from "../ui-typography";
41
42
  import { EColors } from "../../_types/colors";
42
43
 
43
- const slots = useSlots();
44
-
45
44
  defineProps<{
46
45
  invertOrder?: boolean;
47
46
  disabled?: boolean;
@@ -52,26 +51,16 @@
52
51
  <style scoped>
53
52
  .ui-card-cta {
54
53
  text-align: unset;
55
- width: 100%;
56
- }
57
-
58
- .ui-card-cta:disabled {
59
- pointer-events: none;
60
54
  }
61
55
 
62
56
  .ui-card-cta__wrapper {
63
57
  grid-template-columns: auto 1fr;
64
- width: 100%;
65
58
  }
66
59
 
67
60
  .ui-card-cta:disabled .ui-card-cta__wrapper {
68
61
  opacity: 0.5;
69
62
  }
70
63
 
71
- .ui-card-cta__text-wrapper {
72
- width: 100%;
73
- }
74
-
75
64
  .ui-card-cta_inverted {
76
65
  grid-template-columns: 1fr auto;
77
66
  }
@@ -34,7 +34,8 @@ const Template: Story<TComponentProps> = (args) => ({
34
34
  setup() {
35
35
  return { args, ETypographySizes, ETextWeight, ETextAlign, EButtonTypes, ESize };
36
36
  },
37
- template: `
37
+ template:
38
+ /*html*/`
38
39
  <ui-card-result
39
40
  v-bind="args"
40
41
  header="Some header"
@@ -96,6 +97,7 @@ const Template: Story<TComponentProps> = (args) => ({
96
97
 
97
98
  </template>
98
99
  </ui-card-result>
100
+
99
101
  `,
100
102
  });
101
103
 
@@ -17,7 +17,8 @@ const Template: Story<TComponentProps> = (args) => ({
17
17
  setup() {
18
18
  return { args };
19
19
  },
20
- template: `
20
+ template: /*html*/`
21
+
21
22
  <ui-card-simple>
22
23
  <template v-slot:title>
23
24
  I want to borrow for
@@ -1,2 +1,3 @@
1
1
  export { default } from "./ui-icon.vue";
2
+ export { ESize } from "../../_types/sizing";
2
3
  export type { TIconName }from "./_typings";
@@ -7,10 +7,6 @@ export default {
7
7
  component: UiIcon,
8
8
  // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
9
9
  argTypes: {
10
- hasWrapper:{
11
- control: { type: "boolean" },
12
- description: "The Icon show wrapper",
13
- },
14
10
  size: {
15
11
  control: { type: "select" },
16
12
  options: Object.values(ESize),
@@ -20,7 +16,6 @@ export default {
20
16
  },
21
17
  args: {
22
18
  size: ESize.LG,
23
- hasWrapper: false,
24
19
  },
25
20
  };
26
21
 
@@ -10,7 +10,6 @@
10
10
  size === ESize.LG && 'h-lg w-lg',
11
11
  size === ESize.XL && 'h-xl w-xl',
12
12
  size === ESize.XXL && 'h-xxl w-xxl',
13
- hasWrapper && 'p-sm bg-primary rounded-2xl',
14
13
  ]"
15
14
  />
16
15
  </template>
@@ -20,7 +19,6 @@
20
19
  import type { TIconName } from "./_typings";
21
20
 
22
21
  defineProps<{
23
- hasWrapper?: boolean;
24
22
  size: ESize;
25
23
  iconName: TIconName;
26
24
  }>();
@@ -0,0 +1,10 @@
1
+ export enum EIconWrapperTypes {
2
+ PRIMARY = "primary",
3
+ SECONDARY = "secondary",
4
+ }
5
+ export enum EIconWrapperSizes {
6
+ DEFAULT = "default",
7
+ SMALL = "sm",
8
+ MEDIUM = "md",
9
+ LARGE = "lg"
10
+ }
@@ -0,0 +1 @@
1
+ export { default } from "./ui-icon-wrapper.vue";
@@ -0,0 +1,57 @@
1
+ import UiIconWrapper from "../ui-icon-wrapper";
2
+ import UiIcon from "../ui-icon";
3
+ import UiNotificationBadge, { EBadgeOrigin } from "../ui-notification-badge";
4
+ import { EIconWrapperSizes, EIconWrapperTypes } from "./_typings";
5
+ import { ESize } from "../../_types/sizing";
6
+ import type { Story } from "@storybook/vue3";
7
+
8
+ export default {
9
+ title: "Components/ui-icon-wrapper",
10
+ component: UiIconWrapper,
11
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
12
+ argTypes: {
13
+ kind: {
14
+ control: { type: "select" },
15
+ options: Object.values(EIconWrapperTypes),
16
+ description: "The Icon Wrapper kinds",
17
+ },
18
+ size: {
19
+ control: { type: "select" },
20
+ options: Object.values(EIconWrapperSizes),
21
+ description: "The Icon Wrapper sizes",
22
+ }
23
+ },
24
+ args: {
25
+ slot: "icon",
26
+ },
27
+ };
28
+
29
+ type TComponentProps = InstanceType<typeof UiIconWrapper>["$props"];
30
+
31
+ const Template: Story<TComponentProps> = (args) => ({
32
+ components: { UiIconWrapper, UiIcon, UiNotificationBadge },
33
+ setup() {
34
+ return { args, ESize, EBadgeOrigin };
35
+ },
36
+ template: /*html*/`
37
+ <ui-icon-wrapper kind="primary" v-bind="args" class="mb-sm">
38
+ <p> ${args.slot} </p>
39
+ <UiNotificationBadge :origin=EBadgeOrigin.OFFSET_TOP_RIGHT>
40
+ 1
41
+ </UiNotificationBadge>
42
+ </ui-icon-wrapper>
43
+
44
+ <ui-icon-wrapper kind="secondary" v-bind="args" class="mb-sm">
45
+ <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
+ </ui-icon-wrapper>
47
+
48
+ <ui-icon-wrapper kind="primary" v-bind="args">
49
+ <ui-icon :icon-name="['far', 'fa-face-smile']" :size=ESize.LG />
50
+ <UiNotificationBadge slot="badge" :origin=EBadgeOrigin.DEFAULT>
51
+ 2
52
+ </UiNotificationBadge>
53
+ </ui-icon-wrapper>
54
+ `
55
+ });
56
+
57
+ export const Default = Template.bind({});
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div
3
+ class="icon-wrapper w-fit h-fit grid place-items-center relative rounded-3xl"
4
+ :class="[
5
+ kind === EIconWrapperTypes.PRIMARY && 'text-white bg-primary',
6
+ kind === EIconWrapperTypes.SECONDARY && 'text-black bg-secondary-alt-200',
7
+ size === EIconWrapperSizes.DEFAULT && 'py-sm px-sm',
8
+ size === EIconWrapperSizes.SMALL && 'py-xs px-xs',
9
+ size === EIconWrapperSizes.MEDIUM && 'py-md px-md icon-wrapper_offset-md',
10
+ size === EIconWrapperSizes.LARGE && 'py-lg px-lg icon-wrapper_offset-lg',
11
+ ]"
12
+ >
13
+ <slot />
14
+ </div>
15
+ </template>
16
+
17
+ <script lang="ts" setup>
18
+ import { EIconWrapperSizes, EIconWrapperTypes } from "./_typings";
19
+
20
+ type TProps = {
21
+ kind?: EIconWrapperTypes;
22
+ size?: EIconWrapperSizes;
23
+ }
24
+
25
+ withDefaults(defineProps<TProps>(),{
26
+ kind: EIconWrapperTypes.PRIMARY,
27
+ size: EIconWrapperSizes.DEFAULT,
28
+ });
29
+
30
+ </script>
31
+
32
+ <style scoped>
33
+ .icon-wrapper_offset-md :deep(.notification-badge) {
34
+ top: 4px;
35
+ right: 4px;
36
+ }
37
+
38
+ .icon-wrapper_offset-lg :deep(.notification-badge) {
39
+ top: 8px;
40
+ right: 8px;
41
+ }
42
+
43
+ </style>
@@ -49,8 +49,9 @@ const Template: Story<MyComponentProps> = (args: MyComponentProps) => ({
49
49
  valueModel
50
50
  };
51
51
  },
52
- template: `
53
- <ui-input v-bind="args" v-model="valueModel" heading="heading" sub-label="subLabel" />
52
+ template: /*html*/`
53
+ <ui-input v-bind="args" v-model="valueModel" heading="heading" sub-label="subLabel" pattern="[\\d]{9}"
54
+ />
54
55
  `
55
56
  });
56
57
 
@@ -67,7 +68,7 @@ const TemplateAll: Story<MyComponentProps> = (args: MyComponentProps) => ({
67
68
  valueModel
68
69
  };
69
70
  },
70
- template: `
71
+ template: /*html*/`
71
72
  <div :style="{
72
73
  display: 'grid',
73
74
  gridGap: '12px'
@@ -77,12 +78,12 @@ const TemplateAll: Story<MyComponentProps> = (args: MyComponentProps) => ({
77
78
  </ui-input>
78
79
  <ui-input v-bind="args" v-model="valueModel">
79
80
  <template v-slot:prefix-icon>
80
- <icon :size="16" />
81
+ <Icon :size="16" />
81
82
  </template>
82
83
  </ui-input>
83
84
  <ui-input v-bind="args" v-model="valueModel">
84
85
  <template v-slot:postfix-icon>
85
- <icon :size="16" />
86
+ <Icon :size="16" />
86
87
  </template>
87
88
  </ui-input>
88
89
  </div>
@@ -1,4 +1,4 @@
1
- EInputKinds<template>
1
+ <template>
2
2
  <div class="ui-input">
3
3
  <ui-typography
4
4
  v-if="heading"
@@ -7,7 +7,7 @@ EInputKinds<template>
7
7
  >
8
8
  {{ heading }}
9
9
  </ui-typography>
10
- <div
10
+ <label
11
11
  class="ui-input__wrapper flex w-full rounded-lg border bg-white items-center p-sm gap-xs"
12
12
  :class="[
13
13
  !kind && 'border-secondary-alt-500 hover:border-secondary-alt-700',
@@ -25,11 +25,13 @@ EInputKinds<template>
25
25
  :placeholder="placeholder"
26
26
  :value="modelValue"
27
27
  :pattern="pattern"
28
+ :maxlength="maxlength"
29
+ :minlength="minlength"
28
30
  @input="$emit('update:modelValue', ($event.target as HTMLTextAreaElement)?.value)"
29
31
  >
30
32
 
31
33
  <slot name="postfix-icon" />
32
- </div>
34
+ </label>
33
35
  <ui-typography
34
36
  v-if="subLabel"
35
37
  :size="ETypographySizes.SM"
@@ -53,6 +55,8 @@ EInputKinds<template>
53
55
  subLabel?: string;
54
56
  type?: EInputType;
55
57
  pattern?: string;
58
+ maxlength?: string;
59
+ minlength?: string;
56
60
  }>();
57
61
 
58
62
  defineEmits(["update:modelValue"]);
@@ -0,0 +1,5 @@
1
+ export enum EListItemTypes {
2
+ DEFAULT = "DEFAULT",
3
+ COMPACT = "COMPACT",
4
+ PROGRESS = "PROGRESS"
5
+ }
@@ -1 +1,2 @@
1
1
  export { default } from "./ui-list-item.vue";
2
+ export { EListItemTypes } from "./_types";
@@ -1,19 +1,21 @@
1
1
  import UiListItem from "./ui-list-item.vue";
2
2
  import type { Story } from "@storybook/vue3";
3
+ import { EListItemTypes } from "./_types";
3
4
 
4
5
  export default {
5
6
  title: "Components/ui-list-item",
6
7
  component: UiListItem,
7
8
  argTypes: {
8
- description: {
9
- control: { type: "text" },
10
- title: "The Element title",
9
+ kind: {
10
+ control: { type: "select" },
11
+ options: Object.values(EListItemTypes),
12
+ description: "The Element title",
11
13
  }
12
14
  },
13
15
  args: {
14
- slot: "some description text: lorem",
15
16
  title: "default text",
16
- }
17
+ kind: EListItemTypes.DEFAULT
18
+ },
17
19
  };
18
20
 
19
21
  type TComponentProps = InstanceType<typeof UiListItem>["$props"];
@@ -23,17 +25,13 @@ const Template: Story<TComponentProps> = (args) => ({
23
25
  setup() {
24
26
  return { args };
25
27
  },
26
- template: `
27
- <ul class="grid gap-sm">
28
- <ui-list-item :icon="['far', 'face-smile']" :title="args.title">
29
- </ui-list-item>
30
- <ui-list-item :icon="['far', 'face-smile']" :title="args.title">
31
- {{args.slot}}
32
- </ui-list-item>
33
- <ui-list-item :icon="['far', 'face-smile']" :title="args.title">
34
- </ui-list-item>
35
- </ul>
36
- `
28
+ template:/*html*/`
29
+ <ul>
30
+ <ui-list-item v-for= "item in 5" :key="item" :icon="['far', 'face-smile']" :title="args.title" :kind="args.kind">
31
+ {{ args.title }}
32
+ </ui-list-item>
33
+ </ul>
34
+ `,
37
35
  });
38
36
 
39
37
  export const Default = Template.bind({});
@@ -1,36 +1,56 @@
1
+
1
2
  <template>
2
- <li class="ui-icon-list flex">
3
- <ui-icon
4
- v-if="icon"
5
- class="mr-xs"
6
- :size="ESize.SM"
7
- :icon-name="icon"
3
+ <li class="ui-list-item flex gap-xs relative group">
4
+ <div
5
+ v-if="kind===EListItemTypes.PROGRESS"
6
+ class="ui-list-item__line bg-primary-300 h-full absolute w-xxs left-xs -translate-x-2/4 top-sm group-last:hidden"
8
7
  />
8
+ <div
9
+ class="z-0"
10
+ :class="[kind === EListItemTypes.DEFAULT && 'pb-sm',
11
+ kind === EListItemTypes.COMPACT && 'pb-xs',
12
+ kind === EListItemTypes.PROGRESS &&'pb-md']"
13
+ >
14
+ <ui-icon
15
+ v-if="icon"
16
+ :kind="pickKind"
17
+ class="bg-white text-primary"
18
+ :icon-name="icon"
19
+ :size="ESize.SM"
20
+ />
21
+ </div>
9
22
 
10
- <div>
11
- <ui-typography
23
+ <slot>
24
+ <ui-typography
12
25
  :weight="ETextWeight.SEMI_BOLD"
13
26
  >
14
27
  {{ title }}
15
28
  </ui-typography>
16
- <p
17
- v-if="$slots.default"
18
- class="mt-xs"
19
- >
20
- <slot />
21
- </p>
22
- </div>
29
+ </slot>
23
30
  </li>
24
31
  </template>
25
32
 
26
33
  <script lang="ts" setup>
34
+ import { computed } from "vue";
27
35
  import UiIcon, { type TIconName } from "../ui-icon";
28
- import { ESize } from "../../_types/sizing";
29
36
  import UiTypography, { ETextWeight } from "../ui-typography";
37
+ import { ESize } from "../../_types/sizing";
38
+ import { EListItemTypes } from "./_types";
39
+
40
+ const props = withDefaults(defineProps<{
41
+ icon: TIconName;
42
+ title: string;
43
+ kind?:EListItemTypes;
44
+ }>(), {
45
+ kind: EListItemTypes.DEFAULT
46
+ });
30
47
 
31
- defineProps<{
32
- icon?: TIconName;
33
- title?: string;
34
- }>();
48
+ const pickKind = computed(()=>{
49
+ switch(props.kind){
50
+ case EListItemTypes.COMPACT: return EListItemTypes.COMPACT;
51
+ case EListItemTypes.PROGRESS: return EListItemTypes.PROGRESS;
52
+ default: return EListItemTypes.DEFAULT;
53
+ }
54
+ });
35
55
 
36
56
  </script>
@@ -0,0 +1,11 @@
1
+ export enum EBadgeOrigin {
2
+ DEFAULT = "default",
3
+ OFFSET_TOP_RIGHT = "offset-top-right"
4
+ }
5
+
6
+ export enum ENotificationBadgeSizes {
7
+ DEFAULT = "default",
8
+ SMALL = "sm",
9
+ MEDIUM = "md",
10
+ LARGE = "lg"
11
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from "./ui-notification-badge.vue";
2
+ export { EBadgeOrigin } from "./_types";