@delightui/components 0.1.103 → 0.1.105

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.
Files changed (26) hide show
  1. package/dist/cjs/components/molecules/Popover/Popover.presenter.d.ts +26 -0
  2. package/dist/cjs/components/molecules/Select/Option/Option.types.d.ts +6 -0
  3. package/dist/cjs/components/molecules/Select/Select.Context.d.ts +1 -1
  4. package/dist/cjs/components/molecules/Select/Select.d.ts +5 -5
  5. package/dist/cjs/components/molecules/Select/Select.presenter.d.ts +1 -0
  6. package/dist/cjs/components/molecules/Select/Select.types.d.ts +5 -0
  7. package/dist/cjs/components/molecules/Select/index.d.ts +2 -9
  8. package/dist/cjs/components/organisms/Form/Form.types.d.ts +1 -0
  9. package/dist/cjs/components/utils/accessibilityUtils.d.ts +41 -0
  10. package/dist/cjs/components/utils/index.d.ts +2 -0
  11. package/dist/cjs/library.js +3 -3
  12. package/dist/cjs/library.js.map +1 -1
  13. package/dist/esm/components/molecules/Popover/Popover.presenter.d.ts +26 -0
  14. package/dist/esm/components/molecules/Select/Option/Option.types.d.ts +6 -0
  15. package/dist/esm/components/molecules/Select/Select.Context.d.ts +1 -1
  16. package/dist/esm/components/molecules/Select/Select.d.ts +5 -5
  17. package/dist/esm/components/molecules/Select/Select.presenter.d.ts +1 -0
  18. package/dist/esm/components/molecules/Select/Select.types.d.ts +5 -0
  19. package/dist/esm/components/molecules/Select/index.d.ts +2 -9
  20. package/dist/esm/components/organisms/Form/Form.types.d.ts +1 -0
  21. package/dist/esm/components/utils/accessibilityUtils.d.ts +41 -0
  22. package/dist/esm/components/utils/index.d.ts +2 -0
  23. package/dist/esm/library.js +3 -3
  24. package/dist/esm/library.js.map +1 -1
  25. package/dist/index.d.ts +51 -12
  26. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ImgHTMLAttributes, SyntheticEvent, HTMLAttributes, ReactNode, MouseEvent, FormHTMLAttributes, Ref, InputHTMLAttributes, TextareaHTMLAttributes, LiHTMLAttributes, CSSProperties, RefObject, TableHTMLAttributes, TdHTMLAttributes } from 'react';
3
+ import React__default, { ImgHTMLAttributes, SyntheticEvent, HTMLAttributes, ReactNode, MouseEvent, FormHTMLAttributes, Ref, InputHTMLAttributes, TextareaHTMLAttributes, LiHTMLAttributes, CSSProperties, RefObject, TableHTMLAttributes, TdHTMLAttributes, AriaRole, KeyboardEventHandler } from 'react';
4
4
  import { LinkProps } from 'react-router-dom';
5
5
  import { Plugin } from 'flatpickr/dist/types/options';
6
6
  import FlatPickr from 'react-flatpickr';
@@ -302,6 +302,7 @@ type FormContextValues<T extends FormState = FormState> = {
302
302
  onFormSubmit: React__default.FormEventHandler<HTMLFormElement>;
303
303
  updateFieldValidators: (name: keyof T, validate?: FieldValidationFunction) => void;
304
304
  updateRequiredFields: (name: keyof T, required?: boolean) => void;
305
+ resetForm: () => void;
305
306
  };
