@delightui/components 0.1.104 → 0.1.106

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 (120) hide show
  1. package/README.md +104 -1
  2. package/dist/cjs/components/molecules/Modal/DemoModal.d.ts +8 -0
  3. package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
  4. package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
  5. package/dist/cjs/components/molecules/Modal/ModalContext/index.d.ts +3 -0
  6. package/dist/cjs/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
  7. package/dist/cjs/components/molecules/Modal/index.d.ts +2 -0
  8. package/dist/cjs/components/molecules/Popover/Popover.presenter.d.ts +26 -0
  9. package/dist/cjs/components/molecules/Select/Option/Option.types.d.ts +6 -0
  10. package/dist/cjs/components/molecules/Select/Select.Context.d.ts +1 -1
  11. package/dist/cjs/components/molecules/Select/Select.d.ts +5 -5
  12. package/dist/cjs/components/molecules/Select/Select.presenter.d.ts +1 -0
  13. package/dist/cjs/components/molecules/Select/Select.types.d.ts +5 -0
  14. package/dist/cjs/components/molecules/Select/index.d.ts +2 -9
  15. package/dist/cjs/components/molecules/index.d.ts +2 -0
  16. package/dist/cjs/components/utils/accessibilityUtils.d.ts +41 -0
  17. package/dist/cjs/components/utils/index.d.ts +2 -0
  18. package/dist/cjs/library.css +13 -0
  19. package/dist/cjs/library.js +2 -2
  20. package/dist/cjs/library.js.map +1 -1
  21. package/dist/esm/components/molecules/Modal/DemoModal.d.ts +8 -0
  22. package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
  23. package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
  24. package/dist/esm/components/molecules/Modal/ModalContext/index.d.ts +3 -0
  25. package/dist/esm/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
  26. package/dist/esm/components/molecules/Modal/index.d.ts +2 -0
  27. package/dist/esm/components/molecules/Popover/Popover.presenter.d.ts +26 -0
  28. package/dist/esm/components/molecules/Select/Option/Option.types.d.ts +6 -0
  29. package/dist/esm/components/molecules/Select/Select.Context.d.ts +1 -1
  30. package/dist/esm/components/molecules/Select/Select.d.ts +5 -5
  31. package/dist/esm/components/molecules/Select/Select.presenter.d.ts +1 -0
  32. package/dist/esm/components/molecules/Select/Select.types.d.ts +5 -0
  33. package/dist/esm/components/molecules/Select/index.d.ts +2 -9
  34. package/dist/esm/components/molecules/index.d.ts +2 -0
  35. package/dist/esm/components/utils/accessibilityUtils.d.ts +41 -0
  36. package/dist/esm/components/utils/index.d.ts +2 -0
  37. package/dist/esm/library.css +13 -0
  38. package/dist/esm/library.js +3 -3
  39. package/dist/esm/library.js.map +1 -1
  40. package/dist/index.d.ts +156 -12
  41. package/docs/README.md +264 -0
  42. package/docs/components/atoms/ActionImage.md +119 -0
  43. package/docs/components/atoms/Button.md +197 -0
  44. package/docs/components/atoms/Checkbox.md +299 -0
  45. package/docs/components/atoms/CheckboxItem.md +314 -0
  46. package/docs/components/atoms/Chip.md +380 -0
  47. package/docs/components/atoms/CustomToggle.md +270 -0
  48. package/docs/components/atoms/Icon.md +365 -0
  49. package/docs/components/atoms/IconButton.md +407 -0
  50. package/docs/components/atoms/Image.md +448 -0
  51. package/docs/components/atoms/Input.md +430 -0
  52. package/docs/components/atoms/ListItem.md +502 -0
  53. package/docs/components/atoms/Password.md +472 -0
  54. package/docs/components/atoms/RadioButton.md +614 -0
  55. package/docs/components/atoms/RadioButtonItem.md +588 -0
  56. package/docs/components/atoms/ResponsiveComponent.md +612 -0
  57. package/docs/components/atoms/SelectListItem.md +609 -0
  58. package/docs/components/atoms/Slider.md +605 -0
  59. package/docs/components/atoms/Spinner.md +605 -0
  60. package/docs/components/atoms/Text.md +463 -0
  61. package/docs/components/atoms/TextArea.md +670 -0
  62. package/docs/components/atoms/ToastNotification.md +668 -0
  63. package/docs/components/atoms/Toggle.md +737 -0
  64. package/docs/components/atoms/ToggleButton.md +751 -0
  65. package/docs/components/atoms/Tooltip.md +391 -0
  66. package/docs/components/molecules/Accordion.md +440 -0
  67. package/docs/components/molecules/AccordionGroup.md +547 -0
  68. package/docs/components/molecules/ActionCard.md +546 -0
  69. package/docs/components/molecules/Breadcrumb.md +403 -0
  70. package/docs/components/molecules/Breadcrumbs.md +485 -0
  71. package/docs/components/molecules/ButtonGroup.md +383 -0
  72. package/docs/components/molecules/Card.md +298 -0
  73. package/docs/components/molecules/ChipInput.md +646 -0
  74. package/docs/components/molecules/ContextMenu.md +768 -0
  75. package/docs/components/molecules/CustomTimeSelector.md +116 -0
  76. package/docs/components/molecules/DatePicker.md +516 -0
  77. package/docs/components/molecules/DateTimeSelector.md +166 -0
  78. package/docs/components/molecules/FormField.md +312 -0
  79. package/docs/components/molecules/Grid.md +577 -0
  80. package/docs/components/molecules/GridItem.md +834 -0
  81. package/docs/components/molecules/GridList.md +244 -0
  82. package/docs/components/molecules/List.md +485 -0
  83. package/docs/components/molecules/Modal.md +470 -0
  84. package/docs/components/molecules/ModalFooter.md +702 -0
  85. package/docs/components/molecules/ModalHeader.md +756 -0
  86. package/docs/components/molecules/ModalProvider.md +205 -0
  87. package/docs/components/molecules/Nav.md +530 -0
  88. package/docs/components/molecules/NavItem.md +572 -0
  89. package/docs/components/molecules/NavLink.md +499 -0
  90. package/docs/components/molecules/Option.md +521 -0
  91. package/docs/components/molecules/Pagination.md +592 -0
  92. package/docs/components/molecules/PaginationNumberField.md +722 -0
  93. package/docs/components/molecules/Popover.md +516 -0
  94. package/docs/components/molecules/ProgressBar.md +624 -0
  95. package/docs/components/molecules/RadioGroup.md +831 -0
  96. package/docs/components/molecules/RepeaterList.md +185 -0
  97. package/docs/components/molecules/Select.md +402 -0
  98. package/docs/components/molecules/SortableTrigger.md +82 -0
  99. package/docs/components/molecules/useModal.md +379 -0
  100. package/docs/components/organisms/Dropzone.md +346 -0
  101. package/docs/components/organisms/DropzoneClear.md +135 -0
  102. package/docs/components/organisms/DropzoneContent.md +216 -0
  103. package/docs/components/organisms/DropzoneFilename.md +191 -0
  104. package/docs/components/organisms/DropzoneSupportedFormats.md +184 -0
  105. package/docs/components/organisms/DropzoneTrigger.md +209 -0
  106. package/docs/components/organisms/Form.md +533 -0
  107. package/docs/components/organisms/SlideOutPanel.md +662 -0
  108. package/docs/components/organisms/TabContent.md +902 -0
  109. package/docs/components/organisms/TabItem.md +1091 -0
  110. package/docs/components/organisms/Table.md +611 -0
  111. package/docs/components/organisms/TableBody.md +679 -0
  112. package/docs/components/organisms/TableCell.md +482 -0
  113. package/docs/components/organisms/TableHeader.md +513 -0
  114. package/docs/components/organisms/TableHeaderCell.md +661 -0
  115. package/docs/components/organisms/TableRow.md +715 -0
  116. package/docs/components/organisms/Tabs.md +1330 -0
  117. package/docs/components/utils/ConditionalView.md +568 -0
  118. package/docs/components/utils/RenderStateView.md +726 -0
  119. package/docs/components/utils/WrapTextNodes.md +614 -0
  120. package/package.json +3 -2
