hds-web 0.1.8 → 0.1.10

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": "hds-web",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -16,6 +16,7 @@
16
16
  "react": "^17.0.1",
17
17
  "react-dom": "^17.0.1",
18
18
  "react-scripts": "5.0.1",
19
+ "uuid": "^9.0.0",
19
20
  "web-vitals": "^2.1.4",
20
21
  "yarn": "^1.22.19"
21
22
  },
@@ -16,20 +16,20 @@ const ANIMATED_ARR_CLASSES = {
16
16
 
17
17
  }
18
18
 
19
-
20
19
  const Buttonclasses = {
21
20
  'primary': {
22
21
  'default': {
23
22
  'base': 'db:w-fit tb:w-fit w-full justify-center justify-center bg-blue-500 text-neutral-0',
24
- 'hover': 'hover:bg-blue-700 hover:text-neutral-0',
25
- 'focus': 'focus:bg-blue-600 focus:shadow-[0_0px_0px_4px_#80A3FF] focus:text-neutral-0 focus:outline-none',
23
+ 'hover': 'hover:bg-blue-700 hover:text-neutral-0 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:delay-300 hover:duration-300',
24
+ 'focus': 'focus:bg-blue-600 focus:shadow-[0_0px_0px_4px_#DFE8FF] focus:text-neutral-0 focus:outline-none active:bg-blue-600 active:text-neutral-0 active:outline-none',
25
+
26
26
  },
27
27
  'disabled': 'bg-neutral-200 text-neutral-400',
28
28
  },
29
29
  'tonal': {
30
30
  'default': {
31
31
  'base': 'db:w-fit tb:w-fit w-full justify-center bg-blue-100 text-blue-600',
32
- 'hover': 'hover:bg-blue-200 hover:text-blue-600',
32
+ 'hover': 'hover:bg-blue-200 hover:text-blue-600 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:delay-300 hover:duration-300',
33
33
  'focus': 'focus:bg-blue-100 focus:text-blue-600 focus:shadow-[0px_0px_0px_4px_#DFE8FF] focus:outline-none',
34
34
  },
35
35
  'disabled': 'bg-neutral-200 text-neutral-400',
@@ -38,9 +38,9 @@ const Buttonclasses = {
38
38
  'default': {
39
39
  'base': 'db:w-fit tb:w-fit w-full justify-center border-2 border-blue-500 bg-neutral-0 text-blue-500',
40
40
 
41
- 'hover': 'hover:text-neutral-800 hover:bg-blue-200 hover:border-2 hover:border-blue-500 hover:shadow hover:text-blue-500',
41
+ 'hover': 'hover:text-neutral-0 hover:bg-blue-700 hover:border-2 hover:border-blue-700 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:delay-100 hover:duration-300',
42
42
 
43
- 'focus': 'focus:bg-blue-200 focus:text-neutral-800 focus:border-2 border-blue-500 focus:shadow-[0px_0px_0px_4px_#DFE8FF] focus:outline-none focus:text-blue-500',
43
+ 'focus': 'focus:bg-blue-200 focus:text-blue-500 focus:border-2 border-blue-500 focus:shadow-[0px_0px_0px_4px_#DFE8FF] focus:outline-none focus:text-blue-500',
44
44
  },
45
45
  'disabled': 'bg-neutral-200 text-neutral-400',
46
46
  },
@@ -54,17 +54,17 @@ const Buttonclasses = {
54
54
  },
55
55
  'primaryLink': {
56
56
  'default': {
57
- 'base': 'db:w-fit tb:w-fit w-full justify-center text-blue-600',
58
- 'hover': 'hover:text-blue-700',
59
- 'focus': 'focus:text-blue-700 focus:outline-none',
57
+ 'base': 'db:w-fit tb:w-fit w-full justify-center text-blue-500',
58
+ 'hover': 'hover:text-blue-600',
59
+ 'focus': 'focus:shadow-[0px_0px_0px_4px_#DFE8FF] focus:outline-none focus:text-blue-600',
60
60
  },
61
61
  'disabled': 'text-neutral-300',
62
62
  },
63
63
  'secondaryLink': {
64
64
  'default': {
65
65
  'base': 'db:w-fit tb:w-fit w-full justify-center text-neutral-800',
66
- 'hover': 'hover:text-neutral-900 hover:underline',
67
- 'focus': 'focus:text-neutral-900 focus:underline focus:outline-none',
66
+ 'hover': 'hover:text-neutral-900 ',
67
+ 'focus': 'focus:text-neutral-900 focus:outline-none focus:shadow-[0px_0px_0px_4px_#E5E7EB]',
68
68
  },
69
69
  'disabled': 'text-neutral-300',
70
70
  },
@@ -72,14 +72,29 @@ const Buttonclasses = {
72
72
  'default': {
73
73
  'base': 'w-fit justify-center justify-center bg-blue-200 rounded-full p-1.5',
74
74
 
75
- 'hover': 'hover:bg-blue-600 hover:shadow',
75
+ 'hover': 'hover:bg-blue-600 hover:shadow-md hover:shadow hover:transition-all hover:ease-out hover:delay-300 hover:duration-300',
76
76
 
77
77
  'focus': 'focus:bg-blue-600 focus:shadow-[0_0px_0px_4px_#DFE8FF] focus:text-neutral-0 focus:outline-none',
78
78
  },
79
79
  'disabled': 'bg-neutral-200 text-neutral-400',
80
+ 'icon':{
81
+ 'sm':'h-5 w-5 p-0',
82
+ 'md': 'h-5 w-5 p-2.5',
83
+ 'lg': 'h-6 w-6 p-3'
84
+ },
80
85
  },
81
-
82
-
86
+ 'buttonSizes' : {
87
+ 'default': {
88
+ 'sm': 'text-hds-d-body3c-medium py-1.5 pr-2.5 pl-4 rounded-full',
89
+ 'md': 'text-hds-d-body3c-medium rounded-full py-2.5 pl-5 pr-3',
90
+ 'lg': 'text-hds-d-body1c-medium rounded-full py-3 pl-6 pr-4'
91
+ },
92
+ 'iconOnly': {
93
+ 'sm': 'rounded-full',
94
+ 'md': 'rounded-full p-2.5',
95
+ 'lg': 'trounded-full p-3'
96
+ }
97
+ }
83
98
  }
84
99
  export default function Button(props) {
85
100
  const {
@@ -93,6 +108,7 @@ export default function Button(props) {
93
108
  label,
94
109
  rightAnimatedArrow,
95
110
  rightAnimatedArrowColor,
111
+ animatedHoverStroke,
96
112
  className,
97
113
  ...rest // destructuring rest of the props
98
114
  } = props
@@ -108,11 +124,14 @@ export default function Button(props) {
108
124
  defaultClasses = Buttonclasses[type][state];
109
125
  }
110
126
 
127
+ let sizeType = 'default';
128
+ if(type=='iconOnly'){sizeType='iconOnly'}
129
+
130
+
111
131
  const buttonClasses = [
112
132
  'inline-flex items-center',
113
- 'hover:shadow',
114
133
  'rounded-full',
115
- `button-${size}`,
134
+ Buttonclasses['buttonSizes'][`${sizeType}`][`${size}`],
116
135
  'group',
117
136
  defaultClasses,
118
137
  className
@@ -126,23 +145,29 @@ export default function Button(props) {
126
145
  className={buttonClasses}
127
146
  {...rest}
128
147
  >
129
- {leftIconVariant && leftIconVariant !== 'none' && (
130
- <div className='-ml-0.5 mr-2 h-4 w-4 '>
148
+ {leftIconVariant && leftIconVariant !== 'none' && type!='iconOnly' && (
149
+ <div className={`-ml-0.5 mr-2 ${ANIMATED_ARR_CLASSES['icon1'][`${size}`]} `}>
131
150
  <Icon variant={leftIconVariant} strokeColor={leftIconColor} />
132
151
  </div>
133
152
  )}
153
+
154
+ {leftIconVariant && leftIconVariant !== 'none' && type=='iconOnly' && (
155
+ <div className={`${ANIMATED_ARR_CLASSES['icon1'][`${size}`]} `}>
156
+ <Icon variant={leftIconVariant} height='group-active:stroke-neutral-0 group-hover:transition-all group-hover:ease-out group-hover:delay-300 group-hover:duration-300 group-hover:stroke-neutral-0 group-focus:stroke-neutral-0' strokeColor={leftIconColor} />
157
+ </div>
158
+ )}
134
159
  {label}
135
160
 
136
- {rightAnimatedArrow && rightAnimatedArrow !== 'none' && (
137
- <div className=' hover:transition-all '>
138
- <Icon className='z-10 stroke-[1.5px] group-hover:translate-x-[0.15rem] group-hover:transition-all' height={`${ANIMATED_ARR_CLASSES['icon1'][`${size}`]}`} variant={'chevronright'} strokeColor={rightAnimatedArrowColor} />
161
+ {rightAnimatedArrow && rightAnimatedArrow !== 'none' && type!='iconOnly' && (
162
+ <div className={ `group-hover:transition-all ${animatedHoverStroke}`}>
163
+ <Icon className='z-10 stroke-2 group-hover:translate-x-[0.15rem] group-hover:transition-all group-hover:duration-300' height={`${ANIMATED_ARR_CLASSES['icon1'][`${size}`]} ${animatedHoverStroke}`} variant={'chevronright'} strokeColor={rightAnimatedArrowColor} />
139
164
 
140
- <Icon className='invisible stroke-[1.5px] group-hover:transition-all group-hover:delay-100 group-hover:visible' height={`${ANIMATED_ARR_CLASSES['icon2'][`${size}`]}`} variant='minus01' strokeColor={rightAnimatedArrowColor} />
165
+ <Icon className='invisible stroke-2 group-hover:transition-all group-hover:delay-300 group-hover:visible ' height={`${ANIMATED_ARR_CLASSES['icon2'][`${size}`]} ${animatedHoverStroke}`} variant='minus01' strokeColor={rightAnimatedArrowColor} />
141
166
 
142
167
  </div>
143
168
  )}
144
169
 
145
- {rightIconVariant && rightIconVariant !== 'none' && (
170
+ {rightIconVariant && rightIconVariant !== 'none' && type!='iconOnly' && (
146
171
  <div className='ml-1.5 h-4 w-4 '>
147
172
  <Icon variant={rightIconVariant} strokeColor={rightIconColor} />
148
173
  </div>
@@ -150,7 +175,6 @@ export default function Button(props) {
150
175
  </button>
151
176
  </div>
152
177
  );
153
-
154
178
  };
155
179
 
156
180
  Button.propTypes = {
@@ -159,7 +183,9 @@ Button.propTypes = {
159
183
  type: PropTypes.string.isRequired,
160
184
  state: PropTypes.oneOf(['default', 'disabled']),
161
185
  leftIconVariant: PropTypes.string,
162
- rightIconVariant: PropTypes.string
186
+ rightIconVariant: PropTypes.string,
187
+ animatedHoverStroke: PropTypes.string
188
+
163
189
 
164
190
  };
165
191
 
@@ -169,6 +195,7 @@ Button.defaultProps = {
169
195
  leftIconVariant: 'home03',
170
196
  rightIconVariant: 'home3',
171
197
  rightIconColor: '#80ff00',
172
- leftIconColor: '#80ff00'
198
+ leftIconColor: '#80ff00',
199
+ animatedHoverStroke:''
173
200
 
174
201
  };
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { v4 as uuidv4 } from 'uuid';
2
3
  export default function TableA(props) {
3
4
  const {
4
5
  head,
@@ -42,10 +43,10 @@ export default function TableA(props) {
42
43
  </thead>
43
44
  <tbody className="divide-y divide-gray-200 bg-white">
44
45
  {tableValue.map((person) => (
45
- <tr key={person.email}>
46
+ <tr key={uuidv4()}>
46
47
  {Object.keys(person).map((key) => (
47
48
  <td
48
- key={key}
49
+ key={uuidv4()}
49
50
  className=" py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-3"
50
51
  >
51
52
  {``}{person[key]}