smartsell-ui-kit 0.0.6 → 0.1.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.
package/dist/index.d.cts CHANGED
@@ -1,31 +1,38 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
3
- import { SmartSellSDK } from 'smartsell-sales-sdk';
4
- export { L as LegacyModalAction, a as LegacyModalCompatProps, b as LegacyModalProps, M as Modal, c as ModalAction, d as ModalProps, e as ModalTheme, f as ModalThemeSource, S as StandardModalProps, U as UiKitThemeTokens, u as useUiKitTheme } from './modal-CS9SuYSC.cjs';
3
+ export { L as LegacyModalAction, a as LegacyModalCompatProps, b as LegacyModalProps, M as Modal, c as ModalAction, d as ModalProps, e as ModalTheme, f as ModalThemeSource, S as StandardModalProps, U as UiKitThemeTokens, u as useUiKitTheme } from './modal-B2lmASXk.cjs';
4
+ import 'smartsell-theme';
5
5
 
6
6
  type ControlSize$1 = 'sm' | 'md' | 'lg';
7
7
 
8
8
  type ButtonVariant = 'solid' | 'outline' | 'ghost';
9
9
  type ButtonSize = ControlSize$1;
10
10
  interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'dangerouslySetInnerHTML'> {
11
- sdk: SmartSellSDK;
12
11
  variant?: ButtonVariant;
13
12
  size?: ButtonSize;
14
13
  fullWidth?: boolean;
15
14
  leadingIcon?: ReactNode;
16
15
  trailingIcon?: ReactNode;
17
16
  }
