@brosco/ui 0.0.85 → 0.0.86

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/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import "./_css/styles.css";
2
1
  export * from "./button";
3
2
  export * from "./spinner";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{Button as e}from"@base-ui/react";import{cn as t}from"cn";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{tv as i}from"tailwind-variants";import './index.css';var a=({className:e,size:r=24})=>n(`svg`,{className:t(`spinner`,e),fill:`currentColor`,height:r,stroke:`currentColor`,strokeWidth:`0`,version:`1.1`,viewBox:`0 0 16 16`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:n(`path`,{d:`M16 8c-0.020-1.045-0.247-2.086-0.665-3.038-0.417-0.953-1.023-1.817-1.766-2.53s-1.624-1.278-2.578-1.651c-0.953-0.374-1.978-0.552-2.991-0.531-1.013 0.020-2.021 0.24-2.943 0.646-0.923 0.405-1.758 0.992-2.449 1.712s-1.237 1.574-1.597 2.497c-0.361 0.923-0.533 1.914-0.512 2.895 0.020 0.981 0.234 1.955 0.627 2.847 0.392 0.892 0.961 1.7 1.658 2.368s1.523 1.195 2.416 1.543c0.892 0.348 1.851 0.514 2.799 0.493 0.949-0.020 1.89-0.227 2.751-0.608 0.862-0.379 1.642-0.929 2.287-1.604s1.154-1.472 1.488-2.335c0.204-0.523 0.342-1.069 0.415-1.622 0.019 0.001 0.039 0.002 0.059 0.002 0.552 0 1-0.448 1-1 0-0.028-0.001-0.056-0.004-0.083h0.004zM14.411 10.655c-0.367 0.831-0.898 1.584-1.55 2.206s-1.422 1.112-2.254 1.434c-0.832 0.323-1.723 0.476-2.608 0.454-0.884-0.020-1.759-0.215-2.56-0.57-0.801-0.354-1.526-0.867-2.125-1.495s-1.071-1.371-1.38-2.173c-0.31-0.801-0.457-1.66-0.435-2.512s0.208-1.694 0.551-2.464c0.342-0.77 0.836-1.468 1.441-2.044s1.321-1.029 2.092-1.326c0.771-0.298 1.596-0.438 2.416-0.416s1.629 0.202 2.368 0.532c0.74 0.329 1.41 0.805 1.963 1.387s0.988 1.27 1.272 2.011c0.285 0.74 0.418 1.532 0.397 2.32h0.004c-0.002 0.027-0.004 0.055-0.004 0.083 0 0.516 0.39 0.94 0.892 0.994-0.097 0.544-0.258 1.075-0.481 1.578z`})}),o=i({base:`button`,variants:{variant:{solid:`button--solid`,bordered:`button--bordered`,light:`button--light`},color:{primary:`button--primary`,secondary:`button--secondary`,success:`button--success`,danger:`button--danger`},rounded:{full:`rounded-full`,lg:`rounded-lg`,md:`rounded-md`,sm:`rounded-sm`,none:`rounded-none`},size:{sm:`button--sm`,md:`button--md`,lg:`button--lg`},isIconOnly:{true:`button--icon-only`,false:`px-4`},fullWidth:{true:`w-full`}},defaultVariants:{variant:`light`,color:`primary`,rounded:`lg`,size:`md`}}),s=i({extend:o,variants:{isPending:{true:`button--pending`}},defaultVariants:{variant:`solid`}}),c=({children:i,icon:c,className:l,disabled:u,variant:d,color:f,rounded:p,size:m,isIconOnly:h,fullWidth:g,isPending:_,...v})=>{let y=!!v.render,b=y?o({variant:d,color:f,rounded:p,size:m,isIconOnly:h,fullWidth:g}):s({variant:d,color:f,rounded:p,size:m,isIconOnly:h,fullWidth:g,isPending:_});return r(e,{className:t(b,l),disabled:!y&&u,nativeButton:!y,...v,children:[_&&!y?n(a,{}):c,!h&&n(`span`,{children:i})]})};export{c as Button,a as Spinner,s as buttonVariants,o as linkVariants};
