@nattui/react-components 0.0.21 → 0.0.22
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/{button.module-VAXL2INY.module.css → button.module-G7MNOYWZ.module.css} +23 -23
- package/dist/index.d.ts +10 -10
- package/dist/index.js +5 -7
- package/dist/{input.module-GMZ6XJ62.module.css → input.module-GJV5YJKN.module.css} +16 -16
- package/package.json +2 -6
- package/dist/{button-background.module-Y3DFESUY.module.css → button-background.module-T5B7XZ2Z.module.css} +5 -5
- package/dist/{button-spinner.module-T3OGVJS4.module.css → button-spinner.module-4TBETQ4T.module.css} +12 -12
- package/dist/{label.module-3W6OLN6C.module.css → label.module-4CZ6ETIR.module.css} +2 -2
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
/* Base */
|
|
3
3
|
/* ===================================================== */
|
|
4
4
|
.button {
|
|
5
|
-
|
|
5
|
+
align-items: safe center;
|
|
6
|
+
border-color: transparent;
|
|
7
|
+
border-style: solid;
|
|
8
|
+
border-width: 1px;
|
|
9
|
+
column-gap: 8px;
|
|
10
|
+
cursor: pointer;
|
|
6
11
|
display: flex;
|
|
7
12
|
flex-shrink: 0;
|
|
8
|
-
column-gap: 8px;
|
|
9
|
-
align-items: safe center;
|
|
10
|
-
justify-content: safe center;
|
|
11
|
-
overflow: hidden;
|
|
12
13
|
font-family: var(--font-sans, sans-serif);
|
|
13
14
|
font-size: 14px;
|
|
14
15
|
font-weight: 500;
|
|
16
|
+
justify-content: safe center;
|
|
15
17
|
line-height: 1.5;
|
|
16
|
-
|
|
17
|
-
user-select: none;
|
|
18
|
-
outline-width: 0;
|
|
19
|
-
outline-style: solid;
|
|
20
|
-
outline-color: var(--color-primary-9, #e93d82);
|
|
18
|
+
outline-color: var(--color-primary, #e93d82);
|
|
21
19
|
outline-offset: 2px;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
outline-style: solid;
|
|
21
|
+
outline-width: 0;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
position: relative;
|
|
25
24
|
transition-duration: 150ms;
|
|
26
25
|
transition-property:
|
|
27
26
|
background-color, border-color, box-shadow, color, filter, opacity,
|
|
28
27
|
translate;
|
|
28
|
+
user-select: none;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.button:disabled {
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
/* Icon only */
|
|
68
68
|
/* ===================================================== */
|
|
69
69
|
.button__icon_only {
|
|
70
|
-
width: var(--size) !important;
|
|
71
70
|
padding: 0 !important;
|
|
71
|
+
width: var(--size) !important;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/* ===================================================== */
|
|
@@ -114,16 +114,16 @@
|
|
|
114
114
|
/* ===================================================== */
|
|
115
115
|
/* Accent */
|
|
116
116
|
.button__variant_accent {
|
|
117
|
-
color: var(--color-gray-1, #fdfcfd);
|
|
118
117
|
background-image: linear-gradient(
|
|
119
118
|
to bottom,
|
|
120
|
-
var(--color-primary
|
|
119
|
+
var(--color-primary, #e93d82),
|
|
121
120
|
var(--color-primary-10, #e03177)
|
|
122
121
|
);
|
|
123
|
-
border-color: var(--color-primary
|
|
122
|
+
border-color: var(--color-primary, #e93d82);
|
|
124
123
|
box-shadow:
|
|
125
124
|
inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
|
|
126
125
|
inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
|
|
126
|
+
color: var(--color-gray-1, #fdfcfd);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.button__variant_accent:enabled[aria-pressed="true"],
|
|
@@ -135,28 +135,27 @@
|
|
|
135
135
|
|
|
136
136
|
/* Ghost */
|
|
137
137
|
.button__variant_ghost {
|
|
138
|
-
color: var(--color-gray-11, #6f6e77);
|
|
139
138
|
background-color: transparent;
|
|
139
|
+
color: var(--color-gray-11, #6f6e77);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.button__variant_ghost:enabled[aria-pressed="true"],
|
|
143
143
|
.button__variant_ghost:enabled:active {
|
|
144
|
-
color: var(--color-gray-12, #1a1523);
|
|
145
144
|
background-color: var(--color-gray-5, #e9e8ea) !important;
|
|
145
|
+
color: var(--color-gray-12, #1a1523);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
.button__variant_ghost:enabled:hover {
|
|
149
|
-
color: var(--color-gray-12, #1a1523);
|
|
150
149
|
background-color: color-mix(
|
|
151
150
|
in oklab,
|
|
152
151
|
var(--color-gray-5, #e9e8ea) 75%,
|
|
153
152
|
transparent
|
|
154
153
|
);
|
|
154
|
+
color: var(--color-gray-12, #1a1523);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
/* Primary */
|
|
158
158
|
.button__variant_primary {
|
|
159
|
-
color: var(--color-gray-1, #fdfcfd);
|
|
160
159
|
background-image: linear-gradient(
|
|
161
160
|
to bottom,
|
|
162
161
|
color-mix(in oklab, var(--color-gray-12, #1a1523) 90%, transparent),
|
|
@@ -166,6 +165,7 @@
|
|
|
166
165
|
box-shadow:
|
|
167
166
|
inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
|
|
168
167
|
inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
|
|
168
|
+
color: var(--color-gray-1, #fdfcfd);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
.button__variant_primary:enabled[aria-pressed="true"],
|
|
@@ -177,7 +177,6 @@
|
|
|
177
177
|
|
|
178
178
|
/* Secondary */
|
|
179
179
|
.button__variant_secondary {
|
|
180
|
-
color: var(--color-gray-11, #6f6e77);
|
|
181
180
|
background-image: linear-gradient(
|
|
182
181
|
to bottom,
|
|
183
182
|
var(--color-gray-1, #fdfcfd),
|
|
@@ -187,13 +186,14 @@
|
|
|
187
186
|
box-shadow:
|
|
188
187
|
inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
|
|
189
188
|
inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
|
|
189
|
+
color: var(--color-gray-11, #6f6e77);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
.button__variant_secondary:enabled[aria-pressed="true"],
|
|
193
193
|
.button__variant_secondary:enabled:active,
|
|
194
194
|
.button__variant_secondary:enabled:hover {
|
|
195
|
-
color: var(--color-gray-12, #1a1523);
|
|
196
195
|
border-color: var(--color-gray-8, #c8c7cb);
|
|
196
|
+
color: var(--color-gray-12, #1a1523);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
.button__variant_secondary:enabled[aria-pressed="true"],
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode, JSX } from 'react';
|
|
2
2
|
|
|
3
|
+
interface ButtonIconProps extends ButtonPropsInternal {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
iconEnd?: never;
|
|
6
|
+
iconOnly: true;
|
|
7
|
+
iconStart?: never;
|
|
8
|
+
}
|
|
9
|
+
interface ButtonProps extends ButtonPropsInternal {
|
|
10
|
+
children?: string | string[];
|
|
11
|
+
iconOnly?: false;
|
|
12
|
+
}
|
|
3
13
|
interface ButtonPropsInternal extends Omit<ComponentProps<"button">, "aria-pressed" | "disabled"> {
|
|
4
14
|
iconEnd?: ReactNode;
|
|
5
15
|
iconOnly?: boolean;
|
|
@@ -12,16 +22,6 @@ interface ButtonPropsInternal extends Omit<ComponentProps<"button">, "aria-press
|
|
|
12
22
|
size?: 32 | 36 | 40 | 44;
|
|
13
23
|
variant?: "accent" | "ghost" | "primary" | "secondary";
|
|
14
24
|
}
|
|
15
|
-
interface ButtonIconProps extends ButtonPropsInternal {
|
|
16
|
-
children?: ReactNode;
|
|
17
|
-
iconEnd?: never;
|
|
18
|
-
iconOnly: true;
|
|
19
|
-
iconStart?: never;
|
|
20
|
-
}
|
|
21
|
-
interface ButtonProps extends ButtonPropsInternal {
|
|
22
|
-
children?: string | string[];
|
|
23
|
-
iconOnly?: false;
|
|
24
|
-
}
|
|
25
25
|
type ButtonUnionProps = ButtonIconProps | ButtonProps;
|
|
26
26
|
declare function Button(props: ButtonUnionProps): JSX.Element;
|
|
27
27
|
declare const BUTTON_CLASS_NAME: {
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// src/button.tsx
|
|
2
|
-
import styles3 from "./button.module-VAXL2INY.module.css";
|
|
3
|
-
|
|
4
1
|
// src/button-background.tsx
|
|
5
|
-
import styles from "./button-background.module-
|
|
2
|
+
import styles from "./button-background.module-T5B7XZ2Z.module.css";
|
|
6
3
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
7
4
|
function ButtonBackground(props) {
|
|
8
5
|
const { isRounded = false, variant = "primary" } = props;
|
|
@@ -34,7 +31,7 @@ var BUTTON_BACKGROUND_CLASS_NAME = {
|
|
|
34
31
|
};
|
|
35
32
|
|
|
36
33
|
// src/button-spinner.tsx
|
|
37
|
-
import styles2 from "./button-spinner.module-
|
|
34
|
+
import styles2 from "./button-spinner.module-4TBETQ4T.module.css";
|
|
38
35
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
39
36
|
function ButtonSpinner(props) {
|
|
40
37
|
const { size = 16 } = props;
|
|
@@ -49,6 +46,7 @@ function ButtonSpinner(props) {
|
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
// src/button.tsx
|
|
49
|
+
import styles3 from "./button.module-G7MNOYWZ.module.css";
|
|
52
50
|
import { Fragment as Fragment2, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
53
51
|
function Button(props) {
|
|
54
52
|
const {
|
|
@@ -120,7 +118,7 @@ var BUTTON_CLASS_NAME = {
|
|
|
120
118
|
};
|
|
121
119
|
|
|
122
120
|
// src/input.tsx
|
|
123
|
-
import styles4 from "./input.module-
|
|
121
|
+
import styles4 from "./input.module-GJV5YJKN.module.css";
|
|
124
122
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
125
123
|
function Input(props) {
|
|
126
124
|
const {
|
|
@@ -157,7 +155,7 @@ var INPUT_CLASS_NAME = {
|
|
|
157
155
|
};
|
|
158
156
|
|
|
159
157
|
// src/label.tsx
|
|
160
|
-
import styles5 from "./label.module-
|
|
158
|
+
import styles5 from "./label.module-4CZ6ETIR.module.css";
|
|
161
159
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
162
160
|
function Label(props) {
|
|
163
161
|
const { className: customClassName = "", ...rest } = props;
|
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
/* Base */
|
|
3
3
|
/* ===================================================== */
|
|
4
4
|
.input {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 40px;
|
|
7
|
-
padding: 0 12px;
|
|
8
|
-
font-family: var(--font-sans, sans-serif);
|
|
9
|
-
font-size: 14px;
|
|
10
|
-
font-weight: 400;
|
|
11
|
-
line-height: 1.5;
|
|
12
|
-
color: var(--color-gray-12, #202020);
|
|
13
|
-
text-decoration: none;
|
|
14
5
|
appearance: none;
|
|
15
|
-
cursor: text;
|
|
16
|
-
outline-width: 0;
|
|
17
|
-
outline-style: solid;
|
|
18
|
-
outline-color: var(--color-primary-9, #e93d82);
|
|
19
|
-
outline-offset: 2px;
|
|
20
6
|
background-color: var(--color-gray-1, #fcfcfc);
|
|
21
7
|
border-color: var(--color-gray-5, #e0e0e0);
|
|
8
|
+
border-radius: 8px;
|
|
22
9
|
border-style: solid;
|
|
23
10
|
border-width: 1px;
|
|
24
|
-
border-radius: 8px;
|
|
25
11
|
box-shadow: 0 1px rgba(0, 0, 0, 0.05);
|
|
12
|
+
color: var(--color-gray-12, #202020);
|
|
13
|
+
cursor: text;
|
|
14
|
+
font-family: var(--font-sans, sans-serif);
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
height: 40px;
|
|
18
|
+
line-height: 1.5;
|
|
19
|
+
outline-color: var(--color-primary, #e93d82);
|
|
20
|
+
outline-offset: 2px;
|
|
21
|
+
outline-style: solid;
|
|
22
|
+
outline-width: 0;
|
|
23
|
+
padding: 0 12px;
|
|
24
|
+
text-decoration: none;
|
|
26
25
|
transition-duration: 150ms;
|
|
27
26
|
transition-property: background-color, border-color, box-shadow, opacity;
|
|
27
|
+
width: 100%;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.input::placeholder {
|
|
31
|
-
color: var(--color-gray
|
|
31
|
+
color: var(--color-gray, #8d8d8d);
|
|
32
32
|
user-select: none;
|
|
33
33
|
}
|
|
34
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nattui/react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "A collection of reusable React components built with TypeScript and CSS Modules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -31,14 +31,10 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsup",
|
|
34
|
-
"check": "biome check",
|
|
35
|
-
"check:fix": "biome check --write",
|
|
36
34
|
"dev": "tsup --watch",
|
|
37
|
-
"prepublishOnly": "pnpm run build"
|
|
38
|
-
"update": "pnpx npm-check-updates --upgrade"
|
|
35
|
+
"prepublishOnly": "pnpm run build"
|
|
39
36
|
},
|
|
40
37
|
"devDependencies": {
|
|
41
|
-
"@biomejs/biome": "catalog:",
|
|
42
38
|
"@types/react": "catalog:",
|
|
43
39
|
"tsup": "^8.5.0",
|
|
44
40
|
"typescript": "catalog:"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* Base */
|
|
2
2
|
.button_background {
|
|
3
|
-
position: absolute;
|
|
4
|
-
top: 0;
|
|
5
|
-
right: 0;
|
|
6
3
|
bottom: 50%;
|
|
4
|
+
filter: none !important;
|
|
7
5
|
left: 0;
|
|
8
|
-
z-index: -1;
|
|
9
6
|
opacity: 0.2;
|
|
10
|
-
|
|
7
|
+
position: absolute;
|
|
8
|
+
right: 0;
|
|
9
|
+
top: 0;
|
|
11
10
|
transition-duration: inherit;
|
|
12
11
|
transition-property: opacity;
|
|
12
|
+
z-index: -1;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/* Rounded */
|
package/dist/{button-spinner.module-T3OGVJS4.module.css → button-spinner.module-4TBETQ4T.module.css}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.button_spinner {
|
|
2
|
-
|
|
3
|
-
width: var(--size);
|
|
2
|
+
animation: spinner 1000ms steps(12, end) infinite;
|
|
4
3
|
height: var(--size);
|
|
4
|
+
position: relative;
|
|
5
5
|
scale: -1 1;
|
|
6
|
-
|
|
6
|
+
width: var(--size);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
@keyframes spinner {
|
|
@@ -13,25 +13,25 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.button_spinner > div {
|
|
16
|
-
position: absolute;
|
|
17
|
-
top: 50%;
|
|
18
|
-
right: 0;
|
|
19
|
-
width: calc(var(--size) / 2);
|
|
20
16
|
height: calc(var(--size) / 12);
|
|
21
17
|
pointer-events: none;
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: 0;
|
|
20
|
+
top: 50%;
|
|
22
21
|
transform-origin: center left;
|
|
23
|
-
translate: 0 -50%;
|
|
24
22
|
transition: all 150ms;
|
|
23
|
+
translate: 0 -50%;
|
|
24
|
+
width: calc(var(--size) / 2);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.button_spinner > div::after {
|
|
28
|
+
background-color: currentColor;
|
|
29
|
+
border-radius: 9999px;
|
|
30
|
+
content: "";
|
|
31
|
+
height: 100%;
|
|
28
32
|
position: absolute;
|
|
29
33
|
right: 0;
|
|
30
34
|
width: 50%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
content: "";
|
|
33
|
-
background-color: currentColor;
|
|
34
|
-
border-radius: 9999px;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.button_spinner > div:nth-child(1) {
|