Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@leafygreen-ui/search-input

Package Overview
Dependencies
Maintainers
5
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/search-input - npm Package Compare versions

Comparing version 3.0.0-alpha.1 to 3.0.0

dist/esm/index.js

285

CHANGELOG.md
# @leafygreen-ui/search-input
## 3.0.0-alpha.1
## 3.0.0
### Major Changes
- d40674fe1: Updates build tooling. No functional changes
- f630c718: [LG-4152](https://jira.mongodb.org/browse/LG-4152)
#### `aria-label` prop change
`aria-label` prop can only set the `aria-label` attribute on the searchbox element if `aria-labelledby` prop is undefined
| 👎 Does not use `aria-label` prop | 👍 Does use `aria-label` prop |
| - | - |
| `<SearchInput aria-label="Label" aria-labelledby="custom-label-id" />` | `<SearchInput aria-label="Label" />` |
#### Styling changes
The following styling changes are made:
- added `xsmall` variant
- updated spacing for `default`, `small`, and `large` size variants
- updated dark mode placeholder text color
#### `onKeyDown` bug fix
Previously, if searchbox element had focus and was disabled, user could press keys which would trigger opening the menu element.
Now, if searchbox element has focus and is disabled, user can press keys, and they will not trigger any `onKeyDown` logic.
### Patch Changes
- Updated dependencies [d40674fe1]
- @leafygreen-ui/leafygreen-provider@4.0.0-alpha.1
- @leafygreen-ui/input-option@2.0.0-alpha.1
- @leafygreen-ui/icon-button@16.0.0-alpha.1
- @leafygreen-ui/polymorphic@2.0.0-alpha.1
- @leafygreen-ui/typography@17.0.0-alpha.1
- @leafygreen-ui/emotion@5.0.0-alpha.1
- @leafygreen-ui/palette@5.0.0-alpha.1
- @leafygreen-ui/popover@12.0.0-alpha.1
- @leafygreen-ui/tokens@3.0.0-alpha.1
- @leafygreen-ui/hooks@8.0.0-alpha.1
- @leafygreen-ui/a11y@2.0.0-alpha.1
- @leafygreen-ui/icon@12.0.0-alpha.1
- @leafygreen-ui/lib@11.0.0-alpha.1
- Updated dependencies [9402ba0e]
- Updated dependencies [9b71e34d]
- Updated dependencies [c3906f78]
- Updated dependencies [c3906f78]
- Updated dependencies [070736c4]
- @leafygreen-ui/icon@12.1.0
- @leafygreen-ui/typography@18.4.0
- @leafygreen-ui/lib@13.4.0
- @leafygreen-ui/palette@4.0.10
## 3.0.0-alpha.0
## 2.1.6
### Major Changes
### Patch Changes
- d40674fe1: Updates build tooling. No functional changes
- 356a53fd: Update TS builds to use `typescript@4.9.5`
- Updated dependencies [7a0ff1be]
- Updated dependencies [15185af0]
- Updated dependencies [356a53fd]
- Updated dependencies [66df9ab8]
- @leafygreen-ui/typography@18.3.0
- @leafygreen-ui/leafygreen-provider@3.1.12
- @leafygreen-ui/icon-button@15.0.21
- @leafygreen-ui/popover@11.3.1
- @leafygreen-ui/icon@12.0.1
- @leafygreen-ui/lib@13.3.0
- @leafygreen-ui/a11y@1.4.13
- @leafygreen-ui/emotion@4.0.8
- @leafygreen-ui/hooks@8.1.3
- @leafygreen-ui/input-option@1.1.2
- @leafygreen-ui/palette@4.0.9
- @leafygreen-ui/polymorphic@1.3.7
- @leafygreen-ui/tokens@2.5.2
## 2.1.5
### Patch Changes
- Updated dependencies [d40674fe1]
- @leafygreen-ui/leafygreen-provider@4.0.0-alpha.0
- @leafygreen-ui/input-option@2.0.0-alpha.0
- @leafygreen-ui/icon-button@16.0.0-alpha.0
- @leafygreen-ui/polymorphic@2.0.0-alpha.0
- @leafygreen-ui/typography@17.0.0-alpha.0
- @leafygreen-ui/emotion@5.0.0-alpha.0
- @leafygreen-ui/palette@5.0.0-alpha.0
- @leafygreen-ui/popover@12.0.0-alpha.0
- @leafygreen-ui/tokens@3.0.0-alpha.0
- @leafygreen-ui/hooks@8.0.0-alpha.0
- @leafygreen-ui/a11y@2.0.0-alpha.0
- @leafygreen-ui/icon@12.0.0-alpha.0
- @leafygreen-ui/lib@11.0.0-alpha.0
- Updated dependencies [74057388]
- @leafygreen-ui/icon@12.0.0
- @leafygreen-ui/icon-button@15.0.20
- @leafygreen-ui/typography@18.2.3
## 2.1.4
### Patch Changes
- e487fb24: Renames story files from `.story.tsx` to `.stories.tsx`
- Updated dependencies [8ad4fdbc]
- Updated dependencies [58f4a4c5]
- Updated dependencies [5ee54143]
- Updated dependencies [e487fb24]
- @leafygreen-ui/popover@11.3.0
- @leafygreen-ui/typography@18.2.2
- @leafygreen-ui/tokens@2.5.1
- @leafygreen-ui/input-option@1.1.1
- @leafygreen-ui/hooks@8.1.2
- @leafygreen-ui/icon@11.29.1
## 2.1.3
### Patch Changes
- 2bceccb1: Fixes `lodash` imports to use default exports of specific functions to reduce component's bundle size.
- Updated dependencies [2bceccb1]
- Updated dependencies [2645cd50]
- @leafygreen-ui/hooks@8.1.1
- @leafygreen-ui/lib@13.2.1
- @leafygreen-ui/tokens@2.3.0
## 2.1.2
### Patch Changes
- 9a471879: - Updates dark mode dropdown border from `gray.dark3` to `gray.dark2`
- Updated dependencies [dd4f3da8]
- Updated dependencies [784e9d8a]
- Updated dependencies [90053e16]
- @leafygreen-ui/lib@13.0.0
- @leafygreen-ui/icon-button@15.0.19
- @leafygreen-ui/typography@18.0.0
- @leafygreen-ui/a11y@1.4.11
- @leafygreen-ui/input-option@1.0.13
- @leafygreen-ui/leafygreen-provider@3.1.10
- @leafygreen-ui/popover@11.1.1
## 2.1.1
### Patch Changes
- d70768a7: Add a 1px `gray.light2` border to light mode dropdowns and a 1px `gray.dark3` border to dark mode dropdowns to match Figma specs.
## 2.1.0
### Minor Changes
- f6698369: SearchResultMenu now supports a footer slot prop for children rendered under the list of search results. Popover props are also now correctly passed to the Popover component.
### Patch Changes
- Updated dependencies [f8c77c5d]
- Updated dependencies [1c7c9608]
- Updated dependencies [827060f6]
- @leafygreen-ui/popover@11.1.0
- @leafygreen-ui/icon@11.24.0
## 2.0.17
### Patch Changes
- 3a9b274d: Handles keyboard event based on the event's `key` property rather than its `keyCode` property
- Updated dependencies [3a9b274d]
- @leafygreen-ui/lib@12.0.0
- @leafygreen-ui/a11y@1.4.10
- @leafygreen-ui/icon-button@15.0.18
- @leafygreen-ui/input-option@1.0.11
- @leafygreen-ui/leafygreen-provider@3.1.9
- @leafygreen-ui/popover@11.0.18
- @leafygreen-ui/typography@17.0.1
## 2.0.16
### Patch Changes
- 1a0b9996: Export SearchResultsMenu component
## 2.0.15
### Patch Changes
- Updated dependencies [a5770c15]
- Updated dependencies [c89d17a4]
- @leafygreen-ui/typography@17.0.0
- @leafygreen-ui/input-option@1.0.10
## 2.0.14
### Patch Changes
- Updated dependencies [3fe03b50]
- Updated dependencies [fd907503]
- Updated dependencies [c9f0055a]
- Updated dependencies [56459cde]
- @leafygreen-ui/tokens@2.2.0
- @leafygreen-ui/hooks@8.0.0
- @leafygreen-ui/icon@11.23.0
- @leafygreen-ui/a11y@1.4.9
- @leafygreen-ui/leafygreen-provider@3.1.8
- @leafygreen-ui/popover@11.0.17
## 2.0.13
### Patch Changes
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
- @leafygreen-ui/icon@11.22.2
- @leafygreen-ui/lib@11.0.0
- @leafygreen-ui/polymorphic@1.3.6
- @leafygreen-ui/popover@11.0.16
- @leafygreen-ui/a11y@1.4.8
- @leafygreen-ui/icon-button@15.0.17
- @leafygreen-ui/input-option@1.0.9
- @leafygreen-ui/leafygreen-provider@3.1.7
- @leafygreen-ui/typography@16.5.5
## 2.0.12
### Patch Changes
- c11bbc29: Fixes problem with ts-docs not being available in bundle.
- Updated dependencies [c11bbc29]
- @leafygreen-ui/a11y@1.4.7
- @leafygreen-ui/emotion@4.0.7
- @leafygreen-ui/hooks@7.7.8
- @leafygreen-ui/icon@11.22.1
- @leafygreen-ui/icon-button@15.0.16
- @leafygreen-ui/input-option@1.0.8
- @leafygreen-ui/leafygreen-provider@3.1.6
- @leafygreen-ui/lib@10.4.3
- @leafygreen-ui/palette@4.0.7
- @leafygreen-ui/polymorphic@1.3.5
- @leafygreen-ui/popover@11.0.15
- @leafygreen-ui/tokens@2.1.4
- @leafygreen-ui/typography@16.5.4
## 2.0.11
### Patch Changes
- c15ee2ac: Fixes missing documentation file
- Updated dependencies [f73807cf]
- Updated dependencies [31c09354]
- Updated dependencies [c15ee2ac]
- @leafygreen-ui/icon@11.22.0
- @leafygreen-ui/a11y@1.4.6
- @leafygreen-ui/emotion@4.0.6
- @leafygreen-ui/hooks@7.7.7
- @leafygreen-ui/icon-button@15.0.15
- @leafygreen-ui/input-option@1.0.7
- @leafygreen-ui/leafygreen-provider@3.1.5
- @leafygreen-ui/lib@10.4.2
- @leafygreen-ui/palette@4.0.6
- @leafygreen-ui/polymorphic@1.3.4
- @leafygreen-ui/popover@11.0.14
- @leafygreen-ui/tokens@2.1.3
- @leafygreen-ui/typography@16.5.3
## 2.0.10
### Patch Changes
- e8ef95e6: Updates disabled styles
## 2.0.9
### Patch Changes
- 215268ff: Updates build tooling. No functional changes
- Updated dependencies [215268ff]
- @leafygreen-ui/leafygreen-provider@3.1.4
- @leafygreen-ui/input-option@1.0.6
- @leafygreen-ui/icon-button@15.0.14
- @leafygreen-ui/polymorphic@1.3.3
- @leafygreen-ui/typography@16.5.2
- @leafygreen-ui/emotion@4.0.5
- @leafygreen-ui/palette@4.0.5
- @leafygreen-ui/popover@11.0.13
- @leafygreen-ui/tokens@2.1.2
- @leafygreen-ui/hooks@7.7.6
- @leafygreen-ui/a11y@1.4.5
- @leafygreen-ui/icon@11.20.1
- @leafygreen-ui/lib@10.4.1
## 2.0.8

@@ -50,0 +269,0 @@

38

package.json
{
"name": "@leafygreen-ui/search-input",
"version": "3.0.0-alpha.1",
"version": "3.0.0",
"description": "leafyGreen UI Kit Search Input",

@@ -16,4 +16,5 @@ "main": "./dist/index.js",

"scripts": {
"build": "rollup --config rollup.config.mjs",
"tsc": "tsc --build tsconfig.json"
"build": "lg build-package",
"tsc": "lg build-ts",
"docs": "lg build-tsdoc"
},

@@ -33,14 +34,14 @@ "license": "Apache-2.0",

"dependencies": {
"@leafygreen-ui/a11y": "^2.0.0-alpha.1",
"@leafygreen-ui/emotion": "^5.0.0-alpha.1",
"@leafygreen-ui/hooks": "^8.0.0-alpha.1",
"@leafygreen-ui/icon": "^12.0.0-alpha.1",
"@leafygreen-ui/icon-button": "^16.0.0-alpha.1",
"@leafygreen-ui/input-option": "^2.0.0-alpha.1",
"@leafygreen-ui/lib": "^11.0.0-alpha.1",
"@leafygreen-ui/palette": "^5.0.0-alpha.1",
"@leafygreen-ui/polymorphic": "^2.0.0-alpha.1",
"@leafygreen-ui/popover": "^12.0.0-alpha.1",
"@leafygreen-ui/tokens": "^3.0.0-alpha.1",
"@leafygreen-ui/typography": "^17.0.0-alpha.1",
"@leafygreen-ui/a11y": "^1.4.13",
"@leafygreen-ui/emotion": "^4.0.8",
"@leafygreen-ui/hooks": "^8.1.3",
"@leafygreen-ui/icon": "^12.1.0",
"@leafygreen-ui/icon-button": "^15.0.21",
"@leafygreen-ui/input-option": "^1.1.2",
"@leafygreen-ui/lib": "^13.4.0",
"@leafygreen-ui/palette": "^4.0.10",
"@leafygreen-ui/polymorphic": "^1.3.7",
"@leafygreen-ui/popover": "^11.3.1",
"@leafygreen-ui/tokens": "^2.5.2",
"@leafygreen-ui/typography": "^18.4.0",
"lodash": "^4.17.21",

@@ -50,4 +51,7 @@ "polished": "^4.2.2"

"peerDependencies": {
"@leafygreen-ui/leafygreen-provider": "^4.0.0-alpha.1"
"@leafygreen-ui/leafygreen-provider": "^3.1.12"
},
"devDependencies": {
"@lg-tools/storybook-utils": "^0.1.0"
}
}
}

@@ -7,1 +7,5 @@ export { SearchInput, type SearchInputProps, Size, State } from './SearchInput';

} from './SearchResultGroup';
export {
SearchResultsMenu,
type SearchResultsMenuProps,
} from './SearchResultsMenu';

