@nattui/react-components 0.0.24 → 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;
@@ -113,6 +139,11 @@
113
139
  --padding: 0 16px;
114
140
  }
115
141
 
142
+ .button__size_48 {
143
+ --size: 48px;
144
+ --padding: 0 18px;
145
+ }
146
+
116
147
  /* ===================================================== */
117
148
  /* Variant */
118
149
  /* ===================================================== */
@@ -121,10 +152,10 @@
121
152
  color: var(--color-white, #ffffff);
122
153
  background-image: linear-gradient(
123
154
  to bottom,
124
- var(--color-primary-9, #e93d82),
125
- var(--color-primary-10, #e03177)
155
+ var(--color-button-primary-9),
156
+ var(--color-button-primary-10)
126
157
  );
127
- border-color: var(--color-primary-9, #e93d82);
158
+ border-color: var(--color-button-primary-9);
128
159
  box-shadow:
129
160
  inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
130
161
  inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
@@ -134,35 +165,35 @@
134
165
  .button__variant_accent:enabled:active {
135
166
  box-shadow:
136
167
  inset 0 -1px 0 0 rgba(255, 255, 255, 0.25),
137
- inset 0 1px 0 0 var(--color-primary-11, #d31e66) !important;
168
+ inset 0 1px 0 0 var(--color-button-primary-11) !important;
138
169
  }
139
170
 
140
171
  /* Ghost */
141
172
  .button__variant_ghost {
142
- color: var(--color-gray-11, #6f6e77);
173
+ color: var(--color-button-gray-11);
143
174
  background-color: transparent;
144
175
  }
145
176
 
146
177
  .button__variant_ghost:enabled[aria-pressed="true"],
147
178
  .button__variant_ghost:enabled:active {
148
- color: var(--color-gray-12, #1a1523);
149
- background-color: var(--color-gray-5, #e9e8ea) !important;
179
+ color: var(--color-button-gray-12);
180
+ background-color: var(--color-button-gray-5) !important;
150
181
  }
151
182
 
152
183
  .button__variant_ghost:enabled:hover {
153
- color: var(--color-gray-12, #1a1523);
154
- 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);
155
186
  }
156
187
 
157
188
  /* Primary */
158
189
  .button__variant_primary {
159
- color: var(--color-gray-1, #fdfcfd);
190
+ color: var(--color-button-gray-1);
160
191
  background-image: linear-gradient(
161
192
  to bottom,
162
- color-mix(in oklab, var(--color-gray-12, #1a1523) 90%, transparent),
163
- var(--color-gray-12, #1a1523)
193
+ color-mix(in oklab, var(--color-button-gray-12) 90%, transparent),
194
+ var(--color-button-gray-12)
164
195
  );
165
- border-color: var(--color-gray-12, #1a1523);
196
+ border-color: var(--color-button-gray-12);
166
197
  box-shadow:
167
198
  inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
168
199
  inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
@@ -172,34 +203,30 @@
172
203
  .button__variant_primary:enabled:active {
173
204
  box-shadow:
174
205
  inset 0 -1px 0 0 rgba(255, 255, 255, 0.25),
175
- inset 0 1px 0 0 var(--color-gray-12, #1a1523) !important;
206
+ inset 0 1px 0 0 var(--color-button-gray-12) !important;
176
207
  }
177
208
 
178
209
  /* Secondary */
179
210
  .button__variant_secondary {
180
- color: var(--color-gray-11, #6f6e77);
181
- background-image: linear-gradient(
182
- to bottom,
183
- var(--color-gray-1, #fdfcfd),
184
- var(--color-gray-3, #f4f2f4)
185
- );
186
- 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);
187
214
  box-shadow:
188
- inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
215
+ inset 0 1px 0 0 rgba(255, 255, 255, 1),
189
216
  inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
190
217
  }
191
218
 
192
219
  .button__variant_secondary:enabled[aria-pressed="true"],
193
220
  .button__variant_secondary:enabled:active,
194
221
  .button__variant_secondary:enabled:hover {
195
- color: var(--color-gray-12, #1a1523);
196
- border-color: var(--color-gray-8, #c8c7cb);
222
+ color: var(--color-button-gray-12);
223
+ border-color: var(--color-button-gray-8);
197
224
  }
198
225
 
199
226
  .button__variant_secondary:enabled[aria-pressed="true"],
200
227
  .button__variant_secondary:enabled:active {
201
228
  box-shadow:
202
- inset 0 -1px 0 0 var(--color-gray-1, #fdfcfd),
229
+ inset 0 -1px 0 0 rgba(255, 255, 255, 1),
203
230
  inset 0 1px 0 0 rgba(0, 0, 0, 0.1) !important;
204
231
  }
205
232
 
@@ -233,7 +260,7 @@
233
260
 
234
261
  .button__variant_ghost:enabled:hover,
235
262
  .button__variant_secondary:enabled:hover {
236
- color: var(--color-gray-12, #1a1523);
263
+ color: var(--color-button-gray-12);
237
264
  }
238
265
 
239
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;
@@ -19,7 +20,7 @@ interface ButtonPropsInternal extends Omit<ComponentProps<"button">, "aria-press
19
20
  isFullWidth?: boolean;
20
21
  isLoading?: boolean;
21
22
  isRounded?: boolean;
22
- size?: 32 | 36 | 40 | 44;
23
+ size?: 32 | 36 | 40 | 44 | 48;
23
24
  variant?: "accent" | "ghost" | "primary" | "secondary";
24
25
  }
25
26
  type ButtonUnionProps = ButtonIconProps | ButtonProps;
@@ -36,6 +37,7 @@ declare const BUTTON_CLASS_NAME: {
36
37
  readonly 36: string;
37
38
  readonly 40: string;
38
39
  readonly 44: string;
40
+ readonly 48: string;
39
41
  };
40
42
  readonly VARIANT: {
41
43
  readonly ACCENT: string;
@@ -75,4 +77,11 @@ declare const LABEL_CLASS_NAME: {
75
77
  readonly BASE: string;
76
78
  };
77
79
 
78
- 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-JEUFP4EH.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
 
@@ -62,7 +64,7 @@ function Button(props) {
62
64
  isFullWidth = false,
63
65
  isLoading = false,
64
66
  isRounded = false,
65
- size = 36,
67
+ size = 40,
66
68
  type = "button",
67
69
  variant = "primary",
68
70
  ...rest
@@ -111,7 +113,8 @@ var BUTTON_CLASS_NAME = {
111
113
  32: styles3.button__size_32,
112
114
  36: styles3.button__size_36,
113
115
  40: styles3.button__size_40,
114
- 44: styles3.button__size_44
116
+ 44: styles3.button__size_44,
117
+ 48: styles3.button__size_48
115
118
  },
116
119
  VARIANT: {
117
120
  ACCENT: styles3.button__variant_accent,
@@ -190,11 +193,34 @@ function Label(props) {
190
193
  var LABEL_CLASS_NAME = {
191
194
  BASE: styles5.label
192
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
+ };
193
217
  export {
194
218
  BUTTON_CLASS_NAME,
195
219
  Button,
196
220
  INPUT_CLASS_NAME,
197
221
  Input,
198
222
  LABEL_CLASS_NAME,
199
- Label
223
+ Label,
224
+ SPACER_CLASS_NAME,
225
+ Spacer
200
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.24",
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",