next-helios-fe 1.8.48 → 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.48",
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) => {