@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.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export { IconCtrl, KEYBOARD_SHORTCUT_VARIANTS, KeyIcon, KeyboardShortcut, Keyboa
|
|
|
5
5
|
export { Lottie, LottieAnimationData, LottieProps, LottieRef } from './lottie.cjs';
|
|
6
6
|
export { TextArea, TextAreaProps } from './text-area.cjs';
|
|
7
7
|
export { MarkdownTable, convertTableToCSV, markdownToPlainText, mergeRefs, parseMarkdownTable } from './utils.cjs';
|
|
8
|
-
export { BUTTON_SIZE, BUTTON_VARIANT, Button, ButtonProps, ButtonSize, ButtonVariant, ICON_POSITION, IconPosition } from './button.cjs';
|
|
8
|
+
export { BUTTON_INTENT, BUTTON_SIZE, BUTTON_VARIANT, Button, ButtonIntent, ButtonProps, ButtonSize, ButtonVariant, ICON_POSITION, IconPosition } from './button.cjs';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import 'react';
|
|
11
11
|
import 'lottie-web';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { IconCtrl, KEYBOARD_SHORTCUT_VARIANTS, KeyIcon, KeyboardShortcut, Keyboa
|
|
|
5
5
|
export { Lottie, LottieAnimationData, LottieProps, LottieRef } from './lottie.js';
|
|
6
6
|
export { TextArea, TextAreaProps } from './text-area.js';
|
|
7
7
|
export { MarkdownTable, convertTableToCSV, markdownToPlainText, mergeRefs, parseMarkdownTable } from './utils.js';
|
|
8
|
-
export { BUTTON_SIZE, BUTTON_VARIANT, Button, ButtonProps, ButtonSize, ButtonVariant, ICON_POSITION, IconPosition } from './button.js';
|
|
8
|
+
export { BUTTON_INTENT, BUTTON_SIZE, BUTTON_VARIANT, Button, ButtonIntent, ButtonProps, ButtonSize, ButtonVariant, ICON_POSITION, IconPosition } from './button.js';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import 'react';
|
|
11
11
|
import 'lottie-web';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BUTTON_INTENT,
|
|
2
3
|
BUTTON_SIZE,
|
|
3
4
|
BUTTON_VARIANT,
|
|
4
5
|
Button,
|
|
5
6
|
ICON_POSITION
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EDICS62G.js";
|
|
7
8
|
import "./chunk-C77QMQNT.js";
|
|
8
9
|
import {
|
|
9
10
|
ChatContext,
|
|
@@ -51,6 +52,7 @@ import {
|
|
|
51
52
|
} from "./chunk-KNYB3RL7.js";
|
|
52
53
|
import "./chunk-5WRI5ZAA.js";
|
|
53
54
|
export {
|
|
55
|
+
BUTTON_INTENT,
|
|
54
56
|
BUTTON_SIZE,
|
|
55
57
|
BUTTON_VARIANT,
|
|
56
58
|
Button,
|
package/package.json
CHANGED
package/dist/chunk-FFABDVB3.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
typographyMixin,
|
|
3
|
-
typographyTypes
|
|
4
|
-
} from "./chunk-SV24ONND.js";
|
|
5
|
-
import {
|
|
6
|
-
Icon
|
|
7
|
-
} from "./chunk-OLJIJYB5.js";
|
|
8
|
-
import {
|
|
9
|
-
colors
|
|
10
|
-
} from "./chunk-JF3P66JF.js";
|
|
11
|
-
|
|
12
|
-
// src/components/button/button.tsx
|
|
13
|
-
import { forwardRef } from "react";
|
|
14
|
-
|
|
15
|
-
// src/components/button/button-styles.ts
|
|
16
|
-
import styled, { css } from "styled-components";
|
|
17
|
-
var sizeStyles = {
|
|
18
|
-
xs: css`
|
|
19
|
-
padding: 6px 10px;
|
|
20
|
-
border-radius: 8px;
|
|
21
|
-
gap: 4px;
|
|
22
|
-
`,
|
|
23
|
-
s: css`
|
|
24
|
-
padding: 8px 12px;
|
|
25
|
-
border-radius: 10px;
|
|
26
|
-
gap: 6px;
|
|
27
|
-
`,
|
|
28
|
-
m: css`
|
|
29
|
-
padding: 10px 14px;
|
|
30
|
-
border-radius: 10px;
|
|
31
|
-
gap: 6px;
|
|
32
|
-
`
|
|
33
|
-
};
|
|
34
|
-
var variantStyles = {
|
|
35
|
-
solid: css`
|
|
36
|
-
background: ${colors["brown-100"]};
|
|
37
|
-
color: ${colors.white};
|
|
38
|
-
border: none;
|
|
39
|
-
|
|
40
|
-
&:hover:not(:disabled) {
|
|
41
|
-
background: ${colors["brown-90"]};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&:disabled {
|
|
45
|
-
background: ${colors["brown-20"]};
|
|
46
|
-
color: ${colors["brown-50"]};
|
|
47
|
-
}
|
|
48
|
-
`,
|
|
49
|
-
outline: css`
|
|
50
|
-
background: ${colors.white};
|
|
51
|
-
color: ${colors["brown-100"]};
|
|
52
|
-
border: 1px solid ${colors["brown-40"]};
|
|
53
|
-
|
|
54
|
-
&:hover:not(:disabled) {
|
|
55
|
-
background: ${colors["brown-20"]};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&:disabled {
|
|
59
|
-
border-color: ${colors["brown-20"]};
|
|
60
|
-
color: ${colors["brown-50"]};
|
|
61
|
-
}
|
|
62
|
-
`,
|
|
63
|
-
ghost: css`
|
|
64
|
-
background: transparent;
|
|
65
|
-
color: ${colors["brown-100"]};
|
|
66
|
-
border: none;
|
|
67
|
-
|
|
68
|
-
&:hover:not(:disabled) {
|
|
69
|
-
background: ${colors["brown-20"]};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&:disabled {
|
|
73
|
-
color: ${colors["brown-50"]};
|
|
74
|
-
}
|
|
75
|
-
`
|
|
76
|
-
};
|
|
77
|
-
var StyledButton = styled.button`
|
|
78
|
-
display: inline-flex;
|
|
79
|
-
align-items: center;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
cursor: pointer;
|
|
82
|
-
${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};
|
|
83
|
-
transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
|
|
84
|
-
|
|
85
|
-
&:disabled {
|
|
86
|
-
cursor: not-allowed;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
${({ $size }) => sizeStyles[$size]}
|
|
90
|
-
${({ $variant }) => variantStyles[$variant]}
|
|
91
|
-
`;
|
|
92
|
-
|
|
93
|
-
// src/components/button/constants.ts
|
|
94
|
-
var BUTTON_VARIANT = {
|
|
95
|
-
SOLID: "solid",
|
|
96
|
-
OUTLINE: "outline",
|
|
97
|
-
GHOST: "ghost"
|
|
98
|
-
};
|
|
99
|
-
var BUTTON_SIZE = {
|
|
100
|
-
XS: "xs",
|
|
101
|
-
S: "s",
|
|
102
|
-
M: "m"
|
|
103
|
-
};
|
|
104
|
-
var ICON_POSITION = {
|
|
105
|
-
LEADING: "leading",
|
|
106
|
-
TRAILING: "trailing"
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// src/components/button/button.tsx
|
|
110
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
111
|
-
var Button = forwardRef(function Button2({
|
|
112
|
-
children,
|
|
113
|
-
variant = BUTTON_VARIANT.SOLID,
|
|
114
|
-
size = BUTTON_SIZE.M,
|
|
115
|
-
icon,
|
|
116
|
-
iconPosition = ICON_POSITION.LEADING,
|
|
117
|
-
disabled = false,
|
|
118
|
-
onClick,
|
|
119
|
-
className,
|
|
120
|
-
"aria-label": ariaLabel
|
|
121
|
-
}, ref) {
|
|
122
|
-
const iconElement = icon ? /* @__PURE__ */ jsx(Icon, { icon, size: 16 }) : null;
|
|
123
|
-
return /* @__PURE__ */ jsxs(
|
|
124
|
-
StyledButton,
|
|
125
|
-
{
|
|
126
|
-
ref,
|
|
127
|
-
type: "button",
|
|
128
|
-
$variant: variant,
|
|
129
|
-
$size: size,
|
|
130
|
-
disabled,
|
|
131
|
-
onClick: disabled ? void 0 : onClick,
|
|
132
|
-
className,
|
|
133
|
-
"aria-label": ariaLabel,
|
|
134
|
-
children: [
|
|
135
|
-
iconPosition === ICON_POSITION.LEADING && iconElement,
|
|
136
|
-
/* @__PURE__ */ jsx("span", { children }),
|
|
137
|
-
iconPosition === ICON_POSITION.TRAILING && iconElement
|
|
138
|
-
]
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
export {
|
|
144
|
-
BUTTON_VARIANT,
|
|
145
|
-
BUTTON_SIZE,
|
|
146
|
-
ICON_POSITION,
|
|
147
|
-
Button
|
|
148
|
-
};
|
|
149
|
-
//# sourceMappingURL=chunk-FFABDVB3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/button/button.tsx","../src/components/button/button-styles.ts","../src/components/button/constants.ts"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Icon } from \"../icon/icon\";\nimport { StyledButton } from \"./button-styles\";\nimport { BUTTON_SIZE, BUTTON_VARIANT, ICON_POSITION } from \"./constants\";\nimport type { ButtonProps } from \"./types\";\n\n/** A versatile button component with multiple variants and sizes. */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n variant = BUTTON_VARIANT.SOLID,\n size = BUTTON_SIZE.M,\n icon,\n iconPosition = ICON_POSITION.LEADING,\n disabled = false,\n onClick,\n className,\n \"aria-label\": ariaLabel,\n },\n ref\n) {\n const iconElement = icon ? <Icon icon={icon} size={16} /> : null;\n\n return (\n <StyledButton\n ref={ref}\n type=\"button\"\n $variant={variant}\n $size={size}\n disabled={disabled}\n onClick={disabled ? undefined : onClick}\n className={className}\n aria-label={ariaLabel}\n >\n {iconPosition === ICON_POSITION.LEADING && iconElement}\n <span>{children}</span>\n {iconPosition === ICON_POSITION.TRAILING && iconElement}\n </StyledButton>\n );\n});\n","import styled, { css } from \"styled-components\";\nimport { colors } from \"../../tokens/colors\";\nimport { typographyMixin, typographyTypes } from \"../../tokens/typography\";\nimport type { ButtonSize, ButtonVariant } from \"./types\";\n\nconst sizeStyles: Record<ButtonSize, ReturnType<typeof css>> = {\n xs: css`\n padding: 6px 10px;\n border-radius: 8px;\n gap: 4px;\n `,\n s: css`\n padding: 8px 12px;\n border-radius: 10px;\n gap: 6px;\n `,\n m: css`\n padding: 10px 14px;\n border-radius: 10px;\n gap: 6px;\n `,\n};\n\nconst variantStyles: Record<ButtonVariant, ReturnType<typeof css>> = {\n solid: css`\n background: ${colors[\"brown-100\"]};\n color: ${colors.white};\n border: none;\n\n &:hover:not(:disabled) {\n background: ${colors[\"brown-90\"]};\n }\n\n &:disabled {\n background: ${colors[\"brown-20\"]};\n color: ${colors[\"brown-50\"]};\n }\n `,\n outline: css`\n background: ${colors.white};\n color: ${colors[\"brown-100\"]};\n border: 1px solid ${colors[\"brown-40\"]};\n\n &:hover:not(:disabled) {\n background: ${colors[\"brown-20\"]};\n }\n\n &:disabled {\n border-color: ${colors[\"brown-20\"]};\n color: ${colors[\"brown-50\"]};\n }\n `,\n ghost: css`\n background: transparent;\n color: ${colors[\"brown-100\"]};\n border: none;\n\n &:hover:not(:disabled) {\n background: ${colors[\"brown-20\"]};\n }\n\n &:disabled {\n color: ${colors[\"brown-50\"]};\n }\n `,\n};\n\n/** Styled button element with variant and size transient props. */\nexport const StyledButton = styled.button<{ $variant: ButtonVariant; $size: ButtonSize }>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n ${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};\n transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;\n\n &:disabled {\n cursor: not-allowed;\n }\n\n ${({ $size }) => sizeStyles[$size]}\n ${({ $variant }) => variantStyles[$variant]}\n`;\n","/** Available visual style variants for the Button component. */\nexport const BUTTON_VARIANT = {\n SOLID: \"solid\",\n OUTLINE: \"outline\",\n GHOST: \"ghost\",\n} as const;\n\n/** Available size presets for the Button component. */\nexport const BUTTON_SIZE = {\n XS: \"xs\",\n S: \"s\",\n M: \"m\",\n} as const;\n\n/** Available icon positions relative to the label text. */\nexport const ICON_POSITION = {\n LEADING: \"leading\",\n TRAILING: \"trailing\",\n} as const;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,kBAAkB;;;ACA3B,OAAO,UAAU,WAAW;AAK5B,IAAM,aAAyD;AAAA,EAC7D,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,EAKJ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,EAKH,GAAG;AAAA;AAAA;AAAA;AAAA;AAKL;AAEA,IAAM,gBAA+D;AAAA,EACnE,OAAO;AAAA,kBACS,OAAO,WAAW,CAAC;AAAA,aACxB,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,oBAIL,OAAO,UAAU,CAAC;AAAA;AAAA;AAAA;AAAA,oBAIlB,OAAO,UAAU,CAAC;AAAA,eACvB,OAAO,UAAU,CAAC;AAAA;AAAA;AAAA,EAG/B,SAAS;AAAA,kBACO,OAAO,KAAK;AAAA,aACjB,OAAO,WAAW,CAAC;AAAA,wBACR,OAAO,UAAU,CAAC;AAAA;AAAA;AAAA,oBAGtB,OAAO,UAAU,CAAC;AAAA;AAAA;AAAA;AAAA,sBAIhB,OAAO,UAAU,CAAC;AAAA,eACzB,OAAO,UAAU,CAAC;AAAA;AAAA;AAAA,EAG/B,OAAO;AAAA;AAAA,aAEI,OAAO,WAAW,CAAC;AAAA;AAAA;AAAA;AAAA,oBAIZ,OAAO,UAAU,CAAC;AAAA;AA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