@neoaxis/nectar-react 0.1.0 → 0.1.1
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.
- package/README.md +66 -60
- package/dist/nectar.js +10 -11
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,73 +1,79 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @neoaxis/nectar-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React component library for the Nectar Design System.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Built on [Radix UI](https://www.radix-ui.com/) primitives with full accessibility support and design tokens from [`@neoaxis/nectar-tokens`](../tokens).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
|
7
|
+
## Installation
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
```sh
|
|
10
|
+
npm install @neoaxis/nectar-react @neoaxis/nectar-tokens
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
Import the stylesheet and wrap your application with `NectarProvider`:
|
|
11
16
|
|
|
12
|
-
|
|
17
|
+
```tsx
|
|
18
|
+
import "@neoaxis/nectar-react/style.css";
|
|
19
|
+
import { NectarProvider } from "@neoaxis/nectar-react";
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
function App() {
|
|
22
|
+
return (
|
|
23
|
+
<NectarProvider>
|
|
24
|
+
{/* your app */}
|
|
25
|
+
</NectarProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Components
|
|
15
31
|
|
|
16
|
-
|
|
32
|
+
| Category | Components |
|
|
33
|
+
|---|---|
|
|
34
|
+
| **Actions** | `Button` |
|
|
35
|
+
| **Feedback** | `Progress` |
|
|
36
|
+
| **Form** | `Form`, `FormFieldText`, `FormFieldSelect`, `FormFieldSwitch`, `FormGroup` |
|
|
37
|
+
| **Layout** | `List`, `SidebarAccordion`, `Toolbar` |
|
|
38
|
+
| **Overlay** | `ContextMenu`, `Popover`, `Tooltip` |
|
|
39
|
+
| **Primitives** | `Heading`, `Text`, `Icon`, `Hotkey`, `SectionTitle` |
|
|
17
40
|
|
|
18
|
-
|
|
19
|
-
export default defineConfig([
|
|
20
|
-
globalIgnores(['dist']),
|
|
21
|
-
{
|
|
22
|
-
files: ['**/*.{ts,tsx}'],
|
|
23
|
-
extends: [
|
|
24
|
-
// Other configs...
|
|
41
|
+
## Usage example
|
|
25
42
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// Alternatively, use this for stricter rules
|
|
29
|
-
tseslint.configs.strictTypeChecked,
|
|
30
|
-
// Optionally, add this for stylistic rules
|
|
31
|
-
tseslint.configs.stylisticTypeChecked,
|
|
43
|
+
```tsx
|
|
44
|
+
import { Button, Tooltip } from "@neoaxis/nectar-react";
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// other options...
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
])
|
|
46
|
+
function Example() {
|
|
47
|
+
return (
|
|
48
|
+
<Tooltip content="Save changes">
|
|
49
|
+
<Button>Save</Button>
|
|
50
|
+
</Tooltip>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
44
53
|
```
|
|
45
54
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
])
|
|
55
|
+
## Peer dependencies
|
|
56
|
+
|
|
57
|
+
| Package | Version |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `react` | 19.x |
|
|
60
|
+
| `react-dom` | 19.x |
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
# Component explorer (Ladle)
|
|
66
|
+
yarn dev
|
|
67
|
+
|
|
68
|
+
# Build library
|
|
69
|
+
yarn build
|
|
70
|
+
|
|
71
|
+
# Unit tests
|
|
72
|
+
yarn test
|
|
73
|
+
|
|
74
|
+
# Unit tests with coverage
|
|
75
|
+
yarn test:coverage
|
|
76
|
+
|
|
77
|
+
# End-to-end tests (Playwright)
|
|
78
|
+
yarn test:e2e
|
|
73
79
|
```
|
package/dist/nectar.js
CHANGED
|
@@ -102,7 +102,7 @@ function composeContextScopes$1(...scopes) {
|
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
104
|
//#region ../../node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
105
|
-
|
|
105
|
+
// @__NO_SIDE_EFFECTS__
|
|
106
106
|
function createSlot$2(ownerName) {
|
|
107
107
|
const SlotClone = /* @__PURE__ */ createSlotClone$2(ownerName);
|
|
108
108
|
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
@@ -132,7 +132,7 @@ function createSlot$2(ownerName) {
|
|
|
132
132
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
133
133
|
return Slot2;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
// @__NO_SIDE_EFFECTS__
|
|
136
136
|
function createSlotClone$2(ownerName) {
|
|
137
137
|
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
138
138
|
const { children, ...slotProps } = props;
|
|
@@ -148,7 +148,7 @@ function createSlotClone$2(ownerName) {
|
|
|
148
148
|
return SlotClone;
|
|
149
149
|
}
|
|
150
150
|
var SLOTTABLE_IDENTIFIER$2 = Symbol("radix.slottable");
|
|
151
|
-
|
|
151
|
+
// @__NO_SIDE_EFFECTS__
|
|
152
152
|
function createSlottable(ownerName) {
|
|
153
153
|
const Slottable2 = ({ children }) => {
|
|
154
154
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
@@ -914,7 +914,7 @@ var hide$2 = function(options) {
|
|
|
914
914
|
}
|
|
915
915
|
};
|
|
916
916
|
};
|
|
917
|
-
var originSides =
|
|
917
|
+
var originSides = /*#__PURE__*/ new Set(["left", "top"]);
|
|
918
918
|
async function convertValueToCoords(state, options) {
|
|
919
919
|
const { placement, platform, elements } = state;
|
|
920
920
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
@@ -1288,7 +1288,7 @@ function getScale(element) {
|
|
|
1288
1288
|
y
|
|
1289
1289
|
};
|
|
1290
1290
|
}
|
|
1291
|
-
var noOffsets =
|
|
1291
|
+
var noOffsets = /*#__PURE__*/ createCoords(0);
|
|
1292
1292
|
function getVisualOffsets(element) {
|
|
1293
1293
|
const win = getWindow(element);
|
|
1294
1294
|
if (!isWebKit() || !win.visualViewport) return noOffsets;
|
|
@@ -3082,7 +3082,7 @@ function isPromiseLike$1(value) {
|
|
|
3082
3082
|
function isLazyComponent$1(element) {
|
|
3083
3083
|
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE$1 && "_payload" in element && isPromiseLike$1(element._payload);
|
|
3084
3084
|
}
|
|
3085
|
-
|
|
3085
|
+
// @__NO_SIDE_EFFECTS__
|
|
3086
3086
|
function createSlot$1(ownerName) {
|
|
3087
3087
|
const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
|
|
3088
3088
|
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
@@ -3114,7 +3114,7 @@ function createSlot$1(ownerName) {
|
|
|
3114
3114
|
return Slot2;
|
|
3115
3115
|
}
|
|
3116
3116
|
var Slot$2 = /* @__PURE__ */ createSlot$1("Slot");
|
|
3117
|
-
|
|
3117
|
+
// @__NO_SIDE_EFFECTS__
|
|
3118
3118
|
function createSlotClone$1(ownerName) {
|
|
3119
3119
|
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
3120
3120
|
let { children, ...slotProps } = props;
|
|
@@ -7194,7 +7194,7 @@ function isPromiseLike(value) {
|
|
|
7194
7194
|
function isLazyComponent(element) {
|
|
7195
7195
|
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
7196
7196
|
}
|
|
7197
|
-
|
|
7197
|
+
// @__NO_SIDE_EFFECTS__
|
|
7198
7198
|
function createSlot(ownerName) {
|
|
7199
7199
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
7200
7200
|
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
@@ -7225,7 +7225,7 @@ function createSlot(ownerName) {
|
|
|
7225
7225
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
7226
7226
|
return Slot2;
|
|
7227
7227
|
}
|
|
7228
|
-
|
|
7228
|
+
// @__NO_SIDE_EFFECTS__
|
|
7229
7229
|
function createSlotClone(ownerName) {
|
|
7230
7230
|
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
7231
7231
|
let { children, ...slotProps } = props;
|
|
@@ -7674,9 +7674,8 @@ var ORIENTATIONS = ["horizontal", "vertical"];
|
|
|
7674
7674
|
var Separator$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
7675
7675
|
const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
|
|
7676
7676
|
const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
|
|
7677
|
-
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
7678
7677
|
const semanticProps = decorative ? { role: "none" } : {
|
|
7679
|
-
"aria-orientation":
|
|
7678
|
+
"aria-orientation": orientation === "vertical" ? orientation : void 0,
|
|
7680
7679
|
role: "separator"
|
|
7681
7680
|
};
|
|
7682
7681
|
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neoaxis/nectar-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/nectar.js",
|
|
6
6
|
"module": "./dist/nectar.js",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"react-dom": "19.2.4",
|
|
82
82
|
"typescript": "6.0.2",
|
|
83
83
|
"typescript-eslint": "8.58.0",
|
|
84
|
-
"vite": "8.0.
|
|
85
|
-
"vite-plugin-dts": "
|
|
84
|
+
"vite": "8.0.16",
|
|
85
|
+
"vite-plugin-dts": "5.0.2",
|
|
86
86
|
"vitest": "4.1.8",
|
|
87
87
|
"vitest-axe": "1.0.0-pre.5"
|
|
88
88
|
}
|