next-helios-fe 1.8.47 → 1.8.49

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": "next-helios-fe",
3
- "version": "1.8.47",
3
+ "version": "1.8.49",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,6 +8,7 @@ export interface DateProps extends React.InputHTMLAttributes<HTMLInputElement> {
8
8
  label?: string;
9
9
  description?: string;
10
10
  options?: {
11
+ buttonOnly?: boolean;
11
12
  enableSelectRange?: boolean;
12
13
  disablePast?: boolean;
13
14
  disableFuture?: boolean;
@@ -109,30 +110,34 @@ export const Date: React.FC<DateProps> = ({
109
110
  </div>
110
111
  )}
111
112
  <div className="relative flex items-center">
112
- <input
113
- type="text"
114
- className={`w-full ps-4 pe-14 border-default border rounded-md bg-secondary-bg placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-silent focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled ${height}`}
115
- disabled={rest.disabled}
116
- readOnly
117
- value={
118
- dateRangeLabel(tempValue) === "Custom" ||
119
- !options?.enableSelectRange
120
- ? `${
121
- !options?.enableSelectRange
122
- ? ""
123
- : `${
124
- dayjs(tempValue[0]).format("MMM YYYY") ===
125
- dayjs(tempValue[1]).format("MMM YYYY")
126
- ? dayjs(tempValue[0]).format("DD")
127
- : dayjs(tempValue[0]).format("DD MMM YYYY")
128
- } - `
129
- }${dayjs(tempValue[1]).format("DD MMM YYYY")}`
130
- : dateRangeLabel(tempValue)
131
- }
132
- />
113
+ {!options?.buttonOnly && (
114
+ <input
115
+ type="text"
116
+ className={`w-full ps-4 pe-14 border-default border rounded-md bg-secondary-bg placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-silent focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled ${height}`}
117
+ disabled={rest.disabled}
118
+ readOnly
119
+ value={
120
+ dateRangeLabel(tempValue) === "Custom" ||
121
+ !options?.enableSelectRange
122
+ ? `${
123
+ !options?.enableSelectRange
124
+ ? ""
125
+ : `${
126
+ dayjs(tempValue[0]).format("MMM YYYY") ===
127
+ dayjs(tempValue[1]).format("MMM YYYY")
128
+ ? dayjs(tempValue[0]).format("DD")
129
+ : dayjs(tempValue[0]).format("DD MMM YYYY")
130
+ } - `
131
+ }${dayjs(tempValue[1]).format("DD MMM YYYY")}`
132
+ : dateRangeLabel(tempValue)
133
+ }
134
+ />
135
+ )}
133
136
  <button
134
137
  type="button"
135
- className="absolute right-4 p-1 rounded-full text-xl text-disabled cursor-pointer hover:bg-secondary-light"
138
+ className={`rounded-full text-xl hover:bg-secondary-light ${
139
+ options?.buttonOnly ? "p-2" : "absolute right-4 p-1 text-disabled"
140
+ }`}
136
141
  tabIndex={-1}
137
142
  disabled={rest.disabled}
138
143
  onClick={(e) => {
@@ -125,7 +125,7 @@ export const File: React.FC<FileProps> = ({
125
125
  className={`absolute px-4 pointer-events-none ${
126
126
  tempFile.length === 0 &&
127
127
  "text-silent duration-300 translate-x-0 peer-focus/file:translate-x-1"
128
- }`}
128
+ } ${rest.disabled && "text-disabled"}`}
129
129
  >
130
130
  {tempFile[0]?.name ?? rest.placeholder}
131
131
  </span>
@@ -194,7 +194,11 @@ export const File: React.FC<FileProps> = ({
194
194
  }}
195
195
  {...rest}
196
196
  />
197
- <div className="absolute flex flex-col gap-8 justify-center items-center w-full h-full px-4 pointer-events-none">
197
+ <div
198
+ className={`absolute flex flex-col gap-8 justify-center items-center w-full h-full px-4 pointer-events-none ${
199
+ rest.disabled && "text-disabled"
200
+ }`}
201
+ >
198
202
  <div>
199
203
  <Icon
200
204
  icon={
@@ -238,8 +242,8 @@ export const File: React.FC<FileProps> = ({
238
242
  type="button"
239
243
  className={
240
244
  options?.buttonVariant === "button"
241
- ? "hover:text-primary"
242
- : "p-2 rounded-full hover:bg-secondary-light"
245
+ ? `hover:text-primary disabled:text-disabled`
246
+ : `p-2 rounded-full hover:bg-secondary-light disabled:bg-secondary-light disabled:text-disabled`
243
247
  }
244
248
  tabIndex={-1}
245
249
  disabled={rest.disabled}