@shapesos/clay 0.4.0 → 0.4.1

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.cts CHANGED
@@ -1,16 +1,25 @@
1
1
  export { ColorToken, TypographyStyle, TypographyType, colors, fontFamilies, typographyMixin, typographyStyles, typographyTypes } from './tokens.cjs';
2
- export { Chat, ChatContextValue, ChatMessage, MessageRole } from './chat.cjs';
2
+ export { ChatContext, ChatContextValue, ChatMessage, ChatMessageType, MessageRole, useChatContext, useCopyToClipboard } from './chat.cjs';
3
3
  export { Icon, IconButton, IconButtonProps, IconButtonSize, IconProps } from './icon.cjs';
4
- import { ReactElement } from 'react';
4
+ import { ComponentType, SVGProps, ReactElement } from 'react';
5
5
  export { Lottie, LottieAnimationData, LottieProps, LottieRef } from './lottie.cjs';
6
6
  import 'react/jsx-runtime';
7
7
  import 'lottie-web';
8
8
 
9
+ type KeyIcon = ComponentType<SVGProps<SVGSVGElement>>;
10
+ declare const KEYBOARD_SHORTCUT_VARIANTS: {
11
+ readonly OUTLINED: "outlined";
12
+ readonly FILLED: "filled";
13
+ };
14
+ type KeyboardShortcutVariant = (typeof KEYBOARD_SHORTCUT_VARIANTS)[keyof typeof KEYBOARD_SHORTCUT_VARIANTS];
9
15
  interface KeyboardShortcutProps {
10
- keys: string[];
16
+ keys: KeyIcon[];
17
+ variant?: KeyboardShortcutVariant;
11
18
  className?: string;
12
19
  }
13
20
 
14
- declare function KeyboardShortcut({ keys, className }: KeyboardShortcutProps): ReactElement;
21
+ declare function KeyboardShortcut({ keys, variant, className, }: KeyboardShortcutProps): ReactElement;
15
22
 
16
- export { KeyboardShortcut, type KeyboardShortcutProps };
23
+ declare function CtrlIcon(props: SVGProps<SVGSVGElement>): ReactElement;
24
+
25
+ export { CtrlIcon, KEYBOARD_SHORTCUT_VARIANTS, type KeyIcon, KeyboardShortcut, type KeyboardShortcutProps, type KeyboardShortcutVariant };
package/dist/index.d.ts CHANGED
@@ -1,16 +1,25 @@
1
1
  export { ColorToken, TypographyStyle, TypographyType, colors, fontFamilies, typographyMixin, typographyStyles, typographyTypes } from './tokens.js';
2
- export { Chat, ChatContextValue, ChatMessage, MessageRole } from './chat.js';
2
+ export { ChatContext, ChatContextValue, ChatMessage, ChatMessageType, MessageRole, useChatContext, useCopyToClipboard } from './chat.js';
3
3
  export { Icon, IconButton, IconButtonProps, IconButtonSize, IconProps } from './icon.js';
4
- import { ReactElement } from 'react';
4
+ import { ComponentType, SVGProps, ReactElement } from 'react';
5
5
  export { Lottie, LottieAnimationData, LottieProps, LottieRef } from './lottie.js';
6
6
  import 'react/jsx-runtime';
7
7
  import 'lottie-web';
8
8
 
9
+ type KeyIcon = ComponentType<SVGProps<SVGSVGElement>>;
10
+ declare const KEYBOARD_SHORTCUT_VARIANTS: {
11
+ readonly OUTLINED: "outlined";
12
+ readonly FILLED: "filled";
13
+ };
14
+ type KeyboardShortcutVariant = (typeof KEYBOARD_SHORTCUT_VARIANTS)[keyof typeof KEYBOARD_SHORTCUT_VARIANTS];
9
15
  interface KeyboardShortcutProps {
10
- keys: string[];
16
+ keys: KeyIcon[];
17
+ variant?: KeyboardShortcutVariant;
11
18
  className?: string;
12
19
  }
