shadcn-ui-react 0.6.8 → 0.7.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.cjs +26 -19
- package/dist/index.js +28 -21
- package/dist/style.css +9 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7475,30 +7475,31 @@ var import_react34 = __toESM(require("react"), 1);
|
|
|
7475
7475
|
var import_use_debounce = require("use-debounce");
|
|
7476
7476
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
7477
7477
|
function SearchInput({
|
|
7478
|
-
value,
|
|
7478
|
+
value = "",
|
|
7479
7479
|
placeholder,
|
|
7480
7480
|
className,
|
|
7481
7481
|
classNameDefault,
|
|
7482
7482
|
debounceTime = 750,
|
|
7483
7483
|
onSearch
|
|
7484
7484
|
}) {
|
|
7485
|
-
const [searchTerm, setSearchTerm] = import_react34.default.useState(value);
|
|
7486
|
-
const
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
}, []);
|
|
7485
|
+
const [searchTerm, setSearchTerm] = import_react34.default.useState(value != null ? value : "");
|
|
7486
|
+
const debouncedSearch = (0, import_use_debounce.useDebouncedCallback)((nextValue) => {
|
|
7487
|
+
onSearch(nextValue);
|
|
7488
|
+
}, debounceTime);
|
|
7490
7489
|
import_react34.default.useEffect(() => {
|
|
7491
|
-
|
|
7492
|
-
}, [debouncedValue, handleSettingSearchParams]);
|
|
7493
|
-
import_react34.default.useEffect(() => {
|
|
7494
|
-
setSearchTerm(value);
|
|
7490
|
+
setSearchTerm(value != null ? value : "");
|
|
7495
7491
|
}, [value]);
|
|
7492
|
+
const handleChange = (event) => {
|
|
7493
|
+
const nextValue = event.target.value;
|
|
7494
|
+
setSearchTerm(nextValue);
|
|
7495
|
+
debouncedSearch(nextValue);
|
|
7496
|
+
};
|
|
7496
7497
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
7497
7498
|
Input,
|
|
7498
7499
|
{
|
|
7499
|
-
placeholder: placeholder ||
|
|
7500
|
+
placeholder: placeholder || "Search...",
|
|
7500
7501
|
value: searchTerm,
|
|
7501
|
-
onChange:
|
|
7502
|
+
onChange: handleChange,
|
|
7502
7503
|
className: cn("w-full md:max-w-sm", className),
|
|
7503
7504
|
classNameDefault
|
|
7504
7505
|
}
|
|
@@ -9219,7 +9220,7 @@ function UiSelect({
|
|
|
9219
9220
|
className,
|
|
9220
9221
|
label ? "mt-1" : ""
|
|
9221
9222
|
),
|
|
9222
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectValue, { placeholder })
|
|
9223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectValue, { placeholder, className: "placeholder:text-muted-foreground" })
|
|
9223
9224
|
}
|
|
9224
9225
|
),
|
|
9225
9226
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectContent, { className: cn(contentBase, contentClassName), children: children ? children : items ? items == null ? void 0 : items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
@@ -9292,25 +9293,31 @@ function UiInput(_a) {
|
|
|
9292
9293
|
Label3,
|
|
9293
9294
|
{
|
|
9294
9295
|
ref,
|
|
9295
|
-
className: cn(
|
|
9296
|
+
className: cn(
|
|
9297
|
+
"mb-1 inline-flex items-start gap-0.5 text-sm font-medium",
|
|
9298
|
+
errorMessage && "text-destructive",
|
|
9299
|
+
labelClassName
|
|
9300
|
+
),
|
|
9296
9301
|
htmlFor: formItemId,
|
|
9297
9302
|
children: [
|
|
9298
|
-
label,
|
|
9299
|
-
requiredLabel
|
|
9303
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: label }),
|
|
9304
|
+
requiredLabel ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9300
9305
|
import_lucide_react8.Asterisk,
|
|
9301
9306
|
{
|
|
9307
|
+
"aria-hidden": "true",
|
|
9302
9308
|
className: cn(
|
|
9303
|
-
"
|
|
9309
|
+
"mt-0.5 h-3 w-3 shrink-0 text-red-500",
|
|
9304
9310
|
requiredLabelClassName
|
|
9305
9311
|
)
|
|
9306
9312
|
}
|
|
9307
|
-
)
|
|
9313
|
+
) : null
|
|
9308
9314
|
]
|
|
9309
9315
|
}
|
|
9310
9316
|
) : null,
|
|
9311
9317
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9312
9318
|
Input,
|
|
9313
9319
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
9320
|
+
id: formItemId,
|
|
9314
9321
|
onChange,
|
|
9315
9322
|
placeholder,
|
|
9316
9323
|
className: cn(
|
|
@@ -9321,7 +9328,7 @@ function UiInput(_a) {
|
|
|
9321
9328
|
classNameDefault
|
|
9322
9329
|
})
|
|
9323
9330
|
),
|
|
9324
|
-
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-sm text-destructive
|
|
9331
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "mt-1 text-sm text-destructive", children: errorMessage }) : null
|
|
9325
9332
|
] });
|
|
9326
9333
|
}
|
|
9327
9334
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.js
CHANGED
|
@@ -7256,34 +7256,35 @@ var ScrollBar = React52.forwardRef((_a, ref) => {
|
|
|
7256
7256
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
7257
7257
|
|
|
7258
7258
|
// src/components/search-input.tsx
|
|
7259
|
-
import React53
|
|
7260
|
-
import {
|
|
7259
|
+
import React53 from "react";
|
|
7260
|
+
import { useDebouncedCallback } from "use-debounce";
|
|
7261
7261
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
7262
7262
|
function SearchInput({
|
|
7263
|
-
value,
|
|
7263
|
+
value = "",
|
|
7264
7264
|
placeholder,
|
|
7265
7265
|
className,
|
|
7266
7266
|
classNameDefault,
|
|
7267
7267
|
debounceTime = 750,
|
|
7268
7268
|
onSearch
|
|
7269
7269
|
}) {
|
|
7270
|
-
const [searchTerm, setSearchTerm] = React53.useState(value);
|
|
7271
|
-
const
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
}, []);
|
|
7270
|
+
const [searchTerm, setSearchTerm] = React53.useState(value != null ? value : "");
|
|
7271
|
+
const debouncedSearch = useDebouncedCallback((nextValue) => {
|
|
7272
|
+
onSearch(nextValue);
|
|
7273
|
+
}, debounceTime);
|
|
7275
7274
|
React53.useEffect(() => {
|
|
7276
|
-
|
|
7277
|
-
}, [debouncedValue, handleSettingSearchParams]);
|
|
7278
|
-
React53.useEffect(() => {
|
|
7279
|
-
setSearchTerm(value);
|
|
7275
|
+
setSearchTerm(value != null ? value : "");
|
|
7280
7276
|
}, [value]);
|
|
7277
|
+
const handleChange = (event) => {
|
|
7278
|
+
const nextValue = event.target.value;
|
|
7279
|
+
setSearchTerm(nextValue);
|
|
7280
|
+
debouncedSearch(nextValue);
|
|
7281
|
+
};
|
|
7281
7282
|
return /* @__PURE__ */ jsx31(
|
|
7282
7283
|
Input,
|
|
7283
7284
|
{
|
|
7284
|
-
placeholder: placeholder ||
|
|
7285
|
+
placeholder: placeholder || "Search...",
|
|
7285
7286
|
value: searchTerm,
|
|
7286
|
-
onChange:
|
|
7287
|
+
onChange: handleChange,
|
|
7287
7288
|
className: cn("w-full md:max-w-sm", className),
|
|
7288
7289
|
classNameDefault
|
|
7289
7290
|
}
|
|
@@ -9017,7 +9018,7 @@ function UiSelect({
|
|
|
9017
9018
|
className,
|
|
9018
9019
|
label ? "mt-1" : ""
|
|
9019
9020
|
),
|
|
9020
|
-
children: /* @__PURE__ */ jsx55(SelectValue, { placeholder })
|
|
9021
|
+
children: /* @__PURE__ */ jsx55(SelectValue, { placeholder, className: "placeholder:text-muted-foreground" })
|
|
9021
9022
|
}
|
|
9022
9023
|
),
|
|
9023
9024
|
/* @__PURE__ */ jsx55(SelectContent, { className: cn(contentBase, contentClassName), children: children ? children : items ? items == null ? void 0 : items.map((item) => /* @__PURE__ */ jsx55(
|
|
@@ -9090,25 +9091,31 @@ function UiInput(_a) {
|
|
|
9090
9091
|
Label3,
|
|
9091
9092
|
{
|
|
9092
9093
|
ref,
|
|
9093
|
-
className: cn(
|
|
9094
|
+
className: cn(
|
|
9095
|
+
"mb-1 inline-flex items-start gap-0.5 text-sm font-medium",
|
|
9096
|
+
errorMessage && "text-destructive",
|
|
9097
|
+
labelClassName
|
|
9098
|
+
),
|
|
9094
9099
|
htmlFor: formItemId,
|
|
9095
9100
|
children: [
|
|
9096
|
-
label,
|
|
9097
|
-
requiredLabel
|
|
9101
|
+
/* @__PURE__ */ jsx56("span", { children: label }),
|
|
9102
|
+
requiredLabel ? /* @__PURE__ */ jsx56(
|
|
9098
9103
|
Asterisk2,
|
|
9099
9104
|
{
|
|
9105
|
+
"aria-hidden": "true",
|
|
9100
9106
|
className: cn(
|
|
9101
|
-
"
|
|
9107
|
+
"mt-0.5 h-3 w-3 shrink-0 text-red-500",
|
|
9102
9108
|
requiredLabelClassName
|
|
9103
9109
|
)
|
|
9104
9110
|
}
|
|
9105
|
-
)
|
|
9111
|
+
) : null
|
|
9106
9112
|
]
|
|
9107
9113
|
}
|
|
9108
9114
|
) : null,
|
|
9109
9115
|
/* @__PURE__ */ jsx56(
|
|
9110
9116
|
Input,
|
|
9111
9117
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
9118
|
+
id: formItemId,
|
|
9112
9119
|
onChange,
|
|
9113
9120
|
placeholder,
|
|
9114
9121
|
className: cn(
|
|
@@ -9119,7 +9126,7 @@ function UiInput(_a) {
|
|
|
9119
9126
|
classNameDefault
|
|
9120
9127
|
})
|
|
9121
9128
|
),
|
|
9122
|
-
errorMessage ? /* @__PURE__ */ jsx56("p", { className: "text-sm text-destructive
|
|
9129
|
+
errorMessage ? /* @__PURE__ */ jsx56("p", { className: "mt-1 text-sm text-destructive", children: errorMessage }) : null
|
|
9123
9130
|
] });
|
|
9124
9131
|
}
|
|
9125
9132
|
export {
|
package/dist/style.css
CHANGED
|
@@ -444,6 +444,9 @@
|
|
|
444
444
|
.-mt-4 {
|
|
445
445
|
margin-top: calc(var(--spacing) * -4);
|
|
446
446
|
}
|
|
447
|
+
.mt-0\.5 {
|
|
448
|
+
margin-top: calc(var(--spacing) * 0.5);
|
|
449
|
+
}
|
|
447
450
|
.mt-1 {
|
|
448
451
|
margin-top: calc(var(--spacing) * 1);
|
|
449
452
|
}
|
|
@@ -802,6 +805,9 @@
|
|
|
802
805
|
.items-end {
|
|
803
806
|
align-items: flex-end;
|
|
804
807
|
}
|
|
808
|
+
.items-start {
|
|
809
|
+
align-items: flex-start;
|
|
810
|
+
}
|
|
805
811
|
.justify-between {
|
|
806
812
|
justify-content: space-between;
|
|
807
813
|
}
|
|
@@ -814,6 +820,9 @@
|
|
|
814
820
|
.gap-0 {
|
|
815
821
|
gap: calc(var(--spacing) * 0);
|
|
816
822
|
}
|
|
823
|
+
.gap-0\.5 {
|
|
824
|
+
gap: calc(var(--spacing) * 0.5);
|
|
825
|
+
}
|
|
817
826
|
.gap-1 {
|
|
818
827
|
gap: calc(var(--spacing) * 1);
|
|
819
828
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shadcn-ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Bleker Cordova <bleker@gliyen.com>",
|
|
6
6
|
"description": "A collection of components for building beautiful and accessible user interfaces with React and Tailwind CSS.",
|