Skip to content

Commit 9f2d22a

Browse files
authored
Merge branch 'main' into angular-updates
2 parents 9d0d948 + c332c2c commit 9f2d22a

File tree

156 files changed

+2440
-199
lines changed

Some content is hidden

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

156 files changed

+2440
-199
lines changed

package-lock.json

Lines changed: 616 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
"packages/nimble-tokens",
4646
"packages/nimble-components",
4747
"packages/spright-components",
48+
"packages/react-workspace/nimble-react",
49+
"packages/react-workspace/spright-react",
50+
"packages/react-workspace/react-client-app",
4851
"packages/storybook",
4952
"packages/angular-workspace",
5053
"packages/angular-workspace/nimble-angular",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module.exports = {
2+
root: true,
3+
ignorePatterns: [
4+
'node_modules',
5+
'dist'
6+
],
7+
overrides: [
8+
{
9+
files: ['*.js', '*.cjs'],
10+
extends: ['@ni-private/eslint-config-nimble/javascript'],
11+
rules: {
12+
// Configuration scripts will not be in published package and are allowed to use devDependencies
13+
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
14+
}
15+
},
16+
{
17+
files: ['build/**/*.js'],
18+
rules: {
19+
// Build scripts should give verbose logging
20+
'no-console': 'off',
21+
// Rollup config files use default exports
22+
'import/no-default-export': 'off',
23+
},
24+
},
25+
{
26+
files: ['*.ts'],
27+
extends: ['@ni-private/eslint-config-nimble/typescript'],
28+
parserOptions: {
29+
project: 'tsconfig.json',
30+
tsconfigRootDir: __dirname
31+
},
32+
rules: {
33+
// The React components should use PascalCase
34+
'@typescript-eslint/naming-convention': [
35+
'error',
36+
{
37+
selector: 'variable',
38+
format: ['camelCase', 'PascalCase']
39+
},
40+
],
41+
}
42+
}
43+
],
44+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/icons
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!/dist/*.*
3+
!/dist/esm/**
4+
/dist/esm/**/tests
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@ni/nimble-react",
3+
"entries": [
4+
{
5+
"date": "Tue, 27 May 2025 20:25:14 GMT",
6+
"version": "0.0.2",
7+
"tag": "@ni/nimble-react_v0.0.2",
8+
"comments": {
9+
"patch": [
10+
{
11+
"author": "[email protected]",
12+
"package": "@ni/nimble-react",
13+
"commit": "32fb7facb3daf1d092a47119110504f7206a92eb",
14+
"comment": "Nimble react preview release"
15+
}
16+
]
17+
}
18+
}
19+
]
20+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Change Log - @ni/nimble-react
2+
3+
<!-- This log was last generated on Tue, 27 May 2025 20:25:14 GMT and should not be manually modified. -->
4+
5+
<!-- Start content -->
6+
7+
## 0.0.2
8+
9+
Tue, 27 May 2025 20:25:14 GMT
10+
11+
### Patches
12+
13+
- Nimble react preview release ([ni/nimble@32fb7fa](https://github.com/ni/nimble/commit/32fb7facb3daf1d092a47119110504f7206a92eb))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div align="center">
2+
<p><b>ni | nimble | react</b></p>
3+
</div>
4+
5+
# Nimble React
6+
7+
Work in progress alpha package

packages/storybook/build/generate-icons/source/index.js renamed to packages/react-workspace/nimble-react/build/generate-icons/source/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const trimSizeFromName = text => {
1313
};
1414

1515
const generatedFilePrefix = `// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
16-
// See generation source in storybook/build/generate-icons\n`;
16+
// See generation source in nimble-react/build/generate-icons\n`;
1717

18-
const iconsDirectory = path.resolve(__dirname, '../../../src/nimble/icons');
18+
const iconsDirectory = path.resolve(__dirname, '../../../src/icons');
1919

2020
if (fs.existsSync(iconsDirectory)) {
2121
console.log(`Deleting existing icons directory "${iconsDirectory}"`);
@@ -39,11 +39,12 @@ for (const key of Object.keys(icons)) {
3939

4040
const iconReactWrapperContent = `${generatedFilePrefix}
4141
import { ${className} } from '@ni/nimble-components/dist/esm/icons/${fileName}';
42-
import { wrap } from '../../utilities/react-wrapper';
42+
import { wrap } from '../utilities/react-wrapper';
4343
44+
export { type ${className} };
4445
export const Nimble${className} = wrap(${className});`;
4546

46-
const outputPath = path.resolve(iconsDirectory, `${fileName}.react.tsx`);
47+
const outputPath = path.resolve(iconsDirectory, `${fileName}.ts`);
4748
fs.writeFileSync(outputPath, iconReactWrapperContent, {
4849
encoding: 'utf-8'
4950
});
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@ni/nimble-react",
3+
"version": "0.0.2",
4+
"description": "React components for the NI Nimble Design System",
5+
"keywords": [
6+
"nimble",
7+
"react"
8+
],
9+
"scripts": {
10+
"build": "npm run build:icons && npm run build:components",
11+
"build:icons": "npm run build:icons:bundle && npm run build:icons:run",
12+
"build:icons:bundle": "rollup --bundleConfigAsCjs --config build/generate-icons/rollup.config.js",
13+
"build:icons:run": "node build/generate-icons/dist/index.js",
14+
"build:components": "tsc -p ./tsconfig.json",
15+
"lint": "eslint .",
16+
"format": "eslint . --fix",
17+
"pack": "npm pack",
18+
"invoke-publish": "npm publish"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "git+https://github.com/ni/nimble.git",
23+
"directory": "packages/react-workspace/nimble-react"
24+
},
25+
"publishConfig": {
26+
"access": "public"
27+
},
28+
"author": "National Instruments",
29+
"license": "MIT",
30+
"devDependencies": {
31+
"@ni-private/eslint-config-nimble": "*",
32+
"@ni/fast-web-utilities": "^10.0.0",
33+
"@ni/nimble-tokens": "^8.9.0",
34+
"@rollup/plugin-node-resolve": "^16.0.0",
35+
"rollup": "^4.12.0",
36+
"typescript": "~5.4.5"
37+
},
38+
"peerDependencies": {
39+
"@ni/fast-react-wrapper": "^10.1.0",
40+
"@ni/nimble-components": "^33.8.0",
41+
"react": "^16 || ^17 || ^18"
42+
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AnchorButton } from '@ni/nimble-components/dist/esm/anchor-button';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type AnchorButton };
45
export const NimbleAnchorButton = wrap(AnchorButton);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AnchorMenuItem } from '@ni/nimble-components/dist/esm/anchor-menu-item';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type AnchorMenuItem };
45
export const NimbleAnchorMenuItem = wrap(AnchorMenuItem);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AnchorTab } from '@ni/nimble-components/dist/esm/anchor-tab';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type AnchorTab };
45
export const NimbleAnchorTab = wrap(AnchorTab);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AnchorTabs } from '@ni/nimble-components/dist/esm/anchor-tabs';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type AnchorTabs };
45
export const NimbleAnchorTabs = wrap(AnchorTabs);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AnchorTreeItem } from '@ni/nimble-components/dist/esm/anchor-tree-item';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type AnchorTreeItem };
45
export const NimbleAnchorTreeItem = wrap(AnchorTreeItem);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Anchor } from '@ni/nimble-components/dist/esm/anchor';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type Anchor };
45
export const NimbleAnchor = wrap(Anchor);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AnchoredRegion } from '@ni/nimble-components/dist/esm/anchored-region';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type AnchoredRegion };
45
export const NimbleAnchoredRegion = wrap(AnchoredRegion);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Banner } from '@ni/nimble-components/dist/esm/banner';
2+
import type { BannerToggleEventDetail } from '@ni/nimble-components/dist/esm/banner/types';
3+
import { wrap } from '../utilities/react-wrapper';
4+
5+
export { type Banner };
6+
export const NimbleBanner = wrap(Banner, {
7+
events: {
8+
onToggle: 'toggle',
9+
}
10+
});
11+
export interface BannerToggleEvent extends CustomEvent<BannerToggleEventDetail> {
12+
target: Banner;
13+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { BreadcrumbItem } from '@ni/nimble-components/dist/esm/breadcrumb-item';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type BreadcrumbItem };
45
export const NimbleBreadcrumbItem = wrap(BreadcrumbItem);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Breadcrumb } from '@ni/nimble-components/dist/esm/breadcrumb';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type Breadcrumb };
45
export const NimbleBreadcrumb = wrap(Breadcrumb);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Button } from '@ni/nimble-components/dist/esm/button';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type Button };
45
export const NimbleButton = wrap(Button);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { CardButton } from '@ni/nimble-components/dist/esm/card-button';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type CardButton };
45
export const NimbleCardButton = wrap(CardButton);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Card } from '@ni/nimble-components/dist/esm/card';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type Card };
45
export const NimbleCard = wrap(Card);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Checkbox } from '@ni/nimble-components/dist/esm/checkbox';
2+
import { wrap } from '../utilities/react-wrapper';
3+
4+
export { type Checkbox };
5+
export const NimbleCheckbox = wrap(Checkbox, {
6+
events: {
7+
onChange: 'change',
8+
}
9+
});
10+
export interface CheckboxChangeEvent extends CustomEvent {
11+
target: Checkbox;
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Combobox } from '@ni/nimble-components/dist/esm/combobox';
2+
import { wrap } from '../utilities/react-wrapper';
3+
4+
export { type Combobox };
5+
export const NimbleCombobox = wrap(Combobox, {
6+
events: {
7+
onChange: 'change',
8+
onInput: 'input'
9+
}
10+
});
11+
export interface ComboboxChangeEvent extends CustomEvent {
12+
target: Combobox;
13+
}
14+
export interface ComboboxInputEvent extends CustomEvent {
15+
target: Combobox;
16+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Dialog, UserDismissed } from '@ni/nimble-components/dist/esm/dialog';
2+
import { wrap } from '../utilities/react-wrapper';
3+
4+
export { type Dialog, UserDismissed };
5+
export const NimbleDialog = wrap(Dialog);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Drawer } from '@ni/nimble-components/dist/esm/drawer';
2+
import { wrap } from '../utilities/react-wrapper';
3+
4+
export { type Drawer };
5+
export const NimbleDrawer = wrap(Drawer);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LabelProviderCore } from '@ni/nimble-components/dist/esm/label-provider/core';
2+
import { wrap } from '../../utilities/react-wrapper';
3+
4+
export { type LabelProviderCore };
5+
export const NimbleLabelProviderCore = wrap(LabelProviderCore);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { LabelProviderRichText } from '@ni/nimble-components/dist/esm/label-provider/rich-text';
2-
import { wrap } from '../../../utilities/react-wrapper';
2+
import { wrap } from '../../utilities/react-wrapper';
33

