@dcrackel/hematournamentui 1.0.74 → 1.0.75

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/hematournamentui",
3
3
  "private": false,
4
- "version": "1.0.74",
4
+ "version": "1.0.75",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTouranmentUI-lib.umd.js",
7
7
  "module": "dist/HemaTouranmentUI-lib.es.js",
@@ -94,11 +94,21 @@ export const SquareButton = {
94
94
 
95
95
  export const IconButton = {
96
96
  args: {
97
+ label: '',
97
98
  type: 'iconOnly',
98
99
  iconName: 'fa-check',
99
100
  }
100
101
  };
101
102
 
103
+ export const IconButtonWithIconOnRight = {
104
+ args: {
105
+ label: 'Save',
106
+ type: 'primary',
107
+ iconName: 'fa-check',
108
+ iconLeft: false
109
+ }
110
+ };
111
+
102
112
  export const TabBarButton = {
103
113
  args: {
104
114
  type: 'tabBar',
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <button :class="classes" data-testid="base-button" type="button" @click="handleClick">
3
- <BaseIcon v-if="iconName" :color="textColor" :icon-name="iconName" :size="size" :style="iconStyle" data-testid="base-icon"/>
3
+ <BaseIcon v-if="iconName && iconLeft" :color="textColor" :icon-name="iconName" :size="size" :style="iconStyle" data-testid="base-icon"/>
4
4
  <BaseText :color="textColor" :size="size" :text="label" data-testid="base-text" weight="normal"/>
5
+ <BaseIcon v-if="iconName && !iconLeft" :color="textColor" :icon-name="iconName" :size="size" :style="iconStyle" data-testid="base-icon"/>
5
6
  </button>
6
7
  </template>
7
8
 
@@ -27,6 +28,10 @@ export default {
27
28
  default: 'fa-solid',
28
29
  validator: value => ['fa-solid', 'fa-regular', 'fa-light', 'fa-thing'].includes(value)
29
30
  },
31
+ iconLeft: {
32
+ type: Boolean,
33
+ default: true
34
+ },
30
35
  size: {
31
36
  type: String,
32
37
  default: 'sm',
@@ -54,7 +59,7 @@ export default {
54
59
  tertiary: 'px-2.5 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary ' +
55
60
  (props.selected ? 'bg-primary' : 'bg-tertiary'),
56
61
 
57
- bright: 'px-2.5 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral ' +
62
+ bright: 'px-3 py-1 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral ' +
58
63
  (props.selected ? 'bg-primary' : 'bg-bright'),
59
64
 
60
65
  admin: 'px-2.5 py-2 items-center rounded-md gap-2.5 text-center my-1 text-neutral hover:bg-primaryHighlight ' +
@@ -91,7 +96,7 @@ export default {
91
96
  primary: 'primary',
92
97
  secondary: 'neutral',
93
98
  tertiary: 'tertiary',
94
- bright: 'bright',
99
+ bright: 'neutral',
95
100
  admin: 'neutral',
96
101
  adminSecondary: 'neutral',
97
102
  iconOnly: 'neutral',
@@ -0,0 +1,31 @@
1
+ import PoolFencerCard from './PoolFencerCard.vue';
2
+
3
+ export default {
4
+ title: 'Organisms/Cards/PoolFencerCard',
5
+ component: PoolFencerCard,
6
+ tags: ['autodocs'],
7
+ args: {
8
+ position: 1,
9
+ portrait: 'https://randomuser.me/api/portraits/men/31.jpg',
10
+ name: 'John Doe',
11
+ club: 'Test Club',
12
+ },
13
+ argTypes: {
14
+ position: { control: 'number' },
15
+ portrait: { control: 'text' },
16
+ name: { control: 'text' },
17
+ club: { control: 'text' },
18
+ },
19
+ };
20
+
21
+
22
+ export const Default = {
23
+ args: {
24
+ position: 1,
25
+ portrait: 'https://randomuser.me/api/portraits/men/24.jpg',
26
+ name: 'John Doe',
27
+ club: 'Test Club',
28
+ }
29
+ }
30
+
31
+
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <div class="flex items-center p-2 bg-poolSetup shadow rounded-lg">
3
+ <div class="text-center w-10">
4
+ <BaseText :text="position" />
5
+ </div>
6
+ <div class="w-8 h-8 rounded-md overflow-hidden">
7
+ <div v-if="!portrait" class="w-14 h-14 bg-dropdownSelect flex items-center justify-center">
8
+ <BaseText text="" size="sm" color="neutral" weight="bold"/>
9
+ </div>
10
+ <img :src="portrait" alt="Fencer Portrait" class="w-full h-full object-cover" />
11
+ </div>
12
+ <div class="flex-1 ml-4">
13
+ <BaseText :text="name" size="md" />
14
+ <BaseText :text="club" size="xs" />
15
+ </div>
16
+ <BaseIcon icon-name="fa-grip-dots-vertical" size="2xl" />
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
22
+ import BaseText from "../../../Atoms/Text/BaseText.vue";
23
+
24
+ export default {
25
+ name: 'PoolFencerCard',
26
+ components: {BaseText, BaseIcon},
27
+ props: {
28
+ position: {
29
+ type: Number,
30
+ required: true
31
+ },
32
+ portrait: {
33
+ type: String,
34
+ required: true
35
+ },
36
+ name: {
37
+ type: String,
38
+ required: true
39
+ },
40
+ club: {
41
+ type: String,
42
+ required: true
43
+ }
44
+ }
45
+ }
46
+ </script>
47
+
48
+ <style scoped>
49
+ .cursor-grab {
50
+ cursor: grab;
51
+ }
52
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex flex-row w-full justify-end relative">
2
+ <div class="flex flex-row w-full relative" :class="[alignEnd ? 'justify-end' : '']">
3
3
  <div class="z-10 rounded-lg px-2 py-2 flex flex-row justify-between border border-dropdownSelect" :class="width" @click="handleDropDown()">
4
4
  <BaseText v-if="label.length > 1" :text="label" color="quaternary" size="sm" weight="normal" />
5
5
  <BaseText :text="selectedItem.text" color="secondary" size="sm" weight="normal" />
@@ -40,6 +40,11 @@ export default {
40
40
  type: String,
41
41
  default: 'w-44',
42
42
  required: false
43
+ },
44
+ alignEnd: {
45
+ type: Boolean,
46
+ default: true,
47
+ required: false
43
48
  }
44
49
  },
45
50
  data: () => ({
@@ -0,0 +1,66 @@
1
+ import Pool from './Pool.vue';
2
+ import personsMock from '../../../../mocks/personsMock.js'; // Make sure this path is correct for your project structure
3
+
4
+ export default {
5
+ title: 'Organisms/Containers/Pool',
6
+ component: Pool,
7
+ tags: ['autodocs'],
8
+ args: {
9
+ poolName: 'Pool 1',
10
+ ringName: 'Blue Ring',
11
+ directorName: 'Joe Smith',
12
+ pool: personsMock // Assuming personsMock contains an array of fencers
13
+ },
14
+ argTypes: {
15
+ poolName: {
16
+ control: { type: 'text' },
17
+ description: 'Name of the pool',
18
+ table: {
19
+ type: { summary: 'String' },
20
+ defaultValue: { summary: '' }
21
+ }
22
+ },
23
+ ringName: {
24
+ control: { type: 'text' },
25
+ description: 'Name of the ring',
26
+ table: {
27
+ type: { summary: 'String' },
28
+ defaultValue: { summary: '' }
29
+ }
30
+ },
31
+ directorName: {
32
+ control: { type: 'text' },
33
+ description: 'Name of the director',
34
+ table: {
35
+ type: { summary: 'String' },
36
+ defaultValue: { summary: '' }
37
+ }
38
+ },
39
+ pool: {
40
+ control: { type: 'array' },
41
+ description: 'List of persons in the pool',
42
+ table: {
43
+ type: { summary: 'Array' },
44
+ defaultValue: { summary: '[]' }
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+ export const Default = {
51
+ args: {
52
+ poolName: 'Pool 1',
53
+ ringName: 'Blue Ring',
54
+ directorName: 'Joe Smith',
55
+ pool: personsMock
56
+ }
57
+ };
58
+
59
+ export const EmptyPool = {
60
+ args: {
61
+ poolName: 'Pool 1',
62
+ ringName: 'Blue Ring',
63
+ directorName: 'Joe Smith',
64
+ pool: []
65
+ }
66
+ };
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <div class="p-4 bg-neutral rounded-lg shadow-md border border-dropdownSelect">
3
+
4
+ <div class="flex flex-row justify-between">
5
+ <h2 class="text-xl font-bold mb-2 flex">
6
+ <BaseText :text="`${poolName} - ${ringName}`" size="lg" color="primary" weight="bold" class="p-2"/>
7
+ </h2>
8
+ <div class="bg-eventBoxBlue w-40 h-10 rounded-lg flex flex-row border border-dropdownSelect">
9
+ <BaseText text="STRENGTH" size="xs" color="quinary" weight="bold" class="pt-3 pl-3"/>
10
+ <BaseText :text="strInd" size="2xl" color="primaryHighlight" weight="bold" class="pt-1 pl-2"/>
11
+ <BaseIcon icon-name="fa-circle-info" size="2xl" color="quinary" class="pt-1 pl-3"/>
12
+ </div>
13
+ </div>
14
+
15
+ <div class="text-md mb-4 ml-2 w-full ">
16
+ <BaseText text="Director" size="md" color="primary" weight=""/>
17
+ <DropDownMenu :label="'label'" :items="[]" :selectedItem="{}" width="w-full" class="mt-1 pr-1" :alignEnd="false" @update:selectedItem="handleSelectedItem"/>
18
+ </div>
19
+ <div class="grid grid-cols-1 gap-4">
20
+ <PoolFencerCard v-for="(person, index) in pool" :key="person.id"
21
+ :position="index+1"
22
+ :name="person.Person.FirstName + ' ' + person.Person.LastName"
23
+ :club="person.Person.Club.Name"
24
+ :portrait="portraitURL(person)"
25
+ />
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import PoolFencerCard from '../../Cards/PoolFencerCard/PoolFencerCard.vue';
32
+ import BaseText from "../../../Atoms/Text/BaseText.vue";
33
+ import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
34
+ import DropDownMenu from "../../ComplexInputs/DropDown/DropDownMenu.vue";
35
+
36
+ export default {
37
+ name: 'Pool',
38
+ components: {
39
+ DropDownMenu,
40
+ BaseIcon,
41
+ BaseText,
42
+ PoolFencerCard
43
+ },
44
+ props: {
45
+ poolName: {
46
+ type: String,
47
+ required: true
48
+ },
49
+ ringName: {
50
+ type: String,
51
+ required: true
52
+ },
53
+ directorName: {
54
+ type: String,
55
+ required: true
56
+ },
57
+ pool: {
58
+ type: Array,
59
+ required: true
60
+ }
61
+ },
62
+ data() {
63
+ return {
64
+ strInd: '-2'
65
+ };
66
+ },
67
+ methods: {
68
+ portraitURL(person) {
69
+ const images = person.Person.Images || [];
70
+ const portrait = images.find(image => image.Type === 'Portrait');
71
+ return portrait ? portrait.URL : '';
72
+ },
73
+ }
74
+ };
75
+ </script>