@nattui/react-components 0.0.29 → 0.0.31

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,257 @@
1
+ /* ===================================================== */
2
+ /* Base */
3
+ /* ===================================================== */
4
+ .button {
5
+ display: flex;
6
+ flex-shrink: 0;
7
+ column-gap: 8px;
8
+ align-items: safe center;
9
+ justify-content: safe center;
10
+ height: var(--size);
11
+ overflow: hidden;
12
+ font-family: var(--font-sans, sans-serif);
13
+ font-size: 14px;
14
+ font-weight: 500;
15
+ line-height: 1.5;
16
+ cursor: pointer;
17
+ user-select: none;
18
+ outline-width: 2px;
19
+ outline-style: hidden;
20
+ outline-color: var(--color-primary-9);
21
+ outline-offset: 2px;
22
+ transition-duration: 150ms;
23
+ transition-property: background-color, box-shadow, opacity, translate;
24
+ }
25
+
26
+ /* When pressed, move the button down */
27
+ .button:active:enabled,
28
+ .button[aria-pressed="true"]:enabled {
29
+ translate: 0 1px;
30
+ }
31
+
32
+ /* When disabled, disable cursor and reduce opacity */
33
+ .button:disabled {
34
+ cursor: not-allowed;
35
+ opacity: 0.5;
36
+ }
37
+
38
+ /* When keyboard focused, show outline */
39
+ .button:focus-visible {
40
+ outline-style: solid;
41
+ }
42
+
43
+ /* ===================================================== */
44
+ /* Icon only */
45
+ /* ===================================================== */
46
+ .button__icon_only {
47
+ width: var(--size) !important;
48
+ padding: 0 !important;
49
+ }
50
+
51
+ /* ===================================================== */
52
+ /* Rounded */
53
+ /* ===================================================== */
54
+ .button__rounded_base {
55
+ border-radius: 8px;
56
+ }
57
+
58
+ @supports (corner-shape: squircle) {
59
+ .button__rounded_base {
60
+ border-radius: 9999px;
61
+ corner-shape: squircle;
62
+ }
63
+ }
64
+
65
+ .button__rounded_full {
66
+ border-radius: 9999px;
67
+ }
68
+
69
+ /* ===================================================== */
70
+ /* Size */
71
+ /* ===================================================== */
72
+ .button__size_32 {
73
+ --size: 32px;
74
+ padding: 0 10px;
75
+ }
76
+
77
+ .button__size_36 {
78
+ --size: 36px;
79
+ padding: 0 12px;
80
+ }
81
+
82
+ .button__size_40 {
83
+ --size: 40px;
84
+ padding: 0 14px;
85
+ }
86
+
87
+ .button__size_44 {
88
+ --size: 44px;
89
+ padding: 0 16px;
90
+ }
91
+
92
+ .button__size_48 {
93
+ --size: 48px;
94
+ padding: 0 18px;
95
+ }
96
+
97
+ /* ===================================================== */
98
+ /* Variant */
99
+ /* ===================================================== */
100
+ /* Accent */
101
+ .button__variant_accent {
102
+ color: var(--color-white);
103
+ background-color: var(--color-primary-9);
104
+ background-image: linear-gradient(
105
+ to bottom,
106
+ color-mix(in oklab, transparent 100%, #ffffff 2.5%) 50%,
107
+ color-mix(in oklab, transparent 100%, #ffffff 0%) 50%
108
+ );
109
+ box-shadow:
110
+ 0 0 0 1px var(--color-primary-9) inset,
111
+ 0 1px 0 1px rgba(255, 255, 255, 0.25) inset,
112
+ 0 -1px 0 1px rgba(0, 0, 0, 0.1) inset;
113
+ }
114
+
115
+ .button__variant_accent:active:enabled,
116
+ .button__variant_accent[aria-pressed="true"]:enabled {
117
+ box-shadow:
118
+ 0 0 0 1px var(--color-primary-9) inset,
119
+ 0 -1px 0 1px rgba(255, 255, 255, 0.25) inset,
120
+ 0 1px 0 1px rgba(0, 0, 0, 0.1) inset;
121
+ }
122
+
123
+ .button__variant_accent:active:enabled,
124
+ .button__variant_accent:hover:enabled,
125
+ .button__variant_accent[aria-pressed="true"]:enabled {
126
+ background-color: color-mix(in oklab, var(--color-primary-9) 100%, #ffffff 10%);
127
+ }
128
+
129
+ :global(.dark) .button__variant_accent {
130
+ background-image: linear-gradient(
131
+ to bottom,
132
+ color-mix(in oklab, transparent 100%, #000000 0%) 50%,
133
+ color-mix(in oklab, transparent 100%, #000000 2.5%) 50%
134
+ );
135
+ }
136
+
137
+ /* Ghost */
138
+ .button__variant_ghost {
139
+ color: var(--color-black);
140
+ background-color: transparent;
141
+ }
142
+
143
+ .button__variant_ghost:active:enabled,
144
+ .button__variant_ghost:hover:enabled,
145
+ .button__variant_ghost[aria-pressed="true"]:enabled {
146
+ background-color: var(--color-gray-4);
147
+ }
148
+
149
+ :global(.dark) .button__variant_ghost {
150
+ color: var(--color-white);
151
+ }
152
+
153
+ /* Primary */
154
+ .button__variant_primary {
155
+ color: var(--color-white);
156
+ background-color: var(--color-gray-dark-2);
157
+ background-image: linear-gradient(
158
+ to bottom,
159
+ color-mix(in oklab, transparent 100%, #ffffff 2.5%) 50%,
160
+ color-mix(in oklab, transparent 100%, #ffffff 0%) 50%
161
+ );
162
+ box-shadow:
163
+ 0 0 0 1px var(--color-gray-dark-2) inset,
164
+ 0 1px 0 1px rgba(255, 255, 255, 0.25) inset,
165
+ 0 -1px 0 1px rgba(0, 0, 0, 0.1) inset;
166
+ }
167
+
168
+ .button__variant_primary:active:enabled,
169
+ .button__variant_primary[aria-pressed="true"]:enabled {
170
+ box-shadow:
171
+ 0 0 0 1px var(--color-gray-dark-2) inset,
172
+ 0 -1px 0 1px rgba(255, 255, 255, 0.25) inset,
173
+ 0 1px 0 1px rgba(0, 0, 0, 0.1) inset;
174
+ }
175
+
176
+ .button__variant_primary:active:enabled,
177
+ .button__variant_primary:hover:enabled,
178
+ .button__variant_primary[aria-pressed="true"]:enabled {
179
+ background-color: color-mix(in oklab, var(--color-gray-dark-2) 100%, #ffffff 10%);
180
+ }
181
+
182
+ :global(.dark) .button__variant_primary {
183
+ color: var(--color-black);
184
+ background-color: var(--color-gray-light-1);
185
+ background-image: linear-gradient(
186
+ to bottom,
187
+ color-mix(in oklab, transparent 100%, #000000 0%) 50%,
188
+ color-mix(in oklab, transparent 100%, #000000 2.5%) 50%
189
+ );
190
+ box-shadow:
191
+ 0 0 0 1px var(--color-gray-light-1) inset,
192
+ 0 1px 0 1px rgba(255, 255, 255, 0.25) inset,
193
+ 0 -1px 0 1px rgba(0, 0, 0, 0.1) inset;
194
+ }
195
+
196
+ :global(.dark) .button__variant_primary:active:enabled,
197
+ :global(.dark) .button__variant_primary[aria-pressed="true"]:enabled {
198
+ box-shadow:
199
+ 0 0 0 1px var(--color-gray-light-2) inset,
200
+ 0 -1px 0 1px rgba(255, 255, 255, 0.25) inset,
201
+ 0 1px 0 1px rgba(0, 0, 0, 0.1) inset;
202
+ }
203
+
204
+ :global(.dark) .button__variant_primary:active:enabled,
205
+ :global(.dark) .button__variant_primary:hover:enabled,
206
+ :global(.dark) .button__variant_primary[aria-pressed="true"]:enabled {
207
+ background-color: color-mix(in oklab, var(--color-gray-light-2) 100%, #000000 10%);
208
+ }
209
+
210
+ /* Secondary */
211
+ .button__variant_secondary {
212
+ color: var(--color-black);
213
+ background-color: var(--color-gray-1);
214
+ background-image: linear-gradient(
215
+ to bottom,
216
+ color-mix(in oklab, transparent 100%, #000000 0%) 50%,
217
+ color-mix(in oklab, transparent 100%, #000000 2.5%) 50%
218
+ );
219
+ box-shadow:
220
+ 0 -1px 0 0px rgba(0, 0, 0, 7.5%) inset, /* Bottom */
221
+ 0 0 0 1px var(--color-gray-4) inset; /* Border */
222
+ }
223
+
224
+ .button__variant_secondary:active:enabled,
225
+ .button__variant_secondary[aria-pressed="true"]:enabled {
226
+ box-shadow: 0 0 0 1px var(--color-gray-6) inset;
227
+ }
228
+
229
+ .button__variant_secondary:active:enabled,
230
+ .button__variant_secondary:hover:enabled,
231
+ .button__variant_secondary[aria-pressed="true"]:enabled {
232
+ background-color: var(--color-gray-3);
233
+ }
234
+
235
+ :global(.dark) .button__variant_secondary {
236
+ color: var(--color-white);
237
+ background-color: var(--color-gray-2);
238
+ background-image: linear-gradient(
239
+ to bottom,
240
+ color-mix(in oklab, transparent 100%, #ffffff 2.5%) 50%,
241
+ color-mix(in oklab, transparent 100%, #ffffff 0%) 50%
242
+ );
243
+ box-shadow:
244
+ 0 1px 0 0px rgba(255, 255, 255, 7.5%) inset, /* Top */
245
+ 0 0 0 1px var(--color-gray-4) inset; /* Border */
246
+ }
247
+
248
+ /* ===================================================== */
249
+ /* Width */
250
+ /* ===================================================== */
251
+ .button__width_base {
252
+ width: max-content; /* Fit the button content */
253
+ }
254
+
255
+ .button__width_full {
256
+ width: 100%;
257
+ }
package/dist/index.d.ts CHANGED
@@ -58,7 +58,7 @@ interface InputProps extends Omit<ComponentProps<"input">, "aria-pressed" | "dis
58
58
  isReadOnly?: boolean;
59
59
  isRequired?: boolean;
60
60
  isValid?: boolean;
61
- size?: 32 | 36 | 40 | 44;
61
+ size?: 32 | 36 | 40 | 44 | 48;
62
62
  }
63
63
  declare function Input(props: InputProps): JSX.Element;
64
64
  declare const INPUT_CLASS_NAME: {
@@ -69,6 +69,7 @@ declare const INPUT_CLASS_NAME: {
69
69
  readonly 36: string;
70
70
  readonly 40: string;
71
71
  readonly 44: string;
72
+ readonly 48: string;
72
73
  };
73
74
  };
74
75
 
package/dist/index.js CHANGED
@@ -1,57 +1,23 @@
1
1
  // src/button.tsx
2
- import styles3 from "./button.module-BGP72ND4.module.css";
3
-
4
- // src/button-background.tsx
5
- import styles from "./button-background.module-IXCWW4XS.module.css";
6
- import { Fragment, jsx } from "react/jsx-runtime";
7
- function ButtonBackground(props) {
8
- const { isRounded = false, variant = "primary" } = props;
9
- const combinedBackgroundStyles = `
10
- ${BUTTON_BACKGROUND_CLASS_NAME.BASE}
11
- ${isRounded ? BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.FULL : BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.BASE}
12
- ${variant === "accent" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.ACCENT : ""}
13
- ${variant === "primary" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.PRIMARY : ""}
14
- ${variant === "secondary" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.SECONDARY : ""}
15
- `.replaceAll(/\s+/g, " ").trim();
16
- if (!(variant === "accent" || variant === "primary" || variant === "secondary")) return /* @__PURE__ */ jsx(Fragment, {});
17
- return /* @__PURE__ */ jsx(
18
- "div",
19
- {
20
- className: combinedBackgroundStyles,
21
- "data-element": "button-background"
22
- }
23
- );
24
- }
25
- var BUTTON_BACKGROUND_CLASS_NAME = {
26
- BASE: styles.button_background,
27
- ROUNDED: {
28
- BASE: styles.button_background__rounded_base,
29
- FULL: styles.button_background__rounded_full
30
- },
31
- VARIANT: {
32
- ACCENT: styles.button_background__variant_accent,
33
- PRIMARY: styles.button_background__variant_primary,
34
- SECONDARY: styles.button_background__variant_secondary
35
- }
36
- };
2
+ import styles2 from "./button.module-OLRLDRY6.module.css";
37
3
 
38
4
  // src/button-spinner.tsx
39
- import styles2 from "./button-spinner.module-T3OGVJS4.module.css";
40
- import { jsx as jsx2 } from "react/jsx-runtime";
5
+ import styles from "./button-spinner.module-T3OGVJS4.module.css";
6
+ import { jsx } from "react/jsx-runtime";
41
7
  function ButtonSpinner(props) {
42
8
  const { size = 16 } = props;
43
- return /* @__PURE__ */ jsx2(
9
+ return /* @__PURE__ */ jsx(
44
10
  "div",
45
11
  {
46
- className: styles2.button_spinner,
12
+ className: styles.button_spinner,
47
13
  style: { "--size": `${size}px` },
48
- children: Array.from({ length: 12 }).map((_, index) => /* @__PURE__ */ jsx2("div", {}, index))
14
+ children: Array.from({ length: 12 }).map((_, index) => /* @__PURE__ */ jsx("div", {}, index))
49
15
  }
50
16
  );
51
17
  }
52
18
 
53
19
  // src/button.tsx
54
- import { Fragment as Fragment2, jsx as jsx3, jsxs } from "react/jsx-runtime";
20
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
55
21
  function Button(props) {
56
22
  const {
57
23
  children = "",
@@ -87,50 +53,43 @@ function Button(props) {
87
53
  type,
88
54
  ...rest,
89
55
  children: [
90
- /* @__PURE__ */ jsx3(
91
- ButtonBackground,
92
- {
93
- isRounded,
94
- variant
95
- }
96
- ),
97
- isLoading && /* @__PURE__ */ jsx3(ButtonSpinner, {}),
56
+ isLoading && /* @__PURE__ */ jsx2(ButtonSpinner, {}),
98
57
  !isLoading && iconStart,
99
- iconOnly ? isLoading ? /* @__PURE__ */ jsx3(Fragment2, {}) : children : /* @__PURE__ */ jsx3("span", { children }),
58
+ iconOnly ? isLoading ? /* @__PURE__ */ jsx2(Fragment, {}) : children : /* @__PURE__ */ jsx2("span", { children }),
100
59
  !isLoading && iconEnd
101
60
  ]
102
61
  }
103
62
  );
104
63
  }
105
64
  var BUTTON_CLASS_NAME = {
106
- BASE: styles3.button,
107
- ICON_ONLY: styles3.button__icon_only,
65
+ BASE: styles2.button,
66
+ ICON_ONLY: styles2.button__icon_only,
108
67
  ROUNDED: {
109
- BASE: styles3.button__rounded_base,
110
- FULL: styles3.button__rounded_full
68
+ BASE: styles2.button__rounded_base,
69
+ FULL: styles2.button__rounded_full
111
70
  },
112
71
  SIZE: {
113
- 32: styles3.button__size_32,
114
- 36: styles3.button__size_36,
115
- 40: styles3.button__size_40,
116
- 44: styles3.button__size_44,
117
- 48: styles3.button__size_48
72
+ 32: styles2.button__size_32,
73
+ 36: styles2.button__size_36,
74
+ 40: styles2.button__size_40,
75
+ 44: styles2.button__size_44,
76
+ 48: styles2.button__size_48
118
77
  },
119
78
  VARIANT: {
120
- ACCENT: styles3.button__variant_accent,
121
- GHOST: styles3.button__variant_ghost,
122
- PRIMARY: styles3.button__variant_primary,
123
- SECONDARY: styles3.button__variant_secondary
79
+ ACCENT: styles2.button__variant_accent,
80
+ GHOST: styles2.button__variant_ghost,
81
+ PRIMARY: styles2.button__variant_primary,
82
+ SECONDARY: styles2.button__variant_secondary
124
83
  },
125
84
  WIDTH: {
126
- BASE: styles3.button__width_base,
127
- FULL: styles3.button__width_full
85
+ BASE: styles2.button__width_base,
86
+ FULL: styles2.button__width_full
128
87
  }
129
88
  };
130
89
 
131
90
  // src/input.tsx
132
- import styles4 from "./input.module-IR2FFKFD.module.css";
133
- import { jsx as jsx4 } from "react/jsx-runtime";
91
+ import styles3 from "./input.module-RYUICXYE.module.css";
92
+ import { jsx as jsx3 } from "react/jsx-runtime";
134
93
  function Input(props) {
135
94
  const {
136
95
  className: customClassName = "",
@@ -151,7 +110,7 @@ function Input(props) {
151
110
  ${isPassword ? INPUT_CLASS_NAME.PASSWORD : ""}
152
111
  ${customClassName}
153
112
  `.replaceAll(/\s+/g, " ").trim();
154
- return /* @__PURE__ */ jsx4(
113
+ return /* @__PURE__ */ jsx3(
155
114
  "input",
156
115
  {
157
116
  "aria-pressed": isActive,
@@ -167,26 +126,27 @@ function Input(props) {
167
126
  );
168
127
  }
169
128
  var INPUT_CLASS_NAME = {
170
- BASE: styles4.input,
171
- PASSWORD: styles4.input__password,
129
+ BASE: styles3.input,
130
+ PASSWORD: styles3.input__password,
172
131
  SIZE: {
173
- 32: styles4.input__size_32,
174
- 36: styles4.input__size_36,
175
- 40: styles4.input__size_40,
176
- 44: styles4.input__size_44
132
+ 32: styles3.input__size_32,
133
+ 36: styles3.input__size_36,
134
+ 40: styles3.input__size_40,
135
+ 44: styles3.input__size_44,
136
+ 48: styles3.input__size_48
177
137
  }
178
138
  };
179
139
 
180
140
  // src/label.tsx
181
- import styles5 from "./label.module-HUBUIUFV.module.css";
182
- import { jsx as jsx5 } from "react/jsx-runtime";
141
+ import styles4 from "./label.module-HUBUIUFV.module.css";
142
+ import { jsx as jsx4 } from "react/jsx-runtime";
183
143
  function Label(props) {
184
144
  const { className: customClassName = "", ...rest } = props;
185
145
  const combinedClassName = `
186
146
  ${LABEL_CLASS_NAME.BASE}
187
147
  ${customClassName}
188
148
  `.replaceAll(/\s+/g, " ").trim();
189
- return /* @__PURE__ */ jsx5(
149
+ return /* @__PURE__ */ jsx4(
190
150
  "label",
191
151
  {
192
152
  className: combinedClassName,
@@ -195,28 +155,28 @@ function Label(props) {
195
155
  );
196
156
  }
197
157
  var LABEL_CLASS_NAME = {
198
- BASE: styles5.label
158
+ BASE: styles4.label
199
159
  };
200
160
 
201
161
  // src/spacer.tsx
202
- import styles6 from "./spacer.module-ZYYYWYEB.module.css";
203
- import { jsx as jsx6 } from "react/jsx-runtime";
162
+ import styles5 from "./spacer.module-ZYYYWYEB.module.css";
163
+ import { jsx as jsx5 } from "react/jsx-runtime";
204
164
  function Spacer(props) {
205
165
  const { className: customClassName = "", ...rest } = props;
206
166
  const combinedClassName = `
207
167
  ${SPACER_CLASS_NAME.BASE}
208
168
  ${customClassName}
209
169
  `.replaceAll(/\s+/g, " ").trim();
210
- return /* @__PURE__ */ jsx6(
170
+ return /* @__PURE__ */ jsx5(
211
171
  "div",
212
172
  {
213
- className: `${styles6.spacer} ${combinedClassName}`.trim(),
173
+ className: `${styles5.spacer} ${combinedClassName}`.trim(),
214
174
  ...rest
215
175
  }
216
176
  );
217
177
  }
218
178
  var SPACER_CLASS_NAME = {
219
- BASE: styles6.spacer
179
+ BASE: styles5.spacer
220
180
  };
221
181
  export {
222
182
  BUTTON_CLASS_NAME,
@@ -2,9 +2,9 @@
2
2
  /* Base */
3
3
  /* ===================================================== */
4
4
  .input {
5
- flex-shrink: 0;
6
5
  width: 100%;
7
- height: var(--size);
6
+ min-height: var(--size);
7
+ max-height: var(--size);
8
8
  padding: 0 12px;
9
9
  font-family: var(--font-sans, sans-serif);
10
10
  font-size: 14px;
@@ -19,17 +19,12 @@
19
19
  outline-color: transparent;
20
20
  outline-offset: -2px;
21
21
  background-color: var(--color-gray-1, #fcfcfc);
22
- border-color: var(--color-gray-5, #e0e0e0);
23
- border-style: solid;
24
- border-width: 1px;
25
- border-radius: 8px;
26
- box-shadow: 0 1px rgba(0, 0, 0, 0.05);
22
+ border-style: none;
23
+ box-shadow:
24
+ 0 -1px 0 0px rgba(0, 0, 0, 7.5%) inset, /* Bottom */
25
+ 0 0 0 1px var(--color-gray-4) inset; /* Border */
27
26
  transition-duration: 150ms;
28
- transition-property: background-color, border-color, box-shadow, opacity;
29
- }
30
-
31
- :global(.dark) .input {
32
- background-color: var(--color-gray-2, #101010);
27
+ transition-property: box-shadow, opacity;
33
28
  }
34
29
 
35
30
  @supports (corner-shape: squircle) {
@@ -40,7 +35,7 @@
40
35
  }
41
36
 
42
37
  .input::placeholder {
43
- color: var(--color-gray, #8d8d8d);
38
+ color: var(--color-gray-9, #8d8d8d);
44
39
  user-select: none;
45
40
  }
46
41
 
@@ -53,8 +48,7 @@
53
48
  .input:enabled:focus,
54
49
  .input:enabled:hover,
55
50
  .input:enabled[aria-pressed="true"] {
56
- border-color: var(--color-gray-8, #bbbbbb);
57
- box-shadow: 0 1px transparent;
51
+ box-shadow: 0 0 0 1px var(--color-gray-6) inset;
58
52
  }
59
53
 
60
54
  .input[data-is-valid="true"] {
@@ -70,6 +64,13 @@
70
64
  outline-color: var(--color-primary-9, #e93d82);
71
65
  }
72
66
 
67
+ :global(.dark) .input {
68
+ background-color: var(--color-gray-2, #101010);
69
+ box-shadow:
70
+ 0 1px 0 0px rgba(255, 255, 255, 7.5%) inset, /* Top */
71
+ 0 0 0 1px var(--color-gray-4) inset; /* Border */
72
+ }
73
+
73
74
  /* ===================================================== */
74
75
  /* Password */
75
76
  /* ===================================================== */
@@ -95,3 +96,7 @@
95
96
  .input__size_44 {
96
97
  --size: 44px;
97
98
  }
99
+
100
+ .input__size_48 {
101
+ --size: 48px;
102
+ }
package/package.json CHANGED
@@ -46,5 +46,5 @@
46
46
  },
47
47
  "type": "module",
48
48
  "types": "./dist/index.d.ts",
49
- "version": "0.0.29"
49
+ "version": "0.0.31"
50
50
  }
@@ -1,47 +0,0 @@
1
- /* Base */
2
- .button_background {
3
- position: absolute;
4
- top: 0;
5
- right: 0;
6
- bottom: 50%;
7
- left: 0;
8
- z-index: -1;
9
- opacity: 0.2;
10
- filter: none !important;
11
- transition-duration: inherit;
12
- transition-property: opacity;
13
- }
14
-
15
- /* Rounded */
16
- .button_background__rounded_base {
17
- border-radius: 7px;
18
- }
19
-
20
- @supports (corner-shape: squircle) {
21
- .button_background__rounded_base {
22
- border-radius: 9999px;
23
- corner-shape: squircle;
24
- }
25
- }
26
-
27
- .button_background__rounded_full {
28
- border-radius: 9999px;
29
- }
30
-
31
- /* Variant */
32
- .button_background__variant_accent,
33
- .button_background__variant_primary {
34
- background: linear-gradient(
35
- to bottom,
36
- var(--color-white-a6, rgba(0, 0, 0, 0.4)),
37
- var(--color-white-a5, rgba(0, 0, 0, 0.3))
38
- );
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
- }
@@ -1,275 +0,0 @@
1
- /* ===================================================== */
2
- /* Base */
3
- /* ===================================================== */
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
-
31
- position: relative;
32
- display: flex;
33
- flex-shrink: 0;
34
- column-gap: 8px;
35
- align-items: safe center;
36
- justify-content: safe center;
37
- height: var(--size);
38
- padding: var(--padding);
39
- overflow: hidden;
40
- font-family: var(--font-sans, sans-serif);
41
- font-size: 14px;
42
- font-weight: 500;
43
- line-height: 1.5;
44
- cursor: pointer;
45
- user-select: none;
46
- outline-width: 0;
47
- outline-style: solid;
48
- outline-color: var(--color-button-primary-9);
49
- outline-offset: 2px;
50
- border-color: transparent;
51
- border-style: solid;
52
- border-width: 1px;
53
- transition-duration: 150ms;
54
- transition-property:
55
- background-color, border-color, box-shadow, color, filter, opacity, translate;
56
- }
57
-
58
- .button:disabled {
59
- cursor: not-allowed;
60
- opacity: 0.5;
61
- }
62
-
63
- .button:focus-visible {
64
- outline-width: 2px;
65
- }
66
-
67
- .button:enabled[aria-pressed="true"],
68
- .button:enabled:active {
69
- translate: 0 1px;
70
- }
71
-
72
- /* Disable child shadow */
73
- .button:enabled[aria-pressed="true"] > *,
74
- .button:enabled:active > *,
75
- .button:enabled:hover > * {
76
- filter: none !important;
77
- }
78
-
79
- /* Hover */
80
- .button:enabled[aria-pressed="true"],
81
- .button:enabled:active,
82
- .button:enabled:hover {
83
- opacity: 0.85;
84
- }
85
-
86
- /* Button background */
87
- .button:enabled[aria-pressed="true"] > [data-element="button-background"],
88
- .button:enabled:active > [data-element="button-background"],
89
- .button:enabled:hover > [data-element="button-background"] {
90
- opacity: 0;
91
- }
92
-
93
- /* ===================================================== */
94
- /* Icon only */
95
- /* ===================================================== */
96
- .button__icon_only {
97
- width: var(--size) !important;
98
- padding: 0 !important;
99
- }
100
-
101
- /* ===================================================== */
102
- /* Rounded */
103
- /* ===================================================== */
104
- .button__rounded_base {
105
- border-radius: 8px;
106
- }
107
-
108
- @supports (corner-shape: squircle) {
109
- .button__rounded_base {
110
- border-radius: 9999px;
111
- corner-shape: squircle;
112
- }
113
- }
114
-
115
- .button__rounded_full {
116
- border-radius: 9999px;
117
- }
118
-
119
- /* ===================================================== */
120
- /* Size */
121
- /* ===================================================== */
122
- .button__size_32 {
123
- --size: 32px;
124
- --padding: 0 10px;
125
- }
126
-
127
- .button__size_36 {
128
- --size: 36px;
129
- --padding: 0 12px;
130
- }
131
-
132
- .button__size_40 {
133
- --size: 40px;
134
- --padding: 0 14px;
135
- }
136
-
137
- .button__size_44 {
138
- --size: 44px;
139
- --padding: 0 16px;
140
- }
141
-
142
- .button__size_48 {
143
- --size: 48px;
144
- --padding: 0 18px;
145
- }
146
-
147
- /* ===================================================== */
148
- /* Variant */
149
- /* ===================================================== */
150
- /* Accent */
151
- .button__variant_accent {
152
- color: var(--color-white, #ffffff);
153
- background-image: linear-gradient(
154
- to bottom,
155
- var(--color-button-primary-9),
156
- var(--color-button-primary-10)
157
- );
158
- border-color: var(--color-button-primary-9);
159
- box-shadow:
160
- inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
161
- inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
162
- }
163
-
164
- .button__variant_accent:enabled[aria-pressed="true"],
165
- .button__variant_accent:enabled:active {
166
- box-shadow:
167
- inset 0 -1px 0 0 rgba(255, 255, 255, 0.25),
168
- inset 0 1px 0 0 var(--color-button-primary-11) !important;
169
- }
170
-
171
- /* Ghost */
172
- .button__variant_ghost {
173
- color: var(--color-button-gray-11);
174
- background-color: transparent;
175
- }
176
-
177
- .button__variant_ghost:enabled[aria-pressed="true"],
178
- .button__variant_ghost:enabled:active {
179
- color: var(--color-button-gray-12);
180
- background-color: var(--color-button-gray-5) !important;
181
- }
182
-
183
- .button__variant_ghost:enabled:hover {
184
- color: var(--color-button-gray-12);
185
- background-color: color-mix(in oklab, var(--color-button-gray-5) 75%, transparent);
186
- }
187
-
188
- /* Primary */
189
- .button__variant_primary {
190
- color: var(--color-button-gray-1);
191
- background-image: linear-gradient(
192
- to bottom,
193
- color-mix(in oklab, var(--color-button-gray-12) 90%, transparent),
194
- var(--color-button-gray-12)
195
- );
196
- border-color: var(--color-button-gray-12);
197
- box-shadow:
198
- inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
199
- inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
200
- }
201
-
202
- .button__variant_primary:enabled[aria-pressed="true"],
203
- .button__variant_primary:enabled:active {
204
- box-shadow:
205
- inset 0 -1px 0 0 rgba(255, 255, 255, 0.25),
206
- inset 0 1px 0 0 var(--color-button-gray-12) !important;
207
- }
208
-
209
- /* Secondary */
210
- .button__variant_secondary {
211
- color: var(--color-button-gray-11);
212
- background-color: var(--color-button-gray-2);
213
- border-color: var(--color-button-gray-6);
214
- box-shadow:
215
- inset 0 1px 0 0 rgba(255, 255, 255, 1),
216
- inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
217
- }
218
-
219
- .button__variant_secondary:enabled[aria-pressed="true"],
220
- .button__variant_secondary:enabled:active,
221
- .button__variant_secondary:enabled:hover {
222
- color: var(--color-button-gray-12);
223
- border-color: var(--color-button-gray-8);
224
- }
225
-
226
- .button__variant_secondary:enabled[aria-pressed="true"],
227
- .button__variant_secondary:enabled:active {
228
- box-shadow:
229
- inset 0 -1px 0 0 rgba(255, 255, 255, 1),
230
- inset 0 1px 0 0 rgba(0, 0, 0, 0.1) !important;
231
- }
232
-
233
- /* Group */
234
- .button__variant_accent,
235
- .button__variant_primary,
236
- .button__variant_secondary {
237
- filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.05));
238
- }
239
-
240
- .button__variant_accent > * {
241
- filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.1));
242
- }
243
-
244
- .button__variant_primary > * {
245
- filter: drop-shadow(0 1px 0 rgb(255 255 255 / 0.1));
246
- }
247
-
248
- .button__variant_accent:enabled:active,
249
- .button__variant_accent:enabled:hover,
250
- .button__variant_accent:enabled[aria-pressed="true"],
251
- .button__variant_primary:enabled:active,
252
- .button__variant_primary:enabled:hover,
253
- .button__variant_primary:enabled[aria-pressed="true"],
254
- .button__variant_secondary:enabled:active,
255
- .button__variant_secondary:enabled:hover,
256
- .button__variant_secondary:enabled[aria-pressed="true"] {
257
- box-shadow: inset 0 0 0 0 transparent;
258
- filter: drop-shadow(0 1px 0 transparent);
259
- }
260
-
261
- .button__variant_ghost:enabled:hover,
262
- .button__variant_secondary:enabled:hover {
263
- color: var(--color-button-gray-12);
264
- }
265
-
266
- /* ===================================================== */
267
- /* Width */
268
- /* ===================================================== */
269
- .button__width_base {
270
- width: max-content;
271
- }
272
-
273
- .button__width_full {
274
- width: 100%;
275
- }