1
+ import{Button as e}from"@base-ui/react";import{cn as t}from"cn";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{tv as i}from"tailwind-variants";var a=({className:e,size:r=24})=>n(`svg`,{className:t(`spinner`,e),fill:`currentColor`,height:r,stroke:`currentColor`,strokeWidth:`0`,version:`1.1`,viewBox:`0 0 16 16`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:n(`path`,{d:`M16 8c-0.020-1.045-0.247-2.086-0.665-3.038-0.417-0.953-1.023-1.817-1.766-2.53s-1.624-1.278-2.578-1.651c-0.953-0.374-1.978-0.552-2.991-0.531-1.013 0.020-2.021 0.24-2.943 0.646-0.923 0.405-1.758 0.992-2.449 1.712s-1.237 1.574-1.597 2.497c-0.361 0.923-0.533 1.914-0.512 2.895 0.020 0.981 0.234 1.955 0.627 2.847 0.392 0.892 0.961 1.7 1.658 2.368s1.523 1.195 2.416 1.543c0.892 0.348 1.851 0.514 2.799 0.493 0.949-0.020 1.89-0.227 2.751-0.608 0.862-0.379 1.642-0.929 2.287-1.604s1.154-1.472 1.488-2.335c0.204-0.523 0.342-1.069 0.415-1.622 0.019 0.001 0.039 0.002 0.059 0.002 0.552 0 1-0.448 1-1 0-0.028-0.001-0.056-0.004-0.083h0.004zM14.411 10.655c-0.367 0.831-0.898 1.584-1.55 2.206s-1.422 1.112-2.254 1.434c-0.832 0.323-1.723 0.476-2.608 0.454-0.884-0.020-1.759-0.215-2.56-0.57-0.801-0.354-1.526-0.867-2.125-1.495s-1.071-1.371-1.38-2.173c-0.31-0.801-0.457-1.66-0.435-2.512s0.208-1.694 0.551-2.464c0.342-0.77 0.836-1.468 1.441-2.044s1.321-1.029 2.092-1.326c0.771-0.298 1.596-0.438 2.416-0.416s1.629 0.202 2.368 0.532c0.74 0.329 1.41 0.805 1.963 1.387s0.988 1.27 1.272 2.011c0.285 0.74 0.418 1.532 0.397 2.32h0.004c-0.002 0.027-0.004 0.055-0.004 0.083 0 0.516 0.39 0.94 0.892 0.994-0.097 0.544-0.258 1.075-0.481 1.578z`})}),o=i({base:`button`,variants:{variant:{solid:`button--solid`,bordered:`button--bordered`,light:`button--light`},color:{primary:`button--primary`,secondary:`button--secondary`,success:`button--success`,danger:`button--danger`},rounded:{full:`rounded-full`,lg:`rounded-lg`,md:`rounded-md`,sm:`rounded-sm`,none:`rounded-none`},size:{sm:`button--sm`,md:`button--md`,lg:`button--lg`},isIconOnly:{true:`button--icon-only`,false:`px-4`},fullWidth:{true:`w-full`}},defaultVariants:{variant:`light`,color:`primary`,rounded:`lg`,size:`md`}}),s=i({extend:o,variants:{isPending:{true:`button--pending`}},defaultVariants:{variant:`solid`}}),c=({children:i,icon:c,className:l,disabled:u,variant:d,color:f,rounded:p,size:m,isIconOnly:h,fullWidth:g,isPending:_,...v})=>{let y=!!v.render,b=y?o({variant:d,color:f,rounded:p,size:m,isIconOnly:h,fullWidth:g}):s({variant:d,color:f,rounded:p,size:m,isIconOnly:h,fullWidth:g,isPending:_});return r(e,{className:t(b,l),disabled:!y&&u,nativeButton:!y,...v,children:[_&&!y?n(a,{}):c,!h&&n(`span`,{children:i})]})};export{c as Button,a as Spinner,s as buttonVariants,o as linkVariants};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brosco/ui",
3
- "version": "0.0.85",
3
+ "version": "0.0.86",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -9,7 +9,8 @@
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
11
  "import": "./dist/index.js"
12
- }
12
+ },
13
+ "./styles.css": "./dist/index.css"
13
14
  },
