@measured/puck 0.17.4-canary.62d9972 → 0.17.4-canary.e414e34
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/README.md +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -46
- package/dist/index.mjs +17 -46
- package/package.json +1 -1
package/README.md
CHANGED
@@ -101,11 +101,11 @@ Available recipes include:
|
|
101
101
|
- [Discord server](https://discord.gg/D9e4E3MQVZ) for discussions
|
102
102
|
- [awesome-puck](https://github.com/measuredco/awesome-puck) community repo for plugins, custom fields & more
|
103
103
|
|
104
|
-
##
|
104
|
+
## Hire the Puck team
|
105
105
|
|
106
|
-
|
106
|
+
Puck is developed and maintained by **Measured**, a small group of industry veterans with decades of experience helping companies solve hard UI problems. We offer consultancy and development services for scale-ups, SMEs and enterprises.
|
107
107
|
|
108
|
-
|
108
|
+
If you need support integrating Puck or creating a beautiful component library, please reach out via the [Measured](https://measured.co) website.
|
109
109
|
|
110
110
|
## License
|
111
111
|
|
package/dist/index.d.mts
CHANGED
@@ -39,7 +39,7 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
|
|
39
39
|
type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
|
40
40
|
declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<ValueType, FieldType>): react_jsx_runtime.JSX.Element;
|
41
41
|
|
42
|
-
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp,
|
42
|
+
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, }: {
|
43
43
|
children: ReactNode;
|
44
44
|
href?: string;
|
45
45
|
onClick?: (e: any) => void | Promise<void>;
|
package/dist/index.d.ts
CHANGED
@@ -39,7 +39,7 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
|
|
39
39
|
type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
|
40
40
|
declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<ValueType, FieldType>): react_jsx_runtime.JSX.Element;
|
41
41
|
|
42
|
-
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp,
|
42
|
+
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, }: {
|
43
43
|
children: ReactNode;
|
44
44
|
href?: string;
|
45
45
|
onClick?: (e: any) => void | Promise<void>;
|
package/dist/index.js
CHANGED
@@ -1868,57 +1868,29 @@ var import_react11 = require("react");
|
|
1868
1868
|
init_react_import();
|
1869
1869
|
var Button_module_default = { "Button": "_Button_1t64k_1", "Button--medium": "_Button--medium_1t64k_29", "Button--large": "_Button--large_1t64k_37", "Button-icon": "_Button-icon_1t64k_44", "Button--primary": "_Button--primary_1t64k_48", "Button--secondary": "_Button--secondary_1t64k_67", "Button--flush": "_Button--flush_1t64k_84", "Button--disabled": "_Button--disabled_1t64k_88", "Button--fullWidth": "_Button--fullWidth_1t64k_95", "Button-spinner": "_Button-spinner_1t64k_100" };
|
1870
1870
|
|
1871
|
-
// lib/filter-data-attrs.ts
|
1872
|
-
init_react_import();
|
1873
|
-
var dataAttrRe = /^(data-.*)$/;
|
1874
|
-
var filterDataAttrs = (props) => {
|
1875
|
-
let filteredProps = {};
|
1876
|
-
for (const prop in props) {
|
1877
|
-
if (Object.prototype.hasOwnProperty.call(props, prop) && dataAttrRe.test(prop)) {
|
1878
|
-
filteredProps[prop] = props[prop];
|
1879
|
-
}
|
1880
|
-
}
|
1881
|
-
return filteredProps;
|
1882
|
-
};
|
1883
|
-
|
1884
1871
|
// components/Button/Button.tsx
|
1885
1872
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
1886
1873
|
var getClassName9 = get_class_name_factory_default("Button", Button_module_default);
|
1887
|
-
var Button = (
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
} = _b, props = __objRest(_b, [
|
1902
|
-
"children",
|
1903
|
-
"href",
|
1904
|
-
"onClick",
|
1905
|
-
"variant",
|
1906
|
-
"type",
|
1907
|
-
"disabled",
|
1908
|
-
"tabIndex",
|
1909
|
-
"newTab",
|
1910
|
-
"fullWidth",
|
1911
|
-
"icon",
|
1912
|
-
"size",
|
1913
|
-
"loading"
|
1914
|
-
]);
|
1874
|
+
var Button = ({
|
1875
|
+
children,
|
1876
|
+
href,
|
1877
|
+
onClick,
|
1878
|
+
variant = "primary",
|
1879
|
+
type,
|
1880
|
+
disabled,
|
1881
|
+
tabIndex,
|
1882
|
+
newTab,
|
1883
|
+
fullWidth,
|
1884
|
+
icon,
|
1885
|
+
size = "medium",
|
1886
|
+
loading: loadingProp = false
|
1887
|
+
}) => {
|
1915
1888
|
const [loading, setLoading] = (0, import_react11.useState)(loadingProp);
|
1916
1889
|
(0, import_react11.useEffect)(() => setLoading(loadingProp), [loadingProp]);
|
1917
1890
|
const ElementType = href ? "a" : type ? "button" : "span";
|
1918
|
-
const dataAttrs = filterDataAttrs(props);
|
1919
1891
|
const el = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
1920
1892
|
ElementType,
|
1921
|
-
|
1893
|
+
{
|
1922
1894
|
className: getClassName9({
|
1923
1895
|
primary: variant === "primary",
|
1924
1896
|
secondary: variant === "secondary",
|
@@ -1938,14 +1910,13 @@ var Button = (_a) => {
|
|
1938
1910
|
tabIndex,
|
1939
1911
|
target: newTab ? "_blank" : void 0,
|
1940
1912
|
rel: newTab ? "noreferrer" : void 0,
|
1941
|
-
href
|
1942
|
-
}, dataAttrs), {
|
1913
|
+
href,
|
1943
1914
|
children: [
|
1944
1915
|
icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName9("icon"), children: icon }),
|
1945
1916
|
children,
|
1946
1917
|
loading && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName9("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 14 }) })
|
1947
1918
|
]
|
1948
|
-
}
|
1919
|
+
}
|
1949
1920
|
);
|
1950
1921
|
return el;
|
1951
1922
|
};
|
package/dist/index.mjs
CHANGED
@@ -1689,57 +1689,29 @@ import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
1689
1689
|
init_react_import();
|
1690
1690
|
var Button_module_default = { "Button": "_Button_1t64k_1", "Button--medium": "_Button--medium_1t64k_29", "Button--large": "_Button--large_1t64k_37", "Button-icon": "_Button-icon_1t64k_44", "Button--primary": "_Button--primary_1t64k_48", "Button--secondary": "_Button--secondary_1t64k_67", "Button--flush": "_Button--flush_1t64k_84", "Button--disabled": "_Button--disabled_1t64k_88", "Button--fullWidth": "_Button--fullWidth_1t64k_95", "Button-spinner": "_Button-spinner_1t64k_100" };
|
1691
1691
|
|
1692
|
-
// lib/filter-data-attrs.ts
|
1693
|
-
init_react_import();
|
1694
|
-
var dataAttrRe = /^(data-.*)$/;
|
1695
|
-
var filterDataAttrs = (props) => {
|
1696
|
-
let filteredProps = {};
|
1697
|
-
for (const prop in props) {
|
1698
|
-
if (Object.prototype.hasOwnProperty.call(props, prop) && dataAttrRe.test(prop)) {
|
1699
|
-
filteredProps[prop] = props[prop];
|
1700
|
-
}
|
1701
|
-
}
|
1702
|
-
return filteredProps;
|
1703
|
-
};
|
1704
|
-
|
1705
1692
|
// components/Button/Button.tsx
|
1706
1693
|
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
1707
1694
|
var getClassName9 = get_class_name_factory_default("Button", Button_module_default);
|
1708
|
-
var Button = (
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
} = _b, props = __objRest(_b, [
|
1723
|
-
"children",
|
1724
|
-
"href",
|
1725
|
-
"onClick",
|
1726
|
-
"variant",
|
1727
|
-
"type",
|
1728
|
-
"disabled",
|
1729
|
-
"tabIndex",
|
1730
|
-
"newTab",
|
1731
|
-
"fullWidth",
|
1732
|
-
"icon",
|
1733
|
-
"size",
|
1734
|
-
"loading"
|
1735
|
-
]);
|
1695
|
+
var Button = ({
|
1696
|
+
children,
|
1697
|
+
href,
|
1698
|
+
onClick,
|
1699
|
+
variant = "primary",
|
1700
|
+
type,
|
1701
|
+
disabled,
|
1702
|
+
tabIndex,
|
1703
|
+
newTab,
|
1704
|
+
fullWidth,
|
1705
|
+
icon,
|
1706
|
+
size = "medium",
|
1707
|
+
loading: loadingProp = false
|
1708
|
+
}) => {
|
1736
1709
|
const [loading, setLoading] = useState7(loadingProp);
|
1737
1710
|
useEffect6(() => setLoading(loadingProp), [loadingProp]);
|
1738
1711
|
const ElementType = href ? "a" : type ? "button" : "span";
|
1739
|
-
const dataAttrs = filterDataAttrs(props);
|
1740
1712
|
const el = /* @__PURE__ */ jsxs6(
|
1741
1713
|
ElementType,
|
1742
|
-
|
1714
|
+
{
|
1743
1715
|
className: getClassName9({
|
1744
1716
|
primary: variant === "primary",
|
1745
1717
|
secondary: variant === "secondary",
|
@@ -1759,14 +1731,13 @@ var Button = (_a) => {
|
|
1759
1731
|
tabIndex,
|
1760
1732
|
target: newTab ? "_blank" : void 0,
|
1761
1733
|
rel: newTab ? "noreferrer" : void 0,
|
1762
|
-
href
|
1763
|
-
}, dataAttrs), {
|
1734
|
+
href,
|
1764
1735
|
children: [
|
1765
1736
|
icon && /* @__PURE__ */ jsx14("div", { className: getClassName9("icon"), children: icon }),
|
1766
1737
|
children,
|
1767
1738
|
loading && /* @__PURE__ */ jsx14("div", { className: getClassName9("spinner"), children: /* @__PURE__ */ jsx14(Loader, { size: 14 }) })
|
1768
1739
|
]
|
1769
|
-
}
|
1740
|
+
}
|
1770
1741
|
);
|
1771
1742
|
return el;
|
1772
1743
|
};
|
package/package.json
CHANGED