@shapesos/clay 0.8.2 → 0.9.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.cjs +98 -71
- package/dist/button.cjs.map +1 -1
- package/dist/button.d.cts +10 -1
- package/dist/button.d.ts +10 -1
- package/dist/button.js +3 -1
- package/dist/chunk-EDICS62G.js +177 -0
- package/dist/chunk-EDICS62G.js.map +1 -0
- package/dist/index.cjs +99 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/dist/chunk-FFABDVB3.js +0 -149
- package/dist/chunk-FFABDVB3.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -16342,6 +16342,7 @@ var require_lottie = __commonJS({
|
|
|
16342
16342
|
// src/index.ts
|
|
16343
16343
|
var src_exports = {};
|
|
16344
16344
|
__export(src_exports, {
|
|
16345
|
+
BUTTON_INTENT: () => BUTTON_INTENT,
|
|
16345
16346
|
BUTTON_SIZE: () => BUTTON_SIZE,
|
|
16346
16347
|
BUTTON_VARIANT: () => BUTTON_VARIANT,
|
|
16347
16348
|
Button: () => Button2,
|
|
@@ -17702,66 +17703,107 @@ var import_react10 = require("react");
|
|
|
17702
17703
|
|
|
17703
17704
|
// src/components/button/button-styles.ts
|
|
17704
17705
|
var import_styled_components10 = __toESM(require("styled-components"), 1);
|
|
17705
|
-
var sizeStyles = {
|
|
17706
|
-
xs: import_styled_components10.css`
|
|
17707
|
-
padding: 6px 10px;
|
|
17708
|
-
border-radius: 8px;
|
|
17709
|
-
gap: 4px;
|
|
17710
|
-
`,
|
|
17711
|
-
s: import_styled_components10.css`
|
|
17712
|
-
padding: 8px 12px;
|
|
17713
|
-
border-radius: 10px;
|
|
17714
|
-
gap: 6px;
|
|
17715
|
-
`,
|
|
17716
|
-
m: import_styled_components10.css`
|
|
17717
|
-
padding: 10px 14px;
|
|
17718
|
-
border-radius: 10px;
|
|
17719
|
-
gap: 6px;
|
|
17720
|
-
`
|
|
17721
|
-
};
|
|
17722
|
-
var variantStyles2 = {
|
|
17723
|
-
solid: import_styled_components10.css`
|
|
17724
|
-
background: ${colors["brown-100"]};
|
|
17725
|
-
color: ${colors.white};
|
|
17726
|
-
border: none;
|
|
17727
|
-
|
|
17728
|
-
&:hover:not(:disabled) {
|
|
17729
|
-
background: ${colors["brown-90"]};
|
|
17730
|
-
}
|
|
17731
17706
|
|
|
17732
|
-
|
|
17733
|
-
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17707
|
+
// src/components/button/constants.ts
|
|
17708
|
+
var BUTTON_VARIANT = {
|
|
17709
|
+
SOLID: "solid",
|
|
17710
|
+
OUTLINE: "outline",
|
|
17711
|
+
GHOST: "ghost"
|
|
17712
|
+
};
|
|
17713
|
+
var BUTTON_SIZE = {
|
|
17714
|
+
XS: "xs",
|
|
17715
|
+
S: "s",
|
|
17716
|
+
M: "m"
|
|
17717
|
+
};
|
|
17718
|
+
var BUTTON_INTENT = {
|
|
17719
|
+
PRIMARY: "primary",
|
|
17720
|
+
ERROR: "error"
|
|
17721
|
+
};
|
|
17722
|
+
var ICON_POSITION = {
|
|
17723
|
+
LEADING: "leading",
|
|
17724
|
+
TRAILING: "trailing"
|
|
17725
|
+
};
|
|
17745
17726
|
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17754
|
-
border:
|
|
17727
|
+
// src/components/button/button-styles.ts
|
|
17728
|
+
var intentColors = {
|
|
17729
|
+
[BUTTON_INTENT.PRIMARY]: {
|
|
17730
|
+
base: colors["brown-100"],
|
|
17731
|
+
hover: colors["brown-90"],
|
|
17732
|
+
disabledBg: colors["brown-20"],
|
|
17733
|
+
disabledText: colors["brown-50"],
|
|
17734
|
+
subtleHover: colors["brown-20"],
|
|
17735
|
+
border: colors["brown-40"],
|
|
17736
|
+
disabledBorder: colors["brown-20"]
|
|
17737
|
+
},
|
|
17738
|
+
[BUTTON_INTENT.ERROR]: {
|
|
17739
|
+
base: colors["red-500"],
|
|
17740
|
+
hover: colors["red-600"],
|
|
17741
|
+
disabledBg: colors["red-100"],
|
|
17742
|
+
disabledText: colors["red-200"],
|
|
17743
|
+
subtleHover: colors["red-50"],
|
|
17744
|
+
border: colors["red-200"],
|
|
17745
|
+
disabledBorder: colors["red-100"]
|
|
17746
|
+
}
|
|
17747
|
+
};
|
|
17748
|
+
var sizeValues = {
|
|
17749
|
+
[BUTTON_SIZE.XS]: { padding: "6px 10px", borderRadius: "8px", gap: "4px" },
|
|
17750
|
+
[BUTTON_SIZE.S]: { padding: "8px 12px", borderRadius: "10px", gap: "6px" },
|
|
17751
|
+
[BUTTON_SIZE.M]: { padding: "10px 14px", borderRadius: "10px", gap: "6px" }
|
|
17752
|
+
};
|
|
17753
|
+
function sizeMixin({ $size }) {
|
|
17754
|
+
const s = sizeValues[$size];
|
|
17755
|
+
return import_styled_components10.css`
|
|
17756
|
+
padding: ${s.padding};
|
|
17757
|
+
border-radius: ${s.borderRadius};
|
|
17758
|
+
gap: ${s.gap};
|
|
17759
|
+
`;
|
|
17760
|
+
}
|
|
17761
|
+
var variantColorMap = {
|
|
17762
|
+
[BUTTON_VARIANT.SOLID]: (c) => ({
|
|
17763
|
+
background: c.base,
|
|
17764
|
+
color: colors.white,
|
|
17765
|
+
border: "none",
|
|
17766
|
+
hoverBg: c.hover,
|
|
17767
|
+
disabledBg: c.disabledBg,
|
|
17768
|
+
disabledColor: c.disabledText
|
|
17769
|
+
}),
|
|
17770
|
+
[BUTTON_VARIANT.OUTLINE]: (c) => ({
|
|
17771
|
+
background: colors.white,
|
|
17772
|
+
color: c.base,
|
|
17773
|
+
border: `1px solid ${c.border}`,
|
|
17774
|
+
hoverBg: c.subtleHover,
|
|
17775
|
+
disabledColor: c.disabledText,
|
|
17776
|
+
disabledBorder: c.disabledBorder
|
|
17777
|
+
}),
|
|
17778
|
+
[BUTTON_VARIANT.GHOST]: (c) => ({
|
|
17779
|
+
background: "transparent",
|
|
17780
|
+
color: c.base,
|
|
17781
|
+
border: "none",
|
|
17782
|
+
hoverBg: c.subtleHover,
|
|
17783
|
+
disabledColor: c.disabledText
|
|
17784
|
+
})
|
|
17785
|
+
};
|
|
17786
|
+
function variantMixin({
|
|
17787
|
+
$variant,
|
|
17788
|
+
$intent
|
|
17789
|
+
}) {
|
|
17790
|
+
const v = variantColorMap[$variant](intentColors[$intent]);
|
|
17791
|
+
return import_styled_components10.css`
|
|
17792
|
+
background: ${v.background};
|
|
17793
|
+
color: ${v.color};
|
|
17794
|
+
border: ${v.border};
|
|
17755
17795
|
|
|
17756
17796
|
&:hover:not(:disabled) {
|
|
17757
|
-
background: ${
|
|
17797
|
+
background: ${v.hoverBg};
|
|
17758
17798
|
}
|
|
17759
17799
|
|
|
17760
17800
|
&:disabled {
|
|
17761
|
-
color: ${
|
|
17801
|
+
color: ${v.disabledColor};
|
|
17802
|
+
${v.disabledBg ? `background: ${v.disabledBg};` : ""}
|
|
17803
|
+
${v.disabledBorder ? `border-color: ${v.disabledBorder};` : ""}
|
|
17762
17804
|
}
|
|
17763
|
-
|
|
17764
|
-
}
|
|
17805
|
+
`;
|
|
17806
|
+
}
|
|
17765
17807
|
var StyledButton = import_styled_components10.default.button`
|
|
17766
17808
|
display: inline-flex;
|
|
17767
17809
|
align-items: center;
|
|
@@ -17774,31 +17816,16 @@ var StyledButton = import_styled_components10.default.button`
|
|
|
17774
17816
|
cursor: not-allowed;
|
|
17775
17817
|
}
|
|
17776
17818
|
|
|
17777
|
-
${
|
|
17778
|
-
${
|
|
17819
|
+
${sizeMixin}
|
|
17820
|
+
${variantMixin}
|
|
17779
17821
|
`;
|
|
17780
17822
|
|
|
17781
|
-
// src/components/button/constants.ts
|
|
17782
|
-
var BUTTON_VARIANT = {
|
|
17783
|
-
SOLID: "solid",
|
|
17784
|
-
OUTLINE: "outline",
|
|
17785
|
-
GHOST: "ghost"
|
|
17786
|
-
};
|
|
17787
|
-
var BUTTON_SIZE = {
|
|
17788
|
-
XS: "xs",
|
|
17789
|
-
S: "s",
|
|
17790
|
-
M: "m"
|
|
17791
|
-
};
|
|
17792
|
-
var ICON_POSITION = {
|
|
17793
|
-
LEADING: "leading",
|
|
17794
|
-
TRAILING: "trailing"
|
|
17795
|
-
};
|
|
17796
|
-
|
|
17797
17823
|
// src/components/button/button.tsx
|
|
17798
17824
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
17799
17825
|
var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
17800
17826
|
children,
|
|
17801
17827
|
variant = BUTTON_VARIANT.SOLID,
|
|
17828
|
+
intent = BUTTON_INTENT.PRIMARY,
|
|
17802
17829
|
size = BUTTON_SIZE.M,
|
|
17803
17830
|
icon,
|
|
17804
17831
|
iconPosition = ICON_POSITION.LEADING,
|
|
@@ -17814,6 +17841,7 @@ var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
|
17814
17841
|
ref,
|
|
17815
17842
|
type: "button",
|
|
17816
17843
|
$variant: variant,
|
|
17844
|
+
$intent: intent,
|
|
17817
17845
|
$size: size,
|
|
17818
17846
|
disabled,
|
|
17819
17847
|
onClick: disabled ? void 0 : onClick,
|
|
@@ -17829,6 +17857,7 @@ var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
|
17829
17857
|
});
|
|
17830
17858
|
// Annotate the CommonJS export names for ESM import in node:
|
|
17831
17859
|
0 && (module.exports = {
|
|
17860
|
+
BUTTON_INTENT,
|
|
17832
17861
|
BUTTON_SIZE,
|
|
17833
17862
|
BUTTON_VARIANT,
|
|
17834
17863
|
Button,
|