@nucleux/native-select 0.0.0-stage → 0.7.0
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/LICENSE +21 -0
- package/README.md +25 -2
- package/dist/index.cjs +61 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nucleux
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nucleux/native-select
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Accessible native-backed select with a chevron — Nucleux agentic UI for React.
|
|
4
|
+
|
|
5
|
+
Part of **[Nucleux](https://github.com/intelligaia-open-labs/nucleux)** — agentic UI components for React. Install a single component, or the full kit via [`@nucleux/react`](https://www.npmjs.com/package/@nucleux/react).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @nucleux/native-select @nucleux/tokens
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`react` / `react-dom` are peer dependencies.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { NativeSelect } from "@nucleux/native-select";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Requires the theme once in your app: `import "@nucleux/tokens/styles.css";`
|
|
22
|
+
and the Tailwind preset from `@nucleux/tokens/preset`.
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
MIT © Nucleux
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var lucideReact = require('lucide-react');
|
|
6
|
+
var utils = require('@nucleux/utils');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
+
|
|
29
|
+
// src/index.tsx
|
|
30
|
+
var NativeSelect = React__namespace.forwardRef(
|
|
31
|
+
({ className, containerClassName, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn("relative inline-flex w-full", containerClassName), children: [
|
|
32
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
+
"select",
|
|
34
|
+
{
|
|
35
|
+
ref,
|
|
36
|
+
className: utils.cn(
|
|
37
|
+
"h-9 w-full appearance-none rounded-lg border border-input bg-background pl-3 pr-8 text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props,
|
|
41
|
+
children
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "pointer-events-none absolute right-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" })
|
|
45
|
+
] })
|
|
46
|
+
);
|
|
47
|
+
NativeSelect.displayName = "NativeSelect";
|
|
48
|
+
var NativeSelectOption = React__namespace.forwardRef(
|
|
49
|
+
(props, ref) => /* @__PURE__ */ jsxRuntime.jsx("option", { ref, ...props })
|
|
50
|
+
);
|
|
51
|
+
NativeSelectOption.displayName = "NativeSelectOption";
|
|
52
|
+
var NativeSelectOptGroup = React__namespace.forwardRef(
|
|
53
|
+
(props, ref) => /* @__PURE__ */ jsxRuntime.jsx("optgroup", { ref, ...props })
|
|
54
|
+
);
|
|
55
|
+
NativeSelectOptGroup.displayName = "NativeSelectOptGroup";
|
|
56
|
+
|
|
57
|
+
exports.NativeSelect = NativeSelect;
|
|
58
|
+
exports.NativeSelectOptGroup = NativeSelectOptGroup;
|
|
59
|
+
exports.NativeSelectOption = NativeSelectOption;
|
|
60
|
+
//# sourceMappingURL=index.cjs.map
|
|
61
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":["React","cn","jsx","ChevronDown"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,IAAM,YAAA,GAAqBA,gBAAA,CAAA,UAAA;AAAA,EAChC,CAAC,EAAE,SAAA,EAAW,kBAAA,EAAoB,UAAU,GAAG,KAAA,EAAM,EAAG,GAAA,qCACrD,KAAA,EAAA,EAAI,SAAA,EAAWC,QAAA,CAAG,6BAAA,EAA+B,kBAAkB,CAAA,EAClE,QAAA,EAAA;AAAA,oBAAAC,cAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAWD,QAAA;AAAA,UACT,+PAAA;AAAA,UACA;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,oBACAC,cAAA,CAACC,uBAAA,EAAA,EAAY,SAAA,EAAU,4FAAA,EAA6F;AAAA,GAAA,EACtH;AAEJ;AACA,YAAA,CAAa,WAAA,GAAc,cAAA;AAGpB,IAAM,kBAAA,GAA2BH,gBAAA,CAAA,UAAA;AAAA,EACtC,CAAC,KAAA,EAAO,GAAA,oCAAS,QAAA,EAAA,EAAO,GAAA,EAAW,GAAG,KAAA,EAAO;AAC/C;AACA,kBAAA,CAAmB,WAAA,GAAc,oBAAA;AAG1B,IAAM,oBAAA,GAA6BA,gBAAA,CAAA,UAAA;AAAA,EACxC,CAAC,KAAA,EAAO,GAAA,oCAAS,UAAA,EAAA,EAAS,GAAA,EAAW,GAAG,KAAA,EAAO;AACjD;AACA,oBAAA,CAAqB,WAAA,GAAc,sBAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"@nucleux/utils\";\n\nexport interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {\n /** Wrapper className (the chevron is positioned within it). */\n containerClassName?: string;\n}\n\n/**\n * An accessible select built on the native `<select>` element (full keyboard +\n * screen-reader support), styled to match the design system with a chevron.\n * Pass `<option>`s as children.\n */\nexport const NativeSelect = React.forwardRef<HTMLSelectElement, NativeSelectProps>(\n ({ className, containerClassName, children, ...props }, ref) => (\n <div className={cn(\"relative inline-flex w-full\", containerClassName)}>\n <select\n ref={ref}\n className={cn(\n \"h-9 w-full appearance-none rounded-lg border border-input bg-background pl-3 pr-8 text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n </select>\n <ChevronDown className=\"pointer-events-none absolute right-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground\" />\n </div>\n ),\n);\nNativeSelect.displayName = \"NativeSelect\";\n\n/** An `<option>` for NativeSelect. */\nexport const NativeSelectOption = React.forwardRef<HTMLOptionElement, React.OptionHTMLAttributes<HTMLOptionElement>>(\n (props, ref) => <option ref={ref} {...props} />,\n);\nNativeSelectOption.displayName = \"NativeSelectOption\";\n\n/** An `<optgroup>` for NativeSelect. */\nexport const NativeSelectOptGroup = React.forwardRef<HTMLOptGroupElement, React.OptgroupHTMLAttributes<HTMLOptGroupElement>>(\n (props, ref) => <optgroup ref={ref} {...props} />,\n);\nNativeSelectOptGroup.displayName = \"NativeSelectOptGroup\";\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
4
|
+
/** Wrapper className (the chevron is positioned within it). */
|
|
5
|
+
containerClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* An accessible select built on the native `<select>` element (full keyboard +
|
|
9
|
+
* screen-reader support), styled to match the design system with a chevron.
|
|
10
|
+
* Pass `<option>`s as children.
|
|
11
|
+
*/
|
|
12
|
+
declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
13
|
+
/** An `<option>` for NativeSelect. */
|
|
14
|
+
declare const NativeSelectOption: React.ForwardRefExoticComponent<React.OptionHTMLAttributes<HTMLOptionElement> & React.RefAttributes<HTMLOptionElement>>;
|
|
15
|
+
/** An `<optgroup>` for NativeSelect. */
|
|
16
|
+
declare const NativeSelectOptGroup: React.ForwardRefExoticComponent<React.OptgroupHTMLAttributes<HTMLOptGroupElement> & React.RefAttributes<HTMLOptGroupElement>>;
|
|
17
|
+
|
|
18
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption, type NativeSelectProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
4
|
+
/** Wrapper className (the chevron is positioned within it). */
|
|
5
|
+
containerClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* An accessible select built on the native `<select>` element (full keyboard +
|
|
9
|
+
* screen-reader support), styled to match the design system with a chevron.
|
|
10
|
+
* Pass `<option>`s as children.
|
|
11
|
+
*/
|
|
12
|
+
declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
13
|
+
/** An `<option>` for NativeSelect. */
|
|
14
|
+
declare const NativeSelectOption: React.ForwardRefExoticComponent<React.OptionHTMLAttributes<HTMLOptionElement> & React.RefAttributes<HTMLOptionElement>>;
|
|
15
|
+
/** An `<optgroup>` for NativeSelect. */
|
|
16
|
+
declare const NativeSelectOptGroup: React.ForwardRefExoticComponent<React.OptgroupHTMLAttributes<HTMLOptGroupElement> & React.RefAttributes<HTMLOptGroupElement>>;
|
|
17
|
+
|
|
18
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption, type NativeSelectProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ChevronDown } from 'lucide-react';
|
|
4
|
+
import { cn } from '@nucleux/utils';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
// src/index.tsx
|
|
8
|
+
var NativeSelect = React.forwardRef(
|
|
9
|
+
({ className, containerClassName, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: cn("relative inline-flex w-full", containerClassName), children: [
|
|
10
|
+
/* @__PURE__ */ jsx(
|
|
11
|
+
"select",
|
|
12
|
+
{
|
|
13
|
+
ref,
|
|
14
|
+
className: cn(
|
|
15
|
+
"h-9 w-full appearance-none rounded-lg border border-input bg-background pl-3 pr-8 text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
16
|
+
className
|
|
17
|
+
),
|
|
18
|
+
...props,
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "pointer-events-none absolute right-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" })
|
|
23
|
+
] })
|
|
24
|
+
);
|
|
25
|
+
NativeSelect.displayName = "NativeSelect";
|
|
26
|
+
var NativeSelectOption = React.forwardRef(
|
|
27
|
+
(props, ref) => /* @__PURE__ */ jsx("option", { ref, ...props })
|
|
28
|
+
);
|
|
29
|
+
NativeSelectOption.displayName = "NativeSelectOption";
|
|
30
|
+
var NativeSelectOptGroup = React.forwardRef(
|
|
31
|
+
(props, ref) => /* @__PURE__ */ jsx("optgroup", { ref, ...props })
|
|
32
|
+
);
|
|
33
|
+
NativeSelectOptGroup.displayName = "NativeSelectOptGroup";
|
|
34
|
+
|
|
35
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;AAcO,IAAM,YAAA,GAAqB,KAAA,CAAA,UAAA;AAAA,EAChC,CAAC,EAAE,SAAA,EAAW,kBAAA,EAAoB,UAAU,GAAG,KAAA,EAAM,EAAG,GAAA,0BACrD,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,6BAAA,EAA+B,kBAAkB,CAAA,EAClE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,EAAA;AAAA,UACT,+PAAA;AAAA,UACA;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,oBACA,GAAA,CAAC,WAAA,EAAA,EAAY,SAAA,EAAU,4FAAA,EAA6F;AAAA,GAAA,EACtH;AAEJ;AACA,YAAA,CAAa,WAAA,GAAc,cAAA;AAGpB,IAAM,kBAAA,GAA2B,KAAA,CAAA,UAAA;AAAA,EACtC,CAAC,KAAA,EAAO,GAAA,yBAAS,QAAA,EAAA,EAAO,GAAA,EAAW,GAAG,KAAA,EAAO;AAC/C;AACA,kBAAA,CAAmB,WAAA,GAAc,oBAAA;AAG1B,IAAM,oBAAA,GAA6B,KAAA,CAAA,UAAA;AAAA,EACxC,CAAC,KAAA,EAAO,GAAA,yBAAS,UAAA,EAAA,EAAS,GAAA,EAAW,GAAG,KAAA,EAAO;AACjD;AACA,oBAAA,CAAqB,WAAA,GAAc,sBAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"@nucleux/utils\";\n\nexport interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {\n /** Wrapper className (the chevron is positioned within it). */\n containerClassName?: string;\n}\n\n/**\n * An accessible select built on the native `<select>` element (full keyboard +\n * screen-reader support), styled to match the design system with a chevron.\n * Pass `<option>`s as children.\n */\nexport const NativeSelect = React.forwardRef<HTMLSelectElement, NativeSelectProps>(\n ({ className, containerClassName, children, ...props }, ref) => (\n <div className={cn(\"relative inline-flex w-full\", containerClassName)}>\n <select\n ref={ref}\n className={cn(\n \"h-9 w-full appearance-none rounded-lg border border-input bg-background pl-3 pr-8 text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n </select>\n <ChevronDown className=\"pointer-events-none absolute right-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground\" />\n </div>\n ),\n);\nNativeSelect.displayName = \"NativeSelect\";\n\n/** An `<option>` for NativeSelect. */\nexport const NativeSelectOption = React.forwardRef<HTMLOptionElement, React.OptionHTMLAttributes<HTMLOptionElement>>(\n (props, ref) => <option ref={ref} {...props} />,\n);\nNativeSelectOption.displayName = \"NativeSelectOption\";\n\n/** An `<optgroup>` for NativeSelect. */\nexport const NativeSelectOptGroup = React.forwardRef<HTMLOptGroupElement, React.OptgroupHTMLAttributes<HTMLOptGroupElement>>(\n (props, ref) => <optgroup ref={ref} {...props} />,\n);\nNativeSelectOptGroup.displayName = \"NativeSelectOptGroup\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nucleux/native-select",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": ">=18",
|
|
22
|
+
"react-dom": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@nucleux/utils": "0.7.0",
|
|
26
|
+
"lucide-react": "^0.469.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"tsup": "^8.3.5",
|
|
30
|
+
"typescript": "^5.7.2",
|
|
31
|
+
"@types/react": "^18.3.18",
|
|
32
|
+
"react": "^18.3.1"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/intelligaia-open-labs/nucleux.git",
|
|
41
|
+
"directory": "packages/native-select"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/intelligaia-open-labs/nucleux#readme",
|
|
44
|
+
"description": "Styled native <select> — Nucleux agentic UI for React.",
|
|
45
|
+
"keywords": [
|
|
46
|
+
"nucleux",
|
|
47
|
+
"react",
|
|
48
|
+
"ui",
|
|
49
|
+
"components",
|
|
50
|
+
"agentic",
|
|
51
|
+
"ai",
|
|
52
|
+
"tailwind",
|
|
53
|
+
"native-select"
|
|
54
|
+
],
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "tsup"
|
|
57
|
+
}
|
|
6
58
|
}
|