@nicolassancho/storybook-core 3.0.9 → 3.0.11
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.
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { tv } from "tailwind-variants";
|
|
14
14
|
const searchInputStyles = tv({
|
|
15
|
-
base: "w-full rounded-
|
|
15
|
+
base: "w-full rounded-sm bg-white px-3 py-2 text-sm placeholder:text-neutral-500 focus:outline-hidden focus:ring-2 transition-colors",
|
|
16
16
|
variants: {
|
|
17
17
|
variantSize: {
|
|
18
18
|
small: "text-xs py-1 px-2",
|
|
@@ -32,7 +32,8 @@ const searchInputStyles = tv({
|
|
|
32
32
|
export const SearchInput = (_a) => {
|
|
33
33
|
var { placeholder = "Search…", value, isInvalid = false, onChange, className, variantSize = "medium" } = _a, props = __rest(_a, ["placeholder", "value", "isInvalid", "onChange", "className", "variantSize"]);
|
|
34
34
|
// Fall back to a generic accessible name only when the consumer hasn't labelled the input
|
|
35
|
-
// (
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// (aria-labelledby or their own aria-label). An `id` alone does not name the input, so it does
|
|
36
|
+
// not count; with a visible <Label htmlFor>, also pass `aria-labelledby` pointing at the label.
|
|
37
|
+
const hasLabel = Boolean(props["aria-labelledby"] || props["aria-label"]);
|
|
38
|
+
return (_jsx("input", Object.assign({ type: "search", "aria-label": hasLabel ? undefined : "Search", "aria-invalid": isInvalid || undefined, placeholder: placeholder, value: value, onChange: onChange, className: searchInputStyles({ variantSize, isInvalid, className }) }, props)));
|
|
38
39
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nicolassancho/storybook-core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.11",
|
|
4
4
|
"description": "Accessible React + Tailwind component library built with tailwind-variants and documented in Storybook.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"url": "https://github.com/NicolasSancho/Storybook-core/issues"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@eslint/js": "^9.
|
|
55
|
+
"@eslint/js": "^9.39.5",
|
|
56
56
|
"@storybook/addon-a11y": "^10.6.1",
|
|
57
57
|
"@storybook/addon-docs": "^10.6.1",
|
|
58
58
|
"@storybook/addon-links": "^10.6.1",
|
|
@@ -63,19 +63,19 @@
|
|
|
63
63
|
"@typescript-eslint/eslint-plugin": "^8.71.1",
|
|
64
64
|
"@typescript-eslint/parser": "^8.71.1",
|
|
65
65
|
"@vitest/browser-playwright": "^5.0.3",
|
|
66
|
-
"eslint": "^9.
|
|
66
|
+
"eslint": "^9.39.5",
|
|
67
67
|
"eslint-config-prettier": "^10.1.8",
|
|
68
68
|
"eslint-plugin-react": "^7.37.5",
|
|
69
69
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
70
70
|
"eslint-plugin-storybook": "^10.6.1",
|
|
71
71
|
"playwright": "^1.64.0",
|
|
72
72
|
"postcss": "^8.4.41",
|
|
73
|
-
"prettier": "^3.
|
|
73
|
+
"prettier": "^3.9.10",
|
|
74
74
|
"storybook": "^10.6.1",
|
|
75
75
|
"tailwind-merge": "^3.7.0",
|
|
76
76
|
"tailwind-variants": "^3.3.1",
|
|
77
77
|
"tailwindcss": "^4.3.3",
|
|
78
|
-
"typescript": "^5.
|
|
78
|
+
"typescript": "^5.9.3",
|
|
79
79
|
"vitest": "^5.0.3"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|