@mijn-ui/react-select 0.0.10 → 0.0.11
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/dist/index.d.ts +5 -3
- package/dist/index.js +78 -25
- package/dist/metafile-esm.json +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { UnstyledProps } from '@mijn-ui/react-core';
|
|
3
|
+
import { UnstyledProps, UnstyledComponentWithSlots } from '@mijn-ui/react-core';
|
|
4
4
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
5
|
+
import { SelectSlots } from '@mijn-ui/react-theme';
|
|
5
6
|
|
|
7
|
+
type SelectBaseProps = UnstyledComponentWithSlots<SelectSlots>;
|
|
6
8
|
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
9
|
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
8
|
-
type SelectProps = React.ComponentProps<typeof SelectPrimitive.Root> &
|
|
9
|
-
declare const Select: ({ unstyled, ...props }: SelectProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
type SelectProps = React.ComponentProps<typeof SelectPrimitive.Root> & SelectBaseProps;
|
|
11
|
+
declare const Select: ({ classNames, unstyled, ...props }: SelectProps) => react_jsx_runtime.JSX.Element;
|
|
10
12
|
type SelectTriggerProps = React.ComponentPropsWithRef<typeof SelectPrimitive.Trigger> & UnstyledProps;
|
|
11
13
|
declare const SelectTrigger: ({ unstyled, className, children, ...props }: SelectTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
12
14
|
type SelectScrollUpButtonProps = React.ComponentPropsWithRef<typeof SelectPrimitive.ScrollUpButton> & UnstyledProps;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
// src/select.tsx
|
|
4
|
-
import { createContext } from "@mijn-ui/react-utilities";
|
|
4
|
+
import { cn, createContext } from "@mijn-ui/react-utilities";
|
|
5
5
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
6
6
|
import {
|
|
7
7
|
CheckIcon,
|
|
@@ -18,13 +18,14 @@ var [SelectProvider, useSelectContext] = createContext({
|
|
|
18
18
|
});
|
|
19
19
|
var useSelectStyles = (unstyledOverride) => {
|
|
20
20
|
const context = useSelectContext();
|
|
21
|
-
|
|
21
|
+
const unstyledSlots = useTVUnstyled(context, unstyledOverride);
|
|
22
|
+
return { ...unstyledSlots, classNames: context.classNames };
|
|
22
23
|
};
|
|
23
24
|
var SelectGroup = SelectPrimitive.Group;
|
|
24
25
|
var SelectValue = SelectPrimitive.Value;
|
|
25
|
-
var Select = ({ unstyled = false, ...props }) => {
|
|
26
|
+
var Select = ({ classNames, unstyled = false, ...props }) => {
|
|
26
27
|
const styles = selectStyles();
|
|
27
|
-
return /* @__PURE__ */ jsx(SelectProvider, { value: { unstyled, styles }, children: /* @__PURE__ */ jsx(SelectPrimitive.Root, { ...props }) });
|
|
28
|
+
return /* @__PURE__ */ jsx(SelectProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(SelectPrimitive.Root, { ...props }) });
|
|
28
29
|
};
|
|
29
30
|
var SelectTrigger = ({
|
|
30
31
|
unstyled,
|
|
@@ -32,22 +33,33 @@ var SelectTrigger = ({
|
|
|
32
33
|
children,
|
|
33
34
|
...props
|
|
34
35
|
}) => {
|
|
35
|
-
const { trigger } = useSelectStyles(unstyled);
|
|
36
|
-
return /* @__PURE__ */ jsxs(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const { trigger, classNames } = useSelectStyles(unstyled);
|
|
37
|
+
return /* @__PURE__ */ jsxs(
|
|
38
|
+
SelectPrimitive.Trigger,
|
|
39
|
+
{
|
|
40
|
+
className: trigger({
|
|
41
|
+
className: cn(classNames?.trigger, className)
|
|
42
|
+
}),
|
|
43
|
+
...props,
|
|
44
|
+
children: [
|
|
45
|
+
children,
|
|
46
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
40
50
|
};
|
|
41
51
|
var SelectScrollUpButton = ({
|
|
42
52
|
unstyled,
|
|
43
53
|
className,
|
|
44
54
|
...props
|
|
45
55
|
}) => {
|
|
46
|
-
const { scrollUpBtn } = useSelectStyles(unstyled);
|
|
56
|
+
const { scrollUpBtn, classNames } = useSelectStyles(unstyled);
|
|
47
57
|
return /* @__PURE__ */ jsx(
|
|
48
58
|
SelectPrimitive.ScrollUpButton,
|
|
49
59
|
{
|
|
50
|
-
className: scrollUpBtn({
|
|
60
|
+
className: scrollUpBtn({
|
|
61
|
+
className: cn(classNames?.scrollUpBtn, className)
|
|
62
|
+
}),
|
|
51
63
|
...props,
|
|
52
64
|
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "" })
|
|
53
65
|
}
|
|
@@ -58,11 +70,13 @@ var SelectScrollDownButton = ({
|
|
|
58
70
|
className,
|
|
59
71
|
...props
|
|
60
72
|
}) => {
|
|
61
|
-
const { scrollDownBtn } = useSelectStyles(unstyled);
|
|
73
|
+
const { scrollDownBtn, classNames } = useSelectStyles(unstyled);
|
|
62
74
|
return /* @__PURE__ */ jsx(
|
|
63
75
|
SelectPrimitive.ScrollDownButton,
|
|
64
76
|
{
|
|
65
|
-
className: scrollDownBtn({
|
|
77
|
+
className: scrollDownBtn({
|
|
78
|
+
className: cn(classNames?.scrollDownBtn, className)
|
|
79
|
+
}),
|
|
66
80
|
...props,
|
|
67
81
|
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
68
82
|
}
|
|
@@ -75,24 +89,44 @@ var SelectContent = ({
|
|
|
75
89
|
position = "popper",
|
|
76
90
|
...props
|
|
77
91
|
}) => {
|
|
78
|
-
const { content, viewport } = useSelectStyles(unstyled);
|
|
92
|
+
const { content, viewport, classNames } = useSelectStyles(unstyled);
|
|
79
93
|
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
80
94
|
SelectPrimitive.Content,
|
|
81
95
|
{
|
|
82
|
-
className: content({
|
|
96
|
+
className: content({
|
|
97
|
+
className: cn(classNames?.content, className),
|
|
98
|
+
position
|
|
99
|
+
}),
|
|
83
100
|
position,
|
|
84
101
|
...props,
|
|
85
102
|
children: [
|
|
86
103
|
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
87
|
-
/* @__PURE__ */ jsx(
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
SelectPrimitive.Viewport,
|
|
106
|
+
{
|
|
107
|
+
className: viewport({
|
|
108
|
+
className: classNames?.viewport,
|
|
109
|
+
position
|
|
110
|
+
}),
|
|
111
|
+
children
|
|
112
|
+
}
|
|
113
|
+
),
|
|
88
114
|
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
89
115
|
]
|
|
90
116
|
}
|
|
91
117
|
) });
|
|
92
118
|
};
|
|
93
119
|
var SelectLabel = ({ unstyled, className, ...props }) => {
|
|
94
|
-
const { label } = useSelectStyles(unstyled);
|
|
95
|
-
return /* @__PURE__ */ jsx(
|
|
120
|
+
const { label, classNames } = useSelectStyles(unstyled);
|
|
121
|
+
return /* @__PURE__ */ jsx(
|
|
122
|
+
SelectPrimitive.Label,
|
|
123
|
+
{
|
|
124
|
+
className: label({
|
|
125
|
+
className: cn(classNames?.label, className)
|
|
126
|
+
}),
|
|
127
|
+
...props
|
|
128
|
+
}
|
|
129
|
+
);
|
|
96
130
|
};
|
|
97
131
|
var SelectItem = ({
|
|
98
132
|
unstyled,
|
|
@@ -100,22 +134,41 @@ var SelectItem = ({
|
|
|
100
134
|
children,
|
|
101
135
|
...props
|
|
102
136
|
}) => {
|
|
103
|
-
const { item, itemIndicator } = useSelectStyles(unstyled);
|
|
104
|
-
return /* @__PURE__ */ jsxs(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
137
|
+
const { item, itemIndicator, classNames } = useSelectStyles(unstyled);
|
|
138
|
+
return /* @__PURE__ */ jsxs(
|
|
139
|
+
SelectPrimitive.Item,
|
|
140
|
+
{
|
|
141
|
+
className: item({
|
|
142
|
+
className: cn(classNames?.item, className)
|
|
143
|
+
}),
|
|
144
|
+
...props,
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children }),
|
|
147
|
+
/* @__PURE__ */ jsx(
|
|
148
|
+
"span",
|
|
149
|
+
{
|
|
150
|
+
className: itemIndicator({
|
|
151
|
+
className: classNames?.itemIndicator
|
|
152
|
+
}),
|
|
153
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
108
159
|
};
|
|
109
160
|
var SelectSeparator = ({
|
|
110
161
|
unstyled,
|
|
111
162
|
className,
|
|
112
163
|
...props
|
|
113
164
|
}) => {
|
|
114
|
-
const { separator } = useSelectStyles(unstyled);
|
|
165
|
+
const { separator, classNames } = useSelectStyles(unstyled);
|
|
115
166
|
return /* @__PURE__ */ jsx(
|
|
116
167
|
SelectPrimitive.Separator,
|
|
117
168
|
{
|
|
118
|
-
className: separator({
|
|
169
|
+
className: separator({
|
|
170
|
+
className: cn(classNames?.separator, className)
|
|
171
|
+
}),
|
|
119
172
|
...props
|
|
120
173
|
}
|
|
121
174
|
);
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/select.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/select.tsx":{"bytes":8309,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@radix-ui/react-select","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":25,"imports":[{"path":"src/select.tsx","kind":"import-statement","original":"./select"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@radix-ui/react-select","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Select","SelectContent","SelectGroup","SelectItem","SelectLabel","SelectScrollDownButton","SelectScrollUpButton","SelectSeparator","SelectTrigger","SelectValue"],"entryPoint":"src/index.ts","inputs":{"src/select.tsx":{"bytesInOutput":4647},"src/index.ts":{"bytesInOutput":0}},"bytes":4848}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mijn-ui/react-select",
|
|
3
3
|
"author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.11",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@types/react": "^19.0.0",
|
|
27
27
|
"@types/react-dom": "^19.0.0",
|
|
28
28
|
"@mijn-ui/react-core": "0.0.3",
|
|
29
|
+
"@mijn-ui/react-theme": "0.0.8",
|
|
29
30
|
"eslint-config-custom": "0.0.1",
|
|
30
31
|
"tsconfig": "0.0.0",
|
|
31
32
|
"tsup-config": "0.0.0"
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"react": "^19.0",
|
|
41
42
|
"react-dom": "^19.0",
|
|
42
|
-
"@mijn-ui/react-theme": "^0.0.
|
|
43
|
+
"@mijn-ui/react-theme": "^0.0.8",
|
|
43
44
|
"@mijn-ui/react-core": "^0.0.3"
|
|
44
45
|
},
|
|
45
46
|
"publishConfig": {
|