@neoaxis/nectar-react 0.1.0 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +62 -60
  2. package/dist/nectar.js +10 -11
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1,73 +1,75 @@
1
- # React + TypeScript + Vite
1
+ # @neoaxis/nectar-react
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ React component library for the Nectar Design System.
4
4
 
5
- Currently, two official plugins are available:
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
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
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
- ## React Compiler
9
+ ```sh
10
+ npm install @neoaxis/nectar-react
11
+ ```
12
+
13
+ ## Setup
14
+
15
+ Import the stylesheet and wrap your application with `NectarProvider`:
11
16
 
12
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
17
+ ```tsx
18
+ import "@neoaxis/nectar-react/style.css"
19
+ import { NectarProvider } from "@neoaxis/nectar-react"
13
20
 
14
- ## Expanding the ESLint configuration
21
+ function App() {
22
+ return <NectarProvider>{/* your app */}</NectarProvider>
23
+ }
24
+ ```
25
+
26
+ ## Components
15
27
 
16
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
28
+ | Category | Components |
29
+ | -------------- | -------------------------------------------------------------------------- |
30
+ | **Actions** | `Button` |
31
+ | **Feedback** | `Progress` |
32
+ | **Form** | `Form`, `FormFieldText`, `FormFieldSelect`, `FormFieldSwitch`, `FormGroup` |
33
+ | **Layout** | `List`, `SidebarAccordion`, `Toolbar` |
34
+ | **Overlay** | `ContextMenu`, `Popover`, `Tooltip` |
35
+ | **Primitives** | `Heading`, `Text`, `Icon`, `Hotkey`, `SectionTitle` |
17
36
 
18
- ```js
19
- export default defineConfig([
20
- globalIgnores(['dist']),
21
- {
22
- files: ['**/*.{ts,tsx}'],
23
- extends: [
24
- // Other configs...
37
+ ## Usage example
25
38
 
26
- // Remove tseslint.configs.recommended and replace with this
27
- tseslint.configs.recommendedTypeChecked,
28
- // Alternatively, use this for stricter rules
29
- tseslint.configs.strictTypeChecked,
30
- // Optionally, add this for stylistic rules
31
- tseslint.configs.stylisticTypeChecked,
39
+ ```tsx
40
+ import { Button, Tooltip } from "@neoaxis/nectar-react"
32
41
 
33
- // Other configs...
34
- ],
35
- languageOptions: {
36
- parserOptions: {
37
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
- tsconfigRootDir: import.meta.dirname,
39
- },
40
- // other options...
41
- },
42
- },
43
- ])
42
+ function Example() {
43
+ return (
44
+ <Tooltip content="Save changes">
45
+ <Button>Save</Button>
46
+ </Tooltip>
47
+ )
48
+ }
44
49
  ```
45
50
 
46
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47
-
48
- ```js
49
- // eslint.config.js
50
- import reactX from 'eslint-plugin-react-x'
51
- import reactDom from 'eslint-plugin-react-dom'
52
-
53
- export default defineConfig([
54
- globalIgnores(['dist']),
55
- {
56
- files: ['**/*.{ts,tsx}'],
57
- extends: [
58
- // Other configs...
59
- // Enable lint rules for React
60
- reactX.configs['recommended-typescript'],
61
- // Enable lint rules for React DOM
62
- reactDom.configs.recommended,
63
- ],
64
- languageOptions: {
65
- parserOptions: {
66
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
- tsconfigRootDir: import.meta.dirname,
68
- },
69
- // other options...
70
- },
71
- },
72
- ])
51
+ ## Peer dependencies
52
+
53
+ | Package | Version |
54
+ | ----------- | ------- |
55
+ | `react` | 19.x |
56
+ | `react-dom` | 19.x |
57
+
58
+ ## Development
59
+
60
+ ```sh
61
+ # Component explorer (Ladle)
62
+ yarn dev
63
+
64
+ # Build library
65
+ yarn build
66
+
67
+ # Unit tests
68
+ yarn test
69
+
70
+ # Unit tests with coverage
71
+ yarn test:coverage
72
+
73
+ # End-to-end tests (Playwright)
74
+ yarn test:e2e
73
75
  ```
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
- /* @__NO_SIDE_EFFECTS__ */
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
- /* @__NO_SIDE_EFFECTS__ */
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
- /* @__NO_SIDE_EFFECTS__ */
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 = /* @__PURE__ */ new Set(["left", "top"]);
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 = /* @__PURE__ */ createCoords(0);
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
- /* @__NO_SIDE_EFFECTS__ */
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
- /* @__NO_SIDE_EFFECTS__ */
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
- /* @__NO_SIDE_EFFECTS__ */
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
- /* @__NO_SIDE_EFFECTS__ */
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": ariaOrientation,
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.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/nectar.js",
6
6
  "module": "./dist/nectar.js",
@@ -14,7 +14,7 @@
14
14
  "types": "./dist/tokens.d.ts",
15
15
  "import": "./dist/tokens.js"
16
16
  },
17
- "./style.css": "./dist/@neoaxis/nectar-react.css"
17
+ "./style.css": "./dist/nectar-react.css"
18
18
  },
19
19
  "files": [
20
20
  "dist"
@@ -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.4",
85
- "vite-plugin-dts": "4.5.4",
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
  }