luna-components-library 1.1.39 → 1.1.41

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.
@@ -1,13 +1,18 @@
1
1
  import { default as React } from 'react';
2
- import { Styles } from '../types';
3
- type AccordionElements = 'container' | 'header' | 'content' | 'arrow' | 'innerContent';
2
+ export type AccordionStyles = {
3
+ container?: React.CSSProperties;
4
+ header?: React.CSSProperties;
5
+ content?: React.CSSProperties;
6
+ innerContent?: React.CSSProperties;
7
+ arrow?: React.CSSProperties;
8
+ };
4
9
  export type AccordionProps = {
5
10
  title: React.ReactNode;
6
11
  children: React.ReactNode;
7
12
  defaultActive?: boolean;
8
13
  active?: boolean;
9
14
  onClick?: () => void;
10
- styles?: Styles<AccordionElements>;
15
+ styles?: AccordionStyles;
11
16
  className?: string;
12
17
  };
13
18
  declare const Accordion: ({ title, children, defaultActive, active: externalActive, onClick, className, styles, }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { default as React } from 'react';
2
- import { Size, AnchorVariant } from '../types';
3
- export type { AnchorVariant };
2
+ import { Size, StandardVariant } from '../types';
3
+ export type { StandardVariant as AnchorVariant };
4
4
  export type AnchorSize = Size;
5
5
  export type AllAnchorProps = React.ComponentPropsWithoutRef<'a'>;
6
6
  export type AnchorProps = {
7
7
  children?: React.ReactNode;
8
- variant?: AnchorVariant;
8
+ variant?: StandardVariant;
9
9
  size?: AnchorSize;
10
10
  href?: string;
11
11
  className?: string;
@@ -1,19 +1,22 @@
1
1
  import { default as React } from 'react';
2
- import { ClassNames, Styles, ButtonVariant, ButtonSize } from '../types';
3
- export type { ButtonVariant, ButtonSize };
2
+ import { StandardVariant, ButtonSize } from '../types';
3
+ export type { StandardVariant, ButtonSize };
4
4
  export type AllButtonProps = React.ComponentPropsWithoutRef<'button'>;
5
- export type ButtonClassNames = ClassNames<'button' | 'container' | 'variant' | 'size'>;
6
- export type ButtonStyles = Styles<'button'>;
5
+ export type ButtonClassNames = Partial<Record<'button' | 'container' | 'variant' | 'size', string>>;
6
+ export type ButtonStyles = Partial<Record<'button' | 'container' | 'variant' | 'size', React.CSSProperties>>;
7
7
  export type ButtonProps = {
8
- children: React.ReactNode;
9
- variant?: ButtonVariant;
8
+ children?: React.ReactNode;
9
+ variant?: StandardVariant;
10
10
  size?: ButtonSize;
11
11
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
12
12
  disabled?: boolean;
13
+ rounded?: boolean;
14
+ icon?: React.ReactNode;
15
+ iconPosition?: 'left' | 'right';
13
16
  classNames?: ButtonClassNames;
14
17
  styles?: ButtonStyles;
15
18
  className?: string;
16
19
  style?: React.CSSProperties;
17
20
  };
18
- declare const Button: ({ children, variant, size, onClick, disabled, classNames, styles, className, style: extraStyle, ...props }: AllButtonProps & ButtonProps) => import("react/jsx-runtime").JSX.Element;
21
+ declare const Button: ({ children, variant, size, onClick, disabled, rounded, icon, iconPosition, classNames, styles, className, style: extraStyle, ...props }: AllButtonProps & ButtonProps) => import("react/jsx-runtime").JSX.Element;
19
22
  export default Button;
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { ClassNames, Styles } from '../types';
3
2
  export type DataTableColumn = {
4
3
  key: string;
5
4
  label: React.ReactNode;
@@ -19,8 +18,31 @@ export type DataTableTexts = {
19
18
  noData?: string;
20
19
  filterPlaceholder?: string;
21
20
  };
22
- export type DataTableClassNames = ClassNames<'container' | 'table' | 'thead' | 'tbody' | 'tr' | 'th' | 'td' | 'pagination' | 'searchContainer'>;
23
- export type DataTableStyles = Styles<'container' | 'table' | 'thead' | 'tbody' | 'tr' | 'th' | 'td'>;
21
+ export type DataTableClassNames = {
22
+ container?: string;
23
+ table?: string;
24
+ thead?: string;
25
+ tbody?: string;
26
+ tr?: string;
27
+ th?: string;
28
+ td?: string;
29
+ pagination?: string;
30
+ searchContainer?: string;
31
+ };
32
+ export type DataTableStyles = {
33
+ container?: React.CSSProperties;
34
+ searchContainer?: React.CSSProperties;
35
+ table?: React.CSSProperties;
36
+ thead?: React.CSSProperties;
37
+ tbody?: React.CSSProperties;
38
+ th?: React.CSSProperties;
39
+ td?: React.CSSProperties;
40
+ tr?: React.CSSProperties;
41
+ pagination?: React.CSSProperties;
42
+ icon?: React.CSSProperties;
43
+ filterMenu?: React.CSSProperties;
44
+ filterOption?: React.CSSProperties;
45
+ };
24
46
  export type DataTableProps = {
25
47
  columns: DataTableColumn[];
26
48
  data: any[];
@@ -1,11 +1,22 @@
1
1
  import { default as React } from 'react';
2
- import { ClassNames, Styles } from '../types';
3
2
  export type DropDownOption = {
4
3
  value: string | number;
5
- label: React.ReactNode;
4
+ label?: React.ReactNode;
5
+ text?: React.ReactNode;
6
+ };
7
+ export type DropDownClassNames = {
8
+ container?: string;
9
+ trigger?: string;
10
+ panel?: string;
11
+ option?: string;
12
+ };
13
+ export type DropDownStyles = {
14
+ container?: React.CSSProperties;
15
+ trigger?: React.CSSProperties;
16
+ panel?: React.CSSProperties;
17
+ option?: React.CSSProperties;
18
+ arrow?: React.CSSProperties;
6
19
  };
7
- export type DropDownClassNames = ClassNames<'container' | 'trigger' | 'panel' | 'option'>;
8
- export type DropDownStyles = Styles<'container' | 'trigger' | 'panel' | 'option'>;
9
20
  export type DropDownProps = {
10
21
  options: (string | number | DropDownOption)[];
11
22
  value?: string | number | React.ReactNode;
@@ -17,5 +28,5 @@ export type DropDownProps = {
17
28
  disabled?: boolean;
18
29
  className?: string;
19
30
  };
20
- declare const DropDown: ({ options, value, onChange, placeholder, toggle, classNames, styles, disabled, className, }: DropDownProps) => import("react/jsx-runtime").JSX.Element;
31
+ declare const DropDown: ({ options, value, onChange, placeholder, toggle, className, styles, disabled, }: DropDownProps) => import("react/jsx-runtime").JSX.Element;
21
32
  export default DropDown;
@@ -1,13 +1,13 @@
1
1
  import { default as React } from 'react';
2
- import { ClassNames, Styles, InputVariant, InputSize } from '../types';
3
- export type { InputVariant, InputSize };
2
+ import { InputSize, StandardVariant } from '../types';
3
+ export type { StandardVariant, InputSize };
4
4
  export type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local' | 'month' | 'week' | 'color' | 'file' | 'hidden' | 'image' | 'range' | 'reset' | 'submit';
5
5
  export type AllInputProps = Omit<React.ComponentPropsWithoutRef<'input'>, 'onChange' | 'value'>;
6
- export type InputClassNames = ClassNames<'container' | 'input' | 'label'>;
7
- export type InputStyles = Styles<'container' | 'input' | 'label'>;
6
+ export type InputClassNames = Record<'container' | 'input' | 'label', string>;
7
+ export type InputStyles = Record<'container' | 'input' | 'label', React.CSSProperties>;
8
8
  type InputCommonProps = {
9
9
  children?: React.ReactNode;
10
- variant?: InputVariant;
10
+ variant?: StandardVariant;
11
11
  inputSize?: InputSize;
12
12
  type?: InputType;
13
13
  placeholder?: string;
@@ -17,6 +17,9 @@ type InputCommonProps = {
17
17
  onBlur?: () => void;
18
18
  disabled?: boolean;
19
19
  required?: boolean;
20
+ isRequired?: boolean;
21
+ icon?: React.ReactNode;
22
+ iconPosition?: 'left' | 'right';
20
23
  readOnly?: boolean;
21
24
  mask?: string;
22
25
  maskChar?: string;
@@ -35,5 +38,5 @@ type InputCommonProps = {
35
38
  name?: string;
36
39
  };
37
40
  export type InputProps = InputCommonProps;
38
- declare const Input: ({ children, variant, type, inputSize, placeholder, value: controlledValue, onChange, onFocus, onBlur, disabled, required, readOnly, id, name, mask, maskChar, useCurrency, currency, locale, minFractionDigits, maxFractionDigits, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, classNames, styles, className: extraClassName, style: extraStyle, ...props }: InputProps & AllInputProps) => import("react/jsx-runtime").JSX.Element;
41
+ declare const Input: ({ children, variant, type, inputSize, placeholder, value: controlledValue, onChange, onFocus, onBlur, disabled, required, isRequired, icon, iconPosition, readOnly, id, name, mask, maskChar, useCurrency, currency, locale, minFractionDigits, maxFractionDigits, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, classNames, styles, className: extraClassName, style: extraStyle, ...props }: InputProps & AllInputProps) => import("react/jsx-runtime").JSX.Element;
39
42
  export default Input;
@@ -1,11 +1,34 @@
1
- import { ClassNames, Styles } from '../types';
1
+ import { default as React } from 'react';
2
2
  export type MultiSelectOption = {
3
3
  label: string;
4
4
  value: any;
5
5
  disabled?: boolean;
6
6
  };
7
- export type MultiSelectClassNames = ClassNames<'container' | 'trigger' | 'label' | 'panel' | 'header' | 'filterInput' | 'list' | 'item' | 'chip' | 'chipIcon'>;
8
- export type MultiSelectStyles = Styles<'container' | 'trigger' | 'panel' | 'header' | 'item' | 'chip'>;
7
+ export type MultiSelectClassNames = {
8
+ container?: string;
9
+ trigger?: string;
10
+ label?: string;
11
+ panel?: string;
12
+ header?: string;
13
+ filterInput?: string;
14
+ list?: string;
15
+ item?: string;
16
+ chip?: string;
17
+ chipIcon?: string;
18
+ };
19
+ export type MultiSelectStyles = {
20
+ container?: React.CSSProperties;
21
+ trigger?: React.CSSProperties;
22
+ chevron?: React.CSSProperties;
23
+ panel?: React.CSSProperties;
24
+ header?: React.CSSProperties;
25
+ selectAllWrapper?: React.CSSProperties;
26
+ list?: React.CSSProperties;
27
+ item?: React.CSSProperties;
28
+ checkbox?: React.CSSProperties;
29
+ chip?: React.CSSProperties;
30
+ chipIcon?: React.CSSProperties;
31
+ };
9
32
  export type MultiSelectProps = {
10
33
  options: MultiSelectOption[];
11
34
  value: any[];
@@ -22,5 +45,5 @@ export type MultiSelectProps = {
22
45
  disabled?: boolean;
23
46
  className?: string;
24
47
  };
25
- declare const MultiSelect: ({ options, value, onChange, id, placeholder, display, filter, filterPlaceholder, selectAll, maxSelectedLabels, classNames, styles, disabled, className, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
48
+ declare const MultiSelect: ({ options, value, onChange, id, placeholder, display, filter, filterPlaceholder, selectAll, maxSelectedLabels, classNames, styles, disabled, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
26
49
  export default MultiSelect;
@@ -1,7 +1,23 @@
1
1
  import { default as React } from 'react';
2
- import { ClassNames, Styles, PopconfirmPosition } from '../types';
3
- export type PopconfirmClassNames = ClassNames<'container' | 'popover' | 'title' | 'description' | 'actions' | 'okButton' | 'cancelButton'>;
4
- export type PopconfirmStyles = Styles<'container' | 'popover' | 'title' | 'description'>;
2
+ import { PopconfirmPosition } from '../types';
3
+ export type PopconfirmClassNames = {
4
+ container?: string;
5
+ popover?: string;
6
+ title?: string;
7
+ description?: string;
8
+ actions?: string;
9
+ okButton?: string;
10
+ cancelButton?: string;
11
+ };
12
+ export type PopconfirmStyles = {
13
+ container?: React.CSSProperties;
14
+ popover?: React.CSSProperties;
15
+ titleWrapper?: React.CSSProperties;
16
+ icon?: React.CSSProperties;
17
+ title?: React.CSSProperties;
18
+ description?: React.CSSProperties;
19
+ actions?: React.CSSProperties;
20
+ };
5
21
  export type PopconfirmProps = {
6
22
  title: React.ReactNode;
7
23
  description?: React.ReactNode;
@@ -1,6 +1,13 @@
1
- import { ClassNames, Styles } from '../types';
2
- export type QRCodeClassNames = ClassNames<'container' | 'image'>;
3
- export type QRCodeStyles = Styles<'container' | 'image'>;
1
+ import { default as React } from 'react';
2
+ export type QRCodeClassNames = {
3
+ container?: string;
4
+ image?: string;
5
+ };
6
+ export type QRCodeStyles = {
7
+ container?: React.CSSProperties;
8
+ image?: React.CSSProperties;
9
+ skeleton?: React.CSSProperties;
10
+ };
4
11
  export type QRCodeProps = {
5
12
  value: string;
6
13
  size?: number;
@@ -1,6 +1,21 @@
1
- import { ClassNames, Styles, ToastSeverity, ToastPosition } from '../types';
2
- export type ToastClassNames = ClassNames<'container' | 'content' | 'icon' | 'summary' | 'detail' | 'closeButton'>;
3
- export type ToastStyles = Styles<'container' | 'content' | 'summary' | 'detail'>;
1
+ import { default as React } from 'react';
2
+ import { ToastSeverity, ToastPosition } from '../types';
3
+ export type ToastClassNames = {
4
+ container?: string;
5
+ content?: string;
6
+ icon?: string;
7
+ summary?: string;
8
+ detail?: string;
9
+ closeButton?: string;
10
+ };
11
+ export type ToastStyles = {
12
+ container?: React.CSSProperties;
13
+ iconWrapper?: React.CSSProperties;
14
+ content?: React.CSSProperties;
15
+ summary?: React.CSSProperties;
16
+ detail?: React.CSSProperties;
17
+ closeButton?: React.CSSProperties;
18
+ };
4
19
  export type ToastProps = {
5
20
  visible: boolean;
6
21
  severity?: ToastSeverity;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Size, AnchorVariant, CardPadding, CardShadow, InputSize, InputVariant, ModalSize, PopconfirmPosition, ProgressBarVariant, ToastSeverity, ToastPosition, CornerPosition } from './types';
2
+ import { Size, StandardVariant, CardPadding, CardShadow, InputSize, ModalSize, PopconfirmPosition, ProgressBarVariant, ToastSeverity, ToastPosition, CornerPosition } from './types';
3
3
  export declare const colors: {
4
4
  readonly white: "#ffffff";
5
5
  readonly border: "#e5e7eb";
@@ -14,7 +14,23 @@ export declare const colors: {
14
14
  readonly bgSelected: "#eff6ff";
15
15
  readonly bgSkeleton: "#f3f4f6";
16
16
  readonly primary: "#2563eb";
17
+ readonly primaryHover: "#1d4ed8";
18
+ readonly secondary: "#4b5563";
19
+ readonly secondaryHover: "#6d737c";
20
+ readonly success: "#16a34a";
21
+ readonly successHover: "#15803d";
22
+ readonly danger: "#dc2626";
23
+ readonly dangerHover: "#b91c1c";
24
+ readonly warning: "#f59e0b";
25
+ readonly warningHover: "#d97706";
26
+ readonly info: "#0ea5e9";
27
+ readonly infoHover: "#0891b2";
28
+ readonly light: "#f9fafb";
29
+ readonly lightHover: "#f3f4f6";
17
30
  readonly dark: "#111827";
31
+ readonly darkHover: "#1f2937";
32
+ readonly whatsapp: "#25D366";
33
+ readonly whatsappHover: "#128C7E";
18
34
  };
19
35
  export declare const radii: {
20
36
  readonly sm: "0.375rem";
@@ -67,6 +83,7 @@ export declare const commonStyles: {
67
83
  filterOption: (active: boolean) => React.CSSProperties;
68
84
  pagination: React.CSSProperties;
69
85
  buttonBase: React.CSSProperties;
86
+ anchorBase: React.CSSProperties;
70
87
  inputWrapper: React.CSSProperties;
71
88
  inputLabel: React.CSSProperties;
72
89
  inputField: React.CSSProperties;
@@ -125,11 +142,11 @@ export declare const variantStyles: {
125
142
  readonly color: "#ffffff";
126
143
  };
127
144
  readonly warning: {
128
- readonly backgroundColor: "#eab308";
145
+ readonly backgroundColor: "#f59e0b";
129
146
  readonly color: "#ffffff";
130
147
  };
131
148
  readonly info: {
132
- readonly backgroundColor: "#0891b2";
149
+ readonly backgroundColor: "#0ea5e9";
133
150
  readonly color: "#ffffff";
134
151
  };
135
152
  readonly dark: {
@@ -137,7 +154,7 @@ export declare const variantStyles: {
137
154
  readonly color: "#ffffff";
138
155
  };
139
156
  readonly light: {
140
- readonly backgroundColor: "#f3f4f6";
157
+ readonly backgroundColor: "#f9fafb";
141
158
  readonly color: "#111827";
142
159
  };
143
160
  readonly link: {
@@ -148,23 +165,11 @@ export declare const variantStyles: {
148
165
  readonly textDecoration: "underline";
149
166
  };
150
167
  };
151
- export declare const variantClasses: {
152
- readonly primary: "bg-blue-600 text-white hover:bg-blue-700";
153
- readonly secondary: "bg-gray-600 text-white hover:bg-gray-700";
154
- readonly outline: "border border-gray-300 text-gray-700 hover:bg-gray-50";
155
- readonly success: "bg-green-600 text-white hover:bg-green-700";
156
- readonly danger: "bg-red-600 text-white hover:bg-red-700";
157
- readonly warning: "bg-yellow-500 text-white hover:bg-yellow-600";
158
- readonly info: "bg-cyan-600 text-white hover:bg-cyan-700";
159
- readonly dark: "bg-gray-900 text-white hover:bg-gray-800";
160
- readonly light: "bg-gray-100 text-gray-900 hover:bg-gray-200";
161
- readonly link: "text-blue-600 hover:text-blue-800 hover:underline";
162
- };
163
168
  export declare const inputStyles: (styles?: Record<string, React.CSSProperties>, extraStyle?: React.CSSProperties, inputSize?: InputSize, readOnly?: boolean, disabled?: boolean) => {
164
169
  container: React.CSSProperties;
165
170
  label: React.CSSProperties;
166
171
  input: React.CSSProperties;
167
- variants: Record<InputVariant, React.CSSProperties>;
172
+ variants: Record<StandardVariant, React.CSSProperties>;
168
173
  };
169
174
  export declare const multiSelectStyles: (styles?: Record<string, React.CSSProperties>, disabled?: boolean, isOpen?: boolean) => {
170
175
  container: React.CSSProperties;
@@ -248,7 +253,7 @@ export declare const scrollTopStyles: (styles?: React.CSSProperties, position?:
248
253
  export declare const modalSizeClasses: Record<ModalSize, string>;
249
254
  export declare const modalOverlayClasses: (show: boolean, animation: boolean, className: string) => string;
250
255
  export declare const modalDialogClasses: (size: ModalSize, centered: boolean, dialogClassName: string) => string;
251
- export declare const anchorBaseStyles: (variant: AnchorVariant, isHovered: boolean, size: Size) => React.CSSProperties;
256
+ export declare const anchorBaseStyles: (variant: StandardVariant, isHovered: boolean, size: Size) => React.CSSProperties;
252
257
  export declare const accordionStyles: (isActive: boolean, styles?: Record<string, React.CSSProperties>) => {
253
258
  container: React.CSSProperties;
254
259
  header: React.CSSProperties;
@@ -256,4 +261,4 @@ export declare const accordionStyles: (isActive: boolean, styles?: Record<string
256
261
  innerContent: React.CSSProperties;
257
262
  arrow: React.CSSProperties;
258
263
  };
259
- export declare const anchorVariantStyles: (isHovered: boolean) => Record<AnchorVariant, React.CSSProperties>;
264
+ export declare const standardVariantStyles: (isHovered: boolean) => Record<StandardVariant, React.CSSProperties>;
@@ -1,17 +1,8 @@
1
- import { default as React } from 'react';
2
- export type ClassNames<T extends string> = {
3
- [K in T]?: string;
4
- };
5
- export type Styles<T extends string> = {
6
- [K in T]?: React.CSSProperties;
7
- };
8
1
  export type Size = 'sm' | 'md' | 'lg';
9
2
  export type ExtendedSize = Size | 'xl';
10
3
  export type OptionalSize = Size | 'none';
11
- export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'link';
4
+ export type StandardVariant = 'none' | 'primary' | 'secondary' | 'outline' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'link';
12
5
  export type ButtonSize = Size;
13
- export type AnchorVariant = 'none' | 'primary' | 'secondary' | 'outline';
14
- export type InputVariant = 'none' | 'primary' | 'secondary' | 'outline' | 'danger' | 'success';
15
6
  export type ProgressBarVariant = 'primary' | 'success' | 'warning' | 'danger' | 'dark' | 'light';
16
7
  export type InputSize = ExtendedSize;
17
8
  export type ModalSize = ExtendedSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luna-components-library",
3
- "version": "1.1.39",
3
+ "version": "1.1.41",
4
4
  "description": "A React component library with TypeScript support",
5
5
  "main": "dist/luna-components-library.js",
6
6
  "module": "dist/luna-components-library.js",