@liner-fe/prism 1.13.25 → 1.13.27

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.
@@ -0,0 +1 @@
1
+ export declare const ampLogEventFunc: import("recoil").RecoilState<((title: string, properties?: any, callback?: undefined) => Promise<undefined>) | null>;
@@ -37,7 +37,9 @@ export interface TextButtonProps extends CommonButtonProps, VariantProps<typeof
37
37
  asChild?: boolean;
38
38
  level?: TextLevelType;
39
39
  }
40
- export type ButtonProps = DefaultButtonProps<FillType> | TextButtonProps;
40
+ export type ButtonProps = (DefaultButtonProps<FillType> | TextButtonProps) & {
41
+ elementName?: string;
42
+ };
41
43
  export declare const DefaultButton: import("react").ForwardRefExoticComponent<DefaultButtonProps<boolean> & import("react").RefAttributes<HTMLButtonElement>>;
42
44
  export declare const TextButton: import("react").ForwardRefExoticComponent<TextButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
43
45
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
package/lib/index.d.ts CHANGED
@@ -15,3 +15,4 @@ export * from './components/Select';
15
15
  export * from './components/List';
16
16
  export * from './types/color';
17
17
  export * from './type/index';
18
+ export * from './PrismProvider';
package/lib/index.mjs CHANGED
@@ -3146,10 +3146,10 @@ var ICMemo = /* @__PURE__ */ __name((props) => {
3146
3146
  return /* @__PURE__ */ jsx69("svg", { ...props, width: size, height: size, viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx69(
3147
3147
  "path",
3148
3148
  {
3149
- d: "M14 12H12V14V18V20V22V26V28V30V34V36H14H27H29V34V30V28H34H36V26V22V20V18V14V12H34H14ZM41 41H7L7 7L41 7V41Z",
3150
- fill: color,
3151
- stroke: "#1E1E1F",
3152
- "stroke-width": "4"
3149
+ "fill-rule": "evenodd",
3150
+ "clip-rule": "evenodd",
3151
+ d: "M41 43H7C5.89543 43 5 42.1046 5 41V7C5 5.89543 5.89543 5 7 5H41C42.1046 5 43 5.89543 43 7V41C43 42.1046 42.1046 43 41 43ZM14 14V18H34V14H14ZM14 22H34V26H14V22ZM14 30V34H27V30H14Z",
3152
+ fill: color
3153
3153
  }
3154
3154
  ) });
3155
3155
  }
@@ -3173,10 +3173,10 @@ var ICMemo = /* @__PURE__ */ __name((props) => {
3173
3173
  return /* @__PURE__ */ jsx69("svg", { ...props, width: size, height: size, viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx69(
3174
3174
  "path",
3175
3175
  {
3176
- d: "M14.5 13H13V14.5V17.5V19H14.5H33.5H35V17.5V14.5V13H33.5H14.5ZM14.5 21H13V22.5V25.5V27H14.5H33.5H35V25.5V22.5V21H33.5H14.5ZM14.5 29H13V30.5V33.5V35H14.5H26.5H28V33.5V30.5V29H26.5H14.5ZM41 41.5H7C6.72386 41.5 6.5 41.2761 6.5 41V7C6.5 6.72386 6.72386 6.5 7 6.5H41C41.2761 6.5 41.5 6.72386 41.5 7V41C41.5 41.2761 41.2761 41.5 41 41.5Z",
3177
- fill: color,
3178
- stroke: "#1E1E1F",
3179
- "stroke-width": "3"
3176
+ "fill-rule": "evenodd",
3177
+ "clip-rule": "evenodd",
3178
+ d: "M41 43H7C5.89543 43 5 42.1046 5 41V7C5 5.89543 5.89543 5 7 5H41C42.1046 5 43 5.89543 43 7V41C43 42.1046 42.1046 43 41 43ZM14.5 14.5V17.5H33.5V14.5H14.5ZM14.5 22.5H33.5V25.5H14.5V22.5ZM14.5 30.5V33.5H26.5V30.5H14.5Z",
3179
+ fill: color
3180
3180
  }
3181
3181
  ) });
3182
3182
  }
@@ -6946,6 +6946,16 @@ var Icon = /* @__PURE__ */ __name((props) => {
6946
6946
  );
6947
6947
  }, "Icon");
6948
6948
 
6949
+ // src/components/Button/index.tsx
6950
+ import { useRecoilValue } from "recoil";
6951
+
6952
+ // src/PrismProvider.tsx
6953
+ import { atom } from "recoil";
6954
+ var ampLogEventFunc = atom({
6955
+ key: "ampLogEventFunc",
6956
+ default: null
6957
+ });
6958
+
6949
6959
  // src/components/Button/index.tsx
6950
6960
  import { jsx as jsx144, jsxs as jsxs103 } from "react/jsx-runtime";
6951
6961
  var buttonIconSizeMap = {
@@ -7064,18 +7074,47 @@ var TextButton = forwardRef(
7064
7074
  }
7065
7075
  );
7066
7076
  var Button = forwardRef((props, ref) => {
7067
- switch (props.as) {
7077
+ const ampLogEvent = useRecoilValue(ampLogEventFunc);
7078
+ const { elementName, ...rest } = props;
7079
+ switch (rest.as) {
7068
7080
  case "default":
7069
7081
  case void 0:
7070
- return /* @__PURE__ */ jsx144(DefaultButton, { ...props, ref });
7082
+ return /* @__PURE__ */ jsx144(
7083
+ DefaultButton,
7084
+ {
7085
+ ...rest,
7086
+ onClick: (e) => {
7087
+ if (ampLogEvent) {
7088
+ ampLogEvent(`click_${elementName}_button`, {
7089
+ button_text: rest.children?.toString(),
7090
+ ...rest.leftIcon?.name || rest.rightIcon?.name ? { button_icon: rest.leftIcon?.name || rest.rightIcon?.name } : {}
7091
+ });
7092
+ }
7093
+ props.onClick?.(e);
7094
+ },
7095
+ ref
7096
+ }
7097
+ );
7071
7098
  case "text":
7072
- return /* @__PURE__ */ jsx144(TextButton, { ...props, ref });
7099
+ return /* @__PURE__ */ jsx144(
7100
+ TextButton,
7101
+ {
7102
+ ...rest,
7103
+ onClick: (e) => {
7104
+ if (ampLogEvent) {
7105
+ ampLogEvent(`click_${elementName}_button`, { button_text: rest.children?.toString() });
7106
+ }
7107
+ props.onClick?.(e);
7108
+ },
7109
+ ref
7110
+ }
7111
+ );
7073
7112
  }
7074
7113
  });
7075
7114
 
7076
7115
  // src/components/Toast/hooks/useToast.ts
7077
- import { atom, useSetRecoilState } from "recoil";
7078
- var toastAtom = atom({
7116
+ import { atom as atom2, useSetRecoilState } from "recoil";
7117
+ var toastAtom = atom2({
7079
7118
  default: { list: [] },
7080
7119
  key: "toastAtoms"
7081
7120
  });
@@ -7183,7 +7222,7 @@ var Paragraph = forwardRef2(
7183
7222
  );
7184
7223
 
7185
7224
  // src/components/Toast/index.tsx
7186
- import { useRecoilValue, useSetRecoilState as useSetRecoilState2 } from "recoil";
7225
+ import { useRecoilValue as useRecoilValue2, useSetRecoilState as useSetRecoilState2 } from "recoil";
7187
7226
  import Lottie from "lottie-web";
7188
7227
 
7189
7228
  // src/lottie/loading.json
@@ -7663,7 +7702,7 @@ var loading_default = {
7663
7702
  import { jsx as jsx146, jsxs as jsxs104 } from "react/jsx-runtime";
7664
7703
  import { createElement } from "react";
7665
7704
  var Toaster = /* @__PURE__ */ __name(() => {
7666
- const { list } = useRecoilValue(toastAtom);
7705
+ const { list } = useRecoilValue2(toastAtom);
7667
7706
  return /* @__PURE__ */ jsxs104(Provider, { children: [
7668
7707
  list.map((props) => /* @__PURE__ */ createElement(SingleToast, { ...props, key: props.toastId })),
7669
7708
  /* @__PURE__ */ jsx146(Viewport, { className: style_module_default3.ToastViewport })
@@ -8759,6 +8798,7 @@ export {
8759
8798
  Toaster,
8760
8799
  Tooltip,
8761
8800
  Typography,
8801
+ ampLogEventFunc,
8762
8802
  arrayToStyleObject,
8763
8803
  colorKeys,
8764
8804
  getIconComponent,