josenanodev-react-components-library 1.10.4 → 1.11.0

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 (35) hide show
  1. package/README.md +212 -4
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/types/components/AlertModal/AlertModal.d.ts +14 -0
  4. package/dist/cjs/types/components/AlertModal/index.d.ts +1 -0
  5. package/dist/cjs/types/components/BubbleMenu/BubbleMenu.d.ts +6 -0
  6. package/dist/cjs/types/components/CalendarDatePicker/CalendarDatePicker.d.ts +13 -0
  7. package/dist/cjs/types/components/InputBoxWithConfirmation/InputBoxWithConfirmation.d.ts +12 -0
  8. package/dist/cjs/types/components/IntegerControl/IntegerControl.d.ts +5 -0
  9. package/dist/cjs/types/components/LabeledInput/LabeledInput.d.ts +11 -0
  10. package/dist/cjs/types/components/Modal/Modal.d.ts +6 -0
  11. package/dist/cjs/types/components/Multicalendar/types.d.ts +27 -1
  12. package/dist/cjs/types/components/ScreenSteps/ScreenSteps.d.ts +8 -0
  13. package/dist/cjs/types/components/ScrollSnapGallery/ScrollSnapGallery.d.ts +11 -0
  14. package/dist/cjs/types/components/StackedCards/StackedCards.d.ts +9 -0
  15. package/dist/cjs/types/components/index.d.ts +1 -0
  16. package/dist/cjs/types/index.d.ts +1 -0
  17. package/dist/esm/index.js +1 -1
  18. package/dist/esm/types/components/AlertModal/AlertModal.d.ts +14 -0
  19. package/dist/esm/types/components/AlertModal/index.d.ts +1 -0
  20. package/dist/esm/types/components/BubbleMenu/BubbleMenu.d.ts +6 -0
  21. package/dist/esm/types/components/CalendarDatePicker/CalendarDatePicker.d.ts +13 -0
  22. package/dist/esm/types/components/InputBoxWithConfirmation/InputBoxWithConfirmation.d.ts +12 -0
  23. package/dist/esm/types/components/IntegerControl/IntegerControl.d.ts +5 -0
  24. package/dist/esm/types/components/LabeledInput/LabeledInput.d.ts +11 -0
  25. package/dist/esm/types/components/Modal/Modal.d.ts +6 -0
  26. package/dist/esm/types/components/Multicalendar/types.d.ts +27 -1
  27. package/dist/esm/types/components/ScreenSteps/ScreenSteps.d.ts +8 -0
  28. package/dist/esm/types/components/ScrollSnapGallery/ScrollSnapGallery.d.ts +11 -0
  29. package/dist/esm/types/components/StackedCards/StackedCards.d.ts +9 -0
  30. package/dist/esm/types/components/index.d.ts +1 -0
  31. package/dist/esm/types/index.d.ts +1 -0
  32. package/dist/index.d.ts +141 -2
  33. package/package.json +2 -3
  34. package/dist/cjs/types/stories/CalendarDatePickerMask.d.ts +0 -4
  35. package/dist/esm/types/stories/CalendarDatePickerMask.d.ts +0 -4
@@ -1,18 +1,32 @@
1
1
  import React from "react";
2
2
  type AlertModalProps = {
3
+ /** Visual intent used to select the default status icon and color. */
3
4
  type?: "success" | "error" | "warning" | "info" | "question";
5
+ /** Optional heading displayed above the modal message. */
4
6
  title?: string;
7
+ /** Short body copy displayed below the title. */
5
8
  message?: string;
9
+ /** Custom content rendered between the message and action buttons. */
6
10
  customChildren?: React.ReactNode;
11
+ /** Text rendered in the confirm action button. */
7
12
  confirmText?: string;
13
+ /** Text rendered in the cancel action button. */
8
14
  cancelText?: string;
15
+ /** Shows or hides the confirm action button. */
9
16
  confirmButton?: boolean;
17
+ /** Shows or hides the cancel action button. */
10
18
  cancelButton?: boolean;
19
+ /** Controlled open state. Set to true to display the modal. */
11
20
  overrideOpenState?: boolean;
21
+ /** Prevents closing the modal by clicking the backdrop. */
12
22
  forced?: boolean;
23
+ /** Icon size in pixels. */
13
24
  iconSize?: number;
25
+ /** Overrides the default icon color for the selected type. */
14
26
  iconColor?: string;
27
+ /** Called after the confirm button is clicked. */
15
28
  onConfirm?: () => void;
29
+ /** Called after the cancel button is clicked. */
16
30
  onCancel?: () => void;
17
31
  };
