@delightui/components 0.1.25 → 0.1.27

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.
@@ -82,10 +82,6 @@ export type DatePickerProps = {
82
82
  * @default false
83
83
  */
84
84
  allowInput?: boolean;
85
- /**
86
- * Container element for the calendar when used inside a Popover
87
- */
88
- container?: HTMLElement | null;
89
85
  /**
90
86
  * Custom time picker plugin
91
87
  */
@@ -94,12 +90,14 @@ export type DatePickerProps = {
94
90
  * Custom time picker plugin
95
91
  */
96
92
  customDateTimePickerPlugin?: (config: CustomTimePickerConfig) => Plugin;
93
+ /**
94
+ * Use custom time input same as date picker input
95
+ * This is useful when the datepicker is inline and is re-added to the DOM after closing
96
+ * For example using this inside a Popover as content
97
+ */
98
+ useCustomTimeInputForTimePicker?: boolean;
97
99
  };
98
100
  export type CustomTimePickerConfig = {
99
101
  minuteStep: number;
100
- /**
101
- * Container element for the calendar when used inside a Popover
102
- */
103
- container?: HTMLElement | null;
104
102
  };
105
103
  export {};
@@ -0,0 +1,4 @@
1
+ import { Plugin } from "flatpickr/dist/types/options";
2
+ import { CustomTimePickerConfig } from '../DatePicker.types';
3
+ declare const timeDropdownPlugin: (config: CustomTimePickerConfig) => Plugin;
4
+ export default timeDropdownPlugin;
@@ -15,8 +15,10 @@ export declare const filterDropdownOptions: (dropdown: HTMLDivElement, query: st
15
15
  * Positions the dropdown relative to the input field.
16
16
  * @param dropdown - The dropdown element to position.
17
17
  * @param inputElement - The input element to base the dropdown positioning on.
18
+ * @param wrapperElement - The wrapper element to base the dropdown positioning on. This will take precedence over the input element.
19
+ * @param dropdownPosition - The position of the dropdown. 'fixed' or 'absolute'.
18
20
  */
19
- export declare const positionDropdownRelativeToInput: (dropdown: HTMLDivElement, inputElement: HTMLInputElement) => void;
21
+ export declare const positionDropdownRelativeToInput: (dropdown: HTMLDivElement, inputElement: HTMLInputElement, wrapperElement?: HTMLElement, dropdownPosition?: "fixed" | "absolute") => void;
20
22
  /**
21
23
  * Formats a Date object into a time string (HH:MM AM/PM).
22
24
  * @param date - The Date object to format.
@@ -100,6 +100,11 @@ export type PopoverProps = {
100
100
  * Additional class for overlay container styling.
101
101
  */
102
102
  overlayClassName?: string;
103
+ /**
104
+ * Position of the Popover.
105
+ * @default 'absolute'
106
+ */
107
+ contentPosition?: 'absolute' | 'fixed';
103
108
  };
104
109
  export type PopoverHandle = {
105
110
  close: () => void;
@@ -1461,7 +1461,6 @@ span.flatpickr-weekday {
1461
1461
  .custom-time-wrapper {
1462
1462
  display: flex;
1463
1463
  flex-direction: column;
1464
- position: relative;
1465
1464
  width: 100%;
1466
1465
  margin-top: var(--spacing-large);
1467
1466
  gap: var(--spacing-large);
@@ -1482,11 +1481,15 @@ span.flatpickr-weekday {
1482
1481
  height: auto;
1483
1482
  gap: var(--spacing-medium);
1484
1483
  border-radius: var(--corner-radius-extra-small);
1485
- border: 1px solid var(--border-primary);
1484
+ outline: 1px solid var(--colours-grey-450);
1486
1485
  background: var(--interactive-surface-secondary-default);
1487
1486
  align-items: center;
1488
1487
  padding-left: var(--spacing-medium);
1489
1488
  color: var(--text-primary);
1489
+ position: relative;
1490
+ }
1491
+ .custom-time-input-wrapper:focus-within {
1492
+ outline: 1px solid var(--border-primary);
1490
1493
  }
1491
1494
  .custom-time-input-wrapper .custom-time-input {
1492
1495
  width: 100%;
@@ -1500,15 +1503,40 @@ span.flatpickr-weekday {
1500
1503
  color: var(--text-primary);
1501
1504
  caret-color: var(--text-primary);
1502
1505
  }
1506
+ .custom-time-only-input-wrapper {
1507
+ display: flex;
1508
+ width: 100%;
1509
+ height: auto;
1510
+ gap: var(--spacing-medium);
1511
+ border-radius: var(--corner-radius-extra-small);
1512
+ border: medium none currentcolor;
1513
+ border: initial;
1514
+ background: var(--interactive-surface-secondary-default);
1515
+ align-items: center;
1516
+ padding-left: var(--spacing-medium);
1517
+ color: var(--text-primary);
1518
+ }
1519
+ .custom-time-only-input-wrapper .custom-time-input {
1520
+ width: 100%;
1521
+ font-family: var(--font-family-body);
1522
+ font-size: var(--font-size-body-small);
1523
+ font-weight: 400;
1524
+ line-height: var(--line-height-body-small);
1525
+ text-align: left;
1526
+ padding: var(--spacing-medium);
1527
+ padding-left: 0px;
1528
+ color: var(--text-primary);
1529
+ caret-color: var(--text-primary);
1530
+ }
1503
1531
  .time-dropdown {
1504
1532
  display: flex;
1505
1533
  flex-direction: column;
1506
1534
  z-index: 99999;
1507
1535
  gap: var(--spacing-extra-small);
1508
1536
  color: #fff;
1509
- font-size: var(--font-size-body-small);
1510
- font-family: var(--font-family-body-small);
1511
- line-height: var(--line-height-body-small);
1537
+ font-size: 13px;
1538
+ font-family: var(--font-family-body);
1539
+ line-height: 16px;
1512
1540
  background: var(--surface-background-4);
1513
1541
  outline: 1px solid var(--border-border-grey-3);
1514
1542
  width: 250px;
@@ -1516,6 +1544,7 @@ span.flatpickr-weekday {
1516
1544
  overflow: auto;
1517
1545
  padding: var(--spacing-medium);
1518
1546
  border-radius: var(--corner-radius-extra-small);
1547
+ margin-top: 2px;
1519
1548
  }
1520
1549
  .time-dropdown .dropdown-option {
1521
1550
  align-items: center;