dhre-component-lib 0.8.32 → 0.10.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.
@@ -0,0 +1,60 @@
1
+ import React from "react";
2
+ import "./ButtonV2.module.scss";
3
+ /**
4
+ * `primary` / `secondary` → text buttons (Buttons/Regular)
5
+ * `dark` / `light` / `blur` / `outlined` → icon-only buttons (Buttons/Icon)
6
+ *
7
+ * The icon-only variants are only meaningful when `iconOnly` is true.
8
+ */
9
+ export type ButtonV2Variant = "primary" | "secondary" | "dark" | "light" | "blur" | "outlined";
10
+ /** `xsmall` is only valid in `iconOnly` mode. Text buttons stop at `small`. */
11
+ export type ButtonV2Size = "large" | "medium" | "small" | "xsmall";
12
+ export interface ButtonV2Props extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
13
+ /** Visible label. If you need richer markup, use `children` instead. Ignored when `iconOnly`. */
14
+ label?: React.ReactNode;
15
+ /**
16
+ * Visual style.
17
+ * - Text buttons: `primary` (filled) | `secondary` (outlined). Defaults to `primary`.
18
+ * - Icon-only buttons (when `iconOnly` is true): `dark` | `light` | `blur` | `outlined`.
19
+ * If `iconOnly` is set and no variant is provided, defaults to `dark`.
20
+ */
21
+ variant?: ButtonV2Variant;
22
+ /**
23
+ * Height tier.
24
+ * - Text buttons: large (48) / medium (40) / small (32). Defaults to `large`.
25
+ * - Icon-only buttons: large (64) / medium (48) / small (32) / xsmall (20).
26
+ */
27
+ size?: ButtonV2Size;
28
+ /** When true, renders a spinner and blocks interaction. */
29
+ loading?: boolean;
30
+ /** Standard HTML disabled. */
31
+ disabled?: boolean;
32
+ /** Stretches the button to 100% of its container, always. Ignored when `iconOnly`. */
33
+ fullWidth?: boolean;
34
+ /**
35
+ * Text mode: stretches to 100% on viewports <= 600px (mobile-only).
36
+ * Icon-only mode: steps the button down to the next-smaller size on viewports <= 600px
37
+ * (Large → Medium, Medium → Small). Use to honor the "scales with breakpoint" spec.
38
+ */
39
+ responsiveFullWidth?: boolean;
40
+ /** Optional leading icon (start-side, auto-flips in RTL). Ignored when `iconOnly`. */
41
+ leadIcon?: React.ReactNode;
42
+ /** Optional trailing icon (end-side, auto-flips in RTL). Ignored when `iconOnly`. */
43
+ trailIcon?: React.ReactNode;
44
+ /**
45
+ * Required when `iconOnly` is true — the single icon rendered centered in the
46
+ * circular button. Ignored in text mode.
47
+ */
48
+ icon?: React.ReactNode;
49
+ /**
50
+ * Switches the button to icon-only mode: square, fully circular, no label.
51
+ * Pair with one of the icon-only variants (`dark` / `light` / `blur` / `outlined`)
52
+ * and pass an `aria-label` for accessibility.
53
+ */
54
+ iconOnly?: boolean;
55
+ /** HTML button type. Renamed from native `type` to avoid clashing with `variant`. */
56
+ buttonType?: "button" | "submit" | "reset";
57
+ className?: string;
58
+ }
59
+ declare const ButtonV2: React.ForwardRefExoticComponent<ButtonV2Props & React.RefAttributes<HTMLButtonElement>>;
60
+ export default ButtonV2;
@@ -18,6 +18,7 @@ export interface DropdownProps {
18
18
  searchPlaceholder?: string;
19
19
  noResultsText?: string;
20
20
  searchClearIcon?: React.ReactNode;
21
+ isLifestyle?: boolean;
21
22
  }
22
23
  declare function Dropdown(props: DropdownProps): React.JSX.Element;
