@entropix/react 0.1.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.
@@ -0,0 +1,62 @@
1
+ /* Menu — @entropix/react */
2
+
3
+ .entropix-menu-trigger {
4
+ /* Inherits button styles if also .entropix-button */
5
+ }
6
+
7
+ .entropix-menu-content {
8
+ min-width: 160px;
9
+ padding: var(--entropix-spacing-1);
10
+ background: var(--entropix-color-bg-primary);
11
+ border: 1px solid var(--entropix-color-border-default);
12
+ border-radius: var(--entropix-radius-md);
13
+ box-shadow: var(--entropix-shadow-lg);
14
+ z-index: 50;
15
+ }
16
+
17
+ .entropix-menu-item {
18
+ display: flex;
19
+ align-items: center;
20
+ padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
21
+ border-radius: var(--entropix-radius-sm);
22
+ font-family: var(--entropix-font-family-sans);
23
+ font-size: var(--entropix-font-size-sm);
24
+ color: var(--entropix-color-text-primary);
25
+ cursor: pointer;
26
+ user-select: none;
27
+ transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
28
+ }
29
+
30
+ .entropix-menu-item:hover {
31
+ background: var(--entropix-color-action-secondary-default);
32
+ }
33
+
34
+ .entropix-menu-item[data-state="active"] {
35
+ background: var(--entropix-color-action-secondary-default);
36
+ }
37
+
38
+ .entropix-menu-item[data-disabled="true"],
39
+ .entropix-menu-item[aria-disabled="true"] {
40
+ opacity: 0.5;
41
+ cursor: not-allowed;
42
+ pointer-events: none;
43
+ }
44
+
45
+ .entropix-menu-item:focus-visible {
46
+ outline: 2px solid var(--entropix-color-border-focus);
47
+ outline-offset: -2px;
48
+ }
49
+
50
+ /* === Responsive — Larger touch targets on mobile === */
51
+
52
+ @media (max-width: 767px) {
53
+ .entropix-menu-content {
54
+ min-width: 200px;
55
+ }
56
+
57
+ .entropix-menu-item {
58
+ padding: var(--entropix-spacing-3) var(--entropix-spacing-4);
59
+ font-size: var(--entropix-font-size-base);
60
+ min-height: 44px;
61
+ }
62
+ }
@@ -0,0 +1,50 @@
1
+ /* Switch — @entropix/react */
2
+
3
+ .entropix-switch {
4
+ position: relative;
5
+ display: inline-flex;
6
+ align-items: center;
7
+ width: 44px;
8
+ height: 24px;
9
+ padding: 2px;
10
+ border: none;
11
+ border-radius: var(--entropix-radius-full);
12
+ background: var(--entropix-color-gray-300);
13
+ cursor: pointer;
14
+ transition: background var(--entropix-duration-fast) var(--entropix-easing-default);
15
+ }
16
+
17
+ .entropix-switch::after {
18
+ content: "";
19
+ display: block;
20
+ width: 20px;
21
+ height: 20px;
22
+ border-radius: var(--entropix-radius-full);
23
+ background: var(--entropix-color-white);
24
+ box-shadow: var(--entropix-shadow-sm);
25
+ transition: transform var(--entropix-duration-fast) var(--entropix-easing-default);
26
+ }
27
+
28
+ .entropix-switch[data-state="checked"] {
29
+ background: var(--entropix-color-action-primary-default);
30
+ }
31
+ .entropix-switch[data-state="checked"]::after {
32
+ transform: translateX(20px);
33
+ }
34
+
35
+ .entropix-switch:hover:not(:disabled) {
36
+ background: var(--entropix-color-gray-400);
37
+ }
38
+ .entropix-switch[data-state="checked"]:hover:not(:disabled) {
39
+ background: var(--entropix-color-action-primary-hover);
40
+ }
41
+
42
+ .entropix-switch:disabled {
43
+ opacity: 0.5;
44
+ cursor: not-allowed;
45
+ }
46
+
47
+ .entropix-switch:focus-visible {
48
+ outline: 2px solid var(--entropix-color-border-focus);
49
+ outline-offset: 2px;
50
+ }
@@ -0,0 +1,84 @@
1
+ /* Tabs — @entropix/react */
2
+
3
+ .entropix-tabs {
4
+ display: flex;
5
+ flex-direction: column;
6
+ }
7
+
8
+ .entropix-tablist {
9
+ display: flex;
10
+ gap: var(--entropix-spacing-1);
11
+ border-bottom: 1px solid var(--entropix-color-border-default);
12
+ }
13
+ .entropix-tablist[data-orientation="vertical"] {
14
+ flex-direction: column;
15
+ border-bottom: none;
16
+ border-right: 1px solid var(--entropix-color-border-default);
17
+ }
18
+
19
+ .entropix-tab {
20
+ display: inline-flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ padding: var(--entropix-spacing-2) var(--entropix-spacing-4);
24
+ border: none;
25
+ border-bottom: 2px solid transparent;
26
+ background: transparent;
27
+ font-family: var(--entropix-font-family-sans);
28
+ font-size: var(--entropix-font-size-sm);
29
+ font-weight: var(--entropix-font-weight-medium);
30
+ color: var(--entropix-color-text-secondary);
31
+ cursor: pointer;
32
+ transition:
33
+ color var(--entropix-duration-fast) var(--entropix-easing-default),
34
+ border-color var(--entropix-duration-fast) var(--entropix-easing-default);
35
+ }
36
+
37
+ .entropix-tab:hover:not(:disabled) {
38
+ color: var(--entropix-color-text-primary);
39
+ }
40
+
41
+ .entropix-tab[data-state="active"] {
42
+ color: var(--entropix-color-action-primary-default);
43
+ border-bottom-color: var(--entropix-color-action-primary-default);
44
+ }
45
+
46
+ .entropix-tab:disabled,
47
+ .entropix-tab[aria-disabled="true"] {
48
+ opacity: 0.5;
49
+ cursor: not-allowed;
50
+ }
51
+
52
+ .entropix-tab:focus-visible {
53
+ outline: 2px solid var(--entropix-color-border-focus);
54
+ outline-offset: -2px;
55
+ border-radius: var(--entropix-radius-sm);
56
+ }
57
+
58
+ .entropix-tabpanel {
59
+ padding: var(--entropix-spacing-4);
60
+ }
61
+
62
+ /* === Responsive — Scrollable tabs on mobile === */
63
+
64
+ @media (max-width: 767px) {
65
+ .entropix-tablist {
66
+ overflow-x: auto;
67
+ -webkit-overflow-scrolling: touch;
68
+ scrollbar-width: none;
69
+ -ms-overflow-style: none;
70
+ }
71
+
72
+ .entropix-tablist::-webkit-scrollbar {
73
+ display: none;
74
+ }
75
+
76
+ .entropix-tab {
77
+ white-space: nowrap;
78
+ flex-shrink: 0;
79
+ }
80
+
81
+ .entropix-tabpanel {
82
+ padding: var(--entropix-spacing-3);
83
+ }
84
+ }
@@ -0,0 +1,45 @@
1
+ /* Toggle (checkbox) — @entropix/react */
2
+
3
+ .entropix-toggle {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ padding: var(--entropix-spacing-2) var(--entropix-spacing-3);
8
+ border: 1px solid var(--entropix-color-border-default);
9
+ border-radius: var(--entropix-radius-md);
10
+ background: var(--entropix-color-bg-primary);
11
+ color: var(--entropix-color-text-primary);
12
+ font-family: var(--entropix-font-family-sans);
13
+ font-size: var(--entropix-font-size-sm);
14
+ font-weight: var(--entropix-font-weight-medium);
15
+ cursor: pointer;
16
+ user-select: none;
17
+ transition:
18
+ background var(--entropix-duration-fast) var(--entropix-easing-default),
19
+ border-color var(--entropix-duration-fast) var(--entropix-easing-default),
20
+ color var(--entropix-duration-fast) var(--entropix-easing-default);
21
+ }
22
+
23
+ .entropix-toggle:hover:not(:disabled) {
24
+ background: var(--entropix-color-action-secondary-hover);
25
+ }
26
+
27
+ .entropix-toggle[data-state="checked"] {
28
+ background: var(--entropix-color-action-primary-default);
29
+ color: var(--entropix-color-text-inverse);
30
+ border-color: transparent;
31
+ }
32
+ .entropix-toggle[data-state="checked"]:hover:not(:disabled) {
33
+ background: var(--entropix-color-action-primary-hover);
34
+ }
35
+
36
+ .entropix-toggle:disabled {
37
+ opacity: 0.5;
38
+ cursor: not-allowed;
39
+ pointer-events: none;
40
+ }
41
+
42
+ .entropix-toggle:focus-visible {
43
+ outline: 2px solid var(--entropix-color-border-focus);
44
+ outline-offset: 2px;
45
+ }
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@entropix/react",
3
+ "version": "0.1.0",
4
+ "description": "React (Web) components for the Entropix design system — styled with CSS custom properties and design tokens",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Manish <manindepth07@gmail.com>",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/dev-manindepth/entropix.git",
11
+ "directory": "packages/react"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/dev-manindepth/entropix/issues"
15
+ },
16
+ "homepage": "https://github.com/dev-manindepth/entropix/tree/main/packages/react",
17
+ "keywords": [
18
+ "design-system",
19
+ "react",
20
+ "components",
21
+ "ui-library",
22
+ "css-variables",
23
+ "accessible",
24
+ "entropix"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "registry": "https://registry.npmjs.org"
29
+ },
30
+ "sideEffects": [
31
+ "**/*.css"
32
+ ],
33
+ "exports": {
34
+ ".": {
35
+ "import": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./dist/index.js"
38
+ },
39
+ "require": {
40
+ "types": "./dist/index.d.cts",
41
+ "default": "./dist/index.cjs"
42
+ }
43
+ },
44
+ "./styles": "./dist/styles/index.css",
45
+ "./styles/*": "./dist/styles/*.css"
46
+ },
47
+ "main": "./dist/index.cjs",
48
+ "module": "./dist/index.js",
49
+ "types": "./dist/index.d.ts",
50
+ "files": [
51
+ "dist"
52
+ ],
53
+ "dependencies": {
54
+ "@entropix/core": "0.1.0"
55
+ },
56
+ "peerDependencies": {
57
+ "react": "^18.0.0 || ^19.0.0",
58
+ "react-dom": "^18.0.0 || ^19.0.0"
59
+ },
60
+ "devDependencies": {
61
+ "@testing-library/jest-dom": "^6.6.3",
62
+ "@testing-library/react": "^16.3.0",
63
+ "@testing-library/user-event": "^14.6.1",
64
+ "@types/react": "19.2.2",
65
+ "@types/react-dom": "19.2.2",
66
+ "eslint": "^9.39.1",
67
+ "jsdom": "^26.1.0",
68
+ "react": "^19.2.0",
69
+ "react-dom": "^19.2.0",
70
+ "tsup": "^8.4.0",
71
+ "typescript": "5.9.2",
72
+ "vitest": "^3.2.1",
73
+ "@entropix/typescript-config": "0.0.0",
74
+ "@entropix/eslint-config": "0.0.0"
75
+ },
76
+ "scripts": {
77
+ "build": "tsup",
78
+ "dev": "tsup --watch",
79
+ "lint": "eslint . --max-warnings 0",
80
+ "check-types": "tsc --noEmit",
81
+ "test": "vitest run",
82
+ "test:watch": "vitest"
83
+ }
84
+ }