react-better-html 1.1.262 → 1.1.264
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.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2057,6 +2057,9 @@ var Loader_default = Loader2;
|
|
|
2057
2057
|
|
|
2058
2058
|
// src/components/Button.tsx
|
|
2059
2059
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2060
|
+
var fromSubcomponentProps = {
|
|
2061
|
+
fromSubcomponent: true
|
|
2062
|
+
};
|
|
2060
2063
|
var ButtonElement = styled6.button.withConfig({
|
|
2061
2064
|
shouldForwardProp: (prop) => !["theme", "colorTheme", "style", "hoverStyle", "isSmall", "withText", "isLoading", "withNoBorder"].includes(
|
|
2062
2065
|
prop
|
|
@@ -2139,7 +2142,7 @@ var ButtonComponent = function Button(buttonProps) {
|
|
|
2139
2142
|
onClickWithValue,
|
|
2140
2143
|
...props
|
|
2141
2144
|
} = useComponentsPropsMerger(
|
|
2142
|
-
betterHtmlContextInternal.components.button?.style?.default,
|
|
2145
|
+
!buttonProps.fromSubcomponent ? betterHtmlContextInternal.components.button?.style?.default : {},
|
|
2143
2146
|
buttonProps
|
|
2144
2147
|
);
|
|
2145
2148
|
const theme2 = useTheme9();
|
|
@@ -2264,6 +2267,7 @@ ButtonComponent.secondary = function Secondary(buttonProps) {
|
|
|
2264
2267
|
{
|
|
2265
2268
|
className: `secondary${className ? ` ${className}` : ""}`,
|
|
2266
2269
|
color: theme2.colors.textPrimary,
|
|
2270
|
+
...fromSubcomponentProps,
|
|
2267
2271
|
...props
|
|
2268
2272
|
}
|
|
2269
2273
|
);
|
|
@@ -2275,7 +2279,15 @@ ButtonComponent.destructive = function Destructive(buttonProps) {
|
|
|
2275
2279
|
buttonProps
|
|
2276
2280
|
);
|
|
2277
2281
|
const theme2 = useTheme9();
|
|
2278
|
-
return /* @__PURE__ */ jsx8(
|
|
2282
|
+
return /* @__PURE__ */ jsx8(
|
|
2283
|
+
ButtonComponent,
|
|
2284
|
+
{
|
|
2285
|
+
backgroundColor: theme2.colors.error,
|
|
2286
|
+
color: theme2.colors.base,
|
|
2287
|
+
...fromSubcomponentProps,
|
|
2288
|
+
...props
|
|
2289
|
+
}
|
|
2290
|
+
);
|
|
2279
2291
|
};
|
|
2280
2292
|
ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonColor, ...buttonProps }) {
|
|
2281
2293
|
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
@@ -2289,7 +2301,6 @@ ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonC
|
|
|
2289
2301
|
return /* @__PURE__ */ jsx8(
|
|
2290
2302
|
ButtonComponent,
|
|
2291
2303
|
{
|
|
2292
|
-
...betterHtmlContextInternal.components.button?.style?.icon,
|
|
2293
2304
|
width: readyButtonSize,
|
|
2294
2305
|
height: readyButtonSize,
|
|
2295
2306
|
color: theme2.colors.textPrimary,
|
|
@@ -2302,6 +2313,7 @@ ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonC
|
|
|
2302
2313
|
border: "none",
|
|
2303
2314
|
padding: 0,
|
|
2304
2315
|
filterHover: "none !important",
|
|
2316
|
+
...fromSubcomponentProps,
|
|
2305
2317
|
...props
|
|
2306
2318
|
}
|
|
2307
2319
|
);
|
|
@@ -2325,10 +2337,10 @@ ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...button
|
|
|
2325
2337
|
return /* @__PURE__ */ jsx8(
|
|
2326
2338
|
ButtonComponent,
|
|
2327
2339
|
{
|
|
2328
|
-
...betterHtmlContextInternal.components.button?.style?.upload,
|
|
2329
2340
|
text: "Upload",
|
|
2330
2341
|
icon: "uploadCloud",
|
|
2331
2342
|
onClick: onClickElement,
|
|
2343
|
+
...fromSubcomponentProps,
|
|
2332
2344
|
...props
|
|
2333
2345
|
}
|
|
2334
2346
|
);
|