306
307
  type FormProviderProps<T extends FormState = FormState> = {
307
308
  formRef?: Ref<HTMLFormElement>;
@@ -1740,6 +1741,12 @@ type OptionProps = LiHTMLAttributes<HTMLLIElement> & {
1740
1741
  * Children elements or text content of the option.
1741
1742
  */
1742
1743
  children?: ReactNode;
1744
+ /**
1745
+ * Indicates if the option is selected.
1746
+ * For internal use, not to be set by the user.
1747
+ * @default false
1748
+ */
1749
+ closeSelectOptions?: () => void;
1743
1750
  };
1744
1751
 
1745
1752
  /**
@@ -1794,6 +1801,11 @@ type SelectProviderProps = ControlledFormComponentProps<FieldValue> & {
1794
1801
  * @default false
1795
1802
  */
1796
1803
  hasDefaultOption?: boolean;
1804
+ /**
1805
+ * Function to close the select options menu.
1806
+ * @param value - The new selected value.
1807
+ */
1808
+ closeSelectOptions?: () => void;
1797
1809
  };
1798
1810
  /**
1799
1811
  * Enum representing different states of the Select component.
@@ -1866,6 +1878,15 @@ type SelectViewProps = Omit<HTMLAttributes<HTMLElement>, 'style' | 'children' |
1866
1878
  */
1867
1879
  type SelectProps = Omit<SelectProviderProps, 'children'> & SelectViewProps;
1868
1880
 
1881
+ /**
1882
+ * Select component that wraps SelectComponent with SelectProvider.
1883
+ * Provides state management and context to SelectComponent.
1884
+ *
1885
+ * @param props - Props for configuring the Select component.
1886
+ * @returns JSX element that renders the SelectComponent wrapped with SelectProvider.
1887
+ */
1888
+ declare const Select: (props: SelectProps) => JSX.Element;
1889
+
1869
1890
  /**
1870
1891
  * Custom hook to use the SelectContext values.
1871
1892
  * Throws an error if used outside of a SelectProvider.
@@ -1881,16 +1902,7 @@ declare const useSelectContext: () => SelectContextType;
1881
1902
  * @param props - Props for configuring the SelectProvider.
1882
1903
  * @returns JSX element that provides context to its children.
1883
1904
  */
1884
- declare const SelectProvider: ({ children, value, multiple, disabled, invalid, onValueChange, }: SelectProviderProps) => react_jsx_runtime.JSX.Element;
1885
-
1886
- /**
1887
- * Select component that wraps SelectComponent with SelectProvider.
1888
- * Provides state management and context to SelectComponent.
1889
- *
1890
- * @param props - Props for configuring the Select component.
1891
- * @returns JSX element that renders the SelectComponent wrapped with SelectProvider.
1892
- */
1893
- declare const Select: (props: SelectProps) => JSX.Element;
1905
+ declare const SelectProvider: ({ children, value, multiple, disabled, invalid, onValueChange, closeSelectOptions, }: SelectProviderProps) => react_jsx_runtime.JSX.Element;
1894
1906
 
1895
1907
  type ChipListItemTypeEnum = 'chip' | 'input';