18
- declare function Button({ sdk, variant, size, fullWidth, leadingIcon, trailingIcon, children, disabled, style, type, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onBlur, onKeyDown, onKeyUp, onTouchStart, onTouchEnd, onTouchCancel, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
17
+ declare function Button({ variant, size, fullWidth, leadingIcon, trailingIcon, children, disabled, style, type, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onBlur, onKeyDown, onKeyUp, onTouchStart, onTouchEnd, onTouchCancel, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
19
18
 
20
19
  interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dangerouslySetInnerHTML' | 'title'> {
21
- sdk: SmartSellSDK;
22
20
  children: ReactNode;
23
21
  eyebrow?: ReactNode;
24
22
  title?: ReactNode;
25
23
  action?: ReactNode;
26
24
  padded?: boolean;
27
25
  }
28
- declare function Card({ sdk, children, eyebrow, title, action, padded, style, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
26
+ declare function Card({ children, eyebrow, title, action, padded, style, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
27
+
28
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size' | 'type'> {
29
+ label?: ReactNode;
30
+ hint?: ReactNode;
31
+ error?: ReactNode;
32
+ controlSize?: ControlSize$1;
33
+ indeterminate?: boolean;
34
+ }
35
+ declare function Checkbox({ label, hint, error, controlSize, id, checked, defaultChecked, disabled, indeterminate, required, className, style, onChange, onFocus, onBlur, ...rest }: CheckboxProps): react_jsx_runtime.JSX.Element;
29
36
 
30
37
  interface ModalSlotIds {
31
38
  header: string;
@@ -34,7 +41,6 @@ interface ModalSlotIds {
34
41
  }
35
42
  interface ModalSlotContext<TPayload = unknown> {
36
43
  title: string;
37
- description?: string;
38
44
  payload?: TPayload;
39
45
  close: () => void;
40
46
  confirm?: () => void;
@@ -43,13 +49,18 @@ interface ModalSlotContext<TPayload = unknown> {
43
49
  isOpen: boolean;
44
50
  isBusy: boolean;
45
51
  }
52
+ interface ComposableModalSlotRenderProps<TPayload = unknown> {
53
+ id: string;
54
+ context: ModalSlotContext<TPayload>;
55
+ children?: ReactNode;
56
+ }
57
+ type ComposableModalSlotRenderer<TPayload = unknown> = (props: ComposableModalSlotRenderProps<TPayload>) => ReactNode;
46
58
  interface ComposableModalProps<TPayload = unknown> {
47
- sdk: SmartSellSDK;
48
59
  isOpen: boolean;
49
60
  onClose: () => void;
50
61
  title: string;
51
- description?: string;
52
62
  slotBaseId: string;
63
+ renderSlot?: ComposableModalSlotRenderer<TPayload>;
53
64
  payload?: TPayload;
54
65
  onConfirm?: () => void;
55
66
  confirmLabel?: string;
@@ -66,20 +77,52 @@ interface ComposableModalProps<TPayload = unknown> {
66
77
  children?: ReactNode;
67
78
  }
68
79
  declare const createModalSlotIds: (slotBaseId: string) => ModalSlotIds;
69
- declare function ComposableModal<TPayload = unknown>({ sdk, isOpen, onClose, title, description, slotBaseId, payload, onConfirm, confirmLabel, cancelLabel, isBusy, closeOnBackdrop, closeOnEscape, hideExpandButton, maximized, hideDefaultFooter, maxWidth, headerFallback, footerFallback, children, }: ComposableModalProps<TPayload>): react_jsx_runtime.JSX.Element;
80
+ declare function ComposableModal<TPayload = unknown>({ isOpen, onClose, title, slotBaseId, renderSlot, payload, onConfirm, confirmLabel, cancelLabel, isBusy, closeOnBackdrop, closeOnEscape, hideExpandButton, maximized, hideDefaultFooter, maxWidth, headerFallback, footerFallback, children, }: ComposableModalProps<TPayload>): react_jsx_runtime.JSX.Element;
81
+
82
+ type DatePickerMode = 'date' | 'datetime';
83
+ type DatePickerValue = string | Date | null;
84
+ type DatePickerChangeReason = 'input' | 'picker' | 'clear';
85
+ interface DatePickerChangeContext {
86
+ reason: DatePickerChangeReason;
87
+ date: Date | null;
88
+ nativeValue: string;
89
+ displayValue: string;
90
+ }
91
+ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
92
+ label?: ReactNode;
93
+ hint?: ReactNode;
94
+ error?: ReactNode;
95
+ controlSize?: ControlSize$1;
96
+ value?: DatePickerValue;
97
+ defaultValue?: DatePickerValue;
98
+ onChange?: (value: string | null, context: DatePickerChangeContext) => void;
99
+ mode?: DatePickerMode;
100
+ format?: string;
101
+ allowPastDates?: boolean;
102
+ allowFutureDates?: boolean;
103
+ minDate?: DatePickerValue;
104
+ maxDate?: DatePickerValue;
105
+ minuteStep?: number;
106
+ clearable?: boolean;
107
+ showPickerButton?: boolean;
108
+ isDateUnavailable?: (date: Date) => boolean;
109
+ invalidDateMessage?: ReactNode;
110
+ unavailableDateMessage?: ReactNode;
111
+ pickerButtonLabel?: string;
112
+ clearButtonLabel?: string;
113
+ }
114
+ declare function DatePicker({ label, hint, error, controlSize, value, defaultValue, onChange, mode, format, allowPastDates, allowFutureDates, minDate, maxDate, minuteStep, clearable, showPickerButton, isDateUnavailable, invalidDateMessage, unavailableDateMessage, pickerButtonLabel, clearButtonLabel, id, name, disabled, readOnly, required, style, className, placeholder, onBlur, onFocus, onKeyDown, ...rest }: DatePickerProps): react_jsx_runtime.JSX.Element;
70
115
 
71
116
  interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size'> {
72
- sdk: SmartSellSDK;
73
117
  label?: ReactNode;
74
118
  hint?: ReactNode;
75
119
  error?: ReactNode;
76
120
  controlSize?: ControlSize$1;
77
121
  showPasswordToggle?: boolean;
78
122
  }
79
- declare function Input({ sdk, label, hint, error, controlSize, showPasswordToggle, id, disabled, style, type, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
123
+ declare function Input({ label, hint, error, controlSize, showPasswordToggle, id, disabled, style, type, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
80
124
 
81
125
  interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'dangerouslySetInnerHTML' | 'size'> {
82
- sdk: SmartSellSDK;
83
126
  label?: ReactNode;
84
127
  hint?: ReactNode;
85
128
  error?: ReactNode;
@@ -87,16 +130,15 @@ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'dan
87
130
  isMulti?: boolean;
88
131
  isFilterable?: boolean;
89
132
  }
90
- declare function Select({ sdk, label, hint, error, controlSize, id, disabled, style, children, value, defaultValue, onChange, onFocus, onBlur, onKeyDown, onClick, autoFocus, className, isMulti, isFilterable, multiple, ...rest }: SelectProps): react_jsx_runtime.JSX.Element;
133
+ declare function Select({ label, hint, error, controlSize, id, disabled, style, children, value, defaultValue, onChange, onFocus, onBlur, onKeyDown, onClick, autoFocus, className, isMulti, isFilterable, multiple, ...rest }: SelectProps): react_jsx_runtime.JSX.Element;
91
134
 
92
135
  type ControlSize = 'sm' | 'md' | 'lg';
93
136
  interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'dangerouslySetInnerHTML'> {
94
- sdk: SmartSellSDK;
95
137
  label?: ReactNode;
96
138
  hint?: ReactNode;
97
139
  error?: ReactNode;
98
140
  controlSize?: ControlSize;
99
141
  }
100
- declare function Textarea({ sdk, label, hint, error, controlSize, id, disabled, style, rows, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
142
+ declare function Textarea({ label, hint, error, controlSize, id, disabled, style, rows, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
101
143
 
102
- export { Button, type ButtonProps, Card, type CardProps, ComposableModal, type ComposableModalProps, Input, type InputProps, type ModalSlotContext, type ModalSlotIds, Select, type SelectProps, Textarea, type TextareaProps, createModalSlotIds };
144
+ export { Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, ComposableModal, type ComposableModalProps, type ComposableModalSlotRenderProps, type ComposableModalSlotRenderer, DatePicker, type DatePickerChangeContext, type DatePickerChangeReason, type DatePickerMode, type DatePickerProps, type DatePickerValue, Input, type InputProps, type ModalSlotContext, type ModalSlotIds, Select, type SelectProps, Textarea, type TextareaProps, createModalSlotIds };
package/dist/index.d.ts CHANGED
@@ -1,31 +1,38 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
3
- import { SmartSellSDK } from 'smartsell-sales-sdk';
4
- export { L as LegacyModalAction, a as LegacyModalCompatProps, b as LegacyModalProps, M as Modal, c as ModalAction, d as ModalProps, e as ModalTheme, f as ModalThemeSource, S as StandardModalProps, U as UiKitThemeTokens, u as useUiKitTheme } from './modal-CS9SuYSC.js';
3
+ export { L as LegacyModalAction, a as LegacyModalCompatProps, b as LegacyModalProps, M as Modal, c as ModalAction, d as ModalProps, e as ModalTheme, f as ModalThemeSource, S as StandardModalProps, U as UiKitThemeTokens, u as useUiKitTheme } from './modal-B2lmASXk.js';
4
+ import 'smartsell-theme';
5
5
 
6
6
  type ControlSize$1 = 'sm' | 'md' | 'lg';
7
7
 
8
8
  type ButtonVariant = 'solid' | 'outline' | 'ghost';
9
9
  type ButtonSize = ControlSize$1;
10
10
  interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'dangerouslySetInnerHTML'> {
11
- sdk: SmartSellSDK;
12
11
  variant?: ButtonVariant;
13
12
  size?: ButtonSize;
14
13
  fullWidth?: boolean;
15
14
  leadingIcon?: ReactNode;
16
15
  trailingIcon?: ReactNode;
17
16
  }
18
- declare function Button({ sdk, variant, size, fullWidth, leadingIcon, trailingIcon, children, disabled, style, type, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onBlur, onKeyDown, onKeyUp, onTouchStart, onTouchEnd, onTouchCancel, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
17
+ declare function Button({ variant, size, fullWidth, leadingIcon, trailingIcon, children, disabled, style, type, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onBlur, onKeyDown, onKeyUp, onTouchStart, onTouchEnd, onTouchCancel, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
19
18
 
20
19
  interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dangerouslySetInnerHTML' | 'title'> {
21
- sdk: SmartSellSDK;
22
20
  children: ReactNode;
23
21
  eyebrow?: ReactNode;
24
22
  title?: ReactNode;
25
23
  action?: ReactNode;
26
24
  padded?: boolean;
27
25
  }
28
- declare function Card({ sdk, children, eyebrow, title, action, padded, style, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
26
+ declare function Card({ children, eyebrow, title, action, padded, style, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
27
+
28
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size' | 'type'> {
29
+ label?: ReactNode;
30
+ hint?: ReactNode;
31
+ error?: ReactNode;
32
+ controlSize?: ControlSize$1;
33
+ indeterminate?: boolean;
34
+ }
35
+ declare function Checkbox({ label, hint, error, controlSize, id, checked, defaultChecked, disabled, indeterminate, required, className, style, onChange, onFocus, onBlur, ...rest }: CheckboxProps): react_jsx_runtime.JSX.Element;
29
36
 
30
37
  interface ModalSlotIds {
31
38
  header: string;
@@ -34,7 +41,6 @@ interface ModalSlotIds {
34
41
  }
35
42
  interface ModalSlotContext<TPayload = unknown> {
36
43
  title: string;
37
- description?: string;
38
44
  payload?: TPayload;
39
45
  close: () => void;
40
46
  confirm?: () => void;
@@ -43,13 +49,18 @@ interface ModalSlotContext<TPayload = unknown> {
43
49
  isOpen: boolean;
44
50
  isBusy: boolean;
45
51
  }
52
+ interface ComposableModalSlotRenderProps<TPayload = unknown> {
53
+ id: string;
54
+ context: ModalSlotContext<TPayload>;
55
+ children?: ReactNode;
56
+ }
57
+ type ComposableModalSlotRenderer<TPayload = unknown> = (props: ComposableModalSlotRenderProps<TPayload>) => ReactNode;
46
58
  interface ComposableModalProps<TPayload = unknown> {
47
- sdk: SmartSellSDK;
48
59
  isOpen: boolean;
49
60
  onClose: () => void;
50
61
  title: string;
51
- description?: string;
52
62
  slotBaseId: string;
63
+ renderSlot?: ComposableModalSlotRenderer<TPayload>;
53
64
  payload?: TPayload;
54
65
  onConfirm?: () => void;
55
66
  confirmLabel?: string;
@@ -66,20 +77,52 @@ interface ComposableModalProps<TPayload = unknown> {
66
77
  children?: ReactNode;
67
78
  }
68
79
  declare const createModalSlotIds: (slotBaseId: string) => ModalSlotIds;
69
- declare function ComposableModal<TPayload = unknown>({ sdk, isOpen, onClose, title, description, slotBaseId, payload, onConfirm, confirmLabel, cancelLabel, isBusy, closeOnBackdrop, closeOnEscape, hideExpandButton, maximized, hideDefaultFooter, maxWidth, headerFallback, footerFallback, children, }: ComposableModalProps<TPayload>): react_jsx_runtime.JSX.Element;
80
+ declare function ComposableModal<TPayload = unknown>({ isOpen, onClose, title, slotBaseId, renderSlot, payload, onConfirm, confirmLabel, cancelLabel, isBusy, closeOnBackdrop, closeOnEscape, hideExpandButton, maximized, hideDefaultFooter, maxWidth, headerFallback, footerFallback, children, }: ComposableModalProps<TPayload>): react_jsx_runtime.JSX.Element;
81
+
82
+ type DatePickerMode = 'date' | 'datetime';
83
+ type DatePickerValue = string | Date | null;
84
+ type DatePickerChangeReason = 'input' | 'picker' | 'clear';
85
+ interface DatePickerChangeContext {
86
+ reason: DatePickerChangeReason;
87
+ date: Date | null;
88
+ nativeValue: string;
89
+ displayValue: string;
90
+ }
91
+ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
92
+ label?: ReactNode;
93
+ hint?: ReactNode;
94
+ error?: ReactNode;
95
+ controlSize?: ControlSize$1;
96
+ value?: DatePickerValue;
97
+ defaultValue?: DatePickerValue;
98
+ onChange?: (value: string | null, context: DatePickerChangeContext) => void;
99
+ mode?: DatePickerMode;
100
+ format?: string;
101
+ allowPastDates?: boolean;
102
+ allowFutureDates?: boolean;
103
+ minDate?: DatePickerValue;
104
+ maxDate?: DatePickerValue;
105
+ minuteStep?: number;
106
+ clearable?: boolean;
107
+ showPickerButton?: boolean;
108
+ isDateUnavailable?: (date: Date) => boolean;
109
+ invalidDateMessage?: ReactNode;
110
+ unavailableDateMessage?: ReactNode;
111
+ pickerButtonLabel?: string;
112
+ clearButtonLabel?: string;
113
+ }
114
+ declare function DatePicker({ label, hint, error, controlSize, value, defaultValue, onChange, mode, format, allowPastDates, allowFutureDates, minDate, maxDate, minuteStep, clearable, showPickerButton, isDateUnavailable, invalidDateMessage, unavailableDateMessage, pickerButtonLabel, clearButtonLabel, id, name, disabled, readOnly, required, style, className, placeholder, onBlur, onFocus, onKeyDown, ...rest }: DatePickerProps): react_jsx_runtime.JSX.Element;
70
115
 
71
116
  interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size'> {
72
- sdk: SmartSellSDK;
73
117
  label?: ReactNode;
74
118
  hint?: ReactNode;
75
119
  error?: ReactNode;
76
120
  controlSize?: ControlSize$1;
77
121
  showPasswordToggle?: boolean;
78
122
  }
79
- declare function Input({ sdk, label, hint, error, controlSize, showPasswordToggle, id, disabled, style, type, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
123
+ declare function Input({ label, hint, error, controlSize, showPasswordToggle, id, disabled, style, type, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
80
124
 
81
125
  interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'dangerouslySetInnerHTML' | 'size'> {
82
- sdk: SmartSellSDK;
83
126
  label?: ReactNode;
84
127
  hint?: ReactNode;
85
128
  error?: ReactNode;
@@ -87,16 +130,15 @@ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'dan
87
130
  isMulti?: boolean;
88
131
  isFilterable?: boolean;
89
132
  }
90
- declare function Select({ sdk, label, hint, error, controlSize, id, disabled, style, children, value, defaultValue, onChange, onFocus, onBlur, onKeyDown, onClick, autoFocus, className, isMulti, isFilterable, multiple, ...rest }: SelectProps): react_jsx_runtime.JSX.Element;
133
+ declare function Select({ label, hint, error, controlSize, id, disabled, style, children, value, defaultValue, onChange, onFocus, onBlur, onKeyDown, onClick, autoFocus, className, isMulti, isFilterable, multiple, ...rest }: SelectProps): react_jsx_runtime.JSX.Element;
91
134
 
92
135
  type ControlSize = 'sm' | 'md' | 'lg';
93
136
  interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'dangerouslySetInnerHTML'> {
94
- sdk: SmartSellSDK;
95
137
  label?: ReactNode;
96
138
  hint?: ReactNode;
97
139
  error?: ReactNode;
98
140
  controlSize?: ControlSize;
99
141
  }
100
- declare function Textarea({ sdk, label, hint, error, controlSize, id, disabled, style, rows, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
142
+ declare function Textarea({ label, hint, error, controlSize, id, disabled, style, rows, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
101
143
 
102
- export { Button, type ButtonProps, Card, type CardProps, ComposableModal, type ComposableModalProps, Input, type InputProps, type ModalSlotContext, type ModalSlotIds, Select, type SelectProps, Textarea, type TextareaProps, createModalSlotIds };
144
+ export { Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, ComposableModal, type ComposableModalProps, type ComposableModalSlotRenderProps, type ComposableModalSlotRenderer, DatePicker, type DatePickerChangeContext, type DatePickerChangeReason, type DatePickerMode, type DatePickerProps, type DatePickerValue, Input, type InputProps, type ModalSlotContext, type ModalSlotIds, Select, type SelectProps, Textarea, type TextareaProps, createModalSlotIds };