18
32
  declare const AlertModal: ({ type, title, message, customChildren, confirmText, cancelText, confirmButton, cancelButton, overrideOpenState, forced, iconSize, iconColor, onConfirm, onCancel, }: AlertModalProps) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from "./AlertModal";
@@ -1,11 +1,17 @@
1
1
  import React from "react";
2
2
  type BubbleMenuProps = {
3
+ /** Menu actions displayed when the floating menu is open. */
3
4
  options: {
5
+ /** Icon rendered above the option text. */
4
6
  icon: React.ReactNode;
7
+ /** Label rendered inside the circular option button. */
5
8
  text: string;
9
+ /** Controls whether this option is shown. */
6
10
  visible: boolean;
11
+ /** Called after the menu close animation delay. */
7
12
  optionCallback: () => void;
8
13
  }[];
14
+ /** Language used for the floating menu toggle label. */
9
15
  language?: "en" | "es";
10
16
  };
11
17
  declare const BubbleMenu: ({ options, language }: BubbleMenuProps) => React.JSX.Element;
@@ -1,18 +1,31 @@
1
1
  import React from "react";
2
2
  export type CalendarDatePickerProps = {
3
+ /** Selection model used by the calendar. */
3
4
  mode: "single" | "multiple" | "range" | "booking";
5
+ /** Emits the current selection any time selected dates change. */
4
6
  onSelectedDatesChange: (dates: Date[]) => void;
7
+ /** Language used for month, weekday, and Today labels. */
5
8
  language?: "es" | "en";
9
+ /** Custom date rules used to color, disable, cross out, or handle specific days. */
6
10
  customDates?: {
11
+ /** Background color applied to matching dates. */
7
12
  color: string;
13
+ /** Dates affected by this rule. */
8
14
  dates: Date[];
15
+ /** Whether matching dates can be selected. */
9
16
  selectable: boolean;
17
+ /** Renders a diagonal crossed visual treatment on matching dates. */
10
18
  crossed?: boolean;
19
+ /** Clears the current selection when a matching date is clicked. */
11
20
  clearSelectionIfClicked?: boolean;
21
+ /** Optional side effect triggered when a matching date is clicked. */
12
22
  clickSideEffect?: (date: Date) => void;
13
23
  }[];
24
+ /** Earliest date/month the user can navigate to. */
14
25
  minimumDate?: Date;
26
+ /** Latest date/month the user can navigate to. */
15
27
  maximumDate?: Date;
28
+ /** Inline style applied to the calendar root element. */
16
29
  customStyle?: React.CSSProperties;
17
30
  };
18
31
  declare const CalendarDatePicker: ({ mode, onSelectedDatesChange, language, customDates, minimumDate, maximumDate, customStyle, }: CalendarDatePickerProps) => React.JSX.Element;
@@ -1,16 +1,28 @@
1
1
  import React from "react";
2
2
  type InputBoxWithConfirmationPropsType = {
3
+ /** Called with the committed value after confirmation, Enter, or blur. */
3
4
  onConfirmAction: (inputCurrentValue: string) => void;
5
+ /** Native input type used by the inner input. */
4
6
  inputType?: "text" | "number";
7
+ /** Minimum value passed to the native input and enforced for number inputs. */
5
8
  minimumValue?: HTMLInputElement["min"];
9
+ /** Maximum value passed to the native input and enforced for number inputs. */
6
10
  maximumValue?: HTMLInputElement["max"];
11
+ /** Maximum number of accepted characters. */
7
12
  maxLength?: HTMLInputElement["maxLength"];
13
+ /** Placeholder shown while the input is empty. */
8
14
  placeholder?: HTMLInputElement["placeholder"];
15
+ /** Inline styles applied to the outer clickable wrapper. */
9
16
  divWrapperCustomStyle?: React.CSSProperties;
17
+ /** Inline styles applied to the inner input element. */
10
18
  inputBoxCustomStyle?: React.CSSProperties;
19
+ /** Initial value shown before the user edits. */
11
20
  defaultValue?: string | number;
21
+ /** Controlled value override. Pass null to clear the input. */
12
22
  overrideCurrentValue?: string | number | null;
23
+ /** Shows explicit edit/confirm buttons instead of confirming directly on blur. */
13
24
  showConfirmationButton?: boolean;
25
+ /** Disables editing and hides the confirmation controls. */
14
26
  disabled?: boolean;
15
27
  };