23
24
  export default Dropdown;
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import "./ModalV2.module.scss";
3
+ export interface ModalV2Props {
4
+ /** Controls modal visibility */
5
+ isOpen: boolean;
6
+ /** Callback fired when overlay or close button is clicked */
7
+ onClose: () => void;
8
+ /**
9
+ * Modal heading content.
10
+ * Figma: H5/MEDIUM on desktop (24px / lh 32px), H6/MEDIUM on mobile (20px / lh 28px).
11
+ * The consumer should pass a Typography component with the correct variant.
12
+ */
13
+ title?: React.ReactNode;
14
+ /** Body content rendered inside the scrollable content area */
15
+ children: React.ReactNode;
16
+ /**
17
+ * Close icon element (e.g. an SVG wrapped in BrandedSvg).
18
+ * Rendered inline in the header row alongside the title.
19
+ */
20
+ crossIcon: React.ReactNode;
21
+ /** Optional extra className applied to the modal container for consumer overrides */
22
+ className?: string;
23
+ }
24
+ declare const ModalV2: React.FC<ModalV2Props>;
25
+ export default ModalV2;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import "./RadioButtonV2.module.scss";
3
+ export interface RadioButtonV2Props {
4
+ /** Radio group name */
5
+ name: string;
6
+ /** Value for this option */
7
+ value: string;
8
+ /** Display label shown beside the circle */
9
+ label: string;
10
+ /** Whether this option is currently selected */
11
+ checked?: boolean;
12
+ /** Disables interaction and applies muted styling */
13
+ disabled?: boolean;
14
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
15
+ /** Input element id — links the label for accessibility */
16
+ id?: string;
17
+ /** Optional extra className on the wrapper */
18
+ className?: string;
19
+ }
20
+ declare const RadioButtonV2: React.FC<RadioButtonV2Props>;
21
+ export default RadioButtonV2;
@@ -1 +1,3 @@
1
1
  export { default } from "./RadioButton";
2
+ export { default as RadioButtonV2 } from "./RadioButtonV2";
3
+ export type { RadioButtonV2Props } from "./RadioButtonV2";
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import "./SearchV2.module.scss";
3
+ export type SearchV2Size = "large" | "small";
4
+ export type SearchV2Suggestion = {
5
+ id: string | number;
6
+ title: string;
7
+ };
8
+ export interface SearchV2Props<T extends SearchV2Suggestion = SearchV2Suggestion> {
9
+ placeholder: string;
10
+ searchIcon: React.ReactNode;
11
+ crossIcon: React.ReactNode;
12
+ onSearch: (query: string) => void;
13
+ value?: string;
14
+ defaultValue?: string;
15
+ size?: SearchV2Size;
16
+ disabled?: boolean;
17
+ suggestions?: T[] | null;
18
+ onSelectSuggestion?: (suggestion: T | null) => void;
19
+ shouldShowAll?: boolean;
20
+ noResultFoundText?: string;
21
+ debounceMs?: number;
22
+ className?: string;
23
+ inputClassName?: string;
24
+ suggestionClassName?: string;
25
+ onSearchIconClick?: () => void;
26
+ onHandleClear?: () => void;
27
+ }
28
+ declare function SearchV2<T extends SearchV2Suggestion = SearchV2Suggestion>({ placeholder, searchIcon, crossIcon, onSearch, value: controlledValue, defaultValue, size, disabled, suggestions, onSelectSuggestion, shouldShowAll, noResultFoundText, debounceMs, className, inputClassName, suggestionClassName, onSearchIconClick, onHandleClear, }: SearchV2Props<T>): React.JSX.Element;
29
+ export default SearchV2;
@@ -1,8 +1,24 @@
1
1
  import React from 'react';
2
2
  import '../../theme/Typography/typography.scss';
