smartsell-ui-kit 0.1.5 → 0.1.6
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.cjs +44 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +44 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -47,10 +47,10 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dan
|
|
|
47
47
|
label?: ReactNode;
|
|
48
48
|
hint?: ReactNode;
|
|
49
49
|
error?: ReactNode;
|
|
50
|
-
|
|
50
|
+
size?: ControlSize;
|
|
51
51
|
indeterminate?: boolean;
|
|
52
52
|
}
|
|
53
|
-
declare function Checkbox({ label, hint, error,
|
|
53
|
+
declare function Checkbox({ label, hint, error, size, id, checked, defaultChecked, disabled, indeterminate, required, className, style, onChange, onFocus, onBlur, ...rest }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
54
54
|
|
|
55
55
|
interface ModalSlotIds {
|
|
56
56
|
header: string;
|
|
@@ -110,7 +110,7 @@ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'd
|
|
|
110
110
|
label?: ReactNode;
|
|
111
111
|
hint?: ReactNode;
|
|
112
112
|
error?: ReactNode;
|
|
113
|
-
|
|
113
|
+
size?: ControlSize;
|
|
114
114
|
value?: DatePickerValue;
|
|
115
115
|
defaultValue?: DatePickerValue;
|
|
116
116
|
onChange?: (value: string | null, context: DatePickerChangeContext) => void;
|
|
@@ -129,18 +129,18 @@ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'd
|
|
|
129
129
|
pickerButtonLabel?: string;
|
|
130
130
|
clearButtonLabel?: string;
|
|
131
131
|
}
|
|
132
|
-
declare function DatePicker({ label, hint, error,
|
|
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
133
|
|
|
134
134
|
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size'> {
|
|
135
135
|
label?: ReactNode;
|
|
136
136
|
hint?: ReactNode;
|
|
137
137
|
error?: ReactNode;
|
|
138
|
-
|
|
138
|
+
size?: ControlSize;
|
|
139
139
|
showPasswordToggle?: boolean;
|
|
140
140
|
fileButtonLabel?: ReactNode;
|
|
141
141
|
icon?: ReactNode;
|
|
142
142
|
}
|
|
143
|
-
declare function Input({ label, hint, error,
|
|
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;
|
|
144
144
|
|
|
145
145
|
type ModalActionAppearance = 'text' | 'outlined' | 'contained' | 'link';
|
|
146
146
|
type ModalThemeColors = {
|
|
@@ -208,7 +208,7 @@ interface SharedSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>
|
|
|
208
208
|
hint?: ReactNode;
|
|
209
209
|
error?: ReactNode;
|
|
210
210
|
placeholder?: ReactNode;
|
|
211
|
-
|
|
211
|
+
size?: ControlSize;
|
|
212
212
|
isMulti?: boolean;
|
|
213
213
|
isFilterable?: boolean;
|
|
214
214
|
}
|
|
@@ -367,8 +367,8 @@ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
367
367
|
label?: ReactNode;
|
|
368
368
|
hint?: ReactNode;
|
|
369
369
|
error?: ReactNode;
|
|
370
|
-
|
|
370
|
+
size?: ControlSize;
|
|
371
371
|
}
|
|
372
|
-
declare function Textarea({ label, hint, error,
|
|
372
|
+
declare function Textarea({ label, hint, error, size, id, disabled, style, rows, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
|
|
373
373
|
|
|
374
374
|
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
|
@@ -47,10 +47,10 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dan
|
|
|
47
47
|
label?: ReactNode;
|
|
48
48
|
hint?: ReactNode;
|
|
49
49
|
error?: ReactNode;
|
|
50
|
-
|
|
50
|
+
size?: ControlSize;
|
|
51
51
|
indeterminate?: boolean;
|
|
52
52
|
}
|
|
53
|
-
declare function Checkbox({ label, hint, error,
|
|
53
|
+
declare function Checkbox({ label, hint, error, size, id, checked, defaultChecked, disabled, indeterminate, required, className, style, onChange, onFocus, onBlur, ...rest }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
54
54
|
|
|
55
55
|
interface ModalSlotIds {
|
|
56
56
|
header: string;
|
|
@@ -110,7 +110,7 @@ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'd
|
|
|
110
110
|
label?: ReactNode;
|
|
111
111
|
hint?: ReactNode;
|
|
112
112
|
error?: ReactNode;
|
|
113
|
-
|
|
113
|
+
size?: ControlSize;
|
|
114
114
|
value?: DatePickerValue;
|
|
115
115
|
defaultValue?: DatePickerValue;
|
|
116
116
|
onChange?: (value: string | null, context: DatePickerChangeContext) => void;
|
|
@@ -129,18 +129,18 @@ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'd
|
|
|
129
129
|
pickerButtonLabel?: string;
|
|
130
130
|
clearButtonLabel?: string;
|
|
131
131
|
}
|
|
132
|
-
declare function DatePicker({ label, hint, error,
|
|
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
133
|
|
|
134
134
|
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'dangerouslySetInnerHTML' | 'size'> {
|
|
135
135
|
label?: ReactNode;
|
|
136
136
|
hint?: ReactNode;
|
|
137
137
|
error?: ReactNode;
|
|
138
|
-
|
|
138
|
+
size?: ControlSize;
|
|
139
139
|
showPasswordToggle?: boolean;
|
|
140
140
|
fileButtonLabel?: ReactNode;
|
|
141
141
|
icon?: ReactNode;
|
|
142
142
|
}
|
|
143
|
-
declare function Input({ label, hint, error,
|
|
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;
|
|
144
144
|
|
|
145
145
|
type ModalActionAppearance = 'text' | 'outlined' | 'contained' | 'link';
|
|
146
146
|
type ModalThemeColors = {
|
|
@@ -208,7 +208,7 @@ interface SharedSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>
|
|
|
208
208
|
hint?: ReactNode;
|
|
209
209
|
error?: ReactNode;
|
|
210
210
|
placeholder?: ReactNode;
|
|
211
|
-
|
|
211
|
+
size?: ControlSize;
|
|
212
212
|
isMulti?: boolean;
|
|
213
213
|
isFilterable?: boolean;
|
|
214
214
|
}
|
|
@@ -367,8 +367,8 @@ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
367
367
|
label?: ReactNode;
|
|
368
368
|
hint?: ReactNode;
|
|
369
369
|
error?: ReactNode;
|
|
370
|
-
|
|
370
|
+
size?: ControlSize;
|
|
371
371
|
}
|
|
372
|
-
declare function Textarea({ label, hint, error,
|
|
372
|
+
declare function Textarea({ label, hint, error, size, id, disabled, style, rows, ...rest }: TextareaProps): react_jsx_runtime.JSX.Element;
|
|
373
373
|
|
|
374
374
|
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.js
CHANGED
|
@@ -511,7 +511,7 @@ function CardSmall({
|
|
|
511
511
|
// src/components/Checkbox.tsx
|
|
512
512
|
import { useEffect as useEffect2, useId, useRef, useState } from "react";
|
|
513
513
|
import { jsx as jsx3, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
514
|
-
var
|
|
514
|
+
var CHECKBOX_SIZE_BY_SIZE = {
|
|
515
515
|
sm: 14,
|
|
516
516
|
md: 16,
|
|
517
517
|
lg: 20
|
|
@@ -521,7 +521,7 @@ var CHECKBOX_LABEL_CLASSNAMES = {
|
|
|
521
521
|
md: "text-sm leading-[18px]",
|
|
522
522
|
lg: "text-[15px] leading-[18px]"
|
|
523
523
|
};
|
|
524
|
-
var getCheckboxSize = (
|
|
524
|
+
var getCheckboxSize = (size) => CHECKBOX_SIZE_BY_SIZE[size];
|
|
525
525
|
var hasNodeContent = (value) => {
|
|
526
526
|
if (Array.isArray(value)) {
|
|
527
527
|
return value.some(hasNodeContent);
|
|
@@ -593,7 +593,7 @@ function Checkbox({
|
|
|
593
593
|
label,
|
|
594
594
|
hint,
|
|
595
595
|
error,
|
|
596
|
-
|
|
596
|
+
size = "sm",
|
|
597
597
|
id,
|
|
598
598
|
checked,
|
|
599
599
|
defaultChecked,
|
|
@@ -609,7 +609,7 @@ function Checkbox({
|
|
|
609
609
|
}) {
|
|
610
610
|
const theme = useUiKitTheme();
|
|
611
611
|
const mutedText = theme.colors.textLight;
|
|
612
|
-
const indicatorSize = getCheckboxSize(
|
|
612
|
+
const indicatorSize = getCheckboxSize(size);
|
|
613
613
|
const hasLabel = hasNodeContent(label);
|
|
614
614
|
const hasHint = hasNodeContent(hint);
|
|
615
615
|
const hasError = hasNodeContent(error);
|
|
@@ -703,7 +703,7 @@ function Checkbox({
|
|
|
703
703
|
hasSecondaryContent ? "justify-start" : "justify-center"
|
|
704
704
|
),
|
|
705
705
|
children: [
|
|
706
|
-
label ? /* @__PURE__ */ jsxs4("span", { className: cx("font-semibold text-[var(--theme-text)]", CHECKBOX_LABEL_CLASSNAMES[
|
|
706
|
+
label ? /* @__PURE__ */ jsxs4("span", { className: cx("font-semibold text-[var(--theme-text)]", CHECKBOX_LABEL_CLASSNAMES[size]), children: [
|
|
707
707
|
label,
|
|
708
708
|
required ? /* @__PURE__ */ jsx3("span", { className: "ml-1 text-[var(--theme-negative)]", children: "*" }) : null
|
|
709
709
|
] }) : null,
|
|
@@ -1552,7 +1552,7 @@ function Input({
|
|
|
1552
1552
|
label,
|
|
1553
1553
|
hint,
|
|
1554
1554
|
error,
|
|
1555
|
-
|
|
1555
|
+
size = "sm",
|
|
1556
1556
|
className,
|
|
1557
1557
|
showPasswordToggle = true,
|
|
1558
1558
|
fileButtonLabel,
|
|
@@ -1566,8 +1566,8 @@ function Input({
|
|
|
1566
1566
|
...rest
|
|
1567
1567
|
}) {
|
|
1568
1568
|
useUiKitTheme();
|
|
1569
|
-
const controlMetrics = getControlMetrics(
|
|
1570
|
-
const passwordToggleMetrics = getPasswordToggleMetrics(
|
|
1569
|
+
const controlMetrics = getControlMetrics(size);
|
|
1570
|
+
const passwordToggleMetrics = getPasswordToggleMetrics(size);
|
|
1571
1571
|
const generatedId = useId2();
|
|
1572
1572
|
const inputId = id != null ? id : generatedId;
|
|
1573
1573
|
const fileInputRef = useRef2(null);
|
|
@@ -1601,16 +1601,16 @@ function Input({
|
|
|
1601
1601
|
const showUploadLabel = hasFileButtonLabel && !hasSelectedFiles;
|
|
1602
1602
|
const passwordLockIconSize = passwordToggleMetrics.iconSize + 2;
|
|
1603
1603
|
const leadingContentGap = Math.max(0, Math.round(controlMetrics.paddingX / 3));
|
|
1604
|
-
const leadingIconInset = getControlLeadingIconInset(
|
|
1604
|
+
const leadingIconInset = getControlLeadingIconInset(size);
|
|
1605
1605
|
const controlTextNudgeStyle = getControlTextNudgeStyle();
|
|
1606
1606
|
const hasExternalError = error !== void 0 && error !== null && error !== "";
|
|
1607
1607
|
const resolvedError = hasExternalError ? error : validationError;
|
|
1608
1608
|
const hasResolvedError = resolvedError !== void 0 && resolvedError !== null && resolvedError !== "";
|
|
1609
1609
|
const fileSelectionText = selectedFileNames.length === 0 ? placeholder != null ? placeholder : "" : selectedFileNames.length === 1 ? selectedFileNames[0] : `${selectedFileNames.length} files selected`;
|
|
1610
1610
|
const fileIconSize = Math.max(controlMetrics.fontSize + 3, 16);
|
|
1611
|
-
const fileTriggerWidth = getControlLeadingAdornmentWidth(
|
|
1612
|
-
const leadingAdornmentWidth = getControlLeadingAdornmentWidth(
|
|
1613
|
-
const passwordAdornmentWidth = getControlLeadingAdornmentWidth(
|
|
1611
|
+
const fileTriggerWidth = getControlLeadingAdornmentWidth(size, fileIconSize);
|
|
1612
|
+
const leadingAdornmentWidth = getControlLeadingAdornmentWidth(size, fileIconSize);
|
|
1613
|
+
const passwordAdornmentWidth = getControlLeadingAdornmentWidth(size, passwordLockIconSize);
|
|
1614
1614
|
const defaultLeadingIcon = isEmailField ? /* @__PURE__ */ jsx6(EmailIcon, { size: fileIconSize }) : isLoginField ? /* @__PURE__ */ jsx6(LoginIcon, { size: fileIconSize }) : null;
|
|
1615
1615
|
const resolvedLeadingIcon = icon != null ? icon : defaultLeadingIcon;
|
|
1616
1616
|
const hasLeadingIcon = isRenderableNode(resolvedLeadingIcon);
|
|
@@ -1621,8 +1621,8 @@ function Input({
|
|
|
1621
1621
|
"w-full box-border rounded-2xl border border-solid bg-[var(--theme-surface)]",
|
|
1622
1622
|
"text-[var(--theme-text)] outline-none transition-[border-color,box-shadow,background-color]",
|
|
1623
1623
|
"duration-150 placeholder:text-[var(--theme-textLight)]",
|
|
1624
|
-
FIELD_HEIGHT_CLASSNAMES[
|
|
1625
|
-
FIELD_TEXT_CLASSNAMES[
|
|
1624
|
+
FIELD_HEIGHT_CLASSNAMES[size],
|
|
1625
|
+
FIELD_TEXT_CLASSNAMES[size],
|
|
1626
1626
|
hasResolvedError ? "border-[var(--theme-negative)]" : "border-[var(--theme-textLight)]",
|
|
1627
1627
|
disabled ? "cursor-not-allowed opacity-70" : "cursor-text"
|
|
1628
1628
|
);
|
|
@@ -1632,15 +1632,15 @@ function Input({
|
|
|
1632
1632
|
"border border-solid bg-[var(--theme-surface)] text-[var(--theme-text)] text-left",
|
|
1633
1633
|
"transition-[border-color,box-shadow,background-color] duration-150",
|
|
1634
1634
|
"shadow-[0px_4px_5px_var(--theme-shadow)]",
|
|
1635
|
-
FIELD_HEIGHT_CLASSNAMES[
|
|
1636
|
-
FIELD_TEXT_CLASSNAMES[
|
|
1635
|
+
FIELD_HEIGHT_CLASSNAMES[size],
|
|
1636
|
+
FIELD_TEXT_CLASSNAMES[size],
|
|
1637
1637
|
hasResolvedError ? "border-[var(--theme-negative)]" : "border-[var(--theme-textLight)]",
|
|
1638
1638
|
disabled ? "opacity-70" : null
|
|
1639
1639
|
);
|
|
1640
1640
|
const adornedInputClassName = cx(
|
|
1641
1641
|
"h-full min-w-0 flex-1 border-0 bg-transparent text-[var(--theme-text)] outline-none",
|
|
1642
1642
|
"placeholder:text-[var(--theme-textLight)]",
|
|
1643
|
-
FIELD_TEXT_CLASSNAMES[
|
|
1643
|
+
FIELD_TEXT_CLASSNAMES[size],
|
|
1644
1644
|
disabled ? "cursor-not-allowed" : "cursor-text"
|
|
1645
1645
|
);
|
|
1646
1646
|
const adornmentColorClassName = hasResolvedError ? "text-[var(--theme-negative)]" : "text-[var(--theme-textLight)]";
|
|
@@ -1704,7 +1704,7 @@ function Input({
|
|
|
1704
1704
|
className: cx(
|
|
1705
1705
|
"inline-flex shrink-0 self-stretch whitespace-nowrap border-0 bg-transparent",
|
|
1706
1706
|
"items-center text-[var(--theme-text)] appearance-none",
|
|
1707
|
-
FIELD_TEXT_CLASSNAMES[
|
|
1707
|
+
FIELD_TEXT_CLASSNAMES[size],
|
|
1708
1708
|
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
1709
1709
|
showUploadLabel ? "justify-start font-bold" : "justify-center"
|
|
1710
1710
|
),
|
|
@@ -1752,7 +1752,7 @@ function Input({
|
|
|
1752
1752
|
{
|
|
1753
1753
|
className: cx(
|
|
1754
1754
|
"flex h-full min-w-0 flex-1 items-center overflow-hidden text-ellipsis whitespace-nowrap",
|
|
1755
|
-
FIELD_TEXT_CLASSNAMES[
|
|
1755
|
+
FIELD_TEXT_CLASSNAMES[size],
|
|
1756
1756
|
hasSelectedFiles ? "text-[var(--theme-text)]" : "text-[var(--theme-textLight)]"
|
|
1757
1757
|
),
|
|
1758
1758
|
style: {
|
|
@@ -1813,7 +1813,7 @@ function Input({
|
|
|
1813
1813
|
className: cx(adornedInputClassName, className),
|
|
1814
1814
|
"aria-invalid": hasResolvedError,
|
|
1815
1815
|
style: {
|
|
1816
|
-
padding: getTextInputPadding(
|
|
1816
|
+
padding: getTextInputPadding(size, { leadingPadding: leadingContentGap })
|
|
1817
1817
|
}
|
|
1818
1818
|
}
|
|
1819
1819
|
)
|
|
@@ -1854,7 +1854,7 @@ function Input({
|
|
|
1854
1854
|
className: cx(adornedInputClassName, className),
|
|
1855
1855
|
"aria-invalid": hasResolvedError,
|
|
1856
1856
|
style: {
|
|
1857
|
-
padding: getTextInputPadding(
|
|
1857
|
+
padding: getTextInputPadding(size, { leadingPadding: leadingContentGap })
|
|
1858
1858
|
}
|
|
1859
1859
|
}
|
|
1860
1860
|
)
|
|
@@ -1870,10 +1870,10 @@ function Input({
|
|
|
1870
1870
|
disabled,
|
|
1871
1871
|
onChange: handleValidatedInputChange,
|
|
1872
1872
|
"aria-invalid": hasResolvedError,
|
|
1873
|
-
className: cx(fieldBaseClassName, FIELD_PADDING_X_CLASSNAMES[
|
|
1873
|
+
className: cx(fieldBaseClassName, FIELD_PADDING_X_CLASSNAMES[size], className),
|
|
1874
1874
|
style: {
|
|
1875
1875
|
boxShadow: "0px 4px 5px var(--theme-shadow)",
|
|
1876
|
-
padding: getTextInputPadding(
|
|
1876
|
+
padding: getTextInputPadding(size),
|
|
1877
1877
|
...style
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
@@ -2120,7 +2120,7 @@ function DatePicker({
|
|
|
2120
2120
|
label,
|
|
2121
2121
|
hint,
|
|
2122
2122
|
error,
|
|
2123
|
-
|
|
2123
|
+
size = "sm",
|
|
2124
2124
|
value,
|
|
2125
2125
|
defaultValue,
|
|
2126
2126
|
onChange,
|
|
@@ -2154,8 +2154,8 @@ function DatePicker({
|
|
|
2154
2154
|
}) {
|
|
2155
2155
|
var _a;
|
|
2156
2156
|
useUiKitTheme();
|
|
2157
|
-
const controlMetrics = getControlMetrics(
|
|
2158
|
-
const accessoryMetrics = ACCESSORY_METRICS_BY_SIZE[
|
|
2157
|
+
const controlMetrics = getControlMetrics(size);
|
|
2158
|
+
const accessoryMetrics = ACCESSORY_METRICS_BY_SIZE[size];
|
|
2159
2159
|
const generatedIdRef = useRef3();
|
|
2160
2160
|
const visibleInputRef = useRef3(null);
|
|
2161
2161
|
const nativeInputRef = useRef3(null);
|
|
@@ -2213,8 +2213,8 @@ function DatePicker({
|
|
|
2213
2213
|
const canOpenPicker = !disabled && !readOnly && !hasConfigurationConflict;
|
|
2214
2214
|
const canClear = clearable && !disabled && !readOnly && !required && hasAnyValue;
|
|
2215
2215
|
const leadingContentGap = Math.max(0, Math.round(controlMetrics.paddingX / 3));
|
|
2216
|
-
const leadingIconInset = getControlLeadingIconInset(
|
|
2217
|
-
const pickerAdornmentWidth = getControlLeadingAdornmentWidth(
|
|
2216
|
+
const leadingIconInset = getControlLeadingIconInset(size);
|
|
2217
|
+
const pickerAdornmentWidth = getControlLeadingAdornmentWidth(size, accessoryMetrics.iconSize);
|
|
2218
2218
|
const trailingButtonCount = Number(canClear);
|
|
2219
2219
|
const trailingInset = trailingButtonCount > 0 ? Math.max(
|
|
2220
2220
|
0,
|
|
@@ -2226,8 +2226,8 @@ function DatePicker({
|
|
|
2226
2226
|
"w-full box-border rounded-2xl border border-solid bg-[var(--theme-surface)]",
|
|
2227
2227
|
"text-[var(--theme-text)] outline-none transition-[border-color,box-shadow,background-color]",
|
|
2228
2228
|
"duration-150 placeholder:text-[var(--theme-textLight)]",
|
|
2229
|
-
FIELD_HEIGHT_CLASSNAMES2[
|
|
2230
|
-
FIELD_TEXT_CLASSNAMES2[
|
|
2229
|
+
FIELD_HEIGHT_CLASSNAMES2[size],
|
|
2230
|
+
FIELD_TEXT_CLASSNAMES2[size],
|
|
2231
2231
|
resolvedError ? "border-[var(--theme-negative)]" : "border-[var(--theme-textLight)]",
|
|
2232
2232
|
disabled ? "cursor-not-allowed" : readOnly ? "cursor-default" : "cursor-text"
|
|
2233
2233
|
);
|
|
@@ -2235,15 +2235,15 @@ function DatePicker({
|
|
|
2235
2235
|
"box-border flex w-full items-center gap-0 overflow-hidden rounded-2xl",
|
|
2236
2236
|
"bg-[var(--theme-surface)] text-[var(--theme-text)]",
|
|
2237
2237
|
"transition-[border-color,box-shadow,background-color] duration-150",
|
|
2238
|
-
FIELD_HEIGHT_CLASSNAMES2[
|
|
2239
|
-
FIELD_TEXT_CLASSNAMES2[
|
|
2238
|
+
FIELD_HEIGHT_CLASSNAMES2[size],
|
|
2239
|
+
FIELD_TEXT_CLASSNAMES2[size],
|
|
2240
2240
|
disabled ? "cursor-not-allowed" : readOnly ? "cursor-default" : "cursor-text"
|
|
2241
2241
|
);
|
|
2242
2242
|
const integratedFieldBoxShadow = getInsetBorderShadow(fieldBorderColor, resolvedError ? { outerShadow: "0 0 0 3px var(--theme-negative)", componentShadow: "0px 4px 5px var(--theme-shadow)" } : { componentShadow: "0px 4px 5px var(--theme-shadow)" });
|
|
2243
2243
|
const integratedInputClassName = cx(
|
|
2244
2244
|
"h-full w-full box-border border-0 bg-transparent text-[var(--theme-text)]",
|
|
2245
2245
|
"outline-none placeholder:text-[var(--theme-textLight)]",
|
|
2246
|
-
FIELD_TEXT_CLASSNAMES2[
|
|
2246
|
+
FIELD_TEXT_CLASSNAMES2[size],
|
|
2247
2247
|
disabled ? "cursor-not-allowed" : readOnly ? "cursor-default" : "cursor-text"
|
|
2248
2248
|
);
|
|
2249
2249
|
const pickerAdornmentClassName = cx(
|
|
@@ -2488,7 +2488,7 @@ function DatePicker({
|
|
|
2488
2488
|
...visibleInputProps,
|
|
2489
2489
|
className: cx(integratedInputClassName, className),
|
|
2490
2490
|
style: {
|
|
2491
|
-
padding: getTextInputPadding(
|
|
2491
|
+
padding: getTextInputPadding(size, {
|
|
2492
2492
|
leadingPadding: leadingContentGap,
|
|
2493
2493
|
trailingPadding: controlMetrics.paddingX + trailingInset
|
|
2494
2494
|
})
|
|
@@ -2505,9 +2505,9 @@ function DatePicker({
|
|
|
2505
2505
|
"input",
|
|
2506
2506
|
{
|
|
2507
2507
|
...visibleInputProps,
|
|
2508
|
-
className: cx(fieldBaseClassName, FIELD_PADDING_X_CLASSNAMES2[
|
|
2508
|
+
className: cx(fieldBaseClassName, FIELD_PADDING_X_CLASSNAMES2[size], className),
|
|
2509
2509
|
style: {
|
|
2510
|
-
padding: getTextInputPadding(
|
|
2510
|
+
padding: getTextInputPadding(size, {
|
|
2511
2511
|
trailingPadding: controlMetrics.paddingX + trailingInset
|
|
2512
2512
|
}),
|
|
2513
2513
|
boxShadow: resolvedError ? "0 0 0 3px var(--theme-negative), 0px 4px 5px var(--theme-shadow)" : "0px 4px 5px var(--theme-shadow)",
|
|
@@ -2644,7 +2644,7 @@ function SelectBase({
|
|
|
2644
2644
|
hint,
|
|
2645
2645
|
error,
|
|
2646
2646
|
placeholder,
|
|
2647
|
-
|
|
2647
|
+
size = "sm",
|
|
2648
2648
|
id,
|
|
2649
2649
|
disabled,
|
|
2650
2650
|
style,
|
|
@@ -2717,7 +2717,7 @@ function SelectBase({
|
|
|
2717
2717
|
const visibleEnabledValues = visibleEnabledOptions.map((option) => option.value);
|
|
2718
2718
|
const selectedValuesKey = selectedValues.join("\0");
|
|
2719
2719
|
const visibleEnabledValuesKey = visibleEnabledValues.join("\0");
|
|
2720
|
-
const indicatorOffset = getSelectIndicatorOffset(
|
|
2720
|
+
const indicatorOffset = getSelectIndicatorOffset(size);
|
|
2721
2721
|
const controlTextNudgeStyle = getSelectTextNudgeStyle();
|
|
2722
2722
|
const listboxId = `${resolvedId}-listbox`;
|
|
2723
2723
|
const searchInputId = `${resolvedId}-search`;
|
|
@@ -2737,8 +2737,8 @@ function SelectBase({
|
|
|
2737
2737
|
"m-0 box-border flex w-full min-w-0 items-center justify-between gap-3 rounded-2xl border-0 appearance-none",
|
|
2738
2738
|
"bg-[var(--theme-surface)] outline-none transition-[border-color,box-shadow,background-color]",
|
|
2739
2739
|
"duration-150 text-left",
|
|
2740
|
-
FIELD_HEIGHT_CLASSNAMES3[
|
|
2741
|
-
FIELD_TEXT_CLASSNAMES3[
|
|
2740
|
+
FIELD_HEIGHT_CLASSNAMES3[size],
|
|
2741
|
+
FIELD_TEXT_CLASSNAMES3[size],
|
|
2742
2742
|
hasSelection ? "text-[var(--theme-text)]" : "text-[var(--theme-textLight)]",
|
|
2743
2743
|
isTriggerDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2744
2744
|
);
|
|
@@ -3128,7 +3128,7 @@ function SelectBase({
|
|
|
3128
3128
|
onBlur: handleTriggerBlur,
|
|
3129
3129
|
onKeyDown: handleTriggerKeyDown,
|
|
3130
3130
|
style: {
|
|
3131
|
-
padding: getSelectControlPadding(
|
|
3131
|
+
padding: getSelectControlPadding(size),
|
|
3132
3132
|
boxShadow: triggerBoxShadow,
|
|
3133
3133
|
...style,
|
|
3134
3134
|
...isTriggerDisabled ? { opacity: DISABLED_FIELD_OPACITY } : {}
|
|
@@ -3335,7 +3335,7 @@ function SelectBase({
|
|
|
3335
3335
|
className: cx(
|
|
3336
3336
|
"flex w-full min-w-0 items-center justify-between gap-3 rounded-xl box-border",
|
|
3337
3337
|
"transition-[background-color,color] duration-150",
|
|
3338
|
-
OPTION_PADDING_CLASSNAMES[
|
|
3338
|
+
OPTION_PADDING_CLASSNAMES[size],
|
|
3339
3339
|
option.disabled ? "cursor-not-allowed text-[var(--theme-secondary)]" : "cursor-pointer",
|
|
3340
3340
|
!option.disabled && isActive ? "text-[var(--theme-onPrimary)]" : null,
|
|
3341
3341
|
!option.disabled && !isActive ? "text-[var(--theme-text)]" : null,
|
|
@@ -5274,7 +5274,7 @@ function Textarea({
|
|
|
5274
5274
|
label,
|
|
5275
5275
|
hint,
|
|
5276
5276
|
error,
|
|
5277
|
-
|
|
5277
|
+
size = "sm",
|
|
5278
5278
|
id,
|
|
5279
5279
|
disabled,
|
|
5280
5280
|
style,
|
|
@@ -5295,7 +5295,7 @@ function Textarea({
|
|
|
5295
5295
|
"duration-150 placeholder:opacity-100 disabled:cursor-not-allowed",
|
|
5296
5296
|
"placeholder:text-[var(--theme-textLight)]",
|
|
5297
5297
|
error ? "border-[var(--theme-negative)]" : "border-[var(--theme-textLight)]",
|
|
5298
|
-
TEXTAREA_SIZE_CLASSNAMES[
|
|
5298
|
+
TEXTAREA_SIZE_CLASSNAMES[size]
|
|
5299
5299
|
),
|
|
5300
5300
|
style: {
|
|
5301
5301
|
boxShadow: error ? "0 0 0 3px var(--theme-negative), 0px 4px 5px var(--theme-shadow)" : "0px 4px 5px var(--theme-shadow)",
|