16
28
  declare const InputBoxWithConfirmation: ({ onConfirmAction, inputType, minimumValue, maximumValue, maxLength, placeholder, divWrapperCustomStyle, inputBoxCustomStyle, defaultValue, overrideCurrentValue, showConfirmationButton, disabled, }: InputBoxWithConfirmationPropsType) => React.JSX.Element;
@@ -1,9 +1,14 @@
1
1
  import React from "react";
2
2
  type IntegerControlProps = {
3
+ /** Called with the clamped value after the user changes it. */
3
4
  onChange: (value: number) => void;
5
+ /** Initial value and visual baseline for the default state. */
4
6
  defaultValue?: number;
7
+ /** Lowest value the control can emit. */
5
8
  minimumValue?: number;
9
+ /** Highest value the control can emit. */
6
10
  maximumValue?: number;
11
+ /** Inline style applied to the root control. */
7
12
  customStyle?: React.CSSProperties;
8
13
  };
9
14
  declare const IntegerControl: ({ onChange, defaultValue, minimumValue, maximumValue, customStyle, }: IntegerControlProps) => React.JSX.Element;
@@ -1,16 +1,27 @@
1
1
  import React from "react";
2
2
  type SpecialType = "credit-card-number" | "expiration-date" | "cvv" | "phone";
3
3
  type LabeledInputProps = {
4
+ /** Floating label displayed over the input. */
4
5
  label: string;
6
+ /** Initial uncontrolled input value. */
5
7
  defaultValue?: string;
8
+ /** Called with the current formatted value whenever the user types. */
6
9
  onChange?: (value: string) => void;
10
+ /** CSS width applied to the root wrapper. */
7
11
  width?: string;
12
+ /** CSS height applied to the root wrapper. */
8
13
  height?: string;
14
+ /** Background color applied to the wrapper and label gap. */
9
15
  backgroundColor?: string;
16
+ /** Text alignment for the native input. */
10
17
  textAlign?: "left" | "center" | "right";
18
+ /** Enables the error border and label color. */
11
19
  highlightError?: boolean;
20
+ /** Error text displayed below the input when highlightError is true. */
12
21
  errorMessage?: string;
22
+ /** Additional props forwarded to the native input element. */
13
23
  inputProps?: React.ComponentProps<"input">;
24
+ /** Optional built-in formatter applied while typing. */
14
25
  specialType?: SpecialType;
15
26
  };
16
27
  declare const LabeledInput: ({ label, defaultValue, onChange, width, height, backgroundColor, textAlign, highlightError, errorMessage, inputProps, specialType, }: LabeledInputProps) => React.JSX.Element;
@@ -1,10 +1,16 @@
1
1
  import React from "react";
2
2
  type ModalProps = {
3
+ /** Content rendered inside the modal panel. */
3
4
  children: React.ReactNode;
5
+ /** Controlled open state. Set to true to display the modal. */
4
6
  overrideOpenState?: boolean;
7
+ /** Prevents backdrop clicks from closing the modal. */
5
8
  forced?: boolean;
9
+ /** Called when overrideOpenState opens the modal. */
6
10
  onOpen?: Function;
11
+ /** Called when the modal closes. */
7
12
  onClose?: Function;
13
+ /** Reserved transition duration prop. Current timing is controlled by CSS. */
8
14
  transitionTime?: number;
9
15
  };