13
20
 
14
- declare function KeyboardShortcut({ keys, className }: KeyboardShortcutProps): ReactElement;
21
+ declare function KeyboardShortcut({ keys, variant, className, }: KeyboardShortcutProps): ReactElement;
15
22
 
16
- export { KeyboardShortcut, type KeyboardShortcutProps };
23
+ declare function CtrlIcon(props: SVGProps<SVGSVGElement>): ReactElement;
24
+
25
+ export { CtrlIcon, KEYBOARD_SHORTCUT_VARIANTS, type KeyIcon, KeyboardShortcut, type KeyboardShortcutProps, type KeyboardShortcutVariant };
package/dist/index.js CHANGED
@@ -1,57 +1,107 @@
1
1
  import "./chunk-C77QMQNT.js";
2
2
  import {
3
- Chat
4
- } from "./chunk-2GFOESHR.js";
3
+ ChatContext,
4
+ ChatMessage,
5
+ useChatContext,
6
+ useCopyToClipboard
7
+ } from "./chunk-EPS4LOOW.js";
5
8
  import {
6
9
  fontFamilies,
7
10
  typographyMixin,
8
11
  typographyStyles,
9
12
  typographyTypes
10
13
  } from "./chunk-A6DKIFWS.js";
11
- import "./chunk-7AJSQJQ5.js";
14
+ import "./chunk-72TJUKMV.js";
12
15
  import {
13
16
  Icon,
14
17
  IconButton
15
- } from "./chunk-P7NISN4V.js";
18
+ } from "./chunk-AEXYOY5H.js";
16
19
  import {
17
20
  colors
18
21
  } from "./chunk-6HNZQ2BF.js";
19
22
  import {
20
23
  Lottie
21
- } from "./chunk-UKM5VQKW.js";
24
+ } from "./chunk-BIATJTD4.js";
22
25
  import "./chunk-5WRI5ZAA.js";
23
26
 
24
- // src/keyboard-shortcut/keyboard-shortcut-styles.ts
25
- import styled from "styled-components";
27
+ // src/components/keyboard-shortcut/keyboard-shortcut-styles.ts
28
+ import styled, { css } from "styled-components";
29
+
30
+ // src/components/keyboard-shortcut/types.ts
31
+ var KEYBOARD_SHORTCUT_VARIANTS = {
32
+ OUTLINED: "outlined",
33
+ FILLED: "filled"
34
+ };
35
+
36
+ // src/components/keyboard-shortcut/keyboard-shortcut-styles.ts
37
+ var variantStyles = {
38
+ [KEYBOARD_SHORTCUT_VARIANTS.OUTLINED]: css`
39
+ border: 1px solid ${colors["brown-70"]};
40
+ color: ${colors["brown-10"]};
41
+ `,
42
+ [KEYBOARD_SHORTCUT_VARIANTS.FILLED]: css`
43
+ background: ${colors["brown-80"]};
44
+ color: ${colors["brown-10"]};
45
+ `
46
+ };
26
47
  var Wrapper = styled.div`
27
48
  display: inline-flex;
28
49
  align-items: center;
29
- gap: 4px;
50
+ gap: 2px;
30
51
  `;
31
52
  var Key = styled.kbd`
32
- padding: 1px 4px;
33
- border-radius: 4px;
34
- border: 1px solid ${colors["brown-70"]};
35
- border-bottom-width: 2px;
36
- ${typographyMixin(typographyTypes.GEIST_LABEL_CAPTION_MEDIUM)};
37
- color: inherit;
53
+ display: inline-flex;
54
+ align-items: center;
55
+ justify-content: center;
56
+ padding: 4px;
57
+ border-radius: 6px;
58
+ ${({ $variant }) => variantStyles[$variant]};
38
59
  `;
