@ikatec/nebula-react 1.0.22 → 1.0.24

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/dist/index.d.mts CHANGED
@@ -589,26 +589,24 @@ interface InputDatePickerSingleProps extends Omit<InputTextProps, 'onChange' | '
589
589
  value?: string;
590
590
  onChange?: (value?: string, calendarDate?: Date) => void;
591
591
  numberOfMonths?: CalendarProps['numberOfMonths'];
592
- portal?: PopoverContentProps['portal'];
593
592
  placeholder?: string;
594
593
  className?: string;
595
594
  disabledDates?: CalendarProps['disabled'];
596
595
  onClean?: VoidFunction;
597
596
  }
598
597
  declare const dateIsAvailable: (inputDate?: Date | null, disabledDates?: InputDatePickerSingleProps["disabledDates"]) => boolean;
599
- declare const InputDatePickerSingle: ({ portal, placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDatePickerSingleProps) => react_jsx_runtime.JSX.Element;
598
+ declare const InputDatePickerSingle: ({ placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDatePickerSingleProps) => react_jsx_runtime.JSX.Element;
600
599
 
601
600
  interface InputDateTimePickerSingleProps extends Omit<InputTextProps, 'onChange' | 'value'> {
602
601
  value?: string;
603
602
  onChange?: (value?: string, calendarDate?: Date, inputTimeValue?: string) => void;
604
603
  numberOfMonths?: CalendarProps['numberOfMonths'];
605
- portal?: PopoverContentProps['portal'];
606
604
  placeholder?: string;
607
605
  className?: string;
608
606
  disabledDates?: CalendarProps['disabled'];
609
607
  onClean?: VoidFunction;
610
608
  }
611
- declare const InputDateTimePickerSingle: ({ portal, placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDateTimePickerSingleProps) => react_jsx_runtime.JSX.Element;
609
+ declare const InputDateTimePickerSingle: ({ placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDateTimePickerSingleProps) => react_jsx_runtime.JSX.Element;
612
610
 
613
611
  type InputTimeProps = Omit<React.ComponentProps<typeof InputText>, 'onChange'> & {
614
612
  onChange?: (value: string) => void;
package/dist/index.d.ts CHANGED
@@ -589,26 +589,24 @@ interface InputDatePickerSingleProps extends Omit<InputTextProps, 'onChange' | '
589
589
  value?: string;
590
590
  onChange?: (value?: string, calendarDate?: Date) => void;
591
591
  numberOfMonths?: CalendarProps['numberOfMonths'];
592
- portal?: PopoverContentProps['portal'];
593
592
  placeholder?: string;
594
593
  className?: string;
595
594
  disabledDates?: CalendarProps['disabled'];
596
595
  onClean?: VoidFunction;
597
596
  }
598
597
  declare const dateIsAvailable: (inputDate?: Date | null, disabledDates?: InputDatePickerSingleProps["disabledDates"]) => boolean;
599
- declare const InputDatePickerSingle: ({ portal, placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDatePickerSingleProps) => react_jsx_runtime.JSX.Element;
598
+ declare const InputDatePickerSingle: ({ placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDatePickerSingleProps) => react_jsx_runtime.JSX.Element;
600
599
 
601
600
  interface InputDateTimePickerSingleProps extends Omit<InputTextProps, 'onChange' | 'value'> {
602
601
  value?: string;
603
602
  onChange?: (value?: string, calendarDate?: Date, inputTimeValue?: string) => void;
604
603
  numberOfMonths?: CalendarProps['numberOfMonths'];
605
- portal?: PopoverContentProps['portal'];
606
604
  placeholder?: string;
607
605
  className?: string;
608
606
  disabledDates?: CalendarProps['disabled'];
609
607
  onClean?: VoidFunction;
610
608
  }
611
- declare const InputDateTimePickerSingle: ({ portal, placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDateTimePickerSingleProps) => react_jsx_runtime.JSX.Element;
609
+ declare const InputDateTimePickerSingle: ({ placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDateTimePickerSingleProps) => react_jsx_runtime.JSX.Element;
612
610
 
613
611
  type InputTimeProps = Omit<React.ComponentProps<typeof InputText>, 'onChange'> & {
614
612
  onChange?: (value: string) => void;
package/dist/index.js CHANGED
@@ -3980,7 +3980,6 @@ var dateIsAvailable = (inputDate, disabledDates) => {
3980
3980
  return !dateIsDisabled(inputDate, disabledDates);
3981
3981
  };
3982
3982
  var InputDatePickerSingle = ({
3983
- portal,
3984
3983
  placeholder,
3985
3984
  className,
3986
3985
  value,
@@ -4058,7 +4057,7 @@ var InputDatePickerSingle = ({
4058
4057
  replacement: { _: /\d/ }
4059
4058
  };
4060
4059
  const inputRef = mask.useMask(maskOptions);
4061
- return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4060
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4062
4061
  /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { className, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4063
4062
  "div",
4064
4063
  {
@@ -4106,10 +4105,13 @@ var InputDatePickerSingle = ({
4106
4105
  /* @__PURE__ */ jsxRuntime.jsx(
4107
4106
  PopoverContent,
4108
4107
  {
4109
- portal,
4110
4108
  side: "bottom",
4111
- className: "nebula-ds p-0 border-none bg-transparent shadow-none",
4109
+ className: "nebula-ds p-0 border-none bg-transparent shadow-none absolute",
4112
4110
  align: "start",
4111
+ collisionPadding: 8,
4112
+ avoidCollisions: true,
4113
+ asChild: false,
4114
+ style: { position: "absolute" },
4113
4115
  children: /* @__PURE__ */ jsxRuntime.jsx(
4114
4116
  Calendar,
4115
4117
  {
@@ -4126,7 +4128,7 @@ var InputDatePickerSingle = ({
4126
4128
  )
4127
4129
  }
4128
4130
  )
4129
- ] });
4131
+ ] }) });
4130
4132
  };
4131
4133
  var InputTime = React8.forwardRef(
4132
4134
  ({ value = "", onChange, placeholder = "--:--", ...rest }, ref) => {
@@ -4196,7 +4198,6 @@ var InputTime = React8.forwardRef(
4196
4198
  InputTime.displayName = "InputTime";
4197
4199
  var DATA_TIME_SEPARATOR = " - ";
4198
4200
  var InputDateTimePickerSingle = ({
4199
- portal,
4200
4201
  placeholder,
4201
4202
  className,
4202
4203
  value,
@@ -4243,9 +4244,21 @@ var InputDateTimePickerSingle = ({
4243
4244
  return;
4244
4245
  }
4245
4246
  const [hour, minutes] = hourSlice.split(":");
4247
+ const padStart = (str, shouldPad = false) => {
4248
+ if (shouldPad) {
4249
+ return str.padStart(2, "0");
4250
+ }
4251
+ return str;
4252
+ };
4246
4253
  const normalizedTime = [
4247
- hour ? Math.min(Math.max(+hour, 0), 23).toString() : "",
4248
- minutes ? Math.min(Math.max(+minutes, 0), 59).toString() : ""
4254
+ hour ? padStart(
4255
+ Math.min(Math.max(+hour, 0), 23).toString(),
4256
+ hour.length === 2
4257
+ ) : "",
4258
+ minutes ? padStart(
4259
+ Math.min(Math.max(+minutes, 0), 59).toString(),
4260
+ minutes.length === 2
4261
+ ) : ""
4249
4262
  ].filter(Boolean).join(":");
4250
4263
  setInnerTimeValue(normalizedTime);
4251
4264
  const [dateStr] = text.split(DATA_TIME_SEPARATOR);
@@ -4298,9 +4311,7 @@ var InputDateTimePickerSingle = ({
4298
4311
  date,
4299
4312
  innerTimeValue
4300
4313
  );
4301
- if (!innerTimeValue) {
4302
- setTimeout(() => inputTimeRef.current?.focus(), 100);
4303
- }
4314
+ setTimeout(() => inputTimeRef.current?.focus(), 100);
4304
4315
  };
4305
4316
  const normalizedCalendarDate = React8.useMemo(() => {
4306
4317
  return dateFns.isValid(innerDate) ? innerDate : void 0;
@@ -4313,7 +4324,7 @@ var InputDateTimePickerSingle = ({
4313
4324
  replacement: { _: /\d/ }
4314
4325
  };
4315
4326
  const inputRef = mask.useMask(maskOptions);
4316
- return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4327
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4317
4328
  /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { className, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4318
4329
  "div",
4319
4330
  {
@@ -4360,10 +4371,13 @@ var InputDateTimePickerSingle = ({
4360
4371
  /* @__PURE__ */ jsxRuntime.jsx(
4361
4372
  PopoverContent,
4362
4373
  {
4363
- portal,
4364
4374
  side: "bottom",
4365
4375
  className: "nebula-ds p-0 border-none bg-transparent shadow-none",
4366
4376
  align: "start",
4377
+ collisionPadding: 8,
4378
+ avoidCollisions: true,
4379
+ asChild: false,
4380
+ style: { position: "absolute" },
4367
4381
  children: /* @__PURE__ */ jsxRuntime.jsx(
4368
4382
  Calendar,
4369
4383
  {
@@ -4396,7 +4410,7 @@ var InputDateTimePickerSingle = ({
4396
4410
  )
4397
4411
  }
4398
4412
  )
4399
- ] });
4413
+ ] }) });
4400
4414
  };
4401
4415
  var FileUploadError = /* @__PURE__ */ ((FileUploadError2) => {
4402
4416
  FileUploadError2["MAX_FILES_EXCEEDED"] = "MAX_FILES_EXCEEDED";
package/dist/index.mjs CHANGED
@@ -3940,7 +3940,6 @@ var dateIsAvailable = (inputDate, disabledDates) => {
3940
3940
  return !dateIsDisabled(inputDate, disabledDates);
3941
3941
  };
3942
3942
  var InputDatePickerSingle = ({
3943
- portal,
3944
3943
  placeholder,
3945
3944
  className,
3946
3945
  value,
@@ -4018,7 +4017,7 @@ var InputDatePickerSingle = ({
4018
4017
  replacement: { _: /\d/ }
4019
4018
  };
4020
4019
  const inputRef = useMask(maskOptions);
4021
- return /* @__PURE__ */ jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4020
+ return /* @__PURE__ */ jsx("div", { className: "nebula-ds w-full", children: /* @__PURE__ */ jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4022
4021
  /* @__PURE__ */ jsx(PopoverTrigger, { className, asChild: true, children: /* @__PURE__ */ jsx(
4023
4022
  "div",
4024
4023
  {
@@ -4066,10 +4065,13 @@ var InputDatePickerSingle = ({
4066
4065
  /* @__PURE__ */ jsx(
4067
4066
  PopoverContent,
4068
4067
  {
4069
- portal,
4070
4068
  side: "bottom",
4071
- className: "nebula-ds p-0 border-none bg-transparent shadow-none",
4069
+ className: "nebula-ds p-0 border-none bg-transparent shadow-none absolute",
4072
4070
  align: "start",
4071
+ collisionPadding: 8,
4072
+ avoidCollisions: true,
4073
+ asChild: false,
4074
+ style: { position: "absolute" },
4073
4075
  children: /* @__PURE__ */ jsx(
4074
4076
  Calendar,
4075
4077
  {
@@ -4086,7 +4088,7 @@ var InputDatePickerSingle = ({
4086
4088
  )
4087
4089
  }
4088
4090
  )
4089
- ] });
4091
+ ] }) });
4090
4092
  };
4091
4093
  var InputTime = forwardRef(
4092
4094
  ({ value = "", onChange, placeholder = "--:--", ...rest }, ref) => {
@@ -4156,7 +4158,6 @@ var InputTime = forwardRef(
4156
4158
  InputTime.displayName = "InputTime";
4157
4159
  var DATA_TIME_SEPARATOR = " - ";
4158
4160
  var InputDateTimePickerSingle = ({
4159
- portal,
4160
4161
  placeholder,
4161
4162
  className,
4162
4163
  value,
@@ -4203,9 +4204,21 @@ var InputDateTimePickerSingle = ({
4203
4204
  return;
4204
4205
  }
4205
4206
  const [hour, minutes] = hourSlice.split(":");
4207
+ const padStart = (str, shouldPad = false) => {
4208
+ if (shouldPad) {
4209
+ return str.padStart(2, "0");
4210
+ }
4211
+ return str;
4212
+ };
4206
4213
  const normalizedTime = [
4207
- hour ? Math.min(Math.max(+hour, 0), 23).toString() : "",
4208
- minutes ? Math.min(Math.max(+minutes, 0), 59).toString() : ""
4214
+ hour ? padStart(
4215
+ Math.min(Math.max(+hour, 0), 23).toString(),
4216
+ hour.length === 2
4217
+ ) : "",
4218
+ minutes ? padStart(
4219
+ Math.min(Math.max(+minutes, 0), 59).toString(),
4220
+ minutes.length === 2
4221
+ ) : ""
4209
4222
  ].filter(Boolean).join(":");
4210
4223
  setInnerTimeValue(normalizedTime);
4211
4224
  const [dateStr] = text.split(DATA_TIME_SEPARATOR);
@@ -4258,9 +4271,7 @@ var InputDateTimePickerSingle = ({
4258
4271
  date,
4259
4272
  innerTimeValue
4260
4273
  );
4261
- if (!innerTimeValue) {
4262
- setTimeout(() => inputTimeRef.current?.focus(), 100);
4263
- }
4274
+ setTimeout(() => inputTimeRef.current?.focus(), 100);
4264
4275
  };
4265
4276
  const normalizedCalendarDate = useMemo(() => {
4266
4277
  return isValid(innerDate) ? innerDate : void 0;
@@ -4273,7 +4284,7 @@ var InputDateTimePickerSingle = ({
4273
4284
  replacement: { _: /\d/ }
4274
4285
  };
4275
4286
  const inputRef = useMask(maskOptions);
4276
- return /* @__PURE__ */ jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4287
+ return /* @__PURE__ */ jsx("div", { className: "nebula-ds w-full", children: /* @__PURE__ */ jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4277
4288
  /* @__PURE__ */ jsx(PopoverTrigger, { className, asChild: true, children: /* @__PURE__ */ jsx(
4278
4289
  "div",
4279
4290
  {
@@ -4320,10 +4331,13 @@ var InputDateTimePickerSingle = ({
4320
4331
  /* @__PURE__ */ jsx(
4321
4332
  PopoverContent,
4322
4333
  {
4323
- portal,
4324
4334
  side: "bottom",
4325
4335
  className: "nebula-ds p-0 border-none bg-transparent shadow-none",
4326
4336
  align: "start",
4337
+ collisionPadding: 8,
4338
+ avoidCollisions: true,
4339
+ asChild: false,
4340
+ style: { position: "absolute" },
4327
4341
  children: /* @__PURE__ */ jsx(
4328
4342
  Calendar,
4329
4343
  {
@@ -4356,7 +4370,7 @@ var InputDateTimePickerSingle = ({
4356
4370
  )
4357
4371
  }
4358
4372
  )
4359
- ] });
4373
+ ] }) });
4360
4374
  };
4361
4375
  var FileUploadError = /* @__PURE__ */ ((FileUploadError2) => {
4362
4376
  FileUploadError2["MAX_FILES_EXCEEDED"] = "MAX_FILES_EXCEEDED";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikatec/nebula-react",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "React components",
5
5
  "publishConfig": {
6
6
  "access": "public"