@0xsquid/ui 0.8.3 → 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.
Files changed (40) hide show
  1. package/README.md +22 -0
  2. package/dist/cjs/index.js +104 -65
  3. package/dist/cjs/types/components/badges/index.d.ts +1 -0
  4. package/dist/cjs/types/components/controls/Input.d.ts +2 -2
  5. package/dist/cjs/types/components/controls/Tooltip.d.ts +1 -2
  6. package/dist/cjs/types/components/layout/DropdownMenu.d.ts +4 -1
  7. package/dist/cjs/types/components/layout/InfoBox.d.ts +8 -0
  8. package/dist/cjs/types/components/layout/Menu.d.ts +2 -1
  9. package/dist/cjs/types/components/layout/index.d.ts +1 -0
  10. package/dist/cjs/types/components/lists/DropdownMenuItem.d.ts +2 -1
  11. package/dist/cjs/types/components/lists/HistoryItem.d.ts +3 -1
  12. package/dist/cjs/types/components/lists/SettingsItem.d.ts +4 -1
  13. package/dist/cjs/types/hooks/index.d.ts +1 -1
  14. package/dist/cjs/types/hooks/useDropdownMenu.d.ts +10 -0
  15. package/dist/cjs/types/stories/buttons/AssetsButton.stories.d.ts +2 -1
  16. package/dist/cjs/types/stories/layout/InfoBox.stories.d.ts +7 -0
  17. package/dist/cjs/types/stories/lists/HistoryItem.stories.d.ts +1 -0
  18. package/dist/cjs/types/stories/lists/SettingsItem.stories.d.ts +2 -0
  19. package/dist/esm/index.js +102 -65
  20. package/dist/esm/types/components/badges/index.d.ts +1 -0
  21. package/dist/esm/types/components/controls/Input.d.ts +2 -2
  22. package/dist/esm/types/components/controls/Tooltip.d.ts +1 -2
  23. package/dist/esm/types/components/layout/DropdownMenu.d.ts +4 -1
  24. package/dist/esm/types/components/layout/InfoBox.d.ts +8 -0
  25. package/dist/esm/types/components/layout/Menu.d.ts +2 -1
  26. package/dist/esm/types/components/layout/index.d.ts +1 -0
  27. package/dist/esm/types/components/lists/DropdownMenuItem.d.ts +2 -1
  28. package/dist/esm/types/components/lists/HistoryItem.d.ts +3 -1
  29. package/dist/esm/types/components/lists/SettingsItem.d.ts +4 -1
  30. package/dist/esm/types/hooks/index.d.ts +1 -1
  31. package/dist/esm/types/hooks/useDropdownMenu.d.ts +10 -0
  32. package/dist/esm/types/stories/buttons/AssetsButton.stories.d.ts +2 -1
  33. package/dist/esm/types/stories/layout/InfoBox.stories.d.ts +7 -0
  34. package/dist/esm/types/stories/lists/HistoryItem.stories.d.ts +1 -0
  35. package/dist/esm/types/stories/lists/SettingsItem.stories.d.ts +2 -0
  36. package/dist/index.css +34 -10
  37. package/dist/index.d.ts +34 -14
  38. package/package.json +1 -1
  39. package/dist/cjs/types/hooks/useModal.d.ts +0 -10
  40. package/dist/esm/types/hooks/useModal.d.ts +0 -10
package/dist/index.d.ts CHANGED
@@ -12,6 +12,11 @@ interface BadgeImageProps {
12
12
  type BadgeSize = 'sm' | 'md';
13
13
  declare function BadgeImage({ imageUrl, badgeUrl, size, extraMarginForBadge, rounded, }: BadgeImageProps): react_jsx_runtime.JSX.Element | null;
14
14
 
15
+ declare function LoadingSkeleton({ className, height, }: {
16
+ className?: string;
17
+ height?: string;
18
+ }): react_jsx_runtime.JSX.Element;
19
+
15
20
  interface UsdAmountProps {
16
21
  usdAmount: string;
17
22
  }
@@ -101,10 +106,10 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
101
106
  showIcon?: boolean;
102
107
  showPasteButton?: boolean;
103
108
  icon?: React.ReactNode;
104
- error?: string;
109
+ isError?: boolean;
105
110
  onPasteButtonClick?: () => void;
106
111
  }
107
- declare function Input({ placeholder, showIcon, showPasteButton, className, icon, error, onPasteButtonClick, ...props }: InputProps): react_jsx_runtime.JSX.Element;
112
+ declare function Input({ placeholder, showIcon, showPasteButton, className, icon, isError, onPasteButtonClick, ...props }: InputProps): react_jsx_runtime.JSX.Element;
108
113
 
109
114
  interface Props extends InputHTMLAttributes<HTMLInputElement> {
110
115
  onParsedValueChanged: (value: string) => void;
@@ -180,8 +185,9 @@ interface DropdownMenuItemProps {
180
185
  labelClassName?: string;
181
186
  imageUrl?: string;
182
187
  icon?: React.ReactNode;
188
+ onClick?: () => void;
183
189
  }
184
- declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
190
+ declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
185
191
 
186
192
  interface HistoryItemProps {
187
193
  firstImageUrl: string;
@@ -193,8 +199,9 @@ interface HistoryItemProps {
193
199
  dateCompleted: string;
194
200
  fromAmount: string;
195
201
  toAmount: string;
202
+ dropdownMenuItems?: DropdownMenuItemProps[];
196
203
  }
197
- declare function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, pendingLabel, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
204
+ declare function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, pendingLabel, dropdownMenuItems, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
198
205
 
199
206
  interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
200
207
  itemTitle: string | React.ReactNode;
@@ -241,8 +248,10 @@ interface SettingsItemProps {
241
248
  transparentControls?: boolean;
242
249
  showHelpIcon?: boolean;
243
250
  link?: string;
251
+ transparent?: boolean;
252
+ helpTooltip?: Omit<TooltipProps, 'children'>;
244
253
  }
245
- declare function SettingsItem({ icon, label, controls, transparentControls, showHelpIcon, link, }: SettingsItemProps): react_jsx_runtime.JSX.Element;
254
+ declare function SettingsItem({ icon, label, controls, transparentControls, showHelpIcon, link, transparent, helpTooltip, }: SettingsItemProps): react_jsx_runtime.JSX.Element;
246
255
 
247
256
  interface SwapDetailListItemProps {
248
257
  label: string;
@@ -263,10 +272,13 @@ declare function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparato
263
272
 
264
273
  interface DropdownMenuProps {
265
274
  dropdownRef?: React.RefObject<HTMLDivElement>;
275
+ menuRef?: React.RefObject<HTMLDivElement>;
266
276
  items: DropdownMenuItemProps[];
267
277
  className?: string;
278
+ isHidden?: boolean;
279
+ listClassName?: string;
268
280
  }
269
- declare function DropdownMenu({ dropdownRef, items, className, }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
281
+ declare function DropdownMenu({ dropdownRef, items, className, menuRef, isHidden, listClassName, }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
270
282
 
271
283
  type ErrorMessageProps = {
272
284
  message: string;
@@ -274,6 +286,13 @@ type ErrorMessageProps = {
274
286
  };
275
287
  declare function ErrorMessage({ message, showIcon }: ErrorMessageProps): react_jsx_runtime.JSX.Element;
276
288
 
289
+ interface InfoBoxProps {
290
+ title: string;
291
+ description: string;
292
+ icon?: React.ReactNode;
293
+ }
294
+ declare function InfoBox({ title, description, icon }: InfoBoxProps): react_jsx_runtime.JSX.Element;
295
+
277
296
  type Rounded = 'sm' | 'lg';
278
297
  interface MenuProps extends React$1.ComponentProps<'div'> {
279
298
  containerClassName?: string;
@@ -281,8 +300,9 @@ interface MenuProps extends React$1.ComponentProps<'div'> {
281
300
  title?: string;
282
301
  displayControls?: boolean;
283
302
  rounded?: Rounded;
303
+ menuRef?: React$1.RefObject<HTMLDivElement>;
284
304
  }
285
- declare function Menu({ children, containerClassName, contentClassName, title, displayControls, rounded, ...props }: MenuProps): react_jsx_runtime.JSX.Element;
305
+ declare function Menu({ children, containerClassName, contentClassName, title, displayControls, rounded, menuRef, ...props }: MenuProps): react_jsx_runtime.JSX.Element;
286
306
 
287
307
  interface ModalProps {
288
308
  children: React.ReactNode;
@@ -424,14 +444,14 @@ declare function SquidConfigProvider({ theme, children, themeType, }: {
424
444
  themeType?: ThemeType;
425
445
  }): react_jsx_runtime.JSX.Element;
426
446
 
427
- declare function useModal(props?: {
447
+ declare function useDropdownMenu(props?: {
428
448
  initialIsModalOpen?: boolean;
429
449
  }): {
430
- isModalOpen: boolean;
431
- openModal: () => void;
432
- closeModal: () => void;
433
- modalRef: React.RefObject<HTMLDivElement>;
434
- openModalButtonRef: React.RefObject<HTMLButtonElement>;
450
+ isDropdownOpen: boolean;
451
+ openDropdown: () => void;
452
+ closeDropdown: () => void;
453
+ dropdownRef: React.RefObject<HTMLDivElement>;
454
+ openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
435
455
  };
436
456
 
437
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipThreshold, type TooltipWidth, UsdAmount, useModal };
457
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/0xsquid/squid-ui.git"
6
6
  },
7
7
  "description": "Squid's UI components",
8
- "version": "0.8.3",
8
+ "version": "0.9.0",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "scripts": {
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function useModal(props?: {
3
- initialIsModalOpen?: boolean;
4
- }): {
5
- isModalOpen: boolean;
6
- openModal: () => void;
7
- closeModal: () => void;
8
- modalRef: React.RefObject<HTMLDivElement>;
9
- openModalButtonRef: React.RefObject<HTMLButtonElement>;
10
- };
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function useModal(props?: {
3
- initialIsModalOpen?: boolean;
4
- }): {
5
- isModalOpen: boolean;
6
- openModal: () => void;
7
- closeModal: () => void;
8
- modalRef: React.RefObject<HTMLDivElement>;
9
- openModalButtonRef: React.RefObject<HTMLButtonElement>;
10
- };