package/README.md CHANGED
@@ -1,3 +1,106 @@
1
1
  # @delightui/components
2
2
 
3
- React components for delight ui
3
+ A comprehensive React component library built with TypeScript, providing a complete set of UI components following atomic design principles. This library offers flexible, accessible, and highly customizable components for building modern web applications.
4
+
5
+ ## Features
6
+
7
+ - **Atomic Design Architecture**: Components organized into Atoms, Molecules, and Organisms
8
+ - **TypeScript Support**: Full TypeScript support with comprehensive type definitions
9
+ - **Accessible**: Built with accessibility in mind following WCAG guidelines
10
+ - **Customizable**: Flexible theming system with SCSS modules
11
+ - **Modern React**: Built with React 18+ and modern hooks
12
+ - **Storybook Integration**: Interactive component documentation and testing
13
+ - **Testing**: Comprehensive test coverage with Vitest and Testing Library
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install @delightui/components
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```tsx
24
+ import { Button, Card, Modal } from '@delightui/components';
25
+
26
+ function App() {
27
+ return (
28
+ <Card>
29
+ <Button variant="primary">Click me</Button>
30
+ </Card>
31
+ );
32
+ }
33
+ ```
34
+
35
+ ## Tools & Libraries
36
+
37
+ ### Core Dependencies
38
+ - **React 18.3+** - Modern React with concurrent features
39
+ - **TypeScript** - Type-safe development
40
+ - **SCSS/Sass** - Styling with CSS modules
41
+ - **classnames** - Conditional CSS class management
42
+
43
+ ### UI & Interaction
44
+ - **@dnd-kit** - Drag and drop functionality
45
+ - **react-overlays** - Positioning and overlay management
46
+ - **react-dropzone** - File upload handling
47
+ - **flatpickr** - Date/time picker component
48
+ - **react-router-dom** - Navigation and routing
49
+
50
+ ### Development Tools
51
+ - **Vite** - Fast build tool and development server
52
+ - **Storybook** - Component development and documentation
53
+ - **Vitest** - Unit testing framework
54
+ - **Testing Library** - React component testing utilities
55
+ - **ESLint** - Code linting with Airbnb TypeScript config
56
+ - **Rollup** - Library bundling and packaging
57
+
58
+ ### Build & Deployment
59
+ - **Rollup** - Production build bundling
60
+ - **PostCSS** - CSS processing and optimization
61
+ - **Bitbucket Pipelines** - CI/CD automation
62
+
63
+ ## Component Library
64
+
65
+ [component list](./docs/README.md)
66
+
67
+ ## Development
68
+
69
+ ### Setup
70
+ ```bash
71
+ npm install
72
+ npm start
73
+ ```
74
+
75
+ ### Available Scripts
76
+ - `npm start` - Start development server
77
+ - `npm run build` - Build for production
78
+ - `npm test` - Run tests
79
+ - `npm run test:ui` - Run tests with UI
80
+ - `npm run storybook` - Start Storybook development server
81
+ - `npm run build-storybook` - Build Storybook for production
82
+ - `npm run lint` - Run ESLint
83
+ - `npm run lint:fix` - Fix ESLint issues
84
+
85
+ ### Testing
86
+ ```bash
87
+ npm test
88
+ ```
89
+
90
+ ### Storybook
91
+ ```bash
92
+ npm run storybook
93
+ ```
94
+
95
+ ## Contributing
96
+
97
+ 1. Fork the repository
98
+ 2. Create a feature branch
99
+ 3. Make your changes
100
+ 4. Add tests for new components
101
+ 5. Update documentation
102
+ 6. Submit a pull request
103
+
104
+ ## License
105
+
106
+ This project is licensed under the MIT License.
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { ModalComponentProps } from './ModalContext';
3
+ interface DemoModalProps extends ModalComponentProps {
4
+ title?: string;
5
+ message?: string;
6
+ }
7
+ declare const DemoModal: React.FC<DemoModalProps>;
8
+ export default DemoModal;
@@ -0,0 +1,41 @@
1
+ import type { ModalContextType, ModalProviderProps } from './ModalContext.types';
2
+ /**
3
+ * Hook to access the modal context.
4
+ * Must be used within a ModalProvider component.
5
+ *
6
+ * @returns The modal context containing openModal and closeModal functions
7
+ * @throws Error if used outside of a ModalProvider
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * function MyComponent() {
12
+ * const { openModal, closeModal } = useModalContext();
13
+ *
14
+ * const handleOpenModal = () => {
15
+ * openModal('my-modal', MyModalComponent, { title: 'Hello' });
16
+ * };
17
+ *
18
+ * return <button onClick={handleOpenModal}>Open Modal</button>;
19
+ * }
20
+ * ```
21
+ */
22
+ export declare const useModalContext: () => ModalContextType;
23
+ /**
24
+ * Provider component that manages modal state and renders modal instances.
25
+ * Wraps child components with modal context and renders all active modals.
26
+ *
27
+ * @param props - The provider props
28
+ * @param props.children - Child components that will have access to modal context
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * function App() {
33
+ * return (
34
+ * <ModalProvider>
35
+ * <MyApplication />
36
+ * </ModalProvider>
37
+ * );
38
+ * }
39
+ * ```
40
+ */
41
+ export declare const ModalProvider: ({ children }: ModalProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,87 @@
1
+ import type { ReactNode, ComponentType } from 'react';
2
+ /**
3
+ * Base props that all modal components must implement.
4
+ */
5
+ export type ModalComponentProps = {
6
+ /** Controls whether the modal is visible */
7
+ show?: boolean;
8
+ /** Callback function to handle modal cancellation/dismissal */
9
+ onCancel?: () => void;
10
+ };
11
+ /**
12
+ * Represents a modal instance stored in the modal context state.
13
+ */
14
+ export type ModalInstance = {
15
+ /** Unique identifier for the modal instance */
16
+ id: string;
17
+ /** The rendered React component for the modal */
18
+ component: ReactNode;
19
+ };
20
+ /**
21
+ * The context type that provides modal management functionality.
22
+ */
23
+ export type ModalContextType = {
24
+ /**
25
+ * Opens a new modal with the specified component and props.
26
+ *
27
+ * @template T - The props type for the modal component (must extend ModalComponentProps)
28
+ * @param id - Unique identifier for the modal instance
29
+ * @param Component - React component to render as the modal
30
+ * @param props - Props to pass to the modal component
31
+ * @returns void
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * const { openModal } = useModalContext();
36
+ *
37
+ * openModal('confirmation', ConfirmationModal, {
38
+ * title: 'Are you sure?',
39
+ * show: true,
40
+ * onCancel: () => console.log('cancelled'),
41
+ * onConfirm: () => console.log('confirmed')
42
+ * });
43
+ * ```
44
+ */
45
+ openModal: <T extends ModalComponentProps>(id: string, Component: ComponentType<T>, props: T) => void;
46
+ /**
47
+ * Closes and removes a modal by its unique identifier.
48
+ *
49
+ * @param id - The unique identifier of the modal to close
50
+ * @returns void
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * const { closeModal } = useModalContext();
55
+ * closeModal('confirmation');
56
+ * ```
57
+ */
58
+ closeModal: (id: string) => void;
59
+ };
60
+ /**
61
+ * Props for the ModalProvider component.
62
+ */
63
+ export type ModalProviderProps = {
64
+ /** Child components that will have access to the modal context */
65
+ children: ReactNode;
66
+ };
67
+ /**
68
+ * Return type for the useModal hook when a component type is provided.
69
+ */
70
+ export type UseModalReturn<T extends ModalComponentProps> = {
71
+ /**
72
+ * Opens the modal with the specified props.
73
+ * Uses the component type provided to the hook.
74
+ *
75
+ * @param props - Props to pass to the modal component
76
+ * @returns void
77
+ */
78
+ openModal: (props: T) => void;
79
+ /**
80
+ * Closes the modal instance managed by this hook.
81
+ *
82
+ * @returns void
83
+ */
84
+ closeModal: () => void;
85
+ /** The unique identifier for this modal instance */
86
+ modalId: string;
87
+ };
@@ -0,0 +1,3 @@
1
+ export { ModalProvider } from './ModalContext';
2
+ export { useModal } from './useModal';
3
+ export type { ModalProviderProps, ModalComponentProps, UseModalReturn } from './ModalContext.types';
@@ -0,0 +1,34 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { ModalComponentProps, UseModalReturn } from './ModalContext.types';
3
+ /**
4
+ * Custom hook that provides an abstraction layer over the modal context.
5
+ * Takes a component type and returns functions to open/close that specific modal.
6
+ * Uses React's useId hook to generate a unique identifier for the modal instance.
7
+ *
8
+ * @template T - The props type for the modal component (must extend ModalComponentProps)
9
+ * @param Component - React component to use for the modal
10
+ * @returns An object containing openModal, closeModal functions and the modalId
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * function MyComponent() {
15
+ * const confirmationModal = useModal(ConfirmationModal);
16
+ *
17
+ * const handleDelete = () => {
18
+ * confirmationModal.openModal({
19
+ * title: 'Delete Item',
20
+ * message: 'Are you sure you want to delete this item?',
21
+ * show: true,
22
+ * onConfirm: () => {
23
+ * // perform delete
24
+ * confirmationModal.closeModal();
25
+ * },
26
+ * onCancel: confirmationModal.closeModal
27
+ * });
28
+ * };
29
+ *
30
+ * return <button onClick={handleDelete}>Delete</button>;
31
+ * }
32
+ * ```
33
+ */
34
+ export declare const useModal: <T extends ModalComponentProps>(Component: ComponentType<T>) => UseModalReturn<T>;
@@ -2,3 +2,5 @@ import Modal from './Modal';
2
2
  import type { ModalProps } from './Modal.types';
3
3
  export type { ModalProps };
4
4
  export default Modal;
5
+ export { ModalProvider, useModal } from './ModalContext';
6
+ export type { ModalProviderProps, ModalComponentProps, UseModalReturn } from './ModalContext';
@@ -0,0 +1,26 @@
1
+ import { PopoverProps } from './Popover.types';
2
+ declare const usePresenter: (props: PopoverProps) => {
3
+ show: boolean;
4
+ offset: import("react-overlays/esm/usePopper").Offset | undefined;
5
+ placement: import("@popperjs/core").Placement;
6
+ handleOnHide: () => void;
7
+ openPopover: () => void;
8
+ containerRef: import("react").RefObject<HTMLDivElement>;
9
+ targetRef: import("react").RefObject<HTMLDivElement>;
10
+ initialTransformRef: import("react").MutableRefObject<string | undefined>;
11
+ action: import("./Popover.types").ActionType;
12
+ hideOnClickAway: boolean;
13
+ defaultShow: boolean;
14
+ keepContentOnItemClick: boolean;
15
+ contentPosition: "fixed" | "absolute";
16
+ onClickListener: (() => false | void) | undefined;
17
+ onDoubleClickListener: (() => false | void) | undefined;
18
+ onMouseOutListener: (() => void) | undefined;
19
+ onMouseOverListener: (() => void) | undefined;
20
+ targetOnClickListener: () => false | void;
21
+ targetOnDoubleClickListener: () => false | void;
22
+ popoverAccessibilityProps: import("../../utils/accessibilityUtils").AccessibilityProps;
23
+ targetAccessibilityProps: import("../../utils/accessibilityUtils").AccessibilityProps;
24
+ otherProps: {};
25
+ };
26
+ export default usePresenter;
@@ -29,4 +29,10 @@ export type OptionProps = LiHTMLAttributes<HTMLLIElement> & {
29
29
  * Children elements or text content of the option.
30
30
  */
31
31
  children?: ReactNode;
32
+ /**
33
+ * Indicates if the option is selected.
34
+ * For internal use, not to be set by the user.
35
+ * @default false
36
+ */
37
+ closeSelectOptions?: () => void;
32
38
  };
@@ -14,4 +14,4 @@ export declare const useSelectContext: () => SelectContextType;
14
14
  * @param props - Props for configuring the SelectProvider.
15
15
  * @returns JSX element that provides context to its children.
16
16
  */
17
- export declare const SelectProvider: ({ children, value, multiple, disabled, invalid, onValueChange, }: SelectProviderProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const SelectProvider: ({ children, value, multiple, disabled, invalid, onValueChange, closeSelectOptions, }: SelectProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,10 @@
1
- import type { SelectViewProps } from './Select.types';
1
+ import type { SelectProps } from './Select.types';
2
2
  /**
3
- * Select component for displaying a dropdown with options.
4
- * Uses Popover for the dropdown functionality.
3
+ * Select component that wraps SelectComponent with SelectProvider.
4
+ * Provides state management and context to SelectComponent.
5
5
  *
6
6
  * @param props - Props for configuring the Select component.
7
- * @returns Element representing the select.
7
+ * @returns JSX element that renders the SelectComponent wrapped with SelectProvider.
8
8
  */
9
- declare const Select: (props: SelectViewProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const Select: (props: SelectProps) => JSX.Element;
10
10
  export default Select;
@@ -23,6 +23,7 @@ declare const usePresenter: (props: SelectProps) => {
23
23
  invalid?: boolean;
24
24
  onValueChange?: ((value: import("../..").FieldValue) => void) | undefined;
25
25
  initialValue?: import("../..").FieldValue | undefined;
26
+ closeSelectOptions?: () => void;
26
27
  role?: import("react").AriaRole | undefined;
27
28
  onLoad?: import("react").ReactEventHandler<HTMLElement> | undefined;
28
29
  onError?: import("react").ReactEventHandler<HTMLElement> | undefined;
@@ -47,6 +47,11 @@ export type SelectProviderProps = ControlledFormComponentProps<FieldValue> & {
47
47
  * @default false
48
48
  */
49
49
  hasDefaultOption?: boolean;
50
+ /**
51
+ * Function to close the select options menu.
52
+ * @param value - The new selected value.
53
+ */
54
+ closeSelectOptions?: () => void;
50
55
  };
51
56
  /**
52
57
  * Enum representing different states of the Select component.
@@ -1,15 +1,8 @@
1
+ import Select from './Select';
1
2
  import { SelectProvider, useSelectContext } from './Select.Context';
2
3
  import type { SelectProps } from './Select.types';
3
4
  export type { SelectProps };
5
+ export * from './Option';
4
6
  export { default as Option } from './Option';
5
7
  export { SelectProvider, useSelectContext };
6
- export * from './Option';
7
- /**
8
- * Select component that wraps SelectComponent with SelectProvider.
9
- * Provides state management and context to SelectComponent.
10
- *
11
- * @param props - Props for configuring the Select component.
12
- * @returns JSX element that renders the SelectComponent wrapped with SelectProvider.
13
- */
14
- declare const Select: (props: SelectProps) => JSX.Element;
15
8
  export default Select;
@@ -17,6 +17,7 @@ export { default as Pagination } from './Pagination';
17
17
  export { default as PaginationNumberField } from './PaginationNumberField';
18
18
  export { default as Popover } from './Popover';
19
19
  export { default as ProgressBar } from './ProgressBar';
20
+ export { default as RadioGroup } from './RadioGroup';
20
21
  export { Option, default as Select } from './Select';
21
22
  export { default as ChipInput } from './ChipInput';
22
23
  export * from './Accordion';
@@ -38,5 +39,6 @@ export * from './Pagination';
38
39
  export * from './PaginationNumberField';
39
40
  export * from './Popover';
40
41
  export * from './ProgressBar';
42
+ export * from './RadioGroup';
41
43
  export * from './Select';
42
44
  export * from './ChipInput';
@@ -0,0 +1,41 @@
1
+ import type { AriaRole, KeyboardEventHandler, SyntheticEvent } from 'react';
2
+ export type ArrowDirectionEnum = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';
3
+ export type AccessibilityActions = {
4
+ onClick?: (event?: SyntheticEvent) => void;
5
+ onTab?: (forward: boolean) => void;
6
+ onEsc?: () => void;
7
+ onArrowNavigation?: (direction: ArrowDirectionEnum) => void;
8
+ };
9
+ export type AccessibilityProps = {
10
+ tabIndex?: number;
11
+ role?: AriaRole;
12
+ onKeyDown?: KeyboardEventHandler<unknown>;
13
+ };
14
+ /** Executes the provided function with setTimeout with 0 delay */
15
+ export declare const runInNextCycle: (func: (() => void)) => void;
16
+ /**
17
+ * Generates accessibility properties for clickable elements.
18
+ * @param {boolean} [addIndex] -
19
+ * @param {AriaRole} [role='button'] - ARIA role attribute to be assigned to the element.
20
+ * @returns {AccessibilityProps}
21
+ */
22
+ export declare const getClickAccessibilityProps: (params: {
23
+ /** Object containing action handlers for various key events. */
24
+ actions: AccessibilityActions;
25
+ /** If true, sets the tabIndex to 0 to make the element focusable. */
26
+ addIndex?: boolean;
27
+ /** Accessibility properties including ARIA role and key event handlers. */
28
+ role?: AriaRole;
29
+ }) => AccessibilityProps;
30
+ /**
31
+ * Handles arrow key navigation for category elements.
32
+ *
33
+ * This function allows users to navigate through keys.
34
+ * It focuses on the next or previous element and optionally triggers a callback.
35
+ *
36
+ * @param {boolean} forward - Whether to move forward (true) or backward (false) in the tab order.
37
+ * @param {number} index - The current index of the focused element.
38
+ * @param {HTMLAnchorElement[]} arrayOfRefs - Array of element references to navigate through.
39
+ * @param {(nextIndex: number) => void} [selectFunction] - Optional callback to handle selection.
40
+ */
41
+ export declare const handleKeyboardNavigation: (forward: boolean, index: number, arrayOfRefs: HTMLAnchorElement[] | HTMLButtonElement[] | HTMLElement[], selectFunction?: (nextIndex: number) => void, shouldFocusNextElement?: boolean) => void;
@@ -1,6 +1,8 @@
1
1
  export { ConditionalView } from './ConditionalView';
2
2
  export { WrapTextNodes } from './WrapTextNodes';
3
3
  export { RenderStateView } from './RenderStateView';
4
+ export type { AccessibilityActions, AccessibilityProps } from './accessibilityUtils';
5
+ export { getClickAccessibilityProps } from './accessibilityUtils';
4
6
  export * from './ConditionalView';
5
7
  export * from './WrapTextNodes';
6
8
  export * from './RenderStateView';
@@ -3555,6 +3555,19 @@ span.flatpickr-weekday {
3555
3555
  .ProgressBar-module_progressBar__FcALd.ProgressBar-module_Horizontal__K0u1- {
3556
3556
  flex-direction: row;
3557
3557
  }
3558
+ .RadioGroup-module_radioGroup__zODB0 {
3559
+ display: flex;
3560
+ gap: 4px;
3561
+ gap: var(--radio-group-gap, 4px);
3562
+ }
3563
+ .RadioGroup-module_radioGroup__zODB0.RadioGroup-module_vertical__Y3hNS {
3564
+ flex-direction: column;
3565
+ }
3566
+ .RadioGroup-module_radioGroup__zODB0.RadioGroup-module_horizontal__gypXB {
3567
+ flex-direction: row;
3568
+ width: 100%;
3569
+ width: var(--radio-group-width, 100%);
3570
+ }
3558
3571
  .Option-module_option__EOKym {
3559
3572
  display: flex;
3560
3573
  width: 100%;