@nayhoo/ui 0.20.2 → 0.21.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-BQdFVzyM.d.mts → button.css-CBtNCrkL.d.mts} +42 -1
- package/dist/{button.css-BQdFVzyM.d.ts → button.css-CBtNCrkL.d.ts} +42 -1
- package/dist/{chunk-MJK5V5VM.mjs → chunk-4JJB6DUF.mjs} +10 -2
- package/dist/chunk-4JJB6DUF.mjs.map +1 -0
- package/dist/{chunk-SG7GE2WP.mjs → chunk-OWCOYR6H.mjs} +19 -5
- package/dist/chunk-OWCOYR6H.mjs.map +1 -0
- package/dist/components/button.css +60 -1
- package/dist/components/button.css.map +1 -1
- package/dist/components/button.d.mts +6 -3
- package/dist/components/button.d.ts +6 -3
- package/dist/components/button.js +20 -2
- package/dist/components/button.js.map +1 -1
- package/dist/components/button.mjs +2 -2
- package/dist/components/dialog.css +60 -1
- package/dist/components/dialog.css.map +1 -1
- package/dist/components/dialog.js +5 -0
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dialog.mjs +1 -1
- package/dist/components/select.css +60 -1
- package/dist/components/select.css.map +1 -1
- package/dist/components/select.d.mts +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +20 -2
- package/dist/components/select.js.map +1 -1
- package/dist/components/select.mjs +2 -2
- package/dist/patterns/index.css +60 -1
- package/dist/patterns/index.css.map +1 -1
- package/dist/patterns/index.js +5 -0
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/index.mjs +1 -1
- package/dist/providers/index.css +60 -1
- package/dist/providers/index.css.map +1 -1
- package/dist/providers/index.js +20 -2
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/index.mjs +2 -2
- package/dist/theme/index.css +60 -1
- package/dist/theme/index.css.map +1 -1
- package/dist/theme/index.d.mts +8 -8
- package/dist/theme/index.d.ts +8 -8
- package/dist/theme/index.js +10 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +6 -2
- package/package.json +1 -1
- package/dist/chunk-MJK5V5VM.mjs.map +0 -1
- package/dist/chunk-SG7GE2WP.mjs.map +0 -1
package/dist/providers/index.js
CHANGED
|
@@ -276,32 +276,50 @@ var Spinner = ({ asChild, ...props }) => {
|
|
|
276
276
|
|
|
277
277
|
// src/theme/recipes/button.css.ts
|
|
278
278
|
var import_createRuntimeFn2 = require("homemade-recipes/createRuntimeFn");
|
|
279
|
+
var buttonIconRecipe = (0, import_createRuntimeFn2.createRuntimeFn)((function() {
|
|
280
|
+
var x = { defaultClassName: "button__hi3ya0r", variantClassNames: { size: { "1": "button_size_1__hi3ya0s", "2": "button_size_2__hi3ya0t", "3": "button_size_3__hi3ya0u" } }, defaultVariants: {}, compoundVariants: [], responsiveVariantClassNames: { initial: void 0 }, conditionNames: [], conditions: { xs: "520px", sm: "768px", md: "1024px", lg: "1280px", xl: "1640px" }, identifier: "homemade-recipe__lb053z0", cssCache: [] };
|
|
281
|
+
x.responsiveVariantClassNames.initial = x.variantClassNames;
|
|
282
|
+
return x;
|
|
283
|
+
})());
|
|
279
284
|
var buttonRecipe = (0, import_createRuntimeFn2.createRuntimeFn)((function() {
|
|
280
285
|
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: [] };
|
|
281
286
|
x.responsiveVariantClassNames.initial = x.variantClassNames;
|
|
282
287
|
return x;
|
|
283
288
|
})());
|
|
289
|
+
var buttonSpinner = "button_buttonSpinner__hi3ya0v";
|
|
284
290
|
|
|
285
291
|
// src/components/button.tsx
|
|
286
292
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
287
293
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
288
294
|
var defaultElement2 = "button";
|
|
289
|
-
var Button = ({
|
|
295
|
+
var Button = ({
|
|
296
|
+
asChild,
|
|
297
|
+
leftIcon,
|
|
298
|
+
rightIcon,
|
|
299
|
+
...props
|
|
300
|
+
}) => {
|
|
290
301
|
const [variants, rest] = extractVariantsFromProps(
|
|
291
302
|
props,
|
|
292
303
|
...buttonRecipe.variants()
|
|
293
304
|
);
|
|
294
305
|
const button = buttonRecipe(variants);
|
|
295
306
|
const Comp = asChild ? import_react_slot2.Slot : defaultElement2;
|
|
307
|
+
const buttonIcon = buttonIconRecipe({
|
|
308
|
+
size: variants.size
|
|
309
|
+
});
|
|
296
310
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
297
311
|
Comp,
|
|
298
312
|
{
|
|
299
313
|
...rest,
|
|
300
314
|
className: mergeClasses(button, rest.className),
|
|
301
315
|
disabled: rest.disabled || Boolean(variants.loading),
|
|
316
|
+
...leftIcon && { "data-left-icon": "" },
|
|
317
|
+
...rightIcon && { "data-right-icon": "" },
|
|
302
318
|
children: [
|
|
319
|
+
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_slot2.Slot, { className: buttonIcon, children: leftIcon }),
|
|
303
320
|
rest.children,
|
|
304
|
-
|
|
321
|
+
rightIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_slot2.Slot, { className: buttonIcon, children: rightIcon }),
|
|
322
|
+
variants.loading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Spinner, { className: buttonSpinner })
|
|
305
323
|
]
|
|
306
324
|
}
|
|
307
325
|
);
|