@entropix/react 0.3.0 → 1.0.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/dist/accordion.cjs +27 -0
- package/dist/accordion.css +57 -0
- package/dist/accordion.d.cts +30 -0
- package/dist/accordion.d.ts +30 -0
- package/dist/accordion.js +6 -0
- package/dist/button.cjs +15 -0
- package/dist/button.css +113 -0
- package/dist/button.d.cts +25 -0
- package/dist/button.d.ts +25 -0
- package/dist/button.js +6 -0
- package/dist/checkbox.cjs +15 -0
- package/dist/checkbox.css +89 -0
- package/dist/checkbox.d.cts +26 -0
- package/dist/checkbox.d.ts +26 -0
- package/dist/checkbox.js +6 -0
- package/dist/chunk-2MKJZEUK.cjs +4 -0
- package/dist/chunk-34IVVIO3.cjs +119 -0
- package/dist/chunk-36ZHHJYV.js +79 -0
- package/dist/chunk-5DKE5YQD.cjs +10 -0
- package/dist/chunk-664P2RGR.js +108 -0
- package/dist/chunk-6NKHMBF3.cjs +97 -0
- package/dist/chunk-6UAQCHIW.js +8 -0
- package/dist/chunk-7AUIZOEH.cjs +84 -0
- package/dist/chunk-AVCBDUKH.js +3 -0
- package/dist/chunk-B5JZHE4I.cjs +90 -0
- package/dist/chunk-BN57JPKV.js +26 -0
- package/dist/chunk-BY4E26CV.js +114 -0
- package/dist/chunk-CL6JXZIY.js +88 -0
- package/dist/chunk-CTT3LXMZ.js +76 -0
- package/dist/chunk-EASSPJBG.cjs +110 -0
- package/dist/chunk-EWY7MSXF.cjs +94 -0
- package/dist/chunk-FJGLK3I4.js +89 -0
- package/dist/chunk-GTVBKK3W.js +88 -0
- package/dist/chunk-GZXXUFCJ.cjs +15 -0
- package/dist/chunk-IXH7OVN3.cjs +86 -0
- package/dist/chunk-KGIUECLG.cjs +91 -0
- package/dist/chunk-LDOP6DVX.cjs +28 -0
- package/dist/chunk-LJK6KK2H.cjs +43 -0
- package/dist/chunk-OT2HJUCB.js +84 -0
- package/dist/chunk-PILZGMQG.js +87 -0
- package/dist/chunk-PN42JF6U.js +92 -0
- package/dist/chunk-RPIYYBFJ.cjs +90 -0
- package/dist/chunk-S6DVQAH4.cjs +240 -0
- package/dist/chunk-U5CZHO6D.js +13 -0
- package/dist/chunk-UGCCJI2F.js +111 -0
- package/dist/chunk-W6N4D4N4.js +230 -0
- package/dist/chunk-Y2M2LJGJ.js +41 -0
- package/dist/chunk-YJG5KX6O.cjs +81 -0
- package/dist/chunk-ZG4PZBSL.cjs +113 -0
- package/dist/dialog.cjs +39 -0
- package/dist/dialog.css +89 -0
- package/dist/dialog.d.cts +62 -0
- package/dist/dialog.d.ts +62 -0
- package/dist/dialog.js +6 -0
- package/dist/index.cjs +170 -1223
- package/dist/index.css +994 -1015
- package/dist/index.d.cts +17 -477
- package/dist/index.d.ts +17 -477
- package/dist/index.js +19 -1189
- package/dist/input.cjs +15 -0
- package/dist/input.css +135 -0
- package/dist/input.d.cts +37 -0
- package/dist/input.d.ts +37 -0
- package/dist/input.js +6 -0
- package/dist/layout.cjs +25 -0
- package/dist/layout.css +176 -0
- package/dist/layout.d.cts +108 -0
- package/dist/layout.d.ts +108 -0
- package/dist/layout.js +4 -0
- package/dist/menu.cjs +27 -0
- package/dist/menu.css +51 -0
- package/dist/menu.d.cts +31 -0
- package/dist/menu.d.ts +31 -0
- package/dist/menu.js +6 -0
- package/dist/radio.cjs +19 -0
- package/dist/radio.css +93 -0
- package/dist/radio.d.cts +37 -0
- package/dist/radio.d.ts +37 -0
- package/dist/radio.js +6 -0
- package/dist/select.cjs +27 -0
- package/dist/select.css +114 -0
- package/dist/select.d.cts +59 -0
- package/dist/select.d.ts +59 -0
- package/dist/select.js +6 -0
- package/dist/styles/accordion.css +1 -69
- package/dist/styles/button.css +1 -135
- package/dist/styles/checkbox.css +1 -121
- package/dist/styles/dialog.css +1 -104
- package/dist/styles/index.css +1 -16
- package/dist/styles/input.css +1 -178
- package/dist/styles/layout.css +1 -127
- package/dist/styles/menu.css +1 -64
- package/dist/styles/radio.css +1 -130
- package/dist/styles/select.css +1 -150
- package/dist/styles/switch.css +1 -52
- package/dist/styles/tabs.css +1 -86
- package/dist/styles/toggle.css +1 -47
- package/dist/switch.cjs +16 -0
- package/dist/switch.css +89 -0
- package/dist/switch.d.cts +14 -0
- package/dist/switch.d.ts +14 -0
- package/dist/switch.js +7 -0
- package/dist/tabs.cjs +27 -0
- package/dist/tabs.css +69 -0
- package/dist/tabs.d.cts +31 -0
- package/dist/tabs.d.ts +31 -0
- package/dist/tabs.js +6 -0
- package/dist/textarea.cjs +15 -0
- package/dist/textarea.css +135 -0
- package/dist/textarea.d.cts +41 -0
- package/dist/textarea.d.ts +41 -0
- package/dist/textarea.js +6 -0
- package/dist/toggle.cjs +19 -0
- package/dist/toggle.css +41 -0
- package/dist/toggle.d.cts +34 -0
- package/dist/toggle.d.ts +34 -0
- package/dist/toggle.js +6 -0
- package/package.json +135 -4
- package/dist/index.cjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/menu.css
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* src/styles/menu.css */
|
|
2
|
+
.entropix-menu-trigger {
|
|
3
|
+
}
|
|
4
|
+
.entropix-menu-content {
|
|
5
|
+
min-width: 160px;
|
|
6
|
+
padding: var(--entropix-spacing-1);
|
|
7
|
+
background: var(--entropix-color-bg-primary);
|
|
8
|
+
border: 1px solid var(--entropix-color-border-default);
|
|
9
|
+
border-radius: var(--entropix-radius-md);
|
|
10
|
+
box-shadow: var(--entropix-shadow-lg);
|
|
11
|
+
z-index: 50;
|
|
12
|
+
}
|
|
13
|
+
.entropix-menu-item {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
|
|
17
|
+
border-radius: var(--entropix-radius-sm);
|
|
18
|
+
font-family: var(--entropix-font-family-sans);
|
|
19
|
+
font-size: var(--entropix-font-size-sm);
|
|
20
|
+
color: var(--entropix-color-text-primary);
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
user-select: none;
|
|
23
|
+
transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
24
|
+
}
|
|
25
|
+
.entropix-menu-item:hover {
|
|
26
|
+
background: var(--entropix-color-action-secondary-default);
|
|
27
|
+
}
|
|
28
|
+
.entropix-menu-item[data-state=active] {
|
|
29
|
+
background: var(--entropix-color-action-secondary-default);
|
|
30
|
+
}
|
|
31
|
+
.entropix-menu-item[data-disabled=true],
|
|
32
|
+
.entropix-menu-item[aria-disabled=true] {
|
|
33
|
+
opacity: 0.5;
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
.entropix-menu-item:focus-visible {
|
|
38
|
+
outline: 2px solid var(--entropix-color-border-focus);
|
|
39
|
+
outline-offset: -2px;
|
|
40
|
+
}
|
|
41
|
+
@media (max-width: 767px) {
|
|
42
|
+
.entropix-menu-content {
|
|
43
|
+
min-width: 200px;
|
|
44
|
+
}
|
|
45
|
+
.entropix-menu-item {
|
|
46
|
+
padding: var(--entropix-spacing-3) var(--entropix-spacing-4);
|
|
47
|
+
font-size: var(--entropix-font-size-base);
|
|
48
|
+
min-height: 44px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/*# sourceMappingURL=menu.css.map */
|
package/dist/menu.d.cts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { UseMenuOptions } from '@entropix/core';
|
|
4
|
+
|
|
5
|
+
interface MenuProps extends UseMenuOptions {
|
|
6
|
+
children: react__default.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function Menu({ children, ...options }: MenuProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
interface MenuTriggerProps {
|
|
11
|
+
children: react__default.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function MenuTrigger({ children, className }: MenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
interface MenuContentProps {
|
|
17
|
+
children: react__default.ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function MenuContent({ children, className }: MenuContentProps): react_jsx_runtime.JSX.Element | null;
|
|
21
|
+
|
|
22
|
+
interface MenuItemProps {
|
|
23
|
+
index: number;
|
|
24
|
+
onSelect?: () => void;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
children: react__default.ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
declare function MenuItem({ index, onSelect, disabled, children, className, }: MenuItemProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { Menu, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, type MenuProps, MenuTrigger, type MenuTriggerProps };
|
package/dist/menu.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { UseMenuOptions } from '@entropix/core';
|
|
4
|
+
|
|
5
|
+
interface MenuProps extends UseMenuOptions {
|
|
6
|
+
children: react__default.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function Menu({ children, ...options }: MenuProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
interface MenuTriggerProps {
|
|
11
|
+
children: react__default.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function MenuTrigger({ children, className }: MenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
interface MenuContentProps {
|
|
17
|
+
children: react__default.ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function MenuContent({ children, className }: MenuContentProps): react_jsx_runtime.JSX.Element | null;
|
|
21
|
+
|
|
22
|
+
interface MenuItemProps {
|
|
23
|
+
index: number;
|
|
24
|
+
onSelect?: () => void;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
children: react__default.ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
declare function MenuItem({ index, onSelect, disabled, children, className, }: MenuItemProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { Menu, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, type MenuProps, MenuTrigger, type MenuTriggerProps };
|
package/dist/menu.js
ADDED
package/dist/radio.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkKGIUECLG_cjs = require('./chunk-KGIUECLG.cjs');
|
|
4
|
+
require('./chunk-LDOP6DVX.cjs');
|
|
5
|
+
require('./chunk-LJK6KK2H.cjs');
|
|
6
|
+
require('./chunk-5DKE5YQD.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "RadioGroup", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkKGIUECLG_cjs.RadioGroup; }
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "RadioItem", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkKGIUECLG_cjs.RadioItem; }
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=radio.cjs.map
|
|
19
|
+
//# sourceMappingURL=radio.cjs.map
|
package/dist/radio.css
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* src/styles/radio.css */
|
|
2
|
+
.entropix-radio-group {
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: var(--entropix-spacing-2);
|
|
5
|
+
}
|
|
6
|
+
.entropix-radio-group[data-orientation=vertical] {
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
}
|
|
9
|
+
.entropix-radio-group[data-orientation=horizontal] {
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
}
|
|
13
|
+
.entropix-radio-item {
|
|
14
|
+
--radio-size: 20px;
|
|
15
|
+
--radio-border-color: var(--entropix-color-border-default);
|
|
16
|
+
--radio-checked-color: var(--entropix-color-action-primary-default);
|
|
17
|
+
--radio-dot-size: 10px;
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--entropix-spacing-2);
|
|
21
|
+
padding: var(--entropix-spacing-1) 0;
|
|
22
|
+
border: none;
|
|
23
|
+
background: transparent;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
user-select: none;
|
|
26
|
+
font-family: var(--entropix-font-family-sans);
|
|
27
|
+
font-size: var(--entropix-font-size-sm);
|
|
28
|
+
color: var(--entropix-color-text-primary);
|
|
29
|
+
line-height: var(--entropix-line-height-normal);
|
|
30
|
+
}
|
|
31
|
+
.entropix-radio-item__indicator {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
width: var(--radio-size);
|
|
36
|
+
height: var(--radio-size);
|
|
37
|
+
border: 2px solid var(--radio-border-color);
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
background: var(--entropix-color-bg-primary);
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
transition: border-color var(--entropix-duration-fast) var(--entropix-easing-default), background var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
42
|
+
}
|
|
43
|
+
.entropix-radio-item__indicator[data-state=checked] {
|
|
44
|
+
border-color: var(--radio-checked-color);
|
|
45
|
+
}
|
|
46
|
+
.entropix-radio-item__indicator[data-state=checked]::after {
|
|
47
|
+
content: "";
|
|
48
|
+
display: block;
|
|
49
|
+
width: var(--radio-dot-size);
|
|
50
|
+
height: var(--radio-dot-size);
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
background: var(--radio-checked-color);
|
|
53
|
+
}
|
|
54
|
+
.entropix-radio-item__label {
|
|
55
|
+
font-family: var(--entropix-font-family-sans);
|
|
56
|
+
font-size: var(--entropix-font-size-sm);
|
|
57
|
+
color: var(--entropix-color-text-primary);
|
|
58
|
+
line-height: var(--entropix-line-height-normal);
|
|
59
|
+
}
|
|
60
|
+
.entropix-radio-item:hover:not(:disabled) .entropix-radio-item__indicator {
|
|
61
|
+
border-color: var(--entropix-color-border-hover);
|
|
62
|
+
}
|
|
63
|
+
.entropix-radio-item:hover:not(:disabled) .entropix-radio-item__indicator[data-state=checked] {
|
|
64
|
+
border-color: var(--entropix-color-action-primary-hover);
|
|
65
|
+
}
|
|
66
|
+
.entropix-radio-item:hover:not(:disabled) .entropix-radio-item__indicator[data-state=checked]::after {
|
|
67
|
+
background: var(--entropix-color-action-primary-hover);
|
|
68
|
+
}
|
|
69
|
+
.entropix-radio-item:focus-visible {
|
|
70
|
+
outline: 2px solid var(--entropix-color-border-focus);
|
|
71
|
+
outline-offset: 2px;
|
|
72
|
+
border-radius: var(--entropix-radius-sm);
|
|
73
|
+
}
|
|
74
|
+
.entropix-radio-item:disabled,
|
|
75
|
+
.entropix-radio-item[data-disabled] {
|
|
76
|
+
opacity: 0.5;
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
}
|
|
80
|
+
@media (max-width: 767px) {
|
|
81
|
+
.entropix-radio-item {
|
|
82
|
+
min-height: 44px;
|
|
83
|
+
}
|
|
84
|
+
.entropix-radio-item__indicator {
|
|
85
|
+
width: 22px;
|
|
86
|
+
height: 22px;
|
|
87
|
+
}
|
|
88
|
+
.entropix-radio-item__indicator[data-state=checked]::after {
|
|
89
|
+
width: 10px;
|
|
90
|
+
height: 10px;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/*# sourceMappingURL=radio.css.map */
|
package/dist/radio.d.cts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { UseRadioGroupOptions } from '@entropix/core';
|
|
4
|
+
|
|
5
|
+
interface RadioGroupProps extends UseRadioGroupOptions {
|
|
6
|
+
/** Label for the radio group */
|
|
7
|
+
label?: string;
|
|
8
|
+
children: react__default.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* RadioGroup component — web adapter for @entropix/core's useRadioGroup.
|
|
13
|
+
*
|
|
14
|
+
* Renders a `<div role="radiogroup">` that provides context to RadioItem children.
|
|
15
|
+
* Sets data-orientation for CSS targeting.
|
|
16
|
+
*/
|
|
17
|
+
declare function RadioGroup({ children, label, className, ...options }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
interface RadioItemProps {
|
|
20
|
+
/** The value this radio option represents */
|
|
21
|
+
value: string;
|
|
22
|
+
/** Whether this specific radio is disabled */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Label text */
|
|
25
|
+
label?: string;
|
|
26
|
+
children?: react__default.ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* RadioItem component — a single radio option within a RadioGroup.
|
|
31
|
+
*
|
|
32
|
+
* Renders a `<button type="button" role="radio">` with an indicator
|
|
33
|
+
* circle and label. Sets data-state="checked"|"unchecked" for CSS targeting.
|
|
34
|
+
*/
|
|
35
|
+
declare function RadioItem({ value, disabled, label, children, className, }: RadioItemProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
export { RadioGroup, type RadioGroupProps, RadioItem, type RadioItemProps };
|
package/dist/radio.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { UseRadioGroupOptions } from '@entropix/core';
|
|
4
|
+
|
|
5
|
+
interface RadioGroupProps extends UseRadioGroupOptions {
|
|
6
|
+
/** Label for the radio group */
|
|
7
|
+
label?: string;
|
|
8
|
+
children: react__default.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* RadioGroup component — web adapter for @entropix/core's useRadioGroup.
|
|
13
|
+
*
|
|
14
|
+
* Renders a `<div role="radiogroup">` that provides context to RadioItem children.
|
|
15
|
+
* Sets data-orientation for CSS targeting.
|
|
16
|
+
*/
|
|
17
|
+
declare function RadioGroup({ children, label, className, ...options }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
interface RadioItemProps {
|
|
20
|
+
/** The value this radio option represents */
|
|
21
|
+
value: string;
|
|
22
|
+
/** Whether this specific radio is disabled */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Label text */
|
|
25
|
+
label?: string;
|
|
26
|
+
children?: react__default.ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* RadioItem component — a single radio option within a RadioGroup.
|
|
31
|
+
*
|
|
32
|
+
* Renders a `<button type="button" role="radio">` with an indicator
|
|
33
|
+
* circle and label. Sets data-state="checked"|"unchecked" for CSS targeting.
|
|
34
|
+
*/
|
|
35
|
+
declare function RadioItem({ value, disabled, label, children, className, }: RadioItemProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
export { RadioGroup, type RadioGroupProps, RadioItem, type RadioItemProps };
|
package/dist/radio.js
ADDED
package/dist/select.cjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk34IVVIO3_cjs = require('./chunk-34IVVIO3.cjs');
|
|
4
|
+
require('./chunk-LDOP6DVX.cjs');
|
|
5
|
+
require('./chunk-LJK6KK2H.cjs');
|
|
6
|
+
require('./chunk-5DKE5YQD.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "Select", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunk34IVVIO3_cjs.Select; }
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "SelectContent", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunk34IVVIO3_cjs.SelectContent; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "SelectOption", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunk34IVVIO3_cjs.SelectOption; }
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "SelectTrigger", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return chunk34IVVIO3_cjs.SelectTrigger; }
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=select.cjs.map
|
|
27
|
+
//# sourceMappingURL=select.cjs.map
|
package/dist/select.css
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* src/styles/select.css */
|
|
2
|
+
.entropix-select {
|
|
3
|
+
--select-border-color: var(--entropix-color-border-default);
|
|
4
|
+
--select-border-radius: var(--entropix-radius-md);
|
|
5
|
+
--select-bg: var(--entropix-color-bg-primary);
|
|
6
|
+
--select-dropdown-shadow: var(--entropix-shadow-lg);
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--entropix-spacing-1);
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
.entropix-select-label {
|
|
14
|
+
display: block;
|
|
15
|
+
font-family: var(--entropix-font-family-sans);
|
|
16
|
+
font-size: var(--entropix-font-size-sm);
|
|
17
|
+
font-weight: var(--entropix-font-weight-medium);
|
|
18
|
+
color: var(--entropix-color-text-primary);
|
|
19
|
+
line-height: var(--entropix-line-height-normal);
|
|
20
|
+
}
|
|
21
|
+
.entropix-select-trigger {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
gap: var(--entropix-spacing-2);
|
|
26
|
+
width: 100%;
|
|
27
|
+
border: 1px solid var(--select-border-color);
|
|
28
|
+
border-radius: var(--select-border-radius);
|
|
29
|
+
background: var(--select-bg);
|
|
30
|
+
color: var(--entropix-color-text-primary);
|
|
31
|
+
font-family: var(--entropix-font-family-sans);
|
|
32
|
+
font-size: var(--entropix-font-size-sm);
|
|
33
|
+
line-height: var(--entropix-line-height-normal);
|
|
34
|
+
padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
user-select: none;
|
|
37
|
+
text-align: left;
|
|
38
|
+
transition: border-color var(--entropix-duration-fast) var(--entropix-easing-default), box-shadow var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
39
|
+
}
|
|
40
|
+
.entropix-select-trigger__value {
|
|
41
|
+
flex: 1;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
}
|
|
46
|
+
.entropix-select-trigger__chevron {
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
font-size: var(--entropix-font-size-xs);
|
|
49
|
+
color: var(--entropix-color-text-secondary);
|
|
50
|
+
line-height: 1;
|
|
51
|
+
}
|
|
52
|
+
.entropix-select-trigger:hover:not(:disabled) {
|
|
53
|
+
border-color: var(--entropix-color-border-hover);
|
|
54
|
+
}
|
|
55
|
+
.entropix-select-trigger:focus-visible {
|
|
56
|
+
outline: 2px solid var(--entropix-color-border-focus);
|
|
57
|
+
outline-offset: 2px;
|
|
58
|
+
}
|
|
59
|
+
.entropix-select-trigger:disabled {
|
|
60
|
+
opacity: 0.5;
|
|
61
|
+
cursor: not-allowed;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
}
|
|
64
|
+
.entropix-select-content {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 100%;
|
|
67
|
+
left: 0;
|
|
68
|
+
right: 0;
|
|
69
|
+
z-index: 50;
|
|
70
|
+
margin-top: var(--entropix-spacing-1);
|
|
71
|
+
border: 1px solid var(--select-border-color);
|
|
72
|
+
border-radius: var(--select-border-radius);
|
|
73
|
+
background: var(--select-bg);
|
|
74
|
+
box-shadow: var(--select-dropdown-shadow);
|
|
75
|
+
padding: var(--entropix-spacing-1) 0;
|
|
76
|
+
max-height: 240px;
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
}
|
|
79
|
+
.entropix-select-option {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
|
|
83
|
+
font-family: var(--entropix-font-family-sans);
|
|
84
|
+
font-size: var(--entropix-font-size-sm);
|
|
85
|
+
color: var(--entropix-color-text-primary);
|
|
86
|
+
line-height: var(--entropix-line-height-normal);
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
user-select: none;
|
|
89
|
+
transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
90
|
+
}
|
|
91
|
+
.entropix-select-option:hover:not([data-disabled]) {
|
|
92
|
+
background: var(--entropix-color-action-secondary-hover);
|
|
93
|
+
}
|
|
94
|
+
.entropix-select-option[data-state=selected] {
|
|
95
|
+
background: var(--entropix-color-action-secondary-default);
|
|
96
|
+
font-weight: var(--entropix-font-weight-medium);
|
|
97
|
+
}
|
|
98
|
+
.entropix-select-option[data-state=selected]:hover {
|
|
99
|
+
background: var(--entropix-color-action-secondary-hover);
|
|
100
|
+
}
|
|
101
|
+
.entropix-select-option[data-disabled] {
|
|
102
|
+
opacity: 0.5;
|
|
103
|
+
cursor: not-allowed;
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
}
|
|
106
|
+
@media (max-width: 767px) {
|
|
107
|
+
.entropix-select-trigger {
|
|
108
|
+
min-height: 44px;
|
|
109
|
+
}
|
|
110
|
+
.entropix-select-option {
|
|
111
|
+
min-height: 44px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/*# sourceMappingURL=select.css.map */
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { UseSelectOptions } from '@entropix/core';
|
|
4
|
+
|
|
5
|
+
interface SelectProps extends UseSelectOptions {
|
|
6
|
+
/** Label for the select */
|
|
7
|
+
label?: string;
|
|
8
|
+
children: react__default.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Select component — web adapter for @entropix/core's useSelect.
|
|
13
|
+
*
|
|
14
|
+
* Provides context to SelectTrigger, SelectContent, and SelectOption children.
|
|
15
|
+
*/
|
|
16
|
+
declare function Select({ children, label, className, ...options }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
interface SelectTriggerProps {
|
|
19
|
+
/** Placeholder text when no value is selected */
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
children?: react__default.ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* SelectTrigger — renders like a styled input with a chevron.
|
|
26
|
+
*
|
|
27
|
+
* Displays the currently selected value or placeholder text.
|
|
28
|
+
*/
|
|
29
|
+
declare function SelectTrigger({ placeholder, children, className, }: SelectTriggerProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
interface SelectContentProps {
|
|
32
|
+
children: react__default.ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* SelectContent — renders the dropdown container for options.
|
|
37
|
+
*
|
|
38
|
+
* Only visible when the select is open.
|
|
39
|
+
*/
|
|
40
|
+
declare function SelectContent({ children, className }: SelectContentProps): react_jsx_runtime.JSX.Element | null;
|
|
41
|
+
|
|
42
|
+
interface SelectOptionProps {
|
|
43
|
+
/** The value this option represents */
|
|
44
|
+
value: string;
|
|
45
|
+
/** The index of this option in the list (auto-assigned by SelectContent if omitted) */
|
|
46
|
+
index?: number;
|
|
47
|
+
/** Whether this option is disabled */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
children: react__default.ReactNode;
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* SelectOption — renders an option within SelectContent.
|
|
54
|
+
*
|
|
55
|
+
* Sets data-state="selected"|"unselected" for CSS targeting.
|
|
56
|
+
*/
|
|
57
|
+
declare function SelectOption({ value, index, disabled, children, className, }: SelectOptionProps): react_jsx_runtime.JSX.Element;
|
|
58
|
+
|
|
59
|
+
export { Select, SelectContent, type SelectContentProps, SelectOption, type SelectOptionProps, type SelectProps, SelectTrigger, type SelectTriggerProps };
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { UseSelectOptions } from '@entropix/core';
|
|
4
|
+
|
|
5
|
+
interface SelectProps extends UseSelectOptions {
|
|
6
|
+
/** Label for the select */
|
|
7
|
+
label?: string;
|
|
8
|
+
children: react__default.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Select component — web adapter for @entropix/core's useSelect.
|
|
13
|
+
*
|
|
14
|
+
* Provides context to SelectTrigger, SelectContent, and SelectOption children.
|
|
15
|
+
*/
|
|
16
|
+
declare function Select({ children, label, className, ...options }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
interface SelectTriggerProps {
|
|
19
|
+
/** Placeholder text when no value is selected */
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
children?: react__default.ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* SelectTrigger — renders like a styled input with a chevron.
|
|
26
|
+
*
|
|
27
|
+
* Displays the currently selected value or placeholder text.
|
|
28
|
+
*/
|
|
29
|
+
declare function SelectTrigger({ placeholder, children, className, }: SelectTriggerProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
interface SelectContentProps {
|
|
32
|
+
children: react__default.ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* SelectContent — renders the dropdown container for options.
|
|
37
|
+
*
|
|
38
|
+
* Only visible when the select is open.
|
|
39
|
+
*/
|
|
40
|
+
declare function SelectContent({ children, className }: SelectContentProps): react_jsx_runtime.JSX.Element | null;
|
|
41
|
+
|
|
42
|
+
interface SelectOptionProps {
|
|
43
|
+
/** The value this option represents */
|
|
44
|
+
value: string;
|
|
45
|
+
/** The index of this option in the list (auto-assigned by SelectContent if omitted) */
|
|
46
|
+
index?: number;
|
|
47
|
+
/** Whether this option is disabled */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
children: react__default.ReactNode;
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* SelectOption — renders an option within SelectContent.
|
|
54
|
+
*
|
|
55
|
+
* Sets data-state="selected"|"unselected" for CSS targeting.
|
|
56
|
+
*/
|
|
57
|
+
declare function SelectOption({ value, index, disabled, children, className, }: SelectOptionProps): react_jsx_runtime.JSX.Element;
|
|
58
|
+
|
|
59
|
+
export { Select, SelectContent, type SelectContentProps, SelectOption, type SelectOptionProps, type SelectProps, SelectTrigger, type SelectTriggerProps };
|
package/dist/select.js
ADDED
|
@@ -1,69 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
@layer entropix {
|
|
4
|
-
.entropix-accordion {
|
|
5
|
-
border: 1px solid var(--entropix-color-border-default);
|
|
6
|
-
border-radius: var(--entropix-radius-lg);
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.entropix-accordion-item {
|
|
11
|
-
border-bottom: 1px solid var(--entropix-color-border-default);
|
|
12
|
-
}
|
|
13
|
-
.entropix-accordion-item:last-child {
|
|
14
|
-
border-bottom: none;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.entropix-accordion-trigger {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: space-between;
|
|
21
|
-
width: 100%;
|
|
22
|
-
padding: var(--entropix-spacing-4);
|
|
23
|
-
border: none;
|
|
24
|
-
background: transparent;
|
|
25
|
-
font-family: var(--entropix-font-family-sans);
|
|
26
|
-
font-size: var(--entropix-font-size-sm);
|
|
27
|
-
font-weight: var(--entropix-font-weight-medium);
|
|
28
|
-
color: var(--entropix-color-text-primary);
|
|
29
|
-
text-align: left;
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.entropix-accordion-trigger:hover:not(:disabled) {
|
|
35
|
-
background: var(--entropix-color-bg-secondary);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.entropix-accordion-trigger:disabled {
|
|
39
|
-
opacity: 0.5;
|
|
40
|
-
cursor: not-allowed;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.entropix-accordion-trigger:focus-visible {
|
|
44
|
-
outline: 2px solid var(--entropix-color-border-focus);
|
|
45
|
-
outline-offset: -2px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.entropix-accordion-panel {
|
|
49
|
-
padding: 0 var(--entropix-spacing-4) var(--entropix-spacing-4);
|
|
50
|
-
font-family: var(--entropix-font-family-sans);
|
|
51
|
-
font-size: var(--entropix-font-size-sm);
|
|
52
|
-
color: var(--entropix-color-text-secondary);
|
|
53
|
-
line-height: var(--entropix-line-height-normal);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/* === Responsive — Touch-friendly on mobile === */
|
|
57
|
-
|
|
58
|
-
@media (max-width: 767px) {
|
|
59
|
-
.entropix-accordion-trigger {
|
|
60
|
-
padding: var(--entropix-spacing-4) var(--entropix-spacing-3);
|
|
61
|
-
min-height: 48px;
|
|
62
|
-
font-size: var(--entropix-font-size-base);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.entropix-accordion-panel {
|
|
66
|
-
padding: 0 var(--entropix-spacing-3) var(--entropix-spacing-3);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
1
|
+
.entropix-accordion{border:1px solid var(--entropix-color-border-default);border-radius:var(--entropix-radius-lg);overflow:hidden}.entropix-accordion-item{border-bottom:1px solid var(--entropix-color-border-default)}.entropix-accordion-item:last-child{border-bottom:none}.entropix-accordion-trigger{width:100%;padding:var(--entropix-spacing-4);font-family:var(--entropix-font-family-sans);font-size:var(--entropix-font-size-sm);font-weight:var(--entropix-font-weight-medium);color:var(--entropix-color-text-primary);text-align:left;cursor:pointer;transition:background var(--entropix-duration-fast) var(--entropix-easing-default);background:0 0;border:none;justify-content:space-between;align-items:center;display:flex}.entropix-accordion-trigger:hover:not(:disabled){background:var(--entropix-color-bg-secondary)}.entropix-accordion-trigger:disabled{opacity:.5;cursor:not-allowed}.entropix-accordion-trigger:focus-visible{outline:2px solid var(--entropix-color-border-focus);outline-offset:-2px}.entropix-accordion-panel{padding:0 var(--entropix-spacing-4) var(--entropix-spacing-4);font-family:var(--entropix-font-family-sans);font-size:var(--entropix-font-size-sm);color:var(--entropix-color-text-secondary);line-height:var(--entropix-line-height-normal)}@media (width<=767px){.entropix-accordion-trigger{padding:var(--entropix-spacing-4) var(--entropix-spacing-3);min-height:48px;font-size:var(--entropix-font-size-base)}.entropix-accordion-panel{padding:0 var(--entropix-spacing-3) var(--entropix-spacing-3)}}
|