@brosco/ui 0.0.84 → 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.84",
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,353 +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
- }
29
- }
30
- }
31
- :root {
32
- --eclipse: var(--color-zinc-900);
33
- --background: var(--color-white);
34
- --foreground: var(--eclipse);
35
- --muted: var(--color-zinc-500);
36
- --primary: var(--color-blue-500);
37
- --secondary: var(--eclipse);
38
- --success: var(--color-green-600);
39
- --danger: var(--color-red-500);
40
- }
41
- :root,
42
- :host {
43
- --color-red-500: oklch(63.7% 0.237 25.331);
44
- --color-green-600: oklch(62.7% 0.194 149.214);
45
- --color-blue-500: oklch(62.3% 0.214 259.815);
46
- --color-zinc-500: oklch(55.2% 0.016 285.938);
47
- --color-zinc-900: oklch(21% 0.006 285.885);
48
- --color-white: #fff;
49
- --spacing: 0.25rem;
50
- --text-sm: 0.875rem;
51
- --text-sm--line-height: calc(1.25 / 0.875);
52
- --text-base: 1rem;
53
- --text-base--line-height: calc(1.5 / 1);
54
- --font-weight-medium: 500;
55
- --animate-spin: spin 1s linear infinite;
56
- --default-transition-duration: 0.15s;
57
- --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
58
- }
59
- @layer utilities;
60
- @layer components {
61
- .button {
62
- --color: transparent;
63
- --bg: transparent;
64
- --bg-hover: var(--bg);
65
- --bg-active: var(--bg-hover);
66
- --fg: currentColor;
67
- }
68
- .button--primary {
69
- --color: var(--primary);
70
- }
71
- .button--secondary {
72
- --color: var(--secondary);
73
- }
74
- .button--success {
75
- --color: var(--success);
76
- }
77
- .button--danger {
78
- --color: var(--danger);
79
- }
80
- .button--solid {
81
- --bg: var(--color);
82
- --bg-hover: var(--bg);
83
- }
84
- @supports (color: color-mix(in lab, red, red)) {
85
- .button--solid {
86
- --bg-hover: color-mix(in oklab, var(--bg) 90%, var(--eclipse) 10%);
87
- }
88
- }
89
- .button--solid {
90
- --bg-active: var(--bg);
91
- }
92
- @supports (color: color-mix(in lab, red, red)) {
93
- .button--solid {
94
- --bg-active: color-mix(in oklab, var(--bg) 80%, var(--eclipse) 20%);
95
- }
96
- }
97
- .button--solid {
98
- --fg: var(--color-white);
99
- }
100
- .button--solid.button--secondary {
101
- --bg: var(--color);
102
- }
103
- @supports (color: color-mix(in lab, red, red)) {
104
- .button--solid.button--secondary {
105
- --bg: color-mix(in oklab, var(--color) 5%, transparent);
106
- }
107
- }
108
- .button--solid.button--secondary {
109
- --bg-hover: var(--bg);
110
- }
111
- @supports (color: color-mix(in lab, red, red)) {
112
- .button--solid.button--secondary {
113
- --bg-hover: color-mix(in oklab, var(--bg) 95%, var(--eclipse) 5%);
114
- }
115
- }
116
- .button--solid.button--secondary {
117
- --bg-active: var(--bg);
118
- }
119
- @supports (color: color-mix(in lab, red, red)) {
120
- .button--solid.button--secondary {
121
- --bg-active: color-mix(in oklab, var(--bg) 90%, var(--eclipse) 10%);
122
- }
123
- }
124
- .button--solid.button--secondary {
125
- --fg: var(--color);
126
- }
127
- .button--bordered,
128
- .button--light {
129
- --fg: var(--color);
130
- --bg-hover: var(--fg);
131
- }
132
- @supports (color: color-mix(in lab, red, red)) {
133
- .button--bordered,
134
- .button--light {
135
- --bg-hover: color-mix(in oklab, var(--fg) 5%, transparent);
136
- }
137
- }
138
- .button {
139
- justify-content: center;
140
- align-items: center;
141
- gap: calc(var(--spacing) * 2);
142
- --tw-font-weight: var(--font-weight-medium);
143
- font-weight: var(--font-weight-medium);
144
- white-space: nowrap;
145
- color: var(--fg);
146
- transition-property: background-color, scale;
147
- transition-timing-function: var(
148
- --tw-ease,
149
- var(--default-transition-timing-function)
150
- );
151
- transition-duration: var(--tw-duration, var(--default-transition-duration));
152
- -webkit-user-select: none;
153
- user-select: none;
154
- display: inline-flex;
155
- }
156
- .button:focus-visible {
157
- --tw-outline-style: none;
158
- outline-style: none;
159
- }
160
- .button:enabled {
161
- cursor: pointer;
162
- }
163
- .button:hover {
164
- background-color: var(--bg-hover);
165
- }
166
- .button:active {
167
- --tw-scale-x: 95%;
168
- --tw-scale-y: 95%;
169
- --tw-scale-z: 95%;
170
- scale: var(--tw-scale-x) var(--tw-scale-y);
171
- background-color: var(--bg-active);
172
- }
173
- .button--pending {
174
- pointer-events: none;
175
- }
176
- .button--sm {
177
- height: calc(var(--spacing) * 9);
178
- font-size: var(--text-sm);
179
- line-height: var(--tw-leading, var(--text-sm--line-height));
180
- }
181
- .button--md {
182
- height: calc(var(--spacing) * 10);
183
- font-size: var(--text-sm);
184
- line-height: var(--tw-leading, var(--text-sm--line-height));
185
- }
186
- .button--lg {
187
- height: calc(var(--spacing) * 11);
188
- font-size: var(--text-base);
189
- line-height: var(--tw-leading, var(--text-base--line-height));
190
- }
191
- .button--icon-only {
192
- flex-shrink: 0;
193
- }
194
- .button--icon-only.button--sm {
195
- width: calc(var(--spacing) * 9);
196
- }
197
- .button--icon-only.button--md {
198
- width: calc(var(--spacing) * 10);
199
- }
200
- .button--icon-only.button--lg {
201
- width: calc(var(--spacing) * 11);
202
- }
203
- .button--solid {
204
- background-color: var(--bg);
205
- }
206
- .button--solid:focus-visible:not(.button--pending) {
207
- --tw-ring-color: var(--color);
208
- --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0
209
- calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
210
- box-shadow:
211
- var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
212
- var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
213
- --tw-ring-offset-width: 2px;
214
- --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0
215
- var(--tw-ring-offset-width) var(--tw-ring-offset-color);
216
- }
217
- .button--bordered {
218
- border-style: var(--tw-border-style);
219
- border-width: 2px;
220
- border-color: var(--fg);
221
- }
222
- .button--bordered:focus-visible:not(.button--pending) {
223
- --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0
224
- calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
225
- box-shadow:
226
- var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
227
- var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
228
- --tw-ring-offset-width: 2px;
229
- --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0
230
- var(--tw-ring-offset-width) var(--tw-ring-offset-color);
231
- }
232
- .button--light {
233
- text-underline-offset: 6px;
234
- text-decoration-line: underline;
235
- position: relative;
236
- }
237
- @media (hover: hover) {
238
- .button--light:hover {
239
- text-decoration-line: none;
240
- }
241
- }
242
- .button--light:focus-visible:not(.button--pending):after {
243
- top: calc(var(--spacing) * 2);
244
- right: calc(var(--spacing) * 3);
245
- left: calc(var(--spacing) * 3);
246
- height: calc(var(--spacing) * 0.5);
247
- content: "";
248
- background-color: currentColor;
249
- position: absolute;
250
- }
251
- .spinner {
252
- animation: var(--animate-spin);
253
- }
254
- :disabled,
255
- [data-disabled] {
256
- pointer-events: none;
257
- opacity: 0.5;
258
- }
259
- }
260
- @property --tw-font-weight {
261
- syntax: "*";
262
- inherits: false;
263
- }
264
- @property --tw-scale-x {
265
- syntax: "*";
266
- inherits: false;
267
- initial-value: 1;
268
- }
269
- @property --tw-scale-y {
270
- syntax: "*";
271
- inherits: false;
272
- initial-value: 1;
273
- }
274
- @property --tw-scale-z {
275
- syntax: "*";
276
- inherits: false;
277
- initial-value: 1;
278
- }
279
- @property --tw-shadow {
280
- syntax: "*";
281
- inherits: false;
282
- initial-value: 0 0 #0000;
283
- }
284
- @property --tw-shadow-color {
285
- syntax: "*";
286
- inherits: false;
287
- }
288
- @property --tw-shadow-alpha {
289
- syntax: "<percentage>";
290
- inherits: false;
291
- initial-value: 100%;
292
- }
293
- @property --tw-inset-shadow {
294
- syntax: "*";
295
- inherits: false;
296
- initial-value: 0 0 #0000;
297
- }
298
- @property --tw-inset-shadow-color {
299
- syntax: "*";
300
- inherits: false;
301
- }
302
- @property --tw-inset-shadow-alpha {
303
- syntax: "<percentage>";
304
- inherits: false;
305
- initial-value: 100%;
306
- }
307
- @property --tw-ring-color {
308
- syntax: "*";
309
- inherits: false;
310
- }
311
- @property --tw-ring-shadow {
312
- syntax: "*";
313
- inherits: false;
314
- initial-value: 0 0 #0000;
315
- }
316
- @property --tw-inset-ring-color {
317
- syntax: "*";
318
- inherits: false;
319
- }
320
- @property --tw-inset-ring-shadow {
321
- syntax: "*";
322
- inherits: false;
323
- initial-value: 0 0 #0000;
324
- }
325
- @property --tw-ring-inset {
326
- syntax: "*";
327
- inherits: false;
328
- }
329
- @property --tw-ring-offset-width {
330
- syntax: "<length>";
331
- inherits: false;
332
- initial-value: 0;
333
- }
334
- @property --tw-ring-offset-color {
335
- syntax: "*";
336
- inherits: false;
337
- initial-value: #fff;
338
- }
339
- @property --tw-ring-offset-shadow {
340
- syntax: "*";
341
- inherits: false;
342
- initial-value: 0 0 #0000;
343
- }
344
- @property --tw-border-style {
345
- syntax: "*";
346
- inherits: false;
347
- initial-value: solid;
348
- }
349
- @keyframes spin {
350
- to {
351
- transform: rotate(360deg);
352
- }
353
- }