39
60
 
40
- // src/keyboard-shortcut/keyboard-shortcut.tsx
61
+ // src/components/keyboard-shortcut/keyboard-shortcut.tsx
41
62
  import { jsx } from "react/jsx-runtime";
42
- function KeyboardShortcut({ keys, className }) {
43
- return /* @__PURE__ */ jsx(Wrapper, { className, children: keys.map((key) => /* @__PURE__ */ jsx(Key, { children: key }, key)) });
63
+ function KeyboardShortcut({
64
+ keys,
65
+ variant = KEYBOARD_SHORTCUT_VARIANTS.OUTLINED,
66
+ className
67
+ }) {
68
+ return /* @__PURE__ */ jsx(Wrapper, { className, children: keys.map((KeyComponent, index) => /* @__PURE__ */ jsx(Key, { $variant: variant, children: /* @__PURE__ */ jsx(Icon, { icon: KeyComponent, size: 12 }) }, index)) });
69
+ }
70
+
71
+ // src/components/keyboard-shortcut/icons/ctrl-icon.tsx
72
+ import { jsx as jsx2 } from "react/jsx-runtime";
73
+ function CtrlIcon(props) {
74
+ const { width = 24, height = 24, ...rest } = props;
75
+ return /* @__PURE__ */ jsx2("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width, height, fill: "none", ...rest, children: /* @__PURE__ */ jsx2(
76
+ "text",
77
+ {
78
+ x: "50%",
79
+ y: "50%",
80
+ dominantBaseline: "central",
81
+ textAnchor: "middle",
82
+ fill: "currentColor",
83
+ fontFamily: "Geist, sans-serif",
84
+ fontWeight: 500,
85
+ fontSize: 14,
86
+ children: "Ctrl"
87
+ }
88
+ ) });
44
89
  }
45
90
  export {
46
- Chat,
91
+ ChatContext,
92
+ ChatMessage,
93
+ CtrlIcon,
47
94
  Icon,
48
95
  IconButton,
96
+ KEYBOARD_SHORTCUT_VARIANTS,
49
97
  KeyboardShortcut,
50
98
  Lottie,
51
99
  colors,
52
100
  fontFamilies,
53
101
  typographyMixin,
54
102
  typographyStyles,
55
- typographyTypes
103
+ typographyTypes,
104
+ useChatContext,
105
+ useCopyToClipboard
56
106
  };
57
107
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/keyboard-shortcut/keyboard-shortcut-styles.ts","../src/keyboard-shortcut/keyboard-shortcut.tsx"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { colors } from \"../tokens/colors\";\nimport { typographyMixin, typographyTypes } from \"../tokens/typography\";\n\nexport const Wrapper = styled.div`\n display: inline-flex;\n align-items: center;\n gap: 4px;\n`;\n\nexport const Key = styled.kbd`\n padding: 1px 4px;\n border-radius: 4px;\n border: 1px solid ${colors[\"brown-70\"]};\n border-bottom-width: 2px;\n ${typographyMixin(typographyTypes.GEIST_LABEL_CAPTION_MEDIUM)};\n color: inherit;\n`;\n","import type { ReactElement } from \"react\";\n\nimport { Key, Wrapper } from \"./keyboard-shortcut-styles\";\nimport type { KeyboardShortcutProps } from \"./types\";\n\nexport function KeyboardShortcut({ keys, className }: KeyboardShortcutProps): ReactElement {\n return (\n <Wrapper className={className}>\n {keys.map((key) => (\n <Key key={key}>{key}</Key>\n ))}\n </Wrapper>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,YAAY;AAKZ,IAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAMvB,IAAM,MAAM,OAAO;AAAA;AAAA;AAAA,sBAGJ,OAAO,UAAU,CAAC;AAAA;AAAA,IAEpC,gBAAgB,gBAAgB,0BAA0B,CAAC;AAAA;AAAA;;;ACPvD;AAJD,SAAS,iBAAiB,EAAE,MAAM,UAAU,GAAwC;AACzF,SACE,oBAAC,WAAQ,WACN,eAAK,IAAI,CAAC,QACT,oBAAC,OAAe,iBAAN,GAAU,CACrB,GACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/components/keyboard-shortcut/keyboard-shortcut-styles.ts","../src/components/keyboard-shortcut/types.ts","../src/components/keyboard-shortcut/keyboard-shortcut.tsx","../src/components/keyboard-shortcut/icons/ctrl-icon.tsx"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { colors } from \"../../tokens/colors\";\nimport { KEYBOARD_SHORTCUT_VARIANTS } from \"./types\";\nimport type { KeyboardShortcutVariant } from \"./types\";\n\nconst variantStyles: Record<KeyboardShortcutVariant, ReturnType<typeof css>> = {\n [KEYBOARD_SHORTCUT_VARIANTS.OUTLINED]: css`\n border: 1px solid ${colors[\"brown-70\"]};\n color: ${colors[\"brown-10\"]};\n `,\n [KEYBOARD_SHORTCUT_VARIANTS.FILLED]: css`\n background: ${colors[\"brown-80\"]};\n color: ${colors[\"brown-10\"]};\n `,\n};\n\nexport const Wrapper = styled.div`\n display: inline-flex;\n align-items: center;\n gap: 2px;\n`;\n\nexport const Key = styled.kbd<{ $variant: KeyboardShortcutVariant }>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 4px;\n border-radius: 6px;\n ${({ $variant }) => variantStyles[$variant]};\n`;\n","import type { ComponentType, SVGProps } from \"react\";\n\nexport type KeyIcon = ComponentType<SVGProps<SVGSVGElement>>;\n\nexport const KEYBOARD_SHORTCUT_VARIANTS = {\n OUTLINED: \"outlined\",\n FILLED: \"filled\",\n} as const;\n\nexport type KeyboardShortcutVariant = (typeof KEYBOARD_SHORTCUT_VARIANTS)[keyof typeof KEYBOARD_SHORTCUT_VARIANTS];\n\nexport interface KeyboardShortcutProps {\n keys: KeyIcon[];\n variant?: KeyboardShortcutVariant;\n className?: string;\n}\n","import type { ReactElement } from \"react\";\n\nimport { Icon } from \"../icon/icon\";\nimport { Key, Wrapper } from \"./keyboard-shortcut-styles\";\nimport { KEYBOARD_SHORTCUT_VARIANTS } from \"./types\";\nimport type { KeyboardShortcutProps } from \"./types\";\n\nexport function KeyboardShortcut({\n keys,\n variant = KEYBOARD_SHORTCUT_VARIANTS.OUTLINED,\n className,\n}: KeyboardShortcutProps): ReactElement {\n return (\n <Wrapper className={className}>\n {keys.map((KeyComponent, index) => (\n <Key key={index} $variant={variant}>\n <Icon icon={KeyComponent} size={12} />\n </Key>\n ))}\n </Wrapper>\n );\n}\n","import type { ReactElement, SVGProps } from \"react\";\n\nexport function CtrlIcon(props: SVGProps<SVGSVGElement>): ReactElement {\n const { width = 24, height = 24, ...rest } = props;\n\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width={width} height={height} fill=\"none\" {...rest}>\n <text\n x=\"50%\"\n y=\"50%\"\n dominantBaseline=\"central\"\n textAnchor=\"middle\"\n fill=\"currentColor\"\n fontFamily=\"Geist, sans-serif\"\n fontWeight={500}\n fontSize={14}\n >\n Ctrl\n </text>\n </svg>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU,WAAW;;;ACIrB,IAAM,6BAA6B;AAAA,EACxC,UAAU;AAAA,EACV,QAAQ;AACV;;;ADDA,IAAM,gBAAyE;AAAA,EAC7E,CAAC,2BAA2B,QAAQ,GAAG;AAAA,wBACjB,OAAO,UAAU,CAAC;AAAA,aAC7B,OAAO,UAAU,CAAC;AAAA;AAAA,EAE7B,CAAC,2BAA2B,MAAM,GAAG;AAAA,kBACrB,OAAO,UAAU,CAAC;AAAA,aACvB,OAAO,UAAU,CAAC;AAAA;AAE/B;AAEO,IAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAMvB,IAAM,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMtB,CAAC,EAAE,SAAS,MAAM,cAAc,QAAQ,CAAC;AAAA;;;AEbnC;AATH,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,UAAU,2BAA2B;AAAA,EACrC;AACF,GAAwC;AACtC,SACE,oBAAC,WAAQ,WACN,eAAK,IAAI,CAAC,cAAc,UACvB,oBAAC,OAAgB,UAAU,SACzB,8BAAC,QAAK,MAAM,cAAc,MAAM,IAAI,KAD5B,KAEV,CACD,GACH;AAEJ;;;ACdM,gBAAAA,YAAA;AALC,SAAS,SAAS,OAA8C;AACrE,QAAM,EAAE,QAAQ,IAAI,SAAS,IAAI,GAAG,KAAK,IAAI;AAE7C,SACE,gBAAAA,KAAC,SAAI,OAAM,8BAA6B,SAAQ,aAAY,OAAc,QAAgB,MAAK,QAAQ,GAAG,MACxG,0BAAAA;AAAA,IAAC;AAAA;AAAA,MACC,GAAE;AAAA,MACF,GAAE;AAAA,MACF,kBAAiB;AAAA,MACjB,YAAW;AAAA,MACX,MAAK;AAAA,MACL,YAAW;AAAA,MACX,YAAY;AAAA,MACZ,UAAU;AAAA,MACX;AAAA;AAAA,EAED,GACF;AAEJ;","names":["jsx"]}
package/dist/lottie.cjs CHANGED
@@ -16339,17 +16339,17 @@ var require_lottie = __commonJS({
16339
16339
  }
16340
16340
  });
