@dust-tt/sparkle 0.2.235 → 0.2.237
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/cjs/index.js +4 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Dialog.d.ts +2 -1
- package/dist/esm/components/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog.js +2 -2
- package/dist/esm/components/Dialog.js.map +1 -1
- package/dist/esm/components/TextArea.d.ts +2 -2
- package/dist/esm/components/TextArea.d.ts.map +1 -1
- package/dist/esm/components/TextArea.js +3 -17
- package/dist/esm/components/TextArea.js.map +1 -1
- package/dist/esm/stories/Dialog.stories.d.ts.map +1 -1
- package/dist/esm/stories/Dialog.stories.js +6 -1
- package/dist/esm/stories/Dialog.stories.js.map +1 -1
- package/dist/esm/stories/TextArea.stories.js +1 -1
- package/dist/esm/stories/TextArea.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Dialog.tsx +4 -1
- package/src/components/TextArea.tsx +4 -20
- package/src/stories/Dialog.stories.tsx +13 -0
- package/src/stories/TextArea.stories.tsx +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -103528,7 +103528,7 @@ DataTable.Caption = function Caption(_a) {
|
|
|
103528
103528
|
};
|
|
103529
103529
|
|
|
103530
103530
|
function Dialog(_a) {
|
|
103531
|
-
var isOpen = _a.isOpen, children = _a.children, onCancel = _a.onCancel, onValidate = _a.onValidate, _b = _a.cancelLabel, cancelLabel = _b === void 0 ? "Cancel" : _b, _c = _a.validateLabel, validateLabel = _c === void 0 ? "Ok" : _c, _d = _a.validateVariant, validateVariant = _d === void 0 ? "primary" : _d,
|
|
103531
|
+
var title = _a.title, isOpen = _a.isOpen, children = _a.children, disabled = _a.disabled, onCancel = _a.onCancel, onValidate = _a.onValidate, _b = _a.cancelLabel, cancelLabel = _b === void 0 ? "Cancel" : _b, _c = _a.validateLabel, validateLabel = _c === void 0 ? "Ok" : _c, _d = _a.validateVariant, validateVariant = _d === void 0 ? "primary" : _d, isSaving = _a.isSaving, _e = _a.backgroundType, backgroundType = _e === void 0 ? "none" : _e;
|
|
103532
103532
|
var referentRef = React.useRef(null);
|
|
103533
103533
|
return (React.createElement(qe, { show: isOpen, as: React.Fragment, appear: true },
|
|
103534
103534
|
React.createElement(_t, { as: "div", className: "s-relative s-z-50", onClose: onCancel },
|
|
@@ -103544,7 +103544,7 @@ function Dialog(_a) {
|
|
|
103544
103544
|
React.createElement(Button.List, null,
|
|
103545
103545
|
!isSaving && (React.createElement(React.Fragment, null,
|
|
103546
103546
|
React.createElement(Button, { label: cancelLabel, variant: "tertiary", onClick: onCancel }),
|
|
103547
|
-
React.createElement(Button, { label: validateLabel, variant: validateVariant, onClick: onValidate }))),
|
|
103547
|
+
React.createElement(Button, { disabled: disabled, label: validateLabel, variant: validateVariant, onClick: onValidate }))),
|
|
103548
103548
|
isSaving && React.createElement(Spinner, { variant: "color" }))),
|
|
103549
103549
|
backgroundType !== "none" && (React.createElement("div", { className: "s-absolute s-bottom-0 s-left-0 s-right-0 s-top-0 s-z-0" },
|
|
103550
103550
|
React.createElement(ConfettiBackground, { variant: backgroundType, referentSize: referentRef }))))))))));
|
|
@@ -129110,26 +129110,12 @@ function Tab(_a) {
|
|
|
129110
129110
|
}
|
|
129111
129111
|
|
|
129112
129112
|
function TextArea(_a) {
|
|
129113
|
-
var placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, error = _a.error, _b = _a.showErrorLabel, showErrorLabel = _b === void 0 ? false : _b, className = _a.className, _c = _a.
|
|
129113
|
+
var placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, error = _a.error, _b = _a.showErrorLabel, showErrorLabel = _b === void 0 ? false : _b, className = _a.className, _c = _a.minRows, minRows = _c === void 0 ? 10 : _c;
|
|
129114
129114
|
var textareaRef = React.useRef(null);
|
|
129115
|
-
React.useEffect(function () {
|
|
129116
|
-
var textarea = textareaRef.current;
|
|
129117
|
-
if (textarea) {
|
|
129118
|
-
textarea.style.height = 'auto'; // Reset height
|
|
129119
|
-
textarea.style.height = "".concat(textarea.scrollHeight, "px"); // Set to scroll height
|
|
129120
|
-
}
|
|
129121
|
-
}, [value]); // Re-run when value changes
|
|
129122
129115
|
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
|
|
129123
|
-
React.createElement("textarea", { rows:
|
|
129116
|
+
React.createElement("textarea", { rows: minRows, ref: textareaRef, className: classNames("overflow-y-auto s-block s-w-full s-min-w-0 s-rounded-xl s-text-sm s-placeholder-element-700 s-transition-all s-duration-200 s-scrollbar-hide", !error
|
|
129124
129117
|
? "s-border-structure-100 focus:s-border-action-300 focus:s-ring-action-300"
|
|
129125
129118
|
: "s-border-red-500 focus:s-border-red-500 focus:s-ring-red-500", "s-border-structure-200 s-bg-structure-50", "s-resize-y", className !== null && className !== void 0 ? className : ""), placeholder: placeholder, value: value !== null && value !== void 0 ? value : "", onChange: function (e) {
|
|
129126
|
-
var newValue = e.target.value;
|
|
129127
|
-
var textAreaComponent = textareaRef.current;
|
|
129128
|
-
if (textAreaComponent &&
|
|
129129
|
-
(value === null || value === void 0 ? void 0 : value.length) &&
|
|
129130
|
-
newValue.length < value.length) {
|
|
129131
|
-
textAreaComponent.style.height = "auto"; // Reset height to recalculate
|
|
129132
|
-
}
|
|
129133
129119
|
onChange(e.target.value);
|
|
129134
129120
|
} }),
|
|
129135
129121
|
error && showErrorLabel && (React.createElement("div", { className: "s-ml-2 s-text-sm s-text-warning-500" }, error))));
|