1896
1908
  type ChipListItemProps = {
@@ -2210,6 +2222,33 @@ type RenderStateViewProps<T = unknown, P = any> = {
2210
2222
 
2211
2223
  declare const RenderStateView: <T = unknown, P = any>(props: RenderStateViewProps<T, P>) => react_jsx_runtime.JSX.Element;
2212
2224
 
2225
+ type ArrowDirectionEnum = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';
2226
+ type AccessibilityActions = {
2227
+ onClick?: (event?: SyntheticEvent) => void;
2228
+ onTab?: (forward: boolean) => void;
2229
+ onEsc?: () => void;
2230
+ onArrowNavigation?: (direction: ArrowDirectionEnum) => void;
2231
+ };
2232
+ type AccessibilityProps = {
2233
+ tabIndex?: number;
2234
+ role?: AriaRole;
2235
+ onKeyDown?: KeyboardEventHandler<unknown>;
2236
+ };
2237
+ /**
2238
+ * Generates accessibility properties for clickable elements.
2239
+ * @param {boolean} [addIndex] -
2240
+ * @param {AriaRole} [role='button'] - ARIA role attribute to be assigned to the element.
2241
+ * @returns {AccessibilityProps}
2242
+ */
2243
+ declare const getClickAccessibilityProps: (params: {
2244
+ /** Object containing action handlers for various key events. */
2245
+ actions: AccessibilityActions;
2246
+ /** If true, sets the tabIndex to 0 to make the element focusable. */
2247
+ addIndex?: boolean;
2248
+ /** Accessibility properties including ARIA role and key event handlers. */
2249
+ role?: AriaRole;
2250
+ }) => AccessibilityProps;
2251
+
2213
2252
  /**
2214
2253
  * Clones valid React elements and applies additional props to them.
2215
2254
  *
@@ -2280,4 +2319,4 @@ declare const NotificationContext: React__default.Context<NotificationContextVal
2280
2319
  declare const NotificationProvider: React__default.FC<NotificationProviderProps>;
2281
2320
  declare const useNotification: () => NotificationContextValue;
2282
2321
 
2283
- export { Accordion, AccordionDetails, AccordionGroup, AccordionSummary, ActionCard, type ActionCardProps, ActionImage, type ActionImageProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Breakpoint, type BreakpointProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Card, type CardProps, Checkbox, CheckboxItem, type CheckboxItemProps, type CheckboxLabelAlignmentEnum, type CheckboxProps, type CheckboxSizeEnum, type CheckboxTypeEnum, Chip, _default as ChipInput, type ChipInputProps, type ChipListItemProps, type ChipListItemTypeEnum, type ChipProps, ConditionalView, type ConditionalViewProps, ContextMenu, type ContextMenuProps, type CustomTimePickerConfig, CustomToggle, type CustomToggleProps, DatePicker, type DatePickerProps, SortableItem as DraggableItem, SortableTrigger as DraggableItemTrigger, Dropzone, DropzoneClear, DropzoneContent, type DropzoneContentProps, type DropzoneContentTypeEnum, DropzoneFilename, DropzoneFilename as DropzonePreview, type DropzoneProps, DropzoneSupportedFormats as DropzoneReject, DropzoneTrigger as DropzoneRoot, DropzoneSupportedFormats, DropzoneTrigger, type FieldValidationFunction, type FieldValidators, type FieldValue, Form, type FormContextValues, type FormErrors, FormField, type FormFieldProps, type FormProps, type FormProviderProps, type FormState, type FormStateChangeHandler, type FormSubmitHandler, type FormValidator, Grid, GridItem, type GridItemProps, GridList, type GridListProps, type GridProps, Icon, IconButton, type IconButtonProps, type IconButtonStyleEnum, type IconProps, type IconSizeEnum, type IconStyleEnum, Image, type ImageFitEnum, type ImageProps, Input, type InputProps, type InputTypeEnum, List, ListItem, type ListItemProps$1 as ListItemProps, type ListProps, Modal, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, Nav, NavItem, type NavItemProps, NavLink, type NavLinkProps, type NavProps, type NotificationContainerProps, NotificationContext, NotificationProvider, Option, type OptionProps, type OverlayDirectionEnum, Pagination, PaginationNumberField, type PaginationNumberFieldProps, type PaginationProps, Password, Popover, type PopoverHandle, type PopoverProps, ProgressBar, type ProgressBarProps, RadioButton, RadioButtonItem, type RadioButtonItemProps, type RadioButtonLabelAlignmentEnum, type RadioButtonProps, type RadioButtonSizeEnum, RenderStateView, type RenderStateViewProps, RepeaterList, type RepeaterListProps, type RequiredFields, ResponsiveComponent, type ResponsiveComponentProps, Select, SelectListItem, type SelectListItemProps, type SelectProps, SelectProvider, SlideOutPanel, type SlideOutPanelDirectionEnum, type SlideOutPanelProps, type SlideOutPanelSizeEnum, Slider, type SliderProps, Spinner, type SpinnerProps, TabContent, type TabContentProps, TabItem, type TabItemProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextDecorationEnum, type TextProps, type TextTypeEnum, type TextWeightEnum, ThemeContext, type ThemeContextType, ThemeProvider, type ThemeProviderProps, Toggle, ToggleButton, type ToggleButtonProps, type ToggleLabelAlignmentEnum, type ToggleProps, Tooltip, type TooltipProps, WrapTextNodes, type WrapTextNodesProps, applyPropsToChildren, mergeRefs, useDropzoneContext, useNotification, useSelectContext, useTab };
2322
+ export { type AccessibilityActions, type AccessibilityProps, Accordion, AccordionDetails, AccordionGroup, AccordionSummary, ActionCard, type ActionCardProps, ActionImage, type ActionImageProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Breakpoint, type BreakpointProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Card, type CardProps, Checkbox, CheckboxItem, type CheckboxItemProps, type CheckboxLabelAlignmentEnum, type CheckboxProps, type CheckboxSizeEnum, type CheckboxTypeEnum, Chip, _default as ChipInput, type ChipInputProps, type ChipListItemProps, type ChipListItemTypeEnum, type ChipProps, ConditionalView, type ConditionalViewProps, ContextMenu, type ContextMenuProps, type CustomTimePickerConfig, CustomToggle, type CustomToggleProps, DatePicker, type DatePickerProps, SortableItem as DraggableItem, SortableTrigger as DraggableItemTrigger, Dropzone, DropzoneClear, DropzoneContent, type DropzoneContentProps, type DropzoneContentTypeEnum, DropzoneFilename, DropzoneFilename as DropzonePreview, type DropzoneProps, DropzoneSupportedFormats as DropzoneReject, DropzoneTrigger as DropzoneRoot, DropzoneSupportedFormats, DropzoneTrigger, type FieldValidationFunction, type FieldValidators, type FieldValue, Form, type FormContextValues, type FormErrors, FormField, type FormFieldProps, type FormProps, type FormProviderProps, type FormState, type FormStateChangeHandler, type FormSubmitHandler, type FormValidator, Grid, GridItem, type GridItemProps, GridList, type GridListProps, type GridProps, Icon, IconButton, type IconButtonProps, type IconButtonStyleEnum, type IconProps, type IconSizeEnum, type IconStyleEnum, Image, type ImageFitEnum, type ImageProps, Input, type InputProps, type InputTypeEnum, List, ListItem, type ListItemProps$1 as ListItemProps, type ListProps, Modal, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, Nav, NavItem, type NavItemProps, NavLink, type NavLinkProps, type NavProps, type NotificationContainerProps, NotificationContext, NotificationProvider, Option, type OptionProps, type OverlayDirectionEnum, Pagination, PaginationNumberField, type PaginationNumberFieldProps, type PaginationProps, Password, Popover, type PopoverHandle, type PopoverProps, ProgressBar, type ProgressBarProps, RadioButton, RadioButtonItem, type RadioButtonItemProps, type RadioButtonLabelAlignmentEnum, type RadioButtonProps, type RadioButtonSizeEnum, RenderStateView, type RenderStateViewProps, RepeaterList, type RepeaterListProps, type RequiredFields, ResponsiveComponent, type ResponsiveComponentProps, Select, SelectListItem, type SelectListItemProps, type SelectProps, SelectProvider, SlideOutPanel, type SlideOutPanelDirectionEnum, type SlideOutPanelProps, type SlideOutPanelSizeEnum, Slider, type SliderProps, Spinner, type SpinnerProps, TabContent, type TabContentProps, TabItem, type TabItemProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextDecorationEnum, type TextProps, type TextTypeEnum, type TextWeightEnum, ThemeContext, type ThemeContextType, ThemeProvider, type ThemeProviderProps, Toggle, ToggleButton, type ToggleButtonProps, type ToggleLabelAlignmentEnum, type ToggleProps, Tooltip, type TooltipProps, WrapTextNodes, type WrapTextNodesProps, applyPropsToChildren, getClickAccessibilityProps, mergeRefs, useDropzoneContext, useNotification, useSelectContext, useTab };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delightui/components",
3
- "version": "0.1.103",
3
+ "version": "0.1.105",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "start": "vite",