16341
16341
 
16342
- // src/lottie/index.ts
16342
+ // src/components/lottie/index.ts
16343
16343
  var lottie_exports = {};
16344
16344
  __export(lottie_exports, {
16345
16345
  Lottie: () => Lottie
16346
16346
  });
16347
16347
  module.exports = __toCommonJS(lottie_exports);
16348
16348
 
16349
- // src/lottie/lottie.tsx
16349
+ // src/components/lottie/lottie.tsx
16350
16350
  var import_react2 = require("react");
16351
16351
 
16352
- // src/lottie/lottie-styles.ts
16352
+ // src/components/lottie/lottie-styles.ts
16353
16353
  var import_styled_components = __toESM(require("styled-components"), 1);
16354
16354
  var LottieContainer = import_styled_components.default.div`
16355
16355
  display: inline-flex;
@@ -16362,7 +16362,7 @@ var LottieContainer = import_styled_components.default.div`
16362
16362
  }
16363
16363
  `;
16364
16364
 
16365
- // src/lottie/use-lottie.ts
16365
+ // src/components/lottie/use-lottie.ts
16366
16366
  var import_react = require("react");
16367
16367
  var import_lottie_web = __toESM(require_lottie(), 1);
16368
16368
  function useLottie({
@@ -16479,7 +16479,7 @@ function createLottieRef(animationRef) {
16479
16479
  };
16480
16480
  }
16481
16481
 
16482
- // src/lottie/lottie.tsx
16482
+ // src/components/lottie/lottie.tsx
16483
16483
  var import_jsx_runtime = require("react/jsx-runtime");
16484
16484
  var Lottie = (0, import_react2.forwardRef)(function Lottie2({
16485
16485
  animationData: animationData2,