@dust-tt/sparkle 0.2.230 → 0.2.232
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 +7 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/TextArea.d.ts +2 -1
- package/dist/esm/components/TextArea.d.ts.map +1 -1
- package/dist/esm/components/TextArea.js +2 -2
- package/dist/esm/components/TextArea.js.map +1 -1
- package/dist/esm/hooks/useHashParams.d.ts +2 -1
- package/dist/esm/hooks/useHashParams.d.ts.map +1 -1
- package/dist/esm/hooks/useHashParams.js.map +1 -1
- package/dist/esm/hooks/usePaginationFromUrl.d.ts +4 -3
- package/dist/esm/hooks/usePaginationFromUrl.d.ts.map +1 -1
- package/dist/esm/hooks/usePaginationFromUrl.js +5 -3
- package/dist/esm/hooks/usePaginationFromUrl.js.map +1 -1
- package/dist/esm/stories/TextArea.stories.d.ts.map +1 -1
- package/dist/esm/stories/TextArea.stories.js +1 -1
- package/dist/esm/stories/TextArea.stories.js.map +1 -1
- package/dist/sparkle.css +0 -4
- package/package.json +1 -1
- package/src/components/TextArea.tsx +4 -1
- package/src/hooks/useHashParams.ts +4 -1
- package/src/hooks/usePaginationFromUrl.ts +10 -5
- package/src/stories/TextArea.stories.tsx +1 -0
package/dist/cjs/index.js
CHANGED
|
@@ -129110,7 +129110,7 @@ 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;
|
|
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.rows, rows = _c === void 0 ? 10 : _c;
|
|
129114
129114
|
var textareaRef = React.useRef(null);
|
|
129115
129115
|
React.useEffect(function () {
|
|
129116
129116
|
var textarea = textareaRef.current;
|
|
@@ -129119,7 +129119,7 @@ function TextArea(_a) {
|
|
|
129119
129119
|
}
|
|
129120
129120
|
}, [value]); // Re-run when value changes
|
|
129121
129121
|
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
|
|
129122
|
-
React.createElement("textarea", { ref: textareaRef, className: classNames("overflow-y-auto s-block s-
|
|
129122
|
+
React.createElement("textarea", { rows: rows, 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
|
|
129123
129123
|
? "s-border-structure-100 focus:s-border-action-300 focus:s-ring-action-300"
|
|
129124
129124
|
: "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) {
|
|
129125
129125
|
var newValue = e.target.value;
|
|
@@ -129293,16 +129293,18 @@ var useHashParam = function (key, defaultValue) {
|
|
|
129293
129293
|
|
|
129294
129294
|
var defaultPageSize = 25;
|
|
129295
129295
|
var usePaginationFromUrl = function (_a) {
|
|
129296
|
-
var urlPrefix = _a.urlPrefix, _b = _a.initialPageSize, initialPageSize = _b === void 0 ? defaultPageSize : _b, _c = _a.
|
|
129296
|
+
var urlPrefix = _a.urlPrefix, _b = _a.initialPageSize, initialPageSize = _b === void 0 ? defaultPageSize : _b, _c = _a.defaultHistory, defaultHistory = _c === void 0 ? "push" : _c;
|
|
129297
129297
|
var _d = __read(useHashParam(urlPrefix ? "".concat(urlPrefix, "PageIndex") : "pageIndex"), 2), pageIndexParam = _d[0], setPageIndexParam = _d[1];
|
|
129298
129298
|
var _e = __read(useHashParam(urlPrefix ? "".concat(urlPrefix, "PageSize") : "pageSize"), 2), pageSizeParam = _e[0], setPageSizeParam = _e[1];
|
|
129299
129299
|
var pageIndex = pageIndexParam ? parseInt(pageIndexParam) : 0;
|
|
129300
129300
|
var pageSize = pageSizeParam ? parseInt(pageSizeParam) : initialPageSize;
|
|
129301
129301
|
var res = React.useMemo(function () {
|
|
129302
129302
|
var pagination = { pageIndex: pageIndex, pageSize: pageSize };
|
|
129303
|
-
var setPagination = function (newValue) {
|
|
129303
|
+
var setPagination = function (newValue, history) {
|
|
129304
129304
|
if (newValue.pageIndex !== pageIndex || newValue.pageSize !== pageSize) {
|
|
129305
|
-
setPageIndexParam(newValue.pageIndex.toString(), {
|
|
129305
|
+
setPageIndexParam(newValue.pageIndex.toString(), {
|
|
129306
|
+
history: history !== null && history !== void 0 ? history : defaultHistory,
|
|
129307
|
+
});
|
|
129306
129308
|
setPageSizeParam(newValue.pageSize.toString());
|
|
129307
129309
|
}
|
|
129308
129310
|
};
|