Skip to content

Commit 25aace9

Browse files
Merge branch 'main' into adam/eslint-plugin
2 parents f97e94b + 0bd90b5 commit 25aace9

File tree

218 files changed

+3878
-844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+3878
-844
lines changed

.changeset/curly-worms-drum.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@leafygreen-ui/tokens': minor
3+
---
4+
5+
Adds additional spacing tokens

.changeset/quick-eggs-kneel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@leafygreen-ui/typography': patch
3+
---
4+
5+
Updates dependency `@leafygreen-ui/[email protected]`

.changeset/tricky-cars-cheat.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@leafygreen-ui/text-area': minor
3+
'@leafygreen-ui/combobox': minor
4+
'@leafygreen-ui/select': minor
5+
---
6+
7+
`description` prop can now be a `React.ReactNode` rather than a `string`

STYLEGUIDE.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,42 @@ Keeps functions pure.
190190

191191
---
192192

193-
### Use “be” verbs for boolean types. (e.g. `should`/`is`/`can`/`does`/`has`)
193+
### Prefix boolean variables with “to be” verbs.
194+
195+
(e.g. `shouldX`, `isY`, `canZ`, `doesX`, `hasY`, `willZ`)
196+
197+
---
198+
199+
### Follow BEM-ish patterns when hard-coding a `data-testid` or `data-lgid`
200+
201+
1. Prefix with “lg”
202+
2. Words are separated by underscore `_`
203+
3. Blocks are separated by dash `-`
204+
4. Name hierarchy should somewhat match the directory structure
205+
206+
Additionally, a hard-coded `data` attribute should _only_ be placed on a root-level, native HTML element. Components should have their own internal id.
207+
208+
#### Prefer
209+
210+
```jsx
211+
// CalendarCell.tsx
212+
<td data-testid="lg-date_picker-calendar_cell" />
213+
```
214+
215+
#### Avoid
216+
217+
```jsx
218+
// Calendar.tsx
219+
<Cell data-testid="lg-date-picker-calendar-cell" />
220+
```
221+
222+
(Note, this is fine to do in a _test/spec_ file. Just don't hard-code this into the component)
223+
224+
#### Why BEM-_ish_?
225+
226+
BEM uses dashes (`-`) to separate words within a block/element, and a double underscore (`__`) to separate blocks/elements/modifiers.
227+
228+
The main issue with strict BEM syntax is that it creates a poor user experience when editing. In most text editors a Double click or `Option`+`ArrowKey` presses treat underscores as one works and dashes as a separator. For example, to replace the `"calendar_cell"` part in the above example, you can double click it and paste. Or to move the cursor from the end of that string to the previous element you can press `Option` + `ArrowLeft`.
194229

195230
---
196231

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"scripts": {
1212
"init": "yarn && yarn build",
13+
"init17": "yarn && yarn build:cli && npx ts-node tools/test/scripts/install-react17.ts && yarn build",
1314
"create-package": "lg create",
1415
"prebuild": "yarn build:cli",
1516
"build": "turbo run build tsc",
@@ -52,11 +53,11 @@
5253
"react-dom": "^18.2.0",
5354
"react-router-dom": "5.2.0",
5455
"storybook": "7.1.1",
55-
"turbo": "^1.10.7",
56+
"turbo": "^1.12.3",
5657
"typescript": "~4.7.0"
5758
},
5859
"resolutions": {
59-
"caniuse-lite": "^1.0.30001135"
60+
"caniuse-lite": "^1.0.30001585"
6061
},
6162
"workspaces": [
6263
"packages/*",

packages/badge/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @leafygreen-ui/badge
22

3+
## 8.1.0
4+
5+
### Minor Changes
6+
7+
- cbe92872: Badge components now have a `border-radius` of `24px`, up from `5px` previously.
8+
39
## 8.0.15
410

511
### Patch Changes

packages/badge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@leafygreen-ui/badge",
3-
"version": "8.0.15",
3+
"version": "8.1.0",
44
"description": "leafyGreen UI Kit Badge",
55
"main": "./dist/index.js",
66
"module": "./dist/esm/index.js",

packages/badge/src/Badge/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const baseStyle = css`
1212
font-weight: ${fontWeights.bold};
1313
font-size: 12px;
1414
line-height: 16px;
15-
border-radius: 5px;
15+
border-radius: 24px;
1616
height: 18px;
1717
padding-left: 6px;
1818
padding-right: 6px;

packages/button/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @leafygreen-ui/button
22

3+
## 21.0.12
4+
5+
### Patch Changes
6+
7+
- e4767683: Fixes disabled state styling when a button is focused or active
8+
- Updated dependencies [2bceccb1]
9+
- Updated dependencies [2645cd50]
10+
- @leafygreen-ui/lib@13.2.1
11+
- @leafygreen-ui/tokens@2.3.0
12+
313
## 21.0.11
414

515
### Patch Changes

packages/button/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@leafygreen-ui/button",
3-
"version": "21.0.11",
3+
"version": "21.0.12",
44
"description": "leafyGreen UI Kit Button",
55
"main": "./dist/index.js",
66
"module": "./dist/esm/index.js",
@@ -24,16 +24,16 @@
2424
"dependencies": {
2525
"@leafygreen-ui/box": "^3.1.8",
2626
"@leafygreen-ui/emotion": "^4.0.7",
27-
"@leafygreen-ui/lib": "^13.1.0",
27+
"@leafygreen-ui/lib": "^13.2.1",
2828
"@leafygreen-ui/palette": "^4.0.7",
2929
"@leafygreen-ui/ripple": "^1.1.12",
30-
"@leafygreen-ui/tokens": "^2.1.4",
30+
"@leafygreen-ui/tokens": "^2.3.0",
3131
"polished": "^4.2.2"
3232
},
3333
"devDependencies": {
3434
"next": "^13.0.5",
3535
"@leafygreen-ui/icon": "^11.25.1",
36-
"@leafygreen-ui/loading-indicator": "^2.0.7"
36+
"@leafygreen-ui/loading-indicator": "^2.0.8"
3737
},
3838
"peerDependencies": {
3939
"@leafygreen-ui/leafygreen-provider": "^3.1.10"

0 commit comments

Comments
 (0)