analytica-frontend-lib 1.0.37 → 1.0.38

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.mts CHANGED
@@ -19,7 +19,8 @@ export { default as useToastStore } from './Toast/ToastStore/index.mjs';
19
19
  export { default as ProgressBar } from './ProgressBar/index.mjs';
20
20
  export { default as ProgressCircle } from './ProgressCircle/index.mjs';
21
21
  export { default as DropdownMenu, DropdownMenuTrigger, MenuContent, MenuItem, MenuLabel, MenuSeparator, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger } from './DropdownMenu/index.mjs';
22
- import { StoreApi } from 'zustand';
22
+ export { default as Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select/index.mjs';
23
+ import 'zustand';
23
24
 
24
25
  /**
25
26
  * Divider component props interface
@@ -109,46 +110,4 @@ type ChipsProps = {
109
110
  */
110
111
  declare const Chips: ({ children, selected, className, disabled, type, ...props }: ChipsProps) => react_jsx_runtime.JSX.Element;
111
112
 
112
- interface SelectStore {
113
- open: boolean;
114
- setOpen: (open: boolean) => void;
115
- value: string;
116
- setValue: (value: string) => void;
117
- selectedLabel: ReactNode;
118
- setSelectedLabel: (label: ReactNode) => void;
119
- }
120
- type SelectStoreApi = StoreApi<SelectStore>;
121
- interface SelectProps {
122
- children: ReactNode;
123
- defaultValue?: string;
124
- value?: string;
125
- onValueChange?: (value: string) => void;
126
- size?: 'small' | 'medium' | 'large';
127
- }
128
- declare const Select: ({ children, defaultValue, value: propValue, onValueChange, size, }: SelectProps) => react_jsx_runtime.JSX.Element;
129
- declare const SelectValue: ({ placeholder, store: externalStore, }: {
130
- placeholder?: string;
131
- store?: SelectStoreApi;
132
- }) => react_jsx_runtime.JSX.Element;
133
- interface SelectTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
134
- className?: string;
135
- invalid?: boolean;
136
- variant?: 'outlined' | 'underlined' | 'rounded';
137
- store?: SelectStoreApi;
138
- }
139
- declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
140
- interface SelectContentProps extends HTMLAttributes<HTMLDivElement> {
141
- className?: string;
142
- align?: 'start' | 'center' | 'end';
143
- side?: 'top' | 'right' | 'bottom' | 'left';
144
- store?: SelectStoreApi;
145
- }
146
- declare const SelectContent: react.ForwardRefExoticComponent<SelectContentProps & react.RefAttributes<HTMLDivElement>>;
147
- interface SelectItemProps extends HTMLAttributes<HTMLDivElement> {
148
- value: string;
149
- disabled?: boolean;
150
- store?: SelectStoreApi;
151
- }
152
- declare const SelectItem: react.ForwardRefExoticComponent<SelectItemProps & react.RefAttributes<HTMLDivElement>>;
153
-
154
- export { Chips, Divider, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue };
113
+ export { Chips, Divider, Input };
package/dist/index.d.ts CHANGED
@@ -19,7 +19,8 @@ export { default as useToastStore } from './Toast/ToastStore/index.js';
19
19
  export { default as ProgressBar } from './ProgressBar/index.js';
20
20
  export { default as ProgressCircle } from './ProgressCircle/index.js';
21
21
  export { default as DropdownMenu, DropdownMenuTrigger, MenuContent, MenuItem, MenuLabel, MenuSeparator, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger } from './DropdownMenu/index.js';
22
- import { StoreApi } from 'zustand';
22
+ export { default as Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select/index.js';
23
+ import 'zustand';
23
24
 
24
25
  /**
25
26
  * Divider component props interface
@@ -109,46 +110,4 @@ type ChipsProps = {
109
110
  */
110
111
  declare const Chips: ({ children, selected, className, disabled, type, ...props }: ChipsProps) => react_jsx_runtime.JSX.Element;
111
112
 
112
- interface SelectStore {
113
- open: boolean;
114
- setOpen: (open: boolean) => void;
115
- value: string;
116
- setValue: (value: string) => void;
117
- selectedLabel: ReactNode;
118
- setSelectedLabel: (label: ReactNode) => void;
119
- }
120
- type SelectStoreApi = StoreApi<SelectStore>;
121
- interface SelectProps {
122
- children: ReactNode;
123
- defaultValue?: string;
124
- value?: string;
125
- onValueChange?: (value: string) => void;
126
- size?: 'small' | 'medium' | 'large';
127
- }
128
- declare const Select: ({ children, defaultValue, value: propValue, onValueChange, size, }: SelectProps) => react_jsx_runtime.JSX.Element;
129
- declare const SelectValue: ({ placeholder, store: externalStore, }: {
130
- placeholder?: string;
131
- store?: SelectStoreApi;
132
- }) => react_jsx_runtime.JSX.Element;
133
- interface SelectTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
134
- className?: string;
135
- invalid?: boolean;
136
- variant?: 'outlined' | 'underlined' | 'rounded';
137
- store?: SelectStoreApi;
138
- }
139
- declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
140
- interface SelectContentProps extends HTMLAttributes<HTMLDivElement> {
141
- className?: string;
142
- align?: 'start' | 'center' | 'end';
143
- side?: 'top' | 'right' | 'bottom' | 'left';
144
- store?: SelectStoreApi;
145
- }
146
- declare const SelectContent: react.ForwardRefExoticComponent<SelectContentProps & react.RefAttributes<HTMLDivElement>>;
147
- interface SelectItemProps extends HTMLAttributes<HTMLDivElement> {
148
- value: string;
149
- disabled?: boolean;
150
- store?: SelectStoreApi;
151
- }
152
- declare const SelectItem: react.ForwardRefExoticComponent<SelectItemProps & react.RefAttributes<HTMLDivElement>>;
153
-
154
- export { Chips, Divider, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue };
113
+ export { Chips, Divider, Input };
package/dist/index.js CHANGED
@@ -1907,26 +1907,32 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
1907
1907
  }, []);
1908
1908
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
1909
1909
  };
1910
- var DropdownMenuTrigger = (0, import_react9.forwardRef)(({ className, children, onClick, store: externalStore, ...props }, ref) => {
1910
+ var DropdownMenuTrigger = ({
1911
+ className,
1912
+ children,
1913
+ onClick,
1914
+ store: externalStore,
1915
+ ...props
1916
+ }) => {
1911
1917
  const store = useDropdownStore(externalStore);
1912
1918
  const open = (0, import_zustand2.useStore)(store, (s) => s.open);
1913
1919
  const toggleOpen = () => store.setState({ open: !open });
1914
1920
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1915
- "button",
1921
+ Button_default,
1916
1922
  {
1917
- ref,
1918
- className: `border border-border-200 cursor-pointer bg-background-muted hover:bg-background-200 transition-colors px-4 py-2 rounded-sm ${className}`,
1923
+ variant: "outline",
1919
1924
  onClick: (e) => {
1920
1925
  e.stopPropagation();
1921
1926
  toggleOpen();
1922
1927
  if (onClick) onClick(e);
1923
1928
  },
1924
1929
  "aria-expanded": open,
1930
+ className: `${className}`,
1925
1931
  ...props,
1926
1932
  children
1927
1933
  }
1928
1934
  );
1929
- });
1935
+ };
1930
1936
  DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
1931
1937
  var ITEM_SIZE_CLASSES = {
1932
1938
  small: "text-sm",
@@ -1943,6 +1949,10 @@ var ALIGN_CLASSES = {
1943
1949
  center: "left-1/2 -translate-x-1/2",
1944
1950
  end: "right-0"
1945
1951
  };
1952
+ var MENUCONTENT_VARIANT_CLASSES = {
1953
+ menu: "p-1",
1954
+ profile: "p-6"
1955
+ };
1946
1956
  var MenuLabel = (0, import_react9.forwardRef)(({ className, inset, store: _store, ...props }, ref) => {
1947
1957
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1948
1958
  "div",
@@ -1959,6 +1969,7 @@ var MenuContent = (0, import_react9.forwardRef)(
1959
1969
  className,
1960
1970
  align = "start",
1961
1971
  side = "bottom",
1972
+ variant = "menu",
1962
1973
  sideOffset = 4,
1963
1974
  children,
1964
1975
  store: externalStore,
@@ -1981,15 +1992,17 @@ var MenuContent = (0, import_react9.forwardRef)(
1981
1992
  const horizontal = ALIGN_CLASSES[align];
1982
1993
  return `absolute ${vertical} ${horizontal}`;
1983
1994
  };
1995
+ const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];
1984
1996
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1985
1997
  "div",
1986
1998
  {
1987
1999
  ref,
1988
2000
  role: "menu",
1989
2001
  className: `
1990
- bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100
2002
+ bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md border-border-100
1991
2003
  ${open ? "animate-in fade-in-0 zoom-in-95" : "animate-out fade-out-0 zoom-out-95"}
1992
2004
  ${getPositionClasses()}
2005
+ ${variantClasses}
1993
2006
  ${className}
1994
2007
  `,
1995
2008
  style: {
@@ -2032,7 +2045,7 @@ var MenuItem = (0, import_react9.forwardRef)(
2032
2045
  };
2033
2046
  const getVariantClasses = () => {
2034
2047
  if (variant === "profile") {
2035
- return "relative flex flex-row justify-between select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-6 [&>svg]:shrink-0";
2048
+ return "relative flex flex-row justify-between select-none items-center gap-2 rounded-sm p-4 text-sm outline-none transition-colors [&>svg]:size-6 [&>svg]:shrink-0";
2036
2049
  }
2037
2050
  return "relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0";
2038
2051
  };
@@ -2061,7 +2074,7 @@ var MenuItem = (0, import_react9.forwardRef)(
2061
2074
  ...props,
2062
2075
  children: [
2063
2076
  iconLeft,
2064
- children,
2077
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w-full text-md", children }),
2065
2078
  iconRight
2066
2079
  ]
2067
2080
  }
@@ -2136,29 +2149,33 @@ var ProfileMenuSection = (0, import_react9.forwardRef)(({ className, children, s
2136
2149
  );
2137
2150
  });
2138
2151
  ProfileMenuSection.displayName = "ProfileMenuSection";
2139
- var ProfileMenuFooter = (0, import_react9.forwardRef)(
2140
- ({ className, disabled = false, onClick, store: externalStore, ...props }, ref) => {
2141
- const store = useDropdownStore(externalStore);
2142
- const setOpen = (0, import_zustand2.useStore)(store, (s) => s.setOpen);
2143
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2144
- "button",
2145
- {
2146
- ref,
2147
- className: `inline-flex items-center justify-center rounded-full cursor-pointer font-medium text-md px-5 py-2.5 w-full bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed ${className}`,
2148
- disabled,
2149
- onClick: (e) => {
2150
- setOpen(false);
2151
- onClick?.(e);
2152
- },
2153
- ...props,
2154
- children: [
2155
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react7.SignOut, {}) }),
2156
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Sair" })
2157
- ]
2158
- }
2159
- );
2160
- }
2161
- );
2152
+ var ProfileMenuFooter = ({
2153
+ className,
2154
+ disabled = false,
2155
+ onClick,
2156
+ store: externalStore,
2157
+ ...props
2158
+ }) => {
2159
+ const store = useDropdownStore(externalStore);
2160
+ const setOpen = (0, import_zustand2.useStore)(store, (s) => s.setOpen);
2161
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2162
+ Button_default,
2163
+ {
2164
+ variant: "outline",
2165
+ className: `w-full ${className}`,
2166
+ disabled,
2167
+ onClick: (e) => {
2168
+ setOpen(false);
2169
+ onClick?.(e);
2170
+ },
2171
+ ...props,
2172
+ children: [
2173
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react7.SignOut, {}) }),
2174
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Sair" })
2175
+ ]
2176
+ }
2177
+ );
2178
+ };
2162
2179
  ProfileMenuFooter.displayName = "ProfileMenuFooter";
2163
2180
  var DropdownMenu_default = DropdownMenu;
2164
2181
 
@@ -2341,8 +2358,9 @@ var SelectTrigger = (0, import_react10.forwardRef)(
2341
2358
  ref,
2342
2359
  className: `
2343
2360
  flex h-9 min-w-[220px] w-full items-center justify-between border-border-300 px-3 py-2
2344
- ${invalid && "border-indicator-error"}
2345
- ${disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
2361
+ ${invalid && "border-indicator-error text-text-600"}
2362
+ ${disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
2363
+ ${!invalid && !disabled ? "text-text-700" : ""}
2346
2364
  ${variantClasses}
2347
2365
  ${className}
2348
2366
  `,
@@ -2377,7 +2395,7 @@ var SelectContent = (0, import_react10.forwardRef)(
2377
2395
  const store = useSelectStore(externalStore);
2378
2396
  const open = (0, import_zustand3.useStore)(store, (s) => s.open);
2379
2397
  if (!open) return null;
2380
- const getPositionClasses = () => `absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
2398
+ const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
2381
2399
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2382
2400
  "div",
2383
2401
  {