3
+ import '../../theme/Typography/lifestyle-lib-typography.scss';
4
+ /**
5
+ * Weight values and what they mean per brand:
6
+ *
7
+ * | Prop | Meraas/DP/Nakheel | Lifestyle (Inter) |
8
+ * |-----------|-------------------|-------------------|
9
+ * | BOLD | 700 | 700 (Inter-Bold) |
10
+ * | SEMI_BOLD | 400 | 500 (Inter-Medium)|
11
+ * | MEDIUM | 300 | 500 (Inter-Light) |
12
+ * | REGULAR | 400 | 400 (Inter-Regular|
13
+ * | LIGHT | 300 | 300 (Inter-Light) |
14
+ *
15
+ * No runtime brand detection needed — CSS handles switching via body.Lifestyle class.
16
+ */
17
+ type TypographyVariant = 'H1' | 'H2' | 'H3' | 'H4' | 'H5' | 'H6' | 'H7' | 'H8' | 'B1' | 'B2' | 'B3' | 'B4' | 'L1' | 'L2' | 'L3';
18
+ type TypographyWeight = 'BOLD' | 'SEMI_BOLD' | 'MEDIUM' | 'REGULAR' | 'LIGHT';
3
19
  interface TypographyProps {
4
- variant?: 'H1' | 'H2' | 'H3' | 'H4' | 'H5' | 'H6' | 'H7' | 'H8' | 'B1' | 'B2' | 'B3' | 'B4' | 'L1' | 'L2' | 'L3';
5
- weight?: 'BOLD' | 'SEMI_BOLD' | 'MEDIUM';
20
+ variant?: TypographyVariant;
21
+ weight?: TypographyWeight;
6
22
  children: React.ReactNode;
7
23
  className?: string;
8
24
  }
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Showcase: React.FC;
3
+ export default Showcase;
@@ -0,0 +1,3 @@
1
+ import "./shim";
2
+ import "./theme.css";
3
+ import "./showcase.scss";
package/dist/index.d.ts CHANGED
@@ -47,6 +47,64 @@ type ButtonProps = {
47
47
  };
48
48
  declare const Button: React.FC<ButtonProps>;
49
49
 