10
16
  declare const Modal: ({ children, overrideOpenState, forced, onOpen, onClose, }: ModalProps) => React.JSX.Element;
@@ -1,27 +1,51 @@
1
1
  export interface MulticalendarProps {
2
+ /** Stable DOM and sessionStorage id. Use a unique value per calendar instance. */
2
3
  multicalendarId: string;
4
+ /** Component rendered inside every visible date/resource grid cell. */
3
5
  ReactCellChildren: ReactCellChildren;
6
+ /** Component rendered for each visible row in the left resource axis. */
4
7
  ReactListElementChildren: ReactListElementChildren;
8
+ /** Resource ids displayed as rows in the calendar. */
5
9
  listElementsIdsArray: string[] | number[];
10
+ /** Language used by toolbar controls and date labels. */
6
11
  language?: "es_ES" | "en_EN";
12
+ /** Whether dates before today are available in the horizontal range. */
7
13
  pastDatesVisible?: boolean;
14
+ /** Width in pixels for each date cell. */
8
15
  cellsWidth?: number;
16
+ /** Height in pixels for each resource row. */
9
17
  cellsHeight?: number;
18
+ /** Width in pixels of the left resource axis. */
10
19
  verticalAxisWidth?: number;
20
+ /** Reserved height setting for the top date axis. */
11
21
  horizontalAxisHeight?: number;
22
+ /** Initial number of past days rendered in the scrollable range. */
12
23
  pastDaysInitialQuantity?: number;
24
+ /** Initial number of future days rendered in the scrollable range. */
13
25
  futureDaysInitialQuantity?: number;
26
+ /** Extra horizontal cells rendered outside the viewport to reduce blank space while scrolling. */
14
27
  chunkRenderX?: number;
28
+ /** Extra vertical rows rendered outside the viewport to reduce blank space while scrolling. */
15
29
  chunkRenderY?: number;
30
+ /** Auto-scrolls while dragging near grid edges. */
16
31
  authomaticScrollOnDraggingOverEdges?: boolean;
32
+ /** Extends the date range when users scroll near the horizontal boundaries. */
17
33
  dynamicDaysQuantity?: boolean;
34
+ /** Debounce time in milliseconds before callsOnScrollingStops runs. */
18
35
  waitTimeForCalls?: number;
36
+ /** Called once after the initial visible ids and dates are available. */
19
37
  callsOnInitialView?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
38
+ /** Called after scrolling settles with currently visible ids and dates. */
20
39
  callsOnScrollingStops?: (visibleIds: string[] | number[], visibleDates: Date[]) => void;
40
+ /** Extra controls rendered in the toolbar beside date navigation. */
21
41
  aditionalControlsComponents?: React.ReactNode | React.ReactNode[];
42
+ /** Custom content rendered in the upper-left corner above the resource axis. */
22
43
  upperLeftComponent?: React.ReactNode;
44
+ /** Persists scroll position in sessionStorage using multicalendarId. */
23
45
  autoSavePosition?: boolean;
46
+ /** Called whenever the vertical scroll position changes. */
24
47
  onScrollTopChanges?: (scrollTop: number) => void;
48
+ /** Called whenever the horizontal scroll position changes. */
25
49
  onScrollLeftChanges?: (scrollLeft: number) => void;
26
50
  }
27
51
  export interface RenderCoordinates {
@@ -33,12 +57,14 @@ export type ReactListElementChildren = React.ElementType<ListElementChildrenProp
33
57
  export type CellChildrenProps = {
34
58
  [key: string]: any;
35
59
  } & {
36
- /**Date in SQL format, i.e. 1993-03-29 */
60
+ /** Date in SQL format, for example 1993-03-29. */
37
61
  date: string;
62
+ /** Row/resource id for the cell being rendered. */
38
63
  listElementId: string | number;
39
64
  };
40
65
  export type ListElementChildrenProps = {
41
66
  [key: string]: any;
42
67
  } & {
68
+ /** Row/resource id for the list element being rendered. */
43
69
  listElementId: string | number;
44
70
  };
@@ -1,14 +1,22 @@
1
1
  import React from "react";
2
2
  type Step = {
3
+ /** React panel rendered for this step. */
3
4
  component: React.ReactNode;
5
+ /** Text rendered inside the step navigation marker. */
4
6
  innerText: string;
7
+ /** Optional descriptive text rendered above the active step panel. */
5
8
  outterText?: string;
6
9
  };
7
10
  type ScreenStepsProps = {
11
+ /** Ordered list of steps in the flow. */
8
12
  steps: Step[];
13
+ /** Initial active step index. */
9
14
  defaultStep?: number;
15
+ /** Called when the active step changes through user navigation. */
10
16
  onStepChange?: (step: number) => void;
17
+ /** Allows users to click step markers to navigate. */
11
18
  canNavigate?: boolean;
19
+ /** Controlled active step index from the parent. */
12
20
  overrideStep?: number;
13
21
  };
14
22
  declare const ScreenSteps: ({ steps, defaultStep, onStepChange, canNavigate, overrideStep, }: ScreenStepsProps) => React.JSX.Element;
@@ -1,16 +1,27 @@
1
1
  import React from "react";
2
2
  import { IconType } from "react-icons/lib";
3
3
  type ScrollSnapGalleryProps = {
4
+ /** Image URLs rendered as slides. */
4
5
  urls: string[];
6
+ /** Optional alt text array matched by slide index. */
5
7
  alts?: string[];
8
+ /** CSS width applied to the scroll frame. */
6
9
  width?: string;
10
+ /** CSS height applied to the scroll frame. */
7
11
  height?: string;
12
+ /** Icon component used for position indicators. */
8
13
  IndicatorIcon?: IconType;
14
+ /** Number of indicator icons emphasized at one time. */
9
15
  positionIndicatorSize?: number;
16
+ /** Indicator icon size in pixels. */
10
17
  iconSize?: number;
18
+ /** Shows previous and next arrow controls. */
11
19
  showArrows?: boolean;
20
+ /** Inline styles applied to the image frame. */
12
21
  frameStyle?: React.CSSProperties;
22
+ /** Called with the active slide index after scrolling. */
13
23
  onSlideChange?: (index: number) => void;
24
+ /** Automatically advances the gallery every 3 seconds. */
14
25
  autoChange?: boolean;
15
26
  };
16
27
  declare const ScrollSnapGallery: ({ urls, alts, width, height, IndicatorIcon, positionIndicatorSize, iconSize, showArrows, frameStyle, onSlideChange, autoChange, }: ScrollSnapGalleryProps) => React.JSX.Element;
@@ -1,15 +1,24 @@
1
1
  import React from "react";
2
2
  type Card = {
3
+ /** Header content rendered at the top of the card. */
3
4
  title: React.ReactNode;
5
+ /** Main content rendered inside the card body. */
4
6
  content: React.ReactNode;
5
7
  };
6
8
  type StackedCardsProps = {
9
+ /** Cards available in the stack. */
7
10
  cards: Card[];
11
+ /** Initial selected card index. */
8
12
  initialCard: number;
13
+ /** Called when the user selects a different card. */
9
14
  onCardChangeByUser?: (cardIndex: number) => void;
15
+ /** Controlled selected card index from the parent. */
10
16
  overrideSelectedCard?: number;
17
+ /** Stack spread direction in degrees. */
11
18
  stackingOrientation?: number;
19
+ /** Height in pixels for each card. */
12
20
  cardHeight?: number;
21
+ /** Width in pixels for each card. */
13
22
  cardWidth?: number;
14
23
  };
15
24
  declare const StackedCards: ({ cards, initialCard, onCardChangeByUser, overrideSelectedCard, stackingOrientation, cardWidth, cardHeight, }: StackedCardsProps) => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ export { default as AlertModal } from "./AlertModal";
1
2
  export { default as BubbleMenu } from "./BubbleMenu";
2
3
  export { default as CalendarDatePicker } from "./CalendarDatePicker";
3
4
  export { default as InputBoxWithConfirmation } from "./InputBoxWithConfirmation";
@@ -1,2 +1,3 @@
1
+ import './index.css';
1
2
  export * from './components';
2
3
  export * from './hooks';