@nattui/react-components 0.0.25 → 0.0.26

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.
@@ -17,6 +17,13 @@
17
17
  border-radius: 7px;
18
18
  }
19
19
 
20
+ @supports (corner-shape: squircle) {
21
+ .button_background__rounded_base {
22
+ border-radius: 9999px;
23
+ corner-shape: squircle;
24
+ }
25
+ }
26
+
20
27
  .button_background__rounded_full {
21
28
  border-radius: 9999px;
22
29
  }
@@ -30,3 +37,11 @@
30
37
  var(--color-white-a5, rgba(0, 0, 0, 0.3))
31
38
  );
32
39
  }
40
+
41
+ .button_background__variant_secondary {
42
+ background: linear-gradient(
43
+ to bottom,
44
+ var(--color-black-a2, rgba(0, 0, 0, 0.4)),
45
+ var(--color-black-a3, rgba(0, 0, 0, 0.3))
46
+ );
47
+ }
@@ -2,6 +2,32 @@
2
2
  /* Base */
3
3
  /* ===================================================== */
4
4
  .button {
5
+ --color-button-gray-1: var(--color-gray-1);
6
+ --color-button-gray-2: var(--color-gray-2);
7
+ --color-button-gray-3: var(--color-gray-3);
8
+ --color-button-gray-4: var(--color-gray-4);
9
+ --color-button-gray-5: var(--color-gray-5);
10
+ --color-button-gray-6: var(--color-gray-6);
11
+ --color-button-gray-7: var(--color-gray-7);
12
+ --color-button-gray-8: var(--color-gray-8);
13
+ --color-button-gray-9: var(--color-gray-9);
14
+ --color-button-gray-10: var(--color-gray-10);
15
+ --color-button-gray-11: var(--color-gray-11);
16
+ --color-button-gray-12: var(--color-gray-12);
17
+
18
+ --color-button-primary-1: var(--color-primary-light-1);
19
+ --color-button-primary-2: var(--color-primary-light-2);
20
+ --color-button-primary-3: var(--color-primary-light-3);
21
+ --color-button-primary-4: var(--color-primary-light-4);
22
+ --color-button-primary-5: var(--color-primary-light-5);
23
+ --color-button-primary-6: var(--color-primary-light-6);
24
+ --color-button-primary-7: var(--color-primary-light-7);
25
+ --color-button-primary-8: var(--color-primary-light-8);
26
+ --color-button-primary-9: var(--color-primary-light-9);
27
+ --color-button-primary-10: var(--color-primary-light-10);
28
+ --color-button-primary-11: var(--color-primary-light-11);
29
+ --color-button-primary-12: var(--color-primary-light-12);
30
+
5
31
  position: relative;
6
32
  display: flex;
7
33
  flex-shrink: 0;
@@ -19,7 +45,7 @@
19
45
  user-select: none;
20
46
  outline-width: 0;
21
47
  outline-style: solid;
22
- outline-color: var(--color-primary-9, #e93d82);
48
+ outline-color: var(--color-button-primary-9);
23
49
  outline-offset: 2px;
24
50
  border-color: transparent;
25
51
  border-style: solid;
@@ -126,10 +152,10 @@
126
152
  color: var(--color-white, #ffffff);
127
153
  background-image: linear-gradient(
128
154
  to bottom,
129
- var(--color-primary-9, #e93d82),
130
- var(--color-primary-10, #e03177)
155
+ var(--color-button-primary-9),
156
+ var(--color-button-primary-10)
131
157
  );
132
- border-color: var(--color-primary-9, #e93d82);
158
+ border-color: var(--color-button-primary-9);
133
159
  box-shadow:
134
160
  inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
135
161
  inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
@@ -139,35 +165,35 @@
139
165
  .button__variant_accent:enabled:active {
140
166
  box-shadow:
141
167
  inset 0 -1px 0 0 rgba(255, 255, 255, 0.25),
142
- inset 0 1px 0 0 var(--color-primary-11, #d31e66) !important;
168
+ inset 0 1px 0 0 var(--color-button-primary-11) !important;
143
169
  }
144
170
 
145
171
  /* Ghost */
146
172
  .button__variant_ghost {
147
- color: var(--color-gray-11, #6f6e77);
173
+ color: var(--color-button-gray-11);
148
174
  background-color: transparent;
149
175
  }
150
176
 
151
177
  .button__variant_ghost:enabled[aria-pressed="true"],
152
178
  .button__variant_ghost:enabled:active {
153
- color: var(--color-gray-12, #1a1523);
154
- background-color: var(--color-gray-5, #e9e8ea) !important;
179
+ color: var(--color-button-gray-12);
180
+ background-color: var(--color-button-gray-5) !important;
155
181
  }
156
182
 
157
183
  .button__variant_ghost:enabled:hover {
158
- color: var(--color-gray-12, #1a1523);
159
- background-color: color-mix(in oklab, var(--color-gray-5, #e9e8ea) 75%, transparent);
184
+ color: var(--color-button-gray-12);
185
+ background-color: color-mix(in oklab, var(--color-button-gray-5) 75%, transparent);
160
186
  }
161
187
 
162
188
  /* Primary */
163
189
  .button__variant_primary {
164
- color: var(--color-gray-1, #fdfcfd);
190
+ color: var(--color-button-gray-1);
165
191
  background-image: linear-gradient(
166
192
  to bottom,
167
- color-mix(in oklab, var(--color-gray-12, #1a1523) 90%, transparent),
168
- var(--color-gray-12, #1a1523)
193
+ color-mix(in oklab, var(--color-button-gray-12) 90%, transparent),
194
+ var(--color-button-gray-12)
169
195
  );
170
- border-color: var(--color-gray-12, #1a1523);
196
+ border-color: var(--color-button-gray-12);
171
197
  box-shadow:
172
198
  inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
173
199
  inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
@@ -177,34 +203,30 @@
177
203
  .button__variant_primary:enabled:active {
178
204
  box-shadow:
179
205
  inset 0 -1px 0 0 rgba(255, 255, 255, 0.25),
180
- inset 0 1px 0 0 var(--color-gray-12, #1a1523) !important;
206
+ inset 0 1px 0 0 var(--color-button-gray-12) !important;
181
207
  }
182
208
 
183
209
  /* Secondary */
184
210
  .button__variant_secondary {
185
- color: var(--color-gray-11, #6f6e77);
186
- background-image: linear-gradient(
187
- to bottom,
188
- var(--color-gray-1, #fdfcfd),
189
- var(--color-gray-3, #f4f2f4)
190
- );
191
- border-color: var(--color-gray-6, #e4e2e4);
211
+ color: var(--color-button-gray-11);
212
+ background-color: var(--color-button-gray-2);
213
+ border-color: var(--color-button-gray-6);
192
214
  box-shadow:
193
- inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
215
+ inset 0 1px 0 0 rgba(255, 255, 255, 1),
194
216
  inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
195
217
  }
196
218
 
197
219
  .button__variant_secondary:enabled[aria-pressed="true"],
198
220
  .button__variant_secondary:enabled:active,
199
221
  .button__variant_secondary:enabled:hover {
200
- color: var(--color-gray-12, #1a1523);
201
- border-color: var(--color-gray-8, #c8c7cb);
222
+ color: var(--color-button-gray-12);
223
+ border-color: var(--color-button-gray-8);
202
224
  }
203
225
 
204
226
  .button__variant_secondary:enabled[aria-pressed="true"],
205
227
  .button__variant_secondary:enabled:active {
206
228
  box-shadow:
207
- inset 0 -1px 0 0 var(--color-gray-1, #fdfcfd),
229
+ inset 0 -1px 0 0 rgba(255, 255, 255, 1),
208
230
  inset 0 1px 0 0 rgba(0, 0, 0, 0.1) !important;
209
231
  }
210
232
 
@@ -238,7 +260,7 @@
238
260
 
239
261
  .button__variant_ghost:enabled:hover,
240
262
  .button__variant_secondary:enabled:hover {
241
- color: var(--color-gray-12, #1a1523);
263
+ color: var(--color-button-gray-12);
242
264
  }
243
265
 
244
266
  /* ===================================================== */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ComponentProps, ReactNode, JSX } from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
4
  interface ButtonIconProps extends ButtonPropsInternal {
4
5
  children?: ReactNode;
@@ -76,4 +77,11 @@ declare const LABEL_CLASS_NAME: {
76
77
  readonly BASE: string;
77
78
  };
78
79
 
79
- export { BUTTON_CLASS_NAME, Button, type ButtonIconProps, type ButtonProps, INPUT_CLASS_NAME, Input, type InputProps, LABEL_CLASS_NAME, Label, type LabelProps };
80
+ interface SpacerProps extends ComponentProps<"div"> {
81
+ }
82
+ declare function Spacer(props: SpacerProps): react_jsx_runtime.JSX.Element;
83
+ declare const SPACER_CLASS_NAME: {
84
+ readonly BASE: string;
85
+ };
86
+
87
+ export { BUTTON_CLASS_NAME, Button, type ButtonIconProps, type ButtonProps, INPUT_CLASS_NAME, Input, type InputProps, LABEL_CLASS_NAME, Label, type LabelProps, SPACER_CLASS_NAME, Spacer, type SpacerProps };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  // src/button.tsx
2
- import styles3 from "./button.module-Y4L4TGW6.module.css";
2
+ import styles3 from "./button.module-BGP72ND4.module.css";
3
3
 
4
4
  // src/button-background.tsx
5
- import styles from "./button-background.module-EWE3JTY4.module.css";
5
+ import styles from "./button-background.module-IXCWW4XS.module.css";
6
6
  import { Fragment, jsx } from "react/jsx-runtime";
7
7
  function ButtonBackground(props) {
8
8
  const { isRounded = false, variant = "primary" } = props;
@@ -11,8 +11,9 @@ function ButtonBackground(props) {
11
11
  ${isRounded ? BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.FULL : BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.BASE}
12
12
  ${variant === "accent" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.ACCENT : ""}
13
13
  ${variant === "primary" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.PRIMARY : ""}
14
+ ${variant === "secondary" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.SECONDARY : ""}
14
15
  `.replaceAll(/\s+/g, " ").trim();
15
- if (!(variant === "accent" || variant === "primary")) return /* @__PURE__ */ jsx(Fragment, {});
16
+ if (!(variant === "accent" || variant === "primary" || variant === "secondary")) return /* @__PURE__ */ jsx(Fragment, {});
16
17
  return /* @__PURE__ */ jsx(
17
18
  "div",
18
19
  {
@@ -29,7 +30,8 @@ var BUTTON_BACKGROUND_CLASS_NAME = {
29
30
  },
30
31
  VARIANT: {
31
32
  ACCENT: styles.button_background__variant_accent,
32
- PRIMARY: styles.button_background__variant_primary
33
+ PRIMARY: styles.button_background__variant_primary,
34
+ SECONDARY: styles.button_background__variant_secondary
33
35
  }
34
36
  };
35
37
 
@@ -191,11 +193,34 @@ function Label(props) {
191
193
  var LABEL_CLASS_NAME = {
192
194
  BASE: styles5.label
193
195
  };
196
+
197
+ // src/spacer.tsx
198
+ import styles6 from "./spacer.module-ZYYYWYEB.module.css";
199
+ import { jsx as jsx6 } from "react/jsx-runtime";
200
+ function Spacer(props) {
201
+ const { className: customClassName = "", ...rest } = props;
202
+ const combinedClassName = `
203
+ ${SPACER_CLASS_NAME.BASE}
204
+ ${customClassName}
205
+ `.replaceAll(/\s+/g, " ").trim();
206
+ return /* @__PURE__ */ jsx6(
207
+ "div",
208
+ {
209
+ className: `${styles6.spacer} ${combinedClassName}`.trim(),
210
+ ...rest
211
+ }
212
+ );
213
+ }
214
+ var SPACER_CLASS_NAME = {
215
+ BASE: styles6.spacer
216
+ };
194
217
  export {
195
218
  BUTTON_CLASS_NAME,
196
219
  Button,
197
220
  INPUT_CLASS_NAME,
198
221
  Input,
199
222
  LABEL_CLASS_NAME,
200
- Label
223
+ Label,
224
+ SPACER_CLASS_NAME,
225
+ Spacer
201
226
  };
@@ -0,0 +1,3 @@
1
+ .spacer {
2
+ flex-shrink: 0;
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nattui/react-components",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "A collection of reusable React components built with TypeScript and CSS Modules",
5
5
  "keywords": [
6
6
  "components",