@nayhoo/ui 0.12.1 → 0.14.0
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/{button.css-CxDH431y.d.mts → button.css-BLr4KDtC.d.mts} +3 -0
- package/dist/{button.css-CxDH431y.d.ts → button.css-BLr4KDtC.d.ts} +3 -0
- package/dist/chunk-4A7WL3BM.mjs +12 -0
- package/dist/chunk-4A7WL3BM.mjs.map +1 -0
- package/dist/{chunk-HNOMBFLC.mjs → chunk-67WEB6LY.mjs} +8 -5
- package/dist/chunk-67WEB6LY.mjs.map +1 -0
- package/dist/{chunk-C53FYO65.mjs → chunk-FQX4V5DP.mjs} +8 -5
- package/dist/chunk-FQX4V5DP.mjs.map +1 -0
- package/dist/chunk-HGLO5LDS.mjs +1 -0
- package/dist/{chunk-OCXG5SMA.mjs → chunk-KYAQZHQ5.mjs} +8 -5
- package/dist/chunk-KYAQZHQ5.mjs.map +1 -0
- package/dist/{chunk-WPNBONR3.mjs → chunk-LSB5JVS2.mjs} +1 -1
- package/dist/chunk-LSB5JVS2.mjs.map +1 -0
- package/dist/{chunk-YJWLCDJE.mjs → chunk-M7HASIMW.mjs} +8 -5
- package/dist/chunk-M7HASIMW.mjs.map +1 -0
- package/dist/{chunk-OKNO3BFR.mjs → chunk-OZ2DHFQP.mjs} +12 -9
- package/dist/chunk-OZ2DHFQP.mjs.map +1 -0
- package/dist/{chunk-REMVSAGR.mjs → chunk-P2VEMZGS.mjs} +6 -2
- package/dist/chunk-P2VEMZGS.mjs.map +1 -0
- package/dist/chunk-UPZYS6TE.mjs +31 -0
- package/dist/chunk-UPZYS6TE.mjs.map +1 -0
- package/dist/{chunk-5VVYRZDU.mjs → chunk-ZSB4NTM3.mjs} +13 -10
- package/dist/chunk-ZSB4NTM3.mjs.map +1 -0
- package/dist/components/avatar.d.mts +1 -1
- package/dist/components/avatar.d.ts +1 -1
- package/dist/components/avatar.js +34 -9
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/avatar.mjs +19 -15
- package/dist/components/avatar.mjs.map +1 -1
- package/dist/components/badge.d.mts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +24 -5
- package/dist/components/badge.js.map +1 -1
- package/dist/components/badge.mjs +7 -4
- package/dist/components/badge.mjs.map +1 -1
- package/dist/components/box.d.mts +1 -1
- package/dist/components/box.d.ts +1 -1
- package/dist/components/box.js.map +1 -1
- package/dist/components/box.mjs +1 -1
- package/dist/components/button.css +54 -48
- package/dist/components/button.css.map +1 -1
- package/dist/components/button.d.mts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +33 -11
- package/dist/components/button.js.map +1 -1
- package/dist/components/button.mjs +4 -4
- package/dist/components/card.d.mts +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/card.mjs.map +1 -1
- package/dist/components/checkbox.d.mts +1 -1
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +26 -6
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/checkbox.mjs +9 -5
- package/dist/components/checkbox.mjs.map +1 -1
- package/dist/components/container.d.mts +1 -1
- package/dist/components/container.d.ts +1 -1
- package/dist/components/container.js +24 -5
- package/dist/components/container.js.map +1 -1
- package/dist/components/container.mjs +7 -4
- package/dist/components/container.mjs.map +1 -1
- package/dist/components/dropdown-menu.d.mts +5 -1
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +21 -2
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/dropdown-menu.mjs +3 -3
- package/dist/components/dropdown-menu.mjs.map +1 -1
- package/dist/components/flex.d.mts +1 -1
- package/dist/components/flex.d.ts +1 -1
- package/dist/components/flex.js +24 -5
- package/dist/components/flex.js.map +1 -1
- package/dist/components/flex.mjs +2 -2
- package/dist/components/form.d.mts +4 -1
- package/dist/components/form.d.ts +4 -1
- package/dist/components/form.js +26 -7
- package/dist/components/form.js.map +1 -1
- package/dist/components/form.mjs +9 -6
- package/dist/components/form.mjs.map +1 -1
- package/dist/components/grid.d.mts +1 -1
- package/dist/components/grid.d.ts +1 -1
- package/dist/components/grid.js +24 -5
- package/dist/components/grid.js.map +1 -1
- package/dist/components/grid.mjs +7 -4
- package/dist/components/grid.mjs.map +1 -1
- package/dist/components/icon-button.d.mts +1 -1
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +32 -10
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/icon-button.mjs +3 -3
- package/dist/components/label.d.mts +1 -1
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/label.mjs.map +1 -1
- package/dist/components/link.d.mts +1 -1
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +24 -5
- package/dist/components/link.js.map +1 -1
- package/dist/components/link.mjs +7 -4
- package/dist/components/link.mjs.map +1 -1
- package/dist/components/menu.d.mts +3 -1
- package/dist/components/menu.d.ts +3 -1
- package/dist/components/menu.js +21 -2
- package/dist/components/menu.js.map +1 -1
- package/dist/components/menu.mjs +3 -3
- package/dist/components/menu.mjs.map +1 -1
- package/dist/components/panel.d.mts +1 -1
- package/dist/components/panel.d.ts +1 -1
- package/dist/components/panel.js.map +1 -1
- package/dist/components/panel.mjs.map +1 -1
- package/dist/components/paragraph.d.mts +1 -1
- package/dist/components/paragraph.d.ts +1 -1
- package/dist/components/paragraph.js.map +1 -1
- package/dist/components/paragraph.mjs.map +1 -1
- package/dist/components/popover.d.mts +4 -1
- package/dist/components/popover.d.ts +4 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/popover.mjs +2 -2
- package/dist/components/popover.mjs.map +1 -1
- package/dist/components/select.css +54 -48
- package/dist/components/select.css.map +1 -1
- package/dist/components/select.d.mts +4 -2
- package/dist/components/select.d.ts +4 -2
- package/dist/components/select.js +30 -8
- package/dist/components/select.js.map +1 -1
- package/dist/components/select.mjs +4 -4
- package/dist/components/select.mjs.map +1 -1
- package/dist/components/separator.d.mts +1 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/separator.mjs.map +1 -1
- package/dist/components/skeleton.d.mts +1 -1
- package/dist/components/skeleton.d.ts +1 -1
- package/dist/components/skeleton.js +24 -5
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/skeleton.mjs +7 -4
- package/dist/components/skeleton.mjs.map +1 -1
- package/dist/components/spinner.d.mts +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +24 -5
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/spinner.mjs +2 -2
- package/dist/components/status.d.mts +1 -1
- package/dist/components/status.d.ts +1 -1
- package/dist/components/status.js +24 -5
- package/dist/components/status.js.map +1 -1
- package/dist/components/status.mjs +2 -2
- package/dist/components/switch.d.mts +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +31 -9
- package/dist/components/switch.js.map +1 -1
- package/dist/components/switch.mjs +14 -8
- package/dist/components/switch.mjs.map +1 -1
- package/dist/components/text-field.d.mts +1 -1
- package/dist/components/text-field.d.ts +1 -1
- package/dist/components/text-field.js +24 -5
- package/dist/components/text-field.js.map +1 -1
- package/dist/components/text-field.mjs +7 -4
- package/dist/components/text-field.mjs.map +1 -1
- package/dist/components/text.d.mts +1 -1
- package/dist/components/text.d.ts +1 -1
- package/dist/components/text.js +24 -5
- package/dist/components/text.js.map +1 -1
- package/dist/components/text.mjs +2 -2
- package/dist/components/tooltip.d.mts +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +28 -6
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tooltip.mjs +11 -8
- package/dist/components/tooltip.mjs.map +1 -1
- package/dist/providers/index.css +54 -48
- package/dist/providers/index.css.map +1 -1
- package/dist/providers/index.d.mts +1 -4
- package/dist/providers/index.d.ts +1 -4
- package/dist/providers/index.js +46 -18
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/index.mjs +6 -6
- package/dist/system-theme-BSCk6DG2.d.mts +5 -0
- package/dist/system-theme-BSCk6DG2.d.ts +5 -0
- package/dist/theme/index.css +189 -173
- package/dist/theme/index.css.map +1 -1
- package/dist/theme/index.d.mts +4 -2
- package/dist/theme/index.d.ts +4 -2
- package/dist/theme/index.js +6 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +4 -2
- package/dist/theme/index.mjs.map +1 -1
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/index.d.mts +11 -1
- package/dist/utils/index.d.ts +11 -1
- package/dist/utils/index.js +23 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +6 -2
- package/package.json +5 -1
- package/dist/chunk-4N6P3Y54.mjs +0 -13
- package/dist/chunk-4N6P3Y54.mjs.map +0 -1
- package/dist/chunk-5VVYRZDU.mjs.map +0 -1
- package/dist/chunk-66WXCRN4.mjs +0 -12
- package/dist/chunk-66WXCRN4.mjs.map +0 -1
- package/dist/chunk-C53FYO65.mjs.map +0 -1
- package/dist/chunk-CYDWEPFL.mjs +0 -1
- package/dist/chunk-HNOMBFLC.mjs.map +0 -1
- package/dist/chunk-OCXG5SMA.mjs.map +0 -1
- package/dist/chunk-OKNO3BFR.mjs.map +0 -1
- package/dist/chunk-REMVSAGR.mjs.map +0 -1
- package/dist/chunk-WPNBONR3.mjs.map +0 -1
- package/dist/chunk-YJWLCDJE.mjs.map +0 -1
- /package/dist/{chunk-CYDWEPFL.mjs.map → chunk-HGLO5LDS.mjs.map} +0 -0
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { T as Theme, S as SystemTheme } from '../system-theme-BSCk6DG2.mjs';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
4
5
|
|
|
5
|
-
type Theme = "light" | "dark" | "system";
|
|
6
|
-
|
|
7
|
-
type SystemTheme = Exclude<Theme, "system">;
|
|
8
|
-
|
|
9
6
|
interface ScriptProps extends react.DetailedHTMLProps<react.ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement> {
|
|
10
7
|
}
|
|
11
8
|
interface UseThemeProps {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { T as Theme, S as SystemTheme } from '../system-theme-BSCk6DG2.js';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
4
5
|
|
|
5
|
-
type Theme = "light" | "dark" | "system";
|
|
6
|
-
|
|
7
|
-
type SystemTheme = Exclude<Theme, "system">;
|
|
8
|
-
|
|
9
6
|
interface ScriptProps extends react.DetailedHTMLProps<react.ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement> {
|
|
10
7
|
}
|
|
11
8
|
interface UseThemeProps {
|
package/dist/providers/index.js
CHANGED
|
@@ -229,9 +229,13 @@ var script = (storageKey2, defaultTheme2, systemThemes2, classes2) => {
|
|
|
229
229
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
230
230
|
var spinnerRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "spinner_spinnerRecipe__15xzcy90", variantClassNames: { size: { "1": "spinner_spinnerRecipe_size_1__15xzcy91", "2": "spinner_spinnerRecipe_size_2__15xzcy92", "3": "spinner_spinnerRecipe_size_3__15xzcy93", "4": "spinner_spinnerRecipe_size_4__15xzcy94", "5": "spinner_spinnerRecipe_size_5__15xzcy95", "6": "spinner_spinnerRecipe_size_6__15xzcy96", "7": "spinner_spinnerRecipe_size_7__15xzcy97", "8": "spinner_spinnerRecipe_size_8__15xzcy98", "9": "spinner_spinnerRecipe_size_9__15xzcy99" } }, defaultVariants: { size: "3" }, compoundVariants: [] });
|
|
231
231
|
|
|
232
|
-
// src/utils/
|
|
233
|
-
function
|
|
234
|
-
|
|
232
|
+
// src/utils/omit.ts
|
|
233
|
+
function omit(obj, ...keys) {
|
|
234
|
+
const ret = { ...obj };
|
|
235
|
+
keys.forEach((key) => {
|
|
236
|
+
delete ret[key];
|
|
237
|
+
});
|
|
238
|
+
return ret;
|
|
235
239
|
}
|
|
236
240
|
|
|
237
241
|
// src/utils/pick.ts
|
|
@@ -243,21 +247,36 @@ function pick(obj, ...keys) {
|
|
|
243
247
|
return ret;
|
|
244
248
|
}
|
|
245
249
|
|
|
250
|
+
// src/utils/extract-variants.ts
|
|
251
|
+
function extractVariantsFromProps(obj, ...keys) {
|
|
252
|
+
const variants = pick(obj, ...keys);
|
|
253
|
+
const rest = omit(obj, ...keys);
|
|
254
|
+
return [variants, rest];
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// src/utils/merge-classes.ts
|
|
258
|
+
function mergeClasses(...classes2) {
|
|
259
|
+
return classes2.filter((cls) => Boolean(cls)).join(" ");
|
|
260
|
+
}
|
|
261
|
+
|
|
246
262
|
// src/components/spinner.tsx
|
|
247
263
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
248
264
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
249
265
|
var defaultElement = "div";
|
|
250
266
|
var Spinner = ({ asChild, ...props }) => {
|
|
251
|
-
const variants =
|
|
267
|
+
const [variants, rest] = extractVariantsFromProps(
|
|
268
|
+
props,
|
|
269
|
+
...spinnerRecipe.variants()
|
|
270
|
+
);
|
|
252
271
|
const spinner = spinnerRecipe(variants);
|
|
253
272
|
const Comp = asChild ? import_react_slot.Slot : defaultElement;
|
|
254
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Comp, { ...
|
|
273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Comp, { ...rest, className: mergeClasses(spinner, rest.className), children: rest.children });
|
|
255
274
|
};
|
|
256
275
|
|
|
257
276
|
// src/theme/recipes/button.css.ts
|
|
258
277
|
var import_createRuntimeFn2 = require("homemade-recipes/createRuntimeFn");
|
|
259
278
|
var buttonRecipe = (0, import_createRuntimeFn2.createRuntimeFn)(function() {
|
|
260
|
-
var x = { defaultClassName: "button__hi3ya00", variantClassNames: { fullWidth: { true: "button_fullWidth_true__hi3ya01" }, loading: { true: "
|
|
279
|
+
var x = { defaultClassName: "button__hi3ya00", variantClassNames: { fullWidth: { true: "button_fullWidth_true__hi3ya01", false: "button_fullWidth_false__hi3ya02" }, loading: { true: "button_loading_true__hi3ya03" }, size: { "1": "button_size_1__hi3ya04", "2": "button_size_2__hi3ya05", "3": "button_size_3__hi3ya06" }, variant: { primary: "button_variant_primary__hi3ya07", secondary: "button_variant_secondary__hi3ya08", outline: "button_variant_outline__hi3ya09", ghost: "button_variant_ghost__hi3ya0a", error: "button_variant_error__hi3ya0b", success: "button_variant_success__hi3ya0c" }, round: { true: "button_round_true__hi3ya0d" } }, defaultVariants: { size: "2", variant: "primary" }, compoundVariants: [], responsiveVariantClassNames: { initial: void 0, sm: { fullWidth: { true: "button_fullWidth_sm_true__hi3ya0e", false: "button_fullWidth_sm_false__hi3ya0f" }, loading: { true: "button_loading_sm_true__hi3ya0g" }, size: { "1": "button_size_sm_1__hi3ya0h", "2": "button_size_sm_2__hi3ya0i", "3": "button_size_sm_3__hi3ya0j" }, variant: { primary: "button_variant_sm_primary__hi3ya0k", secondary: "button_variant_sm_secondary__hi3ya0l", outline: "button_variant_sm_outline__hi3ya0m", ghost: "button_variant_sm_ghost__hi3ya0n", error: "button_variant_sm_error__hi3ya0o", success: "button_variant_sm_success__hi3ya0p" }, round: { true: "button_round_sm_true__hi3ya0q" } } }, conditionNames: ["sm"], conditions: { xs: "520px", sm: "768px", md: "1024px", lg: "1280px", xl: "1640px" }, identifier: "homemade-recipe__lb053z0", cssCache: [] };
|
|
261
280
|
x.responsiveVariantClassNames.initial = x.variantClassNames;
|
|
262
281
|
return x;
|
|
263
282
|
}());
|
|
@@ -267,17 +286,20 @@ var import_react_slot2 = require("@radix-ui/react-slot");
|
|
|
267
286
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
268
287
|
var defaultElement2 = "button";
|
|
269
288
|
var Button = ({ asChild, ...props }) => {
|
|
270
|
-
const variants =
|
|
289
|
+
const [variants, rest] = extractVariantsFromProps(
|
|
290
|
+
props,
|
|
291
|
+
...buttonRecipe.variants()
|
|
292
|
+
);
|
|
271
293
|
const button = buttonRecipe(variants);
|
|
272
294
|
const Comp = asChild ? import_react_slot2.Slot : defaultElement2;
|
|
273
295
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
274
296
|
Comp,
|
|
275
297
|
{
|
|
276
|
-
...
|
|
277
|
-
className: mergeClasses(button,
|
|
278
|
-
disabled:
|
|
298
|
+
...rest,
|
|
299
|
+
className: mergeClasses(button, rest.className),
|
|
300
|
+
disabled: rest.disabled || Boolean(variants.loading),
|
|
279
301
|
children: [
|
|
280
|
-
|
|
302
|
+
rest.children,
|
|
281
303
|
variants.loading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Spinner, { style: { position: "absolute" } })
|
|
282
304
|
]
|
|
283
305
|
}
|
|
@@ -329,17 +351,20 @@ var import_react_slot4 = require("@radix-ui/react-slot");
|
|
|
329
351
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
330
352
|
var defaultElement3 = "button";
|
|
331
353
|
var IconButton = ({ asChild, ...props }) => {
|
|
332
|
-
const variants =
|
|
354
|
+
const [variants, rest] = extractVariantsFromProps(
|
|
355
|
+
props,
|
|
356
|
+
...iconButtonRecipe.variants()
|
|
357
|
+
);
|
|
333
358
|
const iconButton = iconButtonRecipe(variants);
|
|
334
359
|
const Comp = asChild ? import_react_slot4.Slot : defaultElement3;
|
|
335
360
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
336
361
|
Comp,
|
|
337
362
|
{
|
|
338
|
-
...
|
|
339
|
-
className: mergeClasses(iconButton,
|
|
340
|
-
disabled:
|
|
363
|
+
...rest,
|
|
364
|
+
className: mergeClasses(iconButton, rest.className),
|
|
365
|
+
disabled: rest.disabled || Boolean(variants.loading),
|
|
341
366
|
children: [
|
|
342
|
-
|
|
367
|
+
rest.children,
|
|
343
368
|
variants.loading && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Spinner, { style: { position: "absolute" } })
|
|
344
369
|
]
|
|
345
370
|
}
|
|
@@ -351,10 +376,13 @@ var import_react_slot5 = require("@radix-ui/react-slot");
|
|
|
351
376
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
352
377
|
var defaultElement4 = "span";
|
|
353
378
|
var Text = ({ asChild, ...props }) => {
|
|
354
|
-
const variants =
|
|
379
|
+
const [variants, rest] = extractVariantsFromProps(
|
|
380
|
+
props,
|
|
381
|
+
...textRecipe.variants()
|
|
382
|
+
);
|
|
355
383
|
const text = textRecipe(variants);
|
|
356
384
|
const Comp = asChild ? import_react_slot5.Slot : defaultElement4;
|
|
357
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Comp, { ...
|
|
385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Comp, { ...rest, className: mergeClasses(text, rest.className), children: rest.children });
|
|
358
386
|
};
|
|
359
387
|
|
|
360
388
|
// src/theme/styles/toast.css.ts
|