@juspay/blend-design-system 0.0.36 → 0.0.37-beta.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.
@@ -248,6 +248,7 @@ export type DateRangePickerProps = {
248
248
  onChange?: (range: DateRange) => void;
249
249
  onPresetSelection?: (data: PresetSelectionData) => void;
250
250
  showDateTimePicker?: boolean;
251
+ showDateInput?: boolean;
251
252
  showPresets?: boolean;
252
253
  customPresets?: PresetsConfig;
253
254
  placeholder?: string;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { SkeletonVariant } from '../Skeleton';
2
3
  import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
3
4
  export declare enum MenuAlignment {
@@ -38,7 +39,7 @@ export type MenuProps = {
38
39
  alignOffset?: number;
39
40
  collisonBoundaryRef?: Element | null | Array<Element | null>;
40
41
  skeleton?: MenuSkeletonProps;
41
- };
42
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'slot'>;
42
43
  export type SubMenuVirtualScrollProps = {
43
44
  enableVirtualScrolling?: boolean;
44
45
  virtualItemHeight?: number;
@@ -1,3 +1,3 @@
1
1
  import { MultiSelectProps } from './types';
2
- declare const MultiSelect: ({ selectedValues, onChange, items, label, sublabel, disabled, helpIconHintText, name, required, variant, selectionTagType, slot, hintText, placeholder, size, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, customTrigger, useDrawerOnMobile, minMenuWidth, maxMenuWidth, maxMenuHeight, alignment, side, sideOffset, alignOffset, inline, onBlur, onFocus, error, errorMessage, showActionButtons, primaryAction, secondaryAction, showItemDividers, showHeaderBorder, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, itemsToRender, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, showClearButton, onClearAllClick, onOpenChange, multiSelectGroupPosition, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const MultiSelect: ({ selectedValues, onChange, items, label, sublabel, disabled, helpIconHintText, name, required, variant, selectionTagType, slot, hintText, placeholder, size, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, customTrigger, useDrawerOnMobile, minMenuWidth, maxMenuWidth, maxMenuHeight, alignment, side, sideOffset, alignOffset, inline, error, errorMessage, showActionButtons, primaryAction, secondaryAction, showItemDividers, showHeaderBorder, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, itemsToRender, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, showClearButton, onClearAllClick, onOpenChange, multiSelectGroupPosition, ...rest }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MultiSelect;
@@ -15,13 +15,13 @@ export type MultiSelectTriggerProps = {
15
15
  selectionTagType: MultiSelectSelectionTagType;
16
16
  valueLabelMap: Record<string, string>;
17
17
  open: boolean;
18
- onClick?: () => void;
18
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
19
19
  multiSelectTokens: MultiSelectTokensType;
20
20
  inline?: boolean;
21
21
  error?: boolean;
22
22
  disabled?: boolean;
23
23
  maxTriggerWidth?: number;
24
24
  minTriggerWidth?: number;
25
- };
25
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'slot' | 'onClick' | 'name' | 'disabled' | 'onChange'>;
26
26
  declare const MultiSelectTrigger: ({ selectedValues, slot, variant, size, isSmallScreen, onChange, name, label, placeholder, required, open, onClick, multiSelectTokens, inline, error, maxTriggerWidth, minTriggerWidth, }: MultiSelectTriggerProps) => import("react/jsx-runtime").JSX.Element;
27
27
  export default MultiSelectTrigger;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { SkeletonVariant } from '../Skeleton';
2
3
  import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
3
4
  export declare enum MultiSelectVariant {
@@ -92,8 +93,6 @@ export type MultiSelectProps = {
92
93
  sideOffset?: number;
93
94
  alignOffset?: number;
94
95
  inline?: boolean;
95
- onBlur?: () => void;
96
- onFocus?: () => void;
97
96
  onOpenChange?: (open: boolean) => void;
98
97
  error?: boolean;
99
98
  errorMessage?: string;
@@ -127,7 +126,7 @@ export type MultiSelectProps = {
127
126
  showClearButton?: boolean;
128
127
  onClearAllClick?: () => void;
129
128
  multiSelectGroupPosition?: 'center' | 'left' | 'right';
130
- };
129
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'slot' | 'onChange'>;
131
130
  export type MultiSelectMenuProps = {
132
131
  items: MultiSelectMenuGroupType[];
133
132
  selected: string[];
@@ -1,3 +1,3 @@
1
1
  import { SingleSelectProps } from './types';
2
- declare const SingleSelect: ({ label, subLabel, hintText, required, helpIconText, placeholder, error, errorMessage, size, items, name, variant, disabled, selected, onSelect, enableSearch, searchPlaceholder, slot, customTrigger, useDrawerOnMobile, alignment, side, sideOffset, alignOffset, minMenuWidth, maxMenuWidth, maxMenuHeight, onBlur, onFocus, inline, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, singleSelectGroupPosition, allowDeselect, ...rest }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const SingleSelect: ({ label, subLabel, hintText, required, helpIconText, placeholder, error, errorMessage, size, items, name, variant, disabled, selected, onSelect, enableSearch, searchPlaceholder, slot, customTrigger, useDrawerOnMobile, alignment, side, sideOffset, alignOffset, minMenuWidth, maxMenuWidth, maxMenuHeight, inline, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, singleSelectGroupPosition, allowDeselect, ...rest }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default SingleSelect;
@@ -10,7 +10,7 @@ export type SingleSelectTriggerProps = {
10
10
  required: boolean;
11
11
  valueLabelMap: Record<string, string>;
12
12
  open: boolean;
13
- onClick?: () => void;
13
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
14
14
  slot: React.ReactNode;
15
15
  variant: SelectMenuVariant;
16
16
  isSmallScreenWithLargeSize: boolean;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { SkeletonVariant } from '../Skeleton';
2
3
  import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
3
4
  export declare enum SelectMenuAlignment {
@@ -96,8 +97,6 @@ export type SingleSelectProps = {
96
97
  maxMenuWidth?: number;
97
98
  maxMenuHeight?: number;
98
99
  inline?: boolean;
99
- onBlur?: () => void;
100
- onFocus?: () => void;
101
100
  error?: boolean;
102
101
  errorMessage?: string;
103
102
  fullWidth?: boolean;
@@ -115,4 +114,4 @@ export type SingleSelectProps = {
115
114
  customValueLabel?: string;
116
115
  singleSelectGroupPosition?: 'center' | 'left' | 'right';
117
116
  allowDeselect?: boolean;
118
- };
117
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'slot' | 'onSelect'>;
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ type ShadowRootContextType = {
3
+ shadowRoot: ShadowRoot | null;
4
+ target: HTMLElement | null;
5
+ };
6
+ export declare const useShadowRoot: () => ShadowRootContextType;
7
+ type ShadowAwareProps = {
8
+ children: ReactNode;
9
+ /**
10
+ * Target HTMLElement for styled-components to inject styles into.
11
+ * This should be an element inside a ShadowRoot.
12
+ */
13
+ target: HTMLElement;
14
+ };
15
+ declare const ShadowAware: ({ children, target }: ShadowAwareProps) => import("react/jsx-runtime").JSX.Element;
16
+ export default ShadowAware;
@@ -8,6 +8,15 @@ type ThemeProviderProps = {
8
8
  breakpoints?: BreakpointType;
9
9
  theme?: Theme | string;
10
10
  children: React.ReactNode;
11
+ /**
12
+ * Target HTMLElement for styled-components to inject styles into.
13
+ * Use this when rendering inside a Shadow DOM.
14
+ * The element must be inside a shadow root.
15
+ *
16
+ * Note: This is the actual DOM element (not the ShadowRoot itself) that
17
+ * styled-components will use as the style injection target.
18
+ */
19
+ target?: HTMLElement;
11
20
  };
12
- declare const ThemeProvider: ({ foundationTokens, componentTokens, breakpoints, theme, children, }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
21
+ declare const ThemeProvider: ({ foundationTokens, componentTokens, breakpoints, theme, children, target, }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
13
22
  export default ThemeProvider;
@@ -3,3 +3,4 @@ export { Theme } from './theme.enum';
3
3
  export { useTheme } from './ThemeContext';
4
4
  export type { ComponentTokenType } from './ThemeContext';
5
5
  export type { ThemeType } from '../tokens';
6
+ export { default as ShadowAware, useShadowRoot } from './ShadowAware';
@@ -4,3 +4,4 @@ export { default as usePreventParentScroll } from './usePreventParentScroll';
4
4
  export { default as useDropdownInteractionLock } from './useDropdownInteractionLock';
5
5
  export { default as useTruncationDetection } from './useTruncationDetection';
6
6
  export type { UseTruncationDetectionOptions } from './useTruncationDetection';
7
+ export { useShadowRoot } from '../context/ShadowAware';