@@ -9,2 +9,3 @@ import { css } from '@leafygreen-ui/emotion';

hoverRing,
Size,
transitionDuration,

@@ -14,4 +15,2 @@ typeScales,

import { Size } from './SearchInput.types';
/**

@@ -40,2 +39,8 @@ * Adds an inset box shadow to hide the UA background styles for autofilled inputs

export const inputWrapperSizeStyle: Record<Size, string> = {
[Size.XSmall]: css`
font-size: ${typeScales.body1.fontSize}px;
line-height: ${typeScales.body1.lineHeight}px;
height: 22px;
grid-template-columns: 28px 1fr 36px;
`,
[Size.Small]: css`

@@ -45,4 +50,3 @@ font-size: ${typeScales.body1.fontSize}px;

height: 28px;
grid-template-columns: 28px 1fr;
grid-auto-columns: 28px;
grid-template-columns: 32px 1fr 36px;
`,

@@ -53,11 +57,9 @@ [Size.Default]: css`

height: 36px;
grid-template-columns: 36px 1fr;
grid-auto-columns: 36px;
grid-template-columns: 36px 1fr 36px;
`,
[Size.Large]: css`
font-size: 18px;
line-height: 32px;
font-size: ${typeScales.large.fontSize}px;
line-height: ${typeScales.large.lineHeight}px;
height: 48px;
grid-template-columns: 48px 1fr;
grid-auto-columns: 48px;
grid-template-columns: 36px 1fr 44px;
`,

@@ -142,3 +144,3 @@ };

&:disabled {
&[aria-disabled='true'] {
cursor: not-allowed;

@@ -178,3 +180,3 @@

&:not(:disabled) {
&[aria-disabled='false'] {
box-shadow: ${autofillShadowOverride(palette.white)};

@@ -199,3 +201,3 @@

&:disabled {
&[aria-disabled='true'] {
&::placeholder {

@@ -223,3 +225,3 @@ color: ${palette.gray.base};

-webkit-text-fill-color: ${palette.gray.light3};
&:not(:disabled) {
&[aria-disabled='false'] {
box-shadow: ${autofillShadowOverride(palette.gray.dark4)};

@@ -241,9 +243,9 @@

&::placeholder {
color: ${palette.gray.base};
color: ${palette.gray.dark1};
font-weight: ${fontWeights.regular};
}
&:disabled {
&[aria-disabled='true'] {
&::placeholder {
color: ${palette.gray.base};
color: ${palette.gray.dark1};
}

@@ -275,10 +277,13 @@

export const searchIconSizeStyle: Record<Size, string> = {
[Size.XSmall]: css`
margin-left: 2px;
`,
[Size.Small]: css`
left: 10px;
margin-left: 0px;
`,
[Size.Default]: css`
left: 12px;
margin-left: 8px;
`,
[Size.Large]: css`
left: 16px;
margin-left: 8px;
`,

@@ -296,7 +301,10 @@ };

export const clearButtonStyle = css``;
export const clearButtonSizeStyle: Record<Size, string> = {
[Size.XSmall]: css`
height: 22px;
width: 22px;
`,
[Size.Small]: css`
height: 26px;
width: 26px;
height: 28px;
width: 28px;
`,

@@ -303,0 +311,0 @@ [Size.Default]: css`

@@ -9,2 +9,3 @@ import {

import { DarkModeProps } from '@leafygreen-ui/lib';
import { Size } from '@leafygreen-ui/tokens';

@@ -16,12 +17,6 @@ export const State = {

export type State = typeof State[keyof typeof State];
export type State = (typeof State)[keyof typeof State];
export const Size = {
Small: 'small',
Default: 'default',
Large: 'large',
} as const;
export { Size };
export type Size = typeof Size[keyof typeof Size];
interface BaseSearchInputProps

@@ -28,0 +23,0 @@ extends DarkModeProps,

@@ -16,5 +16,7 @@ import { transparentize } from 'polished';

background-color: ${palette.white};
border: 1px solid ${palette.gray.light2};
`,
[Theme.Dark]: css`
background-color: ${palette.gray.dark3};
border: 1px solid ${palette.gray.dark2};
`,

@@ -21,0 +23,0 @@ };

@@ -1,2 +0,2 @@

import React from 'react';
import React, { ReactElement } from 'react';

@@ -10,2 +10,3 @@ import { HTMLElementProps } from '@leafygreen-ui/lib';

open?: boolean;
footerSlot?: ReactElement;
};

@@ -16,3 +16,3 @@ {

],
"exclude": ["**/*.spec.*", "**/*.story.*"],
"exclude": ["**/*.spec.*", "**/*.stories.*"],
"references": [

@@ -19,0 +19,0 @@ {

@@ -35,3 +35,3 @@ [

"defaultValue": {
"value": "default"
"value": "Size.Default"
},

@@ -48,2 +48,5 @@ "description": "Determines the font size, padding and spacing.",

{
"value": "\"xsmall\""
},
{
"value": "\"default\""

@@ -272,8 +275,2 @@ },

{
"value": "{}",
"description": "",
"fullComment": "",
"tags": {}
},
{
"value": "ReactElement<any, string | JSXElementConstructor<any>>",

@@ -285,3 +282,3 @@ "description": "",

{
"value": "ReactNodeArray",
"value": "Iterable<ReactNode>",
"description": "",

@@ -323,8 +320,2 @@ "fullComment": "",

{
"value": "{}",
"description": "",
"fullComment": "",
"tags": {}
},
{
"value": "ReactElement<any, string | JSXElementConstructor<any>>",

@@ -336,3 +327,3 @@ "description": "",

{
"value": "ReactNodeArray",
"value": "Iterable<ReactNode>",
"description": "",

@@ -369,3 +360,3 @@ "fullComment": "",

"name": "enum",
"raw": "NodeUrlLike | ((string | NodeUrlLike) & string)",
"raw": "string | NodeUrlLike | (NodeUrlLike & string)",
"value": [

@@ -395,3 +386,3 @@ {

"name": "enum",
"raw": "\"symbol\" | \"object\" | \"form\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"article\" | \"aside\" | \"audio\" | \"b\" | \"base\" | \"bdi\" | \"bdo\" | \"big\" | \"blockquote\" | \"body\" | \"br\" | \"button\" | ... 157 more ... | FunctionComponent<...>",
"raw": "\"symbol\" | \"object\" | \"form\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"article\" | \"aside\" | \"audio\" | \"b\" | \"base\" | \"bdi\" | \"bdo\" | \"big\" | \"blockquote\" | \"body\" | \"br\" | \"button\" | ... 159 more ... | FunctionComponent<...>",
"value": [

@@ -462,2 +453,5 @@ {

{
"value": "\"center\""
},
{
"value": "\"cite\""

@@ -664,2 +658,5 @@ },

{
"value": "\"search\""
},
{
"value": "\"slot\""

@@ -986,8 +983,2 @@ },

{
"value": "{}",
"description": "",
"fullComment": "",
"tags": {}
},
{
"value": "ReactElement<any, string | JSXElementConstructor<any>>",

@@ -999,3 +990,3 @@ "description": "",

{
"value": "ReactNodeArray",
"value": "Iterable<ReactNode>",
"description": "",

@@ -1002,0 +993,0 @@ "fullComment": "",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc