@nicolassancho/storybook-core 3.0.10 → 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-md bg-white px-3 py-2 text-sm placeholder:text-neutral-500 focus:outline-hidden focus:ring-2 transition-colors",
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
- // (a visible <Label htmlFor>, aria-labelledby or their own aria-label).
36
- const hasLabel = Boolean(props.id || props["aria-labelledby"] || props["aria-label"]);
37
- return (_jsx("input", Object.assign({ type: "search", name: "search", "aria-label": hasLabel ? undefined : "Search", "aria-invalid": isInvalid || undefined, placeholder: placeholder, value: value, onChange: onChange, className: searchInputStyles({ variantSize, isInvalid, className }) }, props)));
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.10",
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",