smartsell-ui-kit 0.1.6 → 0.1.8

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,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, InputHTMLAttributes, Ref, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
3
3
  import { SmartSellTheme, ThemeColors } from 'smartsell-theme';
4
4
 
5
5
  type ControlSize = 'sm' | 'md' | 'lg';
@@ -16,7 +16,8 @@ interface UiKitTheme extends Omit<SmartSellTheme, 'title' | 'colors' | 'color'>
16
16
  }
17
17
  declare function useUiKitTheme(): UiKitTheme;
18
18
 
19
- type ButtonVariant = 'solid' | 'outline' | 'ghost';
19
+ type LegacyVariant = 'primary';
20
+ type ButtonVariant = 'solid' | 'secondary' | 'outline' | 'ghost' | 'negative' | LegacyVariant;
20
21
  type ButtonSize = ControlSize;
21
22
  interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'dangerouslySetInnerHTML'> {
22
23
  variant?: ButtonVariant;
@@ -97,6 +98,19 @@ interface ComposableModalProps<TPayload = unknown> {
97
98
  declare const createModalSlotIds: (slotBaseId: string) => ModalSlotIds;
98
99
  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;
99
100
 
101
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size'> {
102
+ label?: ReactNode;
103
+ hint?: ReactNode;
104
+ error?: ReactNode;
105
+ size?: ControlSize;
106
+ showPasswordToggle?: boolean;
107
+ fileButtonLabel?: ReactNode;
108
+ icon?: ReactNode;
109
+ disableFloatingLabel?: boolean;
110
+ ref?: Ref<HTMLInputElement>;
111
+ }
112
+ declare function Input({ label, hint, error, size, className, showPasswordToggle, fileButtonLabel, icon, id, disabled, placeholder, onChange, style, type, disableFloatingLabel, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
113
+
100
114
  type DatePickerMode = 'date' | 'datetime';
101
115
  type DatePickerValue = string | Date | null;
102
116
  type DatePickerChangeReason = 'input' | 'picker' | 'clear';
@@ -106,11 +120,10 @@ interface DatePickerChangeContext {
106
120
  nativeValue: string;
107
121
  displayValue: string;
108
122
  }
109
- interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
123
+ interface DatePickerProps extends Omit<InputProps, 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
110
124
  label?: ReactNode;
111
125
  hint?: ReactNode;
112
126
  error?: ReactNode;
113
- size?: ControlSize;
114
127
  value?: DatePickerValue;
115
128
  defaultValue?: DatePickerValue;
116
129
  onChange?: (value: string | null, context: DatePickerChangeContext) => void;
@@ -129,18 +142,7 @@ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'd
129
142
  pickerButtonLabel?: string;
130
143
  clearButtonLabel?: string;
131
144
  }
132
- declare function DatePicker({ label, hint, error, size, 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, onClick, onFocus, onKeyDown, ...rest }: DatePickerProps): react_jsx_runtime.JSX.Element;
133
-
134
- interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size'> {
135
- label?: ReactNode;
136
- hint?: ReactNode;
137
- error?: ReactNode;
138
- size?: ControlSize;
139
- showPasswordToggle?: boolean;
140
- fileButtonLabel?: ReactNode;
141
- icon?: ReactNode;
142
- }
143
- declare function Input({ label, hint, error, size, className, showPasswordToggle, fileButtonLabel, icon, id, disabled, placeholder, onChange, style, type, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
145
+ declare function DatePicker({ value, defaultValue, onChange, mode, minDate, maxDate, minuteStep, placeholder, ...props }: DatePickerProps): react_jsx_runtime.JSX.Element;
144
146
 
145
147
  type ModalActionAppearance = 'text' | 'outlined' | 'contained' | 'link';
146
148
  type ModalThemeColors = {
@@ -213,10 +215,15 @@ interface SharedSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>
213
215
  isFilterable?: boolean;
214
216
  }
215
217
 
218
+ type SelectOption = {
219
+ label: string;
220
+ value: string;
221
+ };
216
222
  interface SelectProps extends SharedSelectProps {
217
223
  children?: ReactNode;
224
+ options?: SelectOption[];
218
225
  }
219
- declare function Select({ children, ...props }: SelectProps): react_jsx_runtime.JSX.Element;
226
+ declare function Select({ children, options, ...props }: SelectProps): react_jsx_runtime.JSX.Element;
220
227
 
221
228
  type SelectObjectOptionValue = string | number;
222
229
  interface SelectObjectOption<TValue extends SelectObjectOptionValue = SelectObjectOptionValue> {
@@ -320,6 +327,11 @@ interface SharedTableProps<TItem> {
320
327
  actions?: TableActionSource<TItem>;
321
328
  stickyActionsColumn?: boolean;
322
329
  maxInlineActions?: number;
330
+ /**
331
+ * Viewport width (in px) below which the table switches from the desktop
332
+ * table layout to the stacked mobile card layout. Defaults to 768 so the
333
+ * table collapses in sync with the host app's mobile breakpoint.
334
+ */
323
335
  collapseBelow?: number;
324
336
  searchable?: boolean;
325
337
  showSearch?: boolean;
@@ -369,6 +381,6 @@ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
369
381
  error?: ReactNode;
370
382
  size?: ControlSize;
371
383
  }
372
- declare function Textarea({ label, hint, error, size, id, disabled, style, rows, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
384
+ declare function Textarea({ label, hint, error, size, id, disabled, style, rows, placeholder, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
373
385
 
374
386
  export { Button, type ButtonProps, Card, type CardProps, CardSmall, type CardSmallProps, Checkbox, type CheckboxProps, ComposableModal, type ComposableModalProps, type ComposableModalSlotRenderProps, type ComposableModalSlotRenderer, type ControlSize, DatePicker, type DatePickerChangeContext, type DatePickerChangeReason, type DatePickerMode, type DatePickerProps, type DatePickerValue, Input, type InputProps, Modal, type ModalAction, type ModalProps, type ModalSlotContext, type ModalSlotIds, type ModalTheme, type ModalThemeSource, Select, SelectAsync, type SelectAsyncLoadContext, type SelectAsyncLoadResult, type SelectAsyncOption, type SelectAsyncOptionValue, type SelectAsyncProps, type SelectProps, Separator, type SeparatorOrientation, type SeparatorProps, type SharedTableProps, type StandardModalProps, Table, type TableAction, type TableActionSource, type TableActionTone, TableAsync, type TableAsyncLoadContext, type TableAsyncLoadResult, type TableAsyncProps, type TableColumn, type TableColumnAlign, type TableColumnType, type TableLabels, type TableProps, Textarea, type TextareaProps, type UiKitTheme, createModalSlotIds, useUiKitTheme };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, InputHTMLAttributes, Ref, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
3
3
  import { SmartSellTheme, ThemeColors } from 'smartsell-theme';
4
4
 
5
5
  type ControlSize = 'sm' | 'md' | 'lg';
@@ -16,7 +16,8 @@ interface UiKitTheme extends Omit<SmartSellTheme, 'title' | 'colors' | 'color'>
16
16
  }
17
17
  declare function useUiKitTheme(): UiKitTheme;
18
18
 
19
- type ButtonVariant = 'solid' | 'outline' | 'ghost';
19
+ type LegacyVariant = 'primary';
20
+ type ButtonVariant = 'solid' | 'secondary' | 'outline' | 'ghost' | 'negative' | LegacyVariant;
20
21
  type ButtonSize = ControlSize;
21
22
  interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'dangerouslySetInnerHTML'> {
22
23
  variant?: ButtonVariant;
@@ -97,6 +98,19 @@ interface ComposableModalProps<TPayload = unknown> {
97
98
  declare const createModalSlotIds: (slotBaseId: string) => ModalSlotIds;
98
99
  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;
99
100
 
101
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size'> {
102
+ label?: ReactNode;
103
+ hint?: ReactNode;
104
+ error?: ReactNode;
105
+ size?: ControlSize;
106
+ showPasswordToggle?: boolean;
107
+ fileButtonLabel?: ReactNode;
108
+ icon?: ReactNode;
109
+ disableFloatingLabel?: boolean;
110
+ ref?: Ref<HTMLInputElement>;
111
+ }
112
+ declare function Input({ label, hint, error, size, className, showPasswordToggle, fileButtonLabel, icon, id, disabled, placeholder, onChange, style, type, disableFloatingLabel, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
113
+
100
114
  type DatePickerMode = 'date' | 'datetime';
101
115
  type DatePickerValue = string | Date | null;
102
116
  type DatePickerChangeReason = 'input' | 'picker' | 'clear';
@@ -106,11 +120,10 @@ interface DatePickerChangeContext {
106
120
  nativeValue: string;
107
121
  displayValue: string;
108
122
  }
109
- interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
123
+ interface DatePickerProps extends Omit<InputProps, 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
110
124
  label?: ReactNode;
111
125
  hint?: ReactNode;
112
126
  error?: ReactNode;
113
- size?: ControlSize;
114
127
  value?: DatePickerValue;
115
128
  defaultValue?: DatePickerValue;
116
129
  onChange?: (value: string | null, context: DatePickerChangeContext) => void;
@@ -129,18 +142,7 @@ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'd
129
142
  pickerButtonLabel?: string;
130
143
  clearButtonLabel?: string;
131
144
  }
132
- declare function DatePicker({ label, hint, error, size, 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, onClick, onFocus, onKeyDown, ...rest }: DatePickerProps): react_jsx_runtime.JSX.Element;
133
-
134
- interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size'> {
135
- label?: ReactNode;
136
- hint?: ReactNode;
137
- error?: ReactNode;
138
- size?: ControlSize;
139
- showPasswordToggle?: boolean;
140
- fileButtonLabel?: ReactNode;
141
- icon?: ReactNode;
142
- }
143
- declare function Input({ label, hint, error, size, className, showPasswordToggle, fileButtonLabel, icon, id, disabled, placeholder, onChange, style, type, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
145
+ declare function DatePicker({ value, defaultValue, onChange, mode, minDate, maxDate, minuteStep, placeholder, ...props }: DatePickerProps): react_jsx_runtime.JSX.Element;
144
146
 
145
147
  type ModalActionAppearance = 'text' | 'outlined' | 'contained' | 'link';
146
148
  type ModalThemeColors = {
@@ -213,10 +215,15 @@ interface SharedSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>
213
215
  isFilterable?: boolean;
214
216
  }
215
217
 
218
+ type SelectOption = {
219
+ label: string;
220
+ value: string;
221
+ };
216
222
  interface SelectProps extends SharedSelectProps {
217
223
  children?: ReactNode;
224
+ options?: SelectOption[];
218
225
  }
219
- declare function Select({ children, ...props }: SelectProps): react_jsx_runtime.JSX.Element;
226
+ declare function Select({ children, options, ...props }: SelectProps): react_jsx_runtime.JSX.Element;
220
227
 
221
228
  type SelectObjectOptionValue = string | number;
222
229
  interface SelectObjectOption<TValue extends SelectObjectOptionValue = SelectObjectOptionValue> {
@@ -320,6 +327,11 @@ interface SharedTableProps<TItem> {
320
327
  actions?: TableActionSource<TItem>;
321
328
  stickyActionsColumn?: boolean;
322
329
  maxInlineActions?: number;
330
+ /**
331
+ * Viewport width (in px) below which the table switches from the desktop
332
+ * table layout to the stacked mobile card layout. Defaults to 768 so the
333
+ * table collapses in sync with the host app's mobile breakpoint.
334
+ */
323
335
  collapseBelow?: number;
324
336
  searchable?: boolean;
325
337
  showSearch?: boolean;
@@ -369,6 +381,6 @@ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
369
381
  error?: ReactNode;
370
382
  size?: ControlSize;
371
383
  }
372
- declare function Textarea({ label, hint, error, size, id, disabled, style, rows, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
384
+ declare function Textarea({ label, hint, error, size, id, disabled, style, rows, placeholder, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
373
385
 
374
386
  export { Button, type ButtonProps, Card, type CardProps, CardSmall, type CardSmallProps, Checkbox, type CheckboxProps, ComposableModal, type ComposableModalProps, type ComposableModalSlotRenderProps, type ComposableModalSlotRenderer, type ControlSize, DatePicker, type DatePickerChangeContext, type DatePickerChangeReason, type DatePickerMode, type DatePickerProps, type DatePickerValue, Input, type InputProps, Modal, type ModalAction, type ModalProps, type ModalSlotContext, type ModalSlotIds, type ModalTheme, type ModalThemeSource, Select, SelectAsync, type SelectAsyncLoadContext, type SelectAsyncLoadResult, type SelectAsyncOption, type SelectAsyncOptionValue, type SelectAsyncProps, type SelectProps, Separator, type SeparatorOrientation, type SeparatorProps, type SharedTableProps, type StandardModalProps, Table, type TableAction, type TableActionSource, type TableActionTone, TableAsync, type TableAsyncLoadContext, type TableAsyncLoadResult, type TableAsyncProps, type TableColumn, type TableColumnAlign, type TableColumnType, type TableLabels, type TableProps, Textarea, type TextareaProps, type UiKitTheme, createModalSlotIds, useUiKitTheme };