@mijn-ui/react-select 0.4.2 → 0.4.3

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.js CHANGED
@@ -18,16 +18,15 @@ var selectStyles = tv({
18
18
  slots: {
19
19
  base: "",
20
20
  trigger: [
21
- "border-outline-default min-w-44 bg-bg-default-alt placeholder:text-fg-tertiary hover:bg-bg-secondary flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm [&>span]:line-clamp-1 gap-4",
22
- "[&_svg]:size-4 [&_svg]:opacity-50",
21
+ "border-outline-default bg-bg-default-alt placeholder:text-fg-tertiary hover:bg-bg-secondary flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm [&>span]:line-clamp-1 gap-4",
22
+ // Only the chevron is dimmed. An icon in the selected value (a status
23
+ // dot, a flag) keeps its colour, and any explicit `size-*` it carries;
24
+ // unsized icons still default to 16px.
25
+ "[&_svg:not([class*='size-'])]:size-4 [&_[data-slot=select-trigger-icon]]:opacity-50",
23
26
  "disabled:pointer-events-none",
24
27
  "disabled:opacity-50",
25
- "focus-visible:outline-none",
26
- "focus-visible:ring-2",
27
- "focus-visible:ring-outline-brand",
28
- "focus-visible:ring-outline-brand",
29
- "focus-visible:ring-offset-2",
30
- "focus-visible:ring-offset-bg-default"
28
+ "focus-visible:mijn-focus-ring",
29
+ "focus-visible:ring-outline-brand"
31
30
  ],
32
31
  scrollUpBtn: "",
33
32
  scrollDownBtn: "",
@@ -35,7 +34,7 @@ var selectStyles = tv({
35
34
  "data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=open]:fade-in-0",
36
35
  "data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
37
36
  "data-[side=bottom]:slide-in-from-bottom-6 data-[side=left]:slide-in-from-left-6 data-[side=right]:slide-in-from-right-6 data-[side=top]:slide-in-from-top-6 duration-300",
38
- "border-outline-default bg-bg-default-alt text-fg-default relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-sm w-60"
37
+ "border-outline-default bg-bg-default-alt text-fg-default relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-(--mijn-shadow-sm)"
39
38
  ],
40
39
  viewport: "",
41
40
  label: "py-1.5 pl-2 pr-8 text-sm font-semibold",
@@ -56,8 +55,12 @@ var selectStyles = tv({
56
55
  variants: {
57
56
  position: {
58
57
  popper: {
59
- content: "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
60
- viewport: "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
58
+ // At least as wide as the trigger, wider for a long option, never
59
+ // past the viewport edge. (Radix sets both variables in popper mode.)
60
+ content: "min-w-(--radix-select-trigger-width) max-w-(--radix-select-content-available-width) data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
61
+ // No min-width here: the content already has the trigger's, and a
62
+ // second one inside its 1px border made the list 2px wider.
63
+ viewport: "h-[var(--radix-select-trigger-height)] w-full"
61
64
  },
62
65
  "item-aligned": {}
63
66
  }
@@ -166,10 +169,7 @@ var SelectContent = ({
166
169
  SelectPrimitive.Content,
167
170
  {
168
171
  "data-slot": "select-content",
169
- className: content({
170
- className: cn(classNames?.content, className),
171
- position
172
- }),
172
+ className: cn(content({ position }), classNames?.content, className),
173
173
  position,
174
174
  ...props,
175
175
  children: [
@@ -178,10 +178,7 @@ var SelectContent = ({
178
178
  SelectPrimitive.Viewport,
179
179
  {
180
180
  "data-slot": "select-viewport",
181
- className: viewport({
182
- className: classNames?.viewport,
183
- position
184
- }),
181
+ className: cn(viewport({ position }), classNames?.viewport),
185
182
  children
186
183
  }
187
184
  ),
@@ -1 +1 @@
1
- {"inputs":{"src/select.tsx":{"bytes":11840,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-select","kind":"import-statement","external":true},{"path":"tailwind-variants","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-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-select","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Select","SelectContent","SelectGroup","SelectItem","SelectLabel","SelectScrollDownButton","SelectScrollUpButton","SelectSeparator","SelectTrigger","SelectTriggerIcon","SelectValue","selectStyles","useSelectStyles"],"entryPoint":"src/index.ts","inputs":{"src/select.tsx":{"bytesInOutput":7539},"src/index.ts":{"bytesInOutput":0}},"bytes":7811}}}
1
+ {"inputs":{"src/select.tsx":{"bytes":12570,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-select","kind":"import-statement","external":true},{"path":"tailwind-variants","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-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-select","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Select","SelectContent","SelectGroup","SelectItem","SelectLabel","SelectScrollDownButton","SelectScrollUpButton","SelectSeparator","SelectTrigger","SelectTriggerIcon","SelectValue","selectStyles","useSelectStyles"],"entryPoint":"src/index.ts","inputs":{"src/select.tsx":{"bytesInOutput":7900},"src/index.ts":{"bytesInOutput":0}},"bytes":8172}}}
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.4.2",
4
+ "version": "0.4.3",
5
5
  "homepage": "https://mijn-ui.vercel.app",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -25,19 +25,22 @@
25
25
  "@next/eslint-plugin-next": "^15.0.3",
26
26
  "@types/react": "^19.0.0",
27
27
  "@types/react-dom": "^19.0.0",
28
- "@mijn-ui/react-core": "0.5.0",
28
+ "@testing-library/react": "^16.1.0",
29
+ "jsdom": "^30.1.3",
30
+ "@mijn-ui/react-core": "0.6.0",
29
31
  "eslint-config-custom": "0.0.1",
30
32
  "tsconfig": "0.0.0",
31
- "tsup-config": "0.0.0"
33
+ "tsup-config": "0.0.0",
34
+ "test-utils": "0.0.0"
32
35
  },
33
36
  "dependencies": {
34
- "@radix-ui/react-select": "^2.1.3",
35
- "@mijn-ui/shared-icons": "0.1.0"
37
+ "@radix-ui/react-select": "^2.4.1",
38
+ "@mijn-ui/shared-icons": "0.2.0"
36
39
  },
37
40
  "peerDependencies": {
38
41
  "react": "^19.0",
39
42
  "react-dom": "^19.0",
40
- "@mijn-ui/react-core": "^0.5.0",
43
+ "@mijn-ui/react-core": "^0.6.0",
41
44
  "tailwind-merge": "^3.0.0",
42
45
  "tailwind-variants": "^3.0.0"
43
46
  },
@@ -52,6 +55,7 @@
52
55
  "scripts": {
53
56
  "clean": "rimraf dist .turbo",
54
57
  "build": "tsup",
58
+ "test": "vitest run",
55
59
  "lint": "eslint .",
56
60
  "lint:fix": "eslint . --fix",
57
61
  "types:check": "tsc --noEmit"