14
15
  "scripts": {
15
16
  "dev": "vite",
package/dist/index.css DELETED
@@ -1,410 +0,0 @@
1
- /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
- @layer properties {
3
- @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or
4
- ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
5
- *,
6
- :before,
7
- :after,
8
- ::backdrop {
9
- --tw-font-weight: initial;
10
- --tw-scale-x: 1;
11
- --tw-scale-y: 1;
12
- --tw-scale-z: 1;
13
- --tw-shadow: 0 0 #0000;
14
- --tw-shadow-color: initial;
15
- --tw-shadow-alpha: 100%;
16
- --tw-inset-shadow: 0 0 #0000;
17
- --tw-inset-shadow-color: initial;
18
- --tw-inset-shadow-alpha: 100%;
19
- --tw-ring-color: initial;
20
- --tw-ring-shadow: 0 0 #0000;
21
- --tw-inset-ring-color: initial;
22
- --tw-inset-ring-shadow: 0 0 #0000;
23
- --tw-ring-inset: initial;
24
- --tw-ring-offset-width: 0px;
25
- --tw-ring-offset-color: #fff;
26
- --tw-ring-offset-shadow: 0 0 #0000;
27
- --tw-border-style: solid;
28
- --tw-duration: initial;
29
- }
30
- }
31
- }
32
- :root {
33
- --eclipse: oklch(21% 0.006 285.885);
34
- --white: #fff;
35
- --background: var(--white);
36
- --foreground: var(--eclipse);
37
- --muted: oklch(55.2% 0.016 285.938);
38
- --primary: oklch(62.3% 0.214 259.815);
39
- --secondary: var(--eclipse);
40
- --success: oklch(62.7% 0.194 149.214);
41
- --danger: oklch(63.7% 0.237 25.331);
42
- }
43
- :root,
44
- :host {
45
- --color-foreground: var(--foreground);
46
- --color-muted: var(--muted);
47
- --color-white: #fff;
48
- --spacing: 0.25rem;
49
- --text-sm: 0.875rem;
50
- --text-sm--line-height: calc(1.25 / 0.875);
51
- --text-base: 1rem;
52
- --text-base--line-height: calc(1.5 / 1);
53
- --font-weight-medium: 500;
54
- --animate-spin: spin 1s linear infinite;
55
- --default-transition-duration: 0.15s;
56
- --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
57
- }
58
- @layer utilities;
59
- @layer components {
60
- .button {
61
- --color: transparent;
62
- --bg: transparent;
63
- --bg-hover: var(--bg);
64
- --bg-active: var(--bg-hover);
65
- --fg: currentColor;
66
- }
67
- .button--primary {
68
- --color: var(--primary);
69
- }
70
- .button--secondary {
71
- --color: var(--secondary);
72
- }
73
- .button--success {
74
- --color: var(--success);
75
- }
76
- .button--danger {
77
- --color: var(--danger);
78
- }
79
- .button--solid {
80
- --bg: var(--color);
81
- --bg-hover: var(--bg);
82
- }
83
- @supports (color: color-mix(in lab, red, red)) {
84
- .button--solid {
85
- --bg-hover: color-mix(in oklab, var(--bg) 90%, var(--eclipse) 10%);
86
- }
87
- }
88
- .button--solid {
89
- --bg-active: var(--bg);
90
- }
91
- @supports (color: color-mix(in lab, red, red)) {
92
- .button--solid {
93
- --bg-active: color-mix(in oklab, var(--bg) 80%, var(--eclipse) 20%);
94
- }
95
- }
96
- .button--solid {
97
- --fg: var(--color-white);
98
- }
99
- .button--solid.button--secondary {
100
- --bg: var(--color);
101
- }
102
- @supports (color: color-mix(in lab, red, red)) {
103
- .button--solid.button--secondary {
104
- --bg: color-mix(in oklab, var(--color) 5%, transparent);
105
- }
106
- }
107
- .button--solid.button--secondary {
108
- --bg-hover: var(--bg);
109
- }
110
- @supports (color: color-mix(in lab, red, red)) {
111
- .button--solid.button--secondary {
112
- --bg-hover: color-mix(in oklab, var(--bg) 95%, var(--eclipse) 5%);
113
- }
114
- }
115
- .button--solid.button--secondary {
116
- --bg-active: var(--bg);
117
- }
118
- @supports (color: color-mix(in lab, red, red)) {
119
- .button--solid.button--secondary {
120
- --bg-active: color-mix(in oklab, var(--bg) 90%, var(--eclipse) 10%);
121
- }
122
- }
123
- .button--solid.button--secondary {
124
- --fg: var(--color);
125
- }
126
- .button--bordered,
127
- .button--light {
128
- --fg: var(--color);
129
- --bg-hover: var(--fg);
130
- }
131
- @supports (color: color-mix(in lab, red, red)) {
132
- .button--bordered,
133
- .button--light {
134
- --bg-hover: color-mix(in oklab, var(--fg) 5%, transparent);
135
- }
136
- }
137
- .button {
138
- justify-content: center;
139
- align-items: center;
140
- gap: calc(var(--spacing) * 2);
141
- --tw-font-weight: var(--font-weight-medium);
142
- font-weight: var(--font-weight-medium);
143
- white-space: nowrap;
144
- color: var(--fg);
145
- transition-property: background-color, scale;
146
- transition-timing-function: var(
147
- --tw-ease,
148
- var(--default-transition-timing-function)
149
- );
150
- transition-duration: var(--tw-duration, var(--default-transition-duration));
151
- -webkit-user-select: none;
152
- user-select: none;
153
- display: inline-flex;
154
- }
155
- .button:focus-visible {
156
- --tw-outline-style: none;
157
- outline-style: none;
158
- }
159
- .button:enabled {
160
- cursor: pointer;
161
- }
162
- .button:hover {
163
- background-color: var(--bg-hover);
164
- }
165
- .button:active {
166
- --tw-scale-x: 95%;
167
- --tw-scale-y: 95%;
168
- --tw-scale-z: 95%;
169
- scale: var(--tw-scale-x) var(--tw-scale-y);
170
- background-color: var(--bg-active);
171
- }
172
- .button--pending {
173
- pointer-events: none;
174
- }
175
- .button--sm {
176
- height: calc(var(--spacing) * 9);
177
- font-size: var(--text-sm);
178
- line-height: var(--tw-leading, var(--text-sm--line-height));
179
- }
180
- .button--md {
181
- height: calc(var(--spacing) * 10);
182
- font-size: var(--text-sm);
183
- line-height: var(--tw-leading, var(--text-sm--line-height));
184
- }
185
- .button--lg {
186
- height: calc(var(--spacing) * 11);
187
- font-size: var(--text-base);
188
- line-height: var(--tw-leading, var(--text-base--line-height));
189
- }
190
- .button--icon-only {
191
- flex-shrink: 0;
192
- }
193
- .button--icon-only.button--sm {
194
- width: calc(var(--spacing) * 9);
195
- }
196
- .button--icon-only.button--md {
197
- width: calc(var(--spacing) * 10);
198
- }
199
- .button--icon-only.button--lg {
200
- width: calc(var(--spacing) * 11);
201
- }
202
- .button--solid {
203
- background-color: var(--bg);
204
- }
205
- .button--solid:focus-visible:not(.button--pending) {
206
- --tw-ring-color: var(--color);
207
- --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0
208
- calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
209
- box-shadow:
210
- var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
211
- var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
212
- --tw-ring-offset-width: 2px;
213
- --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0
214
- var(--tw-ring-offset-width) var(--tw-ring-offset-color);
215
- }
216
- .button--bordered {
217
- border-style: var(--tw-border-style);
218
- border-width: 2px;
219
- border-color: var(--fg);
220
- }
221
- .button--bordered:focus-visible:not(.button--pending) {
222
- --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0
223
- calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
224
- box-shadow:
225
- var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
226
- var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
227
- --tw-ring-offset-width: 2px;
228
- --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0
229
- var(--tw-ring-offset-width) var(--tw-ring-offset-color);
230
- }
231
- .button--light {
232
- text-underline-offset: 6px;
233
- text-decoration-line: underline;
234
- position: relative;
235
- }
236
- @media (hover: hover) {
237
- .button--light:hover {
238
- text-decoration-line: none;
239
- }
240
- }
241
- .button--light:focus-visible:not(.button--pending):after {
242
- top: calc(var(--spacing) * 2);
243
- right: calc(var(--spacing) * 3);
244
- left: calc(var(--spacing) * 3);
245
- height: calc(var(--spacing) * 0.5);
246
- content: "";
247
- background-color: currentColor;
248
- position: absolute;
249
- }
250
- .spinner {
251
- animation: var(--animate-spin);
252
- }
253
- [role="tabs"] {
254
- display: flex;
255
- }
256
- [role="tabs"] [role="tablist"] {
257
- gap: var(--spacing);
258
- display: flex;
259
- position: relative;
260
- }
261
- [role="tabs"] [role="tab"] {
262
- z-index: 10;
263
- height: calc(var(--spacing) * 9);
264
- cursor: default;
265
- padding-inline: calc(var(--spacing) * 4);
266
- font-size: var(--text-sm);
267
- line-height: var(--tw-leading, var(--text-sm--line-height));
268
- --tw-font-weight: var(--font-weight-medium);
269
- font-weight: var(--font-weight-medium);
270
- white-space: nowrap;
271
- color: var(--color-muted);
272
- -webkit-user-select: none;
273
- user-select: none;
274
- justify-content: center;
275
- align-items: center;
276
- display: inline-flex;
277
- position: relative;
278
- }
279
- [role="tabs"] [role="tab"]:focus-visible {
280
- --tw-outline-style: none;
281
- outline-style: none;
282
- }
283
- [role="tabs"] [role="tab"][data-active],
284
- [role="tabs"] [role="tab"]:hover:not([data-active]) {
285
- color: var(--color-foreground);
286
- }
287
- [role="tabs"] [role="tab"]:not([data-active]) {
288
- cursor: pointer;
289
- }
290
- [role="tabs"] [role="presentation"] {
291
- background-color: var(--color-foreground);
292
- transition-property: left, width;
293
- transition-timing-function: var(
294
- --tw-ease,
295
- var(--default-transition-timing-function)
296
- );
297
- transition-duration: var(--tw-duration, var(--default-transition-duration));
298
- --tw-duration: 0.2s;
299
- bottom: 0;
300
- left: var(--active-tab-left);
301
- width: var(--active-tab-width);
302
- border-radius: 2147483647px;
303
- height: 3px;
304
- transition-duration: 0.2s;
305
- position: absolute;
306
- }
307
- :disabled,
308
- [data-disabled] {
309
- pointer-events: none;
310
- opacity: 0.5;
311
- }
312
- }
313
- @property --tw-font-weight {
314
- syntax: "*";
315
- inherits: false;
316
- }
317
- @property --tw-scale-x {
318
- syntax: "*";
319
- inherits: false;
320
- initial-value: 1;
321
- }
322
- @property --tw-scale-y {
323
- syntax: "*";
324
- inherits: false;
325
- initial-value: 1;
326
- }
327
- @property --tw-scale-z {
328
- syntax: "*";
329
- inherits: false;
330
- initial-value: 1;
331
- }
332
- @property --tw-shadow {
333
- syntax: "*";
334
- inherits: false;
335
- initial-value: 0 0 #0000;
336
- }
337
- @property --tw-shadow-color {
338
- syntax: "*";
339
- inherits: false;
340
- }
341
- @property --tw-shadow-alpha {
342
- syntax: "<percentage>";
343
- inherits: false;
344
- initial-value: 100%;
345
- }
346
- @property --tw-inset-shadow {
347
- syntax: "*";
348
- inherits: false;
349
- initial-value: 0 0 #0000;
350
- }
351
- @property --tw-inset-shadow-color {
352
- syntax: "*";
353
- inherits: false;
354
- }
355
- @property --tw-inset-shadow-alpha {
356
- syntax: "<percentage>";
357
- inherits: false;
358
- initial-value: 100%;
359
- }
360
- @property --tw-ring-color {
361
- syntax: "*";
362
- inherits: false;
363
- }
364
- @property --tw-ring-shadow {
365
- syntax: "*";
366
- inherits: false;
367
- initial-value: 0 0 #0000;
368
- }
369
- @property --tw-inset-ring-color {
370
- syntax: "*";
371
- inherits: false;
372
- }
373
- @property --tw-inset-ring-shadow {
374
- syntax: "*";
375
- inherits: false;
376
- initial-value: 0 0 #0000;
377
- }
378
- @property --tw-ring-inset {
379
- syntax: "*";
380
- inherits: false;
381
- }
382
- @property --tw-ring-offset-width {
383
- syntax: "<length>";
384
- inherits: false;
385
- initial-value: 0;
386
- }
387
- @property --tw-ring-offset-color {
388
- syntax: "*";
389
- inherits: false;
390
- initial-value: #fff;
391
- }
392
- @property --tw-ring-offset-shadow {
393
- syntax: "*";
394
- inherits: false;
395
- initial-value: 0 0 #0000;
396
- }
397
- @property --tw-border-style {
398
- syntax: "*";
399
- inherits: false;
400
- initial-value: solid;
401
- }
402
- @property --tw-duration {
403
- syntax: "*";
404
- inherits: false;
405
- }
406
- @keyframes spin {
407
- to {
408
- transform: rotate(360deg);
409
- }
410
- }