@delightui/components 0.1.10 → 0.1.12

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/cjs/App.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
2
  import './resources/themes/base.css';
3
- import './resources/themes/light.css';
4
- import './resources/themes/dark.css';
5
3
  declare function App(): React.JSX.Element;
6
4
  export default App;
@@ -1,9 +1,15 @@
1
1
  import type { HTMLAttributes, ReactNode, MouseEvent } from 'react';
2
2
  export type ButtonTypeEnum = 'Filled' | 'Outlined' | 'Ghost';
3
+ export type ButtonAppearanceEnum = 'Default' | 'Inverse';
3
4
  export type ButtonStyleEnum = 'Primary' | 'Secondary' | 'Destructive';
4
5
  export type ButtonSizeEnum = 'Small' | 'Medium' | 'Large';
5
6
  export type ButtonActionTypeEnum = 'button' | 'submit' | 'reset';
6
7
  export type ButtonProps = Omit<HTMLAttributes<HTMLButtonElement>, 'style'> & {
8
+ /**
9
+ * Appearance of the button.
10
+ * @default 'Default'
11
+ */
12
+ appearance?: ButtonAppearanceEnum;
7
13
  /**
8
14
  * Type of the button.
9
15
  * @default 'Filled'
@@ -1,8 +1,14 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ButtonProps } from '../Button/Button.types';
3
+ export type IconButtonAppearanceEnum = 'Default' | 'Inverse';
3
4
  export type IconButtonStyleEnum = 'Primary' | 'Secondary';
4
5
  export type IconButtonSizeEnum = 'Small' | 'Medium';
5
6
  export interface IconButtonProps extends Omit<ButtonProps, 'leadingIcon' | 'trailingIcon' | 'style' | 'size'> {
7
+ /**
8
+ * Appearance of the button.
9
+ * @default 'Default'
10
+ */
11
+ appearance?: IconButtonAppearanceEnum;
6
12
  /**
7
13
  * The icon to be displayed.
8
14
  */
@@ -73,5 +73,13 @@ export type DatePickerProps = {
73
73
  * this function will be used to parse initial date string and date string from input field.
74
74
  */
75
75
  parseDate?: (date: string) => Date;
76
+ /**
77
+ * Allow user to type date/time in input.
78
+ * @default false
79
+ */
80
+ allowInput?: boolean;
81
+ };
82
+ export type CustomTimePickerConfig = {
83
+ minuteStep: number;
76
84
  };
77
85
  export {};
@@ -0,0 +1,4 @@
1
+ import { Plugin } from "flatpickr/dist/types/options";
2
+ import { CustomTimePickerConfig } from "../DatePicker.types";
3
+ declare const dateTimeDropdownPlugin: (config: CustomTimePickerConfig) => Plugin;
4
+ export default dateTimeDropdownPlugin;
@@ -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;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Creates a dropdown element with a specific className.
3
+ * @param className - The class to add to the dropdown element.
4
+ * @returns The created dropdown element.
5
+ */
6
+ export declare const createDropdownElement: (className: string) => HTMLDivElement;
7
+ /**
8
+ * Filters the dropdown options based on the query string.
9
+ * @param dropdown - The dropdown element to populate.
10
+ * @param query - The query string to filter options by.
11
+ * @param options - Array of string options to display in the dropdown.
12
+ */
13
+ export declare const filterDropdownOptions: (dropdown: HTMLDivElement, query: string, options: string[], handleTimeOptionClick: (option: string) => void, closeDropdown?: () => void) => void;
14
+ /**
15
+ * Positions the dropdown relative to the input field.
16
+ * @param dropdown - The dropdown element to position.
17
+ * @param inputElement - The input element to base the dropdown positioning on.
18
+ */
19
+ export declare const positionDropdownRelativeToInput: (dropdown: HTMLDivElement, inputElement: HTMLInputElement) => void;
20
+ /**
21
+ * Formats a Date object into a time string (HH:MM AM/PM).
22
+ * @param date - The Date object to format.
23
+ * @returns The formatted time string (e.g., "12:00 PM").
24
+ */
25
+ export declare const formatTime: (date: Date) => string;
26
+ /**
27
+ * Toggles the visibility of a dropdown element.
28
+ * @param dropdown - The dropdown element to show or hide.
29
+ * @param isVisible - A boolean indicating whether the dropdown should be visible.
30
+ */
31
+ export declare const toggleDropdownVisibility: (dropdown: HTMLDivElement, isVisible: boolean) => void;
32
+ export declare const generateTimeOptions: (minuteStep: number) => string[];