4+
export { type LabelProviderRichText };
45
export const NimbleLabelProviderRichText = wrap(LabelProviderRichText);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { LabelProviderTable } from '@ni/nimble-components/dist/esm/label-provider/table';
2-
import { wrap } from '../../../utilities/react-wrapper';
2+
import { wrap } from '../../utilities/react-wrapper';
33

4+
export { type LabelProviderTable };
45
export const NimbleLabelProviderTable = wrap(LabelProviderTable);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ListOptionGroup } from '@ni/nimble-components/dist/esm/list-option-group';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type ListOptionGroup };
45
export const NimbleListOptionGroup = wrap(ListOptionGroup);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ListOption } from '@ni/nimble-components/dist/esm/list-option';
2-
import { wrap } from '../../utilities/react-wrapper';
2+
import { wrap } from '../utilities/react-wrapper';
33

4+
export { type ListOption };
45
export const NimbleListOption = wrap(ListOption);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { MappingEmpty } from '@ni/nimble-components/dist/esm/mapping/empty';
2-
import { wrap } from '../../../utilities/react-wrapper';
2+
import { wrap } from '../../utilities/react-wrapper';
33

4+
export { type MappingEmpty };
45
export const NimbleMappingEmpty = wrap(MappingEmpty);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { MappingIcon } from '@ni/nimble-components/dist/esm/mapping/icon';
2-
import { wrap } from '../../../utilities/react-wrapper';
2+
import { wrap } from '../../utilities/react-wrapper';
33

4+
export { type MappingIcon };
45
export const NimbleMappingIcon = wrap(MappingIcon);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { MappingSpinner } from '@ni/nimble-components/dist/esm/mapping/spinner';
2-
import { wrap } from '../../../utilities/react-wrapper';
2+
import { wrap } from '../../utilities/react-wrapper';
33

4+
export { type MappingSpinner };
45
export const NimbleMappingSpinner = wrap(MappingSpinner);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { MappingText } from '@ni/nimble-components/dist/esm/mapping/text';
2-
import { wrap } from '../../../utilities/react-wrapper';
2+
import { wrap } from '../../utilities/react-wrapper';
33

4+
export { type MappingText };
45
export const NimbleMappingText = wrap(MappingText);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { MappingUser } from '@ni/nimble-components/dist/esm/mapping/user';
2+
import { wrap } from '../../utilities/react-wrapper';
3+
4+
export { type MappingUser };
5+
export const NimbleMappingUser = wrap(MappingUser);

0 commit comments

Comments
 (0)