50
+ /**
51
+ * `primary` / `secondary` → text buttons (Buttons/Regular)
52
+ * `dark` / `light` / `blur` / `outlined` → icon-only buttons (Buttons/Icon)
53
+ *
54
+ * The icon-only variants are only meaningful when `iconOnly` is true.
55
+ */
56
+ type ButtonV2Variant = "primary" | "secondary" | "dark" | "light" | "blur" | "outlined";
57
+ /** `xsmall` is only valid in `iconOnly` mode. Text buttons stop at `small`. */
58
+ type ButtonV2Size = "large" | "medium" | "small" | "xsmall";
59
+ interface ButtonV2Props extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
60
+ /** Visible label. If you need richer markup, use `children` instead. Ignored when `iconOnly`. */
61
+ label?: React.ReactNode;
62
+ /**
63
+ * Visual style.
64
+ * - Text buttons: `primary` (filled) | `secondary` (outlined). Defaults to `primary`.
65
+ * - Icon-only buttons (when `iconOnly` is true): `dark` | `light` | `blur` | `outlined`.
66
+ * If `iconOnly` is set and no variant is provided, defaults to `dark`.
67
+ */
68
+ variant?: ButtonV2Variant;
69
+ /**
70
+ * Height tier.
71
+ * - Text buttons: large (48) / medium (40) / small (32). Defaults to `large`.
72
+ * - Icon-only buttons: large (64) / medium (48) / small (32) / xsmall (20).
73
+ */
74
+ size?: ButtonV2Size;
75
+ /** When true, renders a spinner and blocks interaction. */
76
+ loading?: boolean;
77
+ /** Standard HTML disabled. */
78
+ disabled?: boolean;
79
+ /** Stretches the button to 100% of its container, always. Ignored when `iconOnly`. */
80
+ fullWidth?: boolean;
81
+ /**
82
+ * Text mode: stretches to 100% on viewports <= 600px (mobile-only).
83
+ * Icon-only mode: steps the button down to the next-smaller size on viewports <= 600px
84
+ * (Large → Medium, Medium → Small). Use to honor the "scales with breakpoint" spec.
85
+ */
86
+ responsiveFullWidth?: boolean;
87
+ /** Optional leading icon (start-side, auto-flips in RTL). Ignored when `iconOnly`. */
88
+ leadIcon?: React.ReactNode;
89
+ /** Optional trailing icon (end-side, auto-flips in RTL). Ignored when `iconOnly`. */
90
+ trailIcon?: React.ReactNode;
91
+ /**
92
+ * Required when `iconOnly` is true — the single icon rendered centered in the
93
+ * circular button. Ignored in text mode.
94
+ */
95
+ icon?: React.ReactNode;
96
+ /**
97
+ * Switches the button to icon-only mode: square, fully circular, no label.
98
+ * Pair with one of the icon-only variants (`dark` / `light` / `blur` / `outlined`)
99
+ * and pass an `aria-label` for accessibility.
100
+ */
101
+ iconOnly?: boolean;
102
+ /** HTML button type. Renamed from native `type` to avoid clashing with `variant`. */
103
+ buttonType?: "button" | "submit" | "reset";
104
+ className?: string;
105
+ }
106
+ declare const ButtonV2: React.ForwardRefExoticComponent<ButtonV2Props & React.RefAttributes<HTMLButtonElement>>;
107
+
50
108
  interface AvatarProps {
51
109
  src: string;
52
110
  alt: string;
@@ -134,6 +192,25 @@ interface RadioButtonProps {
134
192
  }
135
193
  declare const CustomRadioButton: React.FC<RadioButtonProps>;
136
194
 
195
+ interface RadioButtonV2Props {
196
+ /** Radio group name */
197
+ name: string;
198
+ /** Value for this option */
199
+ value: string;
200
+ /** Display label shown beside the circle */
201
+ label: string;
202
+ /** Whether this option is currently selected */
203
+ checked?: boolean;
204
+ /** Disables interaction and applies muted styling */
205
+ disabled?: boolean;
206
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
207
+ /** Input element id — links the label for accessibility */
208
+ id?: string;
209
+ /** Optional extra className on the wrapper */
210
+ className?: string;
211
+ }
212
+ declare const RadioButtonV2: React.FC<RadioButtonV2Props>;
213
+
137
214
  interface CustomInputFieldProps {
138
215
  label?: string;
139
216
  value?: any;
@@ -221,9 +298,24 @@ interface OTPInputProps {
221
298
  }
222
299
  declare const OTPInput: React.FC<OTPInputProps>;
223
300
 
301
+ /**
302
+ * Weight values and what they mean per brand:
303
+ *
304
+ * | Prop | Meraas/DP/Nakheel | Lifestyle (Inter) |
305
+ * |-----------|-------------------|-------------------|
306
+ * | BOLD | 700 | 700 (Inter-Bold) |
307
+ * | SEMI_BOLD | 400 | 500 (Inter-Medium)|
308
+ * | MEDIUM | 300 | 500 (Inter-Light) |
309
+ * | REGULAR | 400 | 400 (Inter-Regular|
310
+ * | LIGHT | 300 | 300 (Inter-Light) |
311
+ *
312
+ * No runtime brand detection needed — CSS handles switching via body.Lifestyle class.
313
+ */
314
+ type TypographyVariant = 'H1' | 'H2' | 'H3' | 'H4' | 'H5' | 'H6' | 'H7' | 'H8' | 'B1' | 'B2' | 'B3' | 'B4' | 'L1' | 'L2' | 'L3';
315
+ type TypographyWeight = 'BOLD' | 'SEMI_BOLD' | 'MEDIUM' | 'REGULAR' | 'LIGHT';
224
316
  interface TypographyProps {
225
- variant?: 'H1' | 'H2' | 'H3' | 'H4' | 'H5' | 'H6' | 'H7' | 'H8' | 'B1' | 'B2' | 'B3' | 'B4' | 'L1' | 'L2' | 'L3';
226
- weight?: 'BOLD' | 'SEMI_BOLD' | 'MEDIUM';
317
+ variant?: TypographyVariant;
318
+ weight?: TypographyWeight;
227
319
  children: React.ReactNode;
228
320
  className?: string;
229
321
  }
@@ -257,6 +349,33 @@ interface CustomSearchFieldProps {
257
349
  }
258
350
  declare const Search: React.FC<CustomSearchFieldProps>;
259
351
 
352
+ type SearchV2Size = "large" | "small";
353
+ type SearchV2Suggestion = {
354
+ id: string | number;
355
+ title: string;
356
+ };
357
+ interface SearchV2Props<T extends SearchV2Suggestion = SearchV2Suggestion> {
358
+ placeholder: string;
359
+ searchIcon: React.ReactNode;
360
+ crossIcon: React.ReactNode;
361
+ onSearch: (query: string) => void;
362
+ value?: string;
363
+ defaultValue?: string;
364
+ size?: SearchV2Size;
365
+ disabled?: boolean;
366
+ suggestions?: T[] | null;
367
+ onSelectSuggestion?: (suggestion: T | null) => void;
368
+ shouldShowAll?: boolean;
369
+ noResultFoundText?: string;
370
+ debounceMs?: number;
371
+ className?: string;
372
+ inputClassName?: string;
373
+ suggestionClassName?: string;
374
+ onSearchIconClick?: () => void;
375
+ onHandleClear?: () => void;
376
+ }
377
+ declare function SearchV2<T extends SearchV2Suggestion = SearchV2Suggestion>({ placeholder, searchIcon, crossIcon, onSearch, value: controlledValue, defaultValue, size, disabled, suggestions, onSelectSuggestion, shouldShowAll, noResultFoundText, debounceMs, className, inputClassName, suggestionClassName, onSearchIconClick, onHandleClear, }: SearchV2Props<T>): React.JSX.Element;
378
+
260
379
  interface ModalProps {
261
380
  isOpen: boolean;
262
381
  onClose: () => void;
@@ -267,6 +386,29 @@ interface ModalProps {
267
386
  }
268
387
  declare const Modal: React.FC<ModalProps>;
269
388
 
389
+ interface ModalV2Props {
390
+ /** Controls modal visibility */
391
+ isOpen: boolean;
392
+ /** Callback fired when overlay or close button is clicked */
393
+ onClose: () => void;
394
+ /**
395
+ * Modal heading content.
396
+ * Figma: H5/MEDIUM on desktop (24px / lh 32px), H6/MEDIUM on mobile (20px / lh 28px).
397
+ * The consumer should pass a Typography component with the correct variant.
398
+ */
399
+ title?: React.ReactNode;
400
+ /** Body content rendered inside the scrollable content area */
401
+ children: React.ReactNode;
402
+ /**
403
+ * Close icon element (e.g. an SVG wrapped in BrandedSvg).
404
+ * Rendered inline in the header row alongside the title.
405
+ */
406
+ crossIcon: React.ReactNode;
407
+ /** Optional extra className applied to the modal container for consumer overrides */
408
+ className?: string;
409
+ }
410
+ declare const ModalV2: React.FC<ModalV2Props>;
411
+
270
412
  type AccordionProps = {
271
413
  icon?: React.ReactNode;
272
414
  title: React.ReactNode;
@@ -313,6 +455,7 @@ interface DropdownProps {
313
455
  searchPlaceholder?: string;
314
456
  noResultsText?: string;
315
457
  searchClearIcon?: React.ReactNode;
458
+ isLifestyle?: boolean;
316
459
  }
317
460
  declare function Dropdown(props: DropdownProps): React.JSX.Element;
318
461
 
@@ -432,4 +575,5 @@ interface StepperInterface {
432
575
  }
433
576
  declare const Stepper: React.FC<StepperInterface>;
434
577
 
435
- export { Accordion as Accordian, Avatar, Badge, Breadcrumb as BreadCrumb, Button, ButtonCategory, Carousel, Checkbox, CircularProgress, GetDirectionAction as Directions, CustomDivider as Divider, Drawer, Dropdown, MapComponent as GoogleMap, HoverOptionsWrapper, CustomInputField as InputTextField, Link, MediaType, Menu, Modal, OTPInput as OtpInput, Progress, CustomRadioButton as RadioButton, RangeSlider, Search, Stepper, Tabs, TextArea, Toast, ToastStatus, ToggleSwitch, Typography, PdfView as default };
578
+ export { Accordion as Accordian, Avatar, Badge, Breadcrumb as BreadCrumb, Button, ButtonCategory, ButtonV2, Carousel, Checkbox, CircularProgress, GetDirectionAction as Directions, CustomDivider as Divider, Drawer, Dropdown, MapComponent as GoogleMap, HoverOptionsWrapper, CustomInputField as InputTextField, Link, MediaType, Menu, Modal, ModalV2, OTPInput as OtpInput, Progress, CustomRadioButton as RadioButton, RadioButtonV2, RangeSlider, Search, SearchV2, Stepper, Tabs, TextArea, Toast, ToastStatus, ToggleSwitch, Typography, PdfView as default };
579
+ export type { ButtonV2Props, ButtonV2Size, ButtonV2Variant, ModalV2Props, RadioButtonV2Props, SearchV2Props, SearchV2Size, SearchV2Suggestion };