-
Notifications
You must be signed in to change notification settings - Fork 68
LG-4899: getLgIds #2786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LG-4899: getLgIds #2786
Changes from 43 commits
e584c08
d44a0cf
6a99af1
e755469
17645b5
576a2aa
b55f264
f842ab0
9b86e59
454e56e
19ef955
9e96a8a
c9b60f1
113f1ae
6ebbdcc
3d36ccb
f760242
a49c5a8
a286f9b
3f69213
8413e2d
4d97726
1616519
5d2ab30
b38c4f9
8aa3033
1460aa5
d55ae33
55d7af8
5140d06
7fa641e
711cd8f
40e641e
b924e48
ac23442
a13ff1b
b0bb942
aa268ad
95b3b93
05a49da
3c4cdc6
ff564be
2a3427b
cf5741e
7065ae8
3a1ad90
e67df1b
7f32cf0
161f668
c195e3a
92e79eb
096d819
04776b8
b579f9e
935ec43
b556bca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
'@leafygreen-ui/confirmation-modal': major | ||
'@leafygreen-ui/gallery-indicator': major | ||
'@leafygreen-ui/password-input': major | ||
'@leafygreen-ui/split-button': major | ||
'@leafygreen-ui/form-footer': major | ||
'@leafygreen-ui/form-field': major | ||
'@leafygreen-ui/text-input': major | ||
'@leafygreen-ui/typography': major | ||
'@leafygreen-ui/text-area': major | ||
'@leafygreen-ui/checkbox': major | ||
'@leafygreen-ui/select': major | ||
'@leafygreen-ui/toggle': major | ||
'@leafygreen-ui/table': major | ||
'@leafygreen-ui/code': major | ||
'@leafygreen-ui/menu': major | ||
'@leafygreen-ui/tabs': major | ||
--- | ||
|
||
Updates `data-lgid` to use scope based test IDs. These test IDs are generated using the helper utility `getLgIds`. For more information [check out the section in the styleguide about getLgIds](https://github.com/mongodb/leafygreen-ui/blob/main/STYLEGUIDE.md#getlgids). | ||
|
||
Removes public exports for: | ||
- `LGIDs` | ||
- `LGIDS_CHECKBOX` | ||
- `LGIDS_FORM_FIELD` | ||
- `LGIDS_SELECT` | ||
- `LGIDS_TYPOGRAPHY` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/date-picker': patch | ||
--- | ||
|
||
Updates spec file to use updated test ids for `@leafygreen-ui/form-field` components |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { LgIdString } from '@leafygreen-ui/lib'; | ||
|
||
export const DEFAULT_LGID_ROOT = 'lg-button'; | ||
|
||
export const getLgIds = (root: `lg-${string}` = DEFAULT_LGID_ROOT) => { | ||
export const getLgIds = (root: LgIdString = DEFAULT_LGID_ROOT) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, but it might be worth creating a type GetLgIdsFunction = (root?: LgIdString) => {
root: LgIdString,
...
} |
||
return { | ||
root, | ||
} as const; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export { type CheckboxProps, checkWrapperClassName, default } from './Checkbox'; | ||
export { LGIDS_CHECKBOX } from './constants'; | ||
export { getTestUtils } from './utils'; | ||
export { | ||
DEFAULT_LGID_ROOT, | ||
getLgIds, | ||
type GetLgIdsReturnType, | ||
getTestUtils, | ||
} from './utils'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { LgIdString } from '@leafygreen-ui/lib'; | ||
|
||
export const DEFAULT_LGID_ROOT = 'lg-checkbox'; | ||
|
||
export const getLgIds = (root: LgIdString = DEFAULT_LGID_ROOT) => { | ||
const ids = { | ||
root, | ||
} as const; | ||
return ids; | ||
}; | ||
|
||
export type GetLgIdsReturnType = ReturnType<typeof getLgIds>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
export { | ||
DEFAULT_LGID_ROOT, | ||
getLgIds, | ||
type GetLgIdsReturnType, | ||
} from './getLgIds'; | ||
export { getTestUtils } from './getTestUtils'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ describe('CopyButton', () => { | |
return render( | ||
<CodeContextProvider | ||
// @ts-expect-error - other ids are missing but not needed for test | ||
lgids={{ | ||
lgIds={{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this testing that a |
||
copyButton: `lg-code-copy_button`, | ||
copyTooltip: `lg-code-copy_tooltip`, | ||
}} | ||
|
Uh oh!
There was an error while loading. Please reload this page.