@0xsquid/ui 0.10.2 → 0.11.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.
Files changed (33) hide show
  1. package/dist/cjs/index.js +106 -50
  2. package/dist/cjs/types/components/buttons/SettingsButton.d.ts +2 -1
  3. package/dist/cjs/types/components/controls/SettingsSlider.d.ts +5 -2
  4. package/dist/cjs/types/components/icons/EmojiSad.d.ts +3 -1
  5. package/dist/cjs/types/components/icons/Loader.d.ts +2 -1
  6. package/dist/cjs/types/components/layout/ProductCard.d.ts +4 -0
  7. package/dist/cjs/types/components/lists/HistoryItem.d.ts +3 -3
  8. package/dist/cjs/types/components/lists/ListItem.d.ts +2 -1
  9. package/dist/cjs/types/components/lists/SectionTitle.d.ts +2 -2
  10. package/dist/cjs/types/components/lists/SettingsItem.d.ts +9 -7
  11. package/dist/cjs/types/components/views/MainView.d.ts +0 -4
  12. package/dist/cjs/types/stories/badges/BadgeImage.stories.d.ts +11 -0
  13. package/dist/cjs/types/stories/badges/LoadingSkeleton.stories.d.ts +6 -0
  14. package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +2 -2
  15. package/dist/cjs/types/stories/lists/HistoryItem.stories.d.ts +2 -1
  16. package/dist/esm/index.js +106 -51
  17. package/dist/esm/types/components/buttons/SettingsButton.d.ts +2 -1
  18. package/dist/esm/types/components/controls/SettingsSlider.d.ts +5 -2
  19. package/dist/esm/types/components/icons/EmojiSad.d.ts +3 -1
  20. package/dist/esm/types/components/icons/Loader.d.ts +2 -1
  21. package/dist/esm/types/components/layout/ProductCard.d.ts +4 -0
  22. package/dist/esm/types/components/lists/HistoryItem.d.ts +3 -3
  23. package/dist/esm/types/components/lists/ListItem.d.ts +2 -1
  24. package/dist/esm/types/components/lists/SectionTitle.d.ts +2 -2
  25. package/dist/esm/types/components/lists/SettingsItem.d.ts +9 -7
  26. package/dist/esm/types/components/views/MainView.d.ts +0 -4
  27. package/dist/esm/types/stories/badges/BadgeImage.stories.d.ts +11 -0
  28. package/dist/esm/types/stories/badges/LoadingSkeleton.stories.d.ts +6 -0
  29. package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +2 -2
  30. package/dist/esm/types/stories/lists/HistoryItem.stories.d.ts +2 -1
  31. package/dist/index.css +102 -27
  32. package/dist/index.d.ts +28 -17
  33. package/package.json +1 -1
package/dist/index.css CHANGED
@@ -649,6 +649,10 @@ video {
649
649
  bottom: 0.5rem;
650
650
  }
651
651
 
652
+ .tw-bottom-4 {
653
+ bottom: 1rem;
654
+ }
655
+
652
656
  .tw-bottom-7 {
653
657
  bottom: 1.75rem;
654
658
  }
@@ -677,6 +681,22 @@ video {
677
681
  left: 15px;
678
682
  }
679
683
 
684
+ .tw-left-\[17px\] {
685
+ left: 17px;
686
+ }
687
+
688
+ .tw-left-\[1px\] {
689
+ left: 1px;
690
+ }
691
+
692
+ .tw-left-\[26px\] {
693
+ left: 26px;
694
+ }
695
+
696
+ .tw-left-\[2px\] {
697
+ left: 2px;
698
+ }
699
+
680
700
  .tw-left-\[54px\] {
681
701
  left: 54px;
682
702
  }
@@ -685,6 +705,10 @@ video {
685
705
  left: calc(50% - 1.5px);
686
706
  }
687
707
 
708
+ .tw-left-squid-l {
709
+ left: 1.875rem;
710
+ }
711
+
688
712
  .tw-left-squid-xs {
689
713
  left: 0.625rem;
690
714
  }
@@ -749,10 +773,6 @@ video {
749
773
  z-index: 20;
750
774
  }
751
775
 
752
- .tw-z-30 {
753
- z-index: 30;
754
- }
755
-
756
776
  .tw-z-40 {
757
777
  z-index: 40;
758
778
  }
@@ -936,6 +956,14 @@ video {
936
956
  height: 60px;
937
957
  }
938
958
 
959
+ .tw-h-\[660px\] {
960
+ height: 660px;
961
+ }
962
+
963
+ .tw-h-\[94px\] {
964
+ height: 94px;
965
+ }
966
+
939
967
  .tw-h-\[95px\] {
940
968
  height: 95px;
941
969
  }
@@ -1008,10 +1036,6 @@ video {
1008
1036
  max-height: 60px;
1009
1037
  }
1010
1038
 
1011
- .tw-max-h-\[660px\] {
1012
- max-height: 660px;
1013
- }
1014
-
1015
1039
  .tw-max-h-\[80px\] {
1016
1040
  max-height: 80px;
1017
1041
  }
@@ -1096,6 +1120,10 @@ video {
1096
1120
  width: 1.5px;
1097
1121
  }
1098
1122
 
1123
+ .tw-w-\[1260px\] {
1124
+ width: 1260px;
1125
+ }
1126
+
1099
1127
  .tw-w-\[135px\] {
1100
1128
  width: 135px;
1101
1129
  }
@@ -1184,14 +1212,14 @@ video {
1184
1212
  width: 72px;
1185
1213
  }
1186
1214
 
1187
- .tw-w-\[76px\] {
1188
- width: 76px;
1189
- }
1190
-
1191
1215
  .tw-w-\[80px\] {
1192
1216
  width: 80px;
1193
1217
  }
1194
1218
 
1219
+ .tw-w-\[84px\] {
1220
+ width: 84px;
1221
+ }
1222
+
1195
1223
  .tw-w-\[90px\] {
1196
1224
  width: 90px;
1197
1225
  }
@@ -1333,16 +1361,6 @@ video {
1333
1361
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1334
1362
  }
1335
1363
 
1336
- .-tw-translate-x-full {
1337
- --tw-translate-x: -100%;
1338
- transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1339
- }
1340
-
1341
- .tw-translate-x-0 {
1342
- --tw-translate-x: 0px;
1343
- transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1344
- }
1345
-
1346
1364
  .tw-translate-x-1\/4 {
1347
1365
  --tw-translate-x: 25%;
1348
1366
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
@@ -1461,6 +1479,20 @@ video {
1461
1479
  animation: tw-loading-gradient 1s ease-in-out both infinite;
1462
1480
  }
1463
1481
 
1482
+ @keyframes tw-move-loading-cover-to-right {
1483
+ 0% {
1484
+ transform: translateX(-64%);
1485
+ }
1486
+
1487
+ 100% {
1488
+ transform: translateX(0%);
1489
+ }
1490
+ }
1491
+
1492
+ .tw-animate-move-loading-cover-to-right {
1493
+ animation: tw-move-loading-cover-to-right 1.4s linear infinite;
1494
+ }
1495
+
1464
1496
  @keyframes tw-slide-to-bottom {
1465
1497
  0% {
1466
1498
  transform: translateY(0);
@@ -1818,11 +1850,6 @@ video {
1818
1850
  background-color: var(--squid-theme-royal-400) !important;
1819
1851
  }
1820
1852
 
1821
- .tw-bg-\[\#FBFBFD\] {
1822
- --tw-bg-opacity: 1;
1823
- background-color: rgb(251 251 253 / var(--tw-bg-opacity));
1824
- }
1825
-
1826
1853
  .tw-bg-blue-950 {
1827
1854
  --tw-bg-opacity: 1;
1828
1855
  background-color: rgb(23 37 84 / var(--tw-bg-opacity));
@@ -1890,6 +1917,10 @@ video {
1890
1917
  background-color: rgb(2 6 23 / var(--tw-bg-opacity));
1891
1918
  }
1892
1919
 
1920
+ .tw-bg-status-negative {
1921
+ background-color: var(--squid-theme-status-negative);
1922
+ }
1923
+
1893
1924
  .tw-bg-status-positive {
1894
1925
  background-color: var(--squid-theme-status-positive);
1895
1926
  }
@@ -1898,6 +1929,10 @@ video {
1898
1929
  background-color: transparent;
1899
1930
  }
1900
1931
 
1932
+ .tw-bg-dark-cover {
1933
+ background-image: linear-gradient(90deg, var(--squid-theme-material-dark-thick) 45.4%, transparent 50.85%, var(--squid-theme-material-dark-thick) 55.61%);
1934
+ }
1935
+
1901
1936
  .tw-bg-gradient-to-b {
1902
1937
  background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
1903
1938
  }
@@ -2447,6 +2482,10 @@ video {
2447
2482
  opacity: 0.33;
2448
2483
  }
2449
2484
 
2485
+ .tw-opacity-50 {
2486
+ opacity: 0.5;
2487
+ }
2488
+
2450
2489
  .tw-opacity-66 {
2451
2490
  opacity: 0.66;
2452
2491
  }
@@ -2635,6 +2674,10 @@ input[type='number'] {
2635
2674
  -moz-appearance: textfield;
2636
2675
  }
2637
2676
 
2677
+ :invalid {
2678
+ outline-color: var(--squid-theme-status-negative);
2679
+ }
2680
+
2638
2681
  .placeholder\:tw-text-grey-600::-moz-placeholder {
2639
2682
  color: var(--squid-theme-grey-600);
2640
2683
  }
@@ -2831,6 +2874,14 @@ input[type='number'] {
2831
2874
  left: calc(50% - 6px);
2832
2875
  }
2833
2876
 
2877
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-bg-grey-100 {
2878
+ background-color: var(--squid-theme-grey-100);
2879
+ }
2880
+
2881
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-bg-grey-900 {
2882
+ background-color: var(--squid-theme-grey-900);
2883
+ }
2884
+
2834
2885
  .tw-group[data-squid-theme-type='dark'] .group-data-\[squid-theme-type\=\'dark\'\]\:tw-bg-royal-dark {
2835
2886
  background-image: linear-gradient(180deg, #BF91F2 0%, #A577D8 100%);
2836
2887
  }
@@ -2843,10 +2894,34 @@ input[type='number'] {
2843
2894
  color: var(--squid-theme-grey-100);
2844
2895
  }
2845
2896
 
2897
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-text-material-light-average {
2898
+ color: var(--squid-theme-material-light-average);
2899
+ }
2900
+
2901
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-text-material-light-thick {
2902
+ color: var(--squid-theme-material-light-thick);
2903
+ }
2904
+
2905
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-text-material-light-thin {
2906
+ color: var(--squid-theme-material-light-thin);
2907
+ }
2908
+
2846
2909
  .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-text-grey-900 {
2847
2910
  color: var(--squid-theme-grey-900);
2848
2911
  }
2849
2912
 
2913
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-text-material-dark-thick {
2914
+ color: var(--squid-theme-material-dark-thick);
2915
+ }
2916
+
2917
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-text-material-dark-thin {
2918
+ color: var(--squid-theme-material-dark-thin);
2919
+ }
2920
+
2921
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-text-transparent {
2922
+ color: transparent;
2923
+ }
2924
+
2850
2925
  .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-shadow-elevation-dark-2 {
2851
2926
  --tw-shadow: 0px 2px 5px 1px rgba(0, 0, 0, 0.20), 0px 5px 20px -1px rgba(0, 0, 0, 0.33);
2852
2927
  --tw-shadow-colored: 0px 2px 5px 1px var(--tw-shadow-color), 0px 5px 20px -1px var(--tw-shadow-color);
package/dist/index.d.ts CHANGED
@@ -101,8 +101,9 @@ declare function FeeButton({ feeInUsd, chipLabel, className, ...props }: FeeButt
101
101
  interface SettingsButtonProps {
102
102
  label: string;
103
103
  isSelected?: boolean;
104
+ onClick?: () => void;
104
105
  }
105
- declare function SettingsButton({ label, isSelected, }: SettingsButtonProps): react_jsx_runtime.JSX.Element;
106
+ declare function SettingsButton({ label, isSelected, onClick, }: SettingsButtonProps): react_jsx_runtime.JSX.Element;
106
107
 
107
108
  interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
108
109
  placeholder?: string;
@@ -127,9 +128,12 @@ declare const NumericInput: ({ onParsedValueChanged, initialValue, forcedUpdateV
127
128
  interface SettingsSliderProps {
128
129
  value: number;
129
130
  type: 'percentage' | 'amount';
130
- onChange?: (value: string) => void;
131
+ onChange?: (value: number) => void;
132
+ hasDecimals?: boolean;
133
+ min?: number;
134
+ max?: number;
131
135
  }
132
- declare function SettingsSlider({ value, type, onChange }: SettingsSliderProps): react_jsx_runtime.JSX.Element;
136
+ declare function SettingsSlider({ value, type, onChange, hasDecimals, max, min, }: SettingsSliderProps): react_jsx_runtime.JSX.Element;
133
137
 
134
138
  interface SwitchProps {
135
139
  checked?: boolean;
@@ -196,20 +200,20 @@ interface DropdownMenuItemProps {
196
200
  }
197
201
  declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
198
202
 
203
+ type HistoryItemStatus = 'completed' | 'pending' | 'failed';
199
204
  interface HistoryItemProps {
200
205
  firstImageUrl: string;
201
206
  secondImageUrl: string;
202
- isPending?: boolean;
207
+ status: HistoryItemStatus;
203
208
  fromLabel: string;
204
209
  toLabel: string;
205
- pendingLabel?: string;
206
210
  dateCompleted: string;
207
211
  fromAmount: string;
208
212
  toAmount: string;
209
213
  dropdownMenuItems?: DropdownMenuItemProps[];
210
214
  itemsContainerRef?: React.RefObject<HTMLElement>;
211
215
  }
212
- declare function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, pendingLabel, dropdownMenuItems, itemsContainerRef, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
216
+ declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
213
217
 
214
218
  interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
215
219
  itemTitle: string | React.ReactNode;
@@ -229,9 +233,10 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
229
233
  loading?: {
230
234
  subtitle?: boolean;
231
235
  };
236
+ containerProps?: React.HTMLAttributes<HTMLLIElement>;
232
237
  }
233
238
  type ListItemSize = 'small' | 'large';
234
- declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
239
+ declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
235
240
 
236
241
  interface MenuItemProps {
237
242
  label: string;
@@ -240,35 +245,37 @@ interface MenuItemProps {
240
245
  }
241
246
  declare function MenuItem({ label, imageUrl, icon }: MenuItemProps): react_jsx_runtime.JSX.Element;
242
247
 
243
- interface SectionTitleProps {
248
+ interface SectionTitleProps extends React.HTMLAttributes<HTMLDivElement> {
244
249
  title: string;
245
250
  icon?: React.ReactNode;
246
251
  accessory?: string | null;
247
252
  actionIcon?: React.ReactNode;
248
253
  className?: string;
249
254
  }
250
- declare function SectionTitle({ title, icon, accessory, actionIcon, className, }: SectionTitleProps): react_jsx_runtime.JSX.Element;
255
+ declare function SectionTitle({ title, icon, accessory, actionIcon, className, ...props }: SectionTitleProps): react_jsx_runtime.JSX.Element;
251
256
 
252
257
  type SettingsControl = {
253
258
  type: 'percentage';
254
259
  value: number;
255
260
  onChange: (value: number) => void;
261
+ min?: number;
262
+ max?: number;
263
+ hasDecimals?: boolean;
256
264
  resetValueControl: {
257
265
  label: string;
258
266
  onSelect: () => void;
259
- isSelected?: boolean;
267
+ value: number;
260
268
  };
261
269
  } | {
262
270
  type: 'amount';
271
+ value: number;
272
+ onChange: (value: number) => void;
263
273
  options: {
264
274
  value: number;
265
- isSelected?: boolean;
266
- onSelect?: () => void;
267
275
  }[];
268
276
  resetValueControl: {
269
277
  label: string;
270
- onSelect: () => void;
271
- isSelected?: boolean;
278
+ value: number;
272
279
  };
273
280
  } | {
274
281
  type: 'switch';
@@ -280,12 +287,12 @@ type SettingsControl = {
280
287
  interface SettingsItemProps {
281
288
  icon: React.ReactNode;
282
289
  label: string;
283
- controls?: SettingsControl[];
290
+ control?: SettingsControl;
284
291
  link?: string;
285
292
  transparent?: boolean;
286
293
  helpTooltip?: Omit<TooltipProps, 'children'>;
287
294
  }
288
- declare function SettingsItem({ icon, label, controls, link, transparent, helpTooltip, }: SettingsItemProps): react_jsx_runtime.JSX.Element;
295
+ declare function SettingsItem({ icon, label, control, link, transparent, helpTooltip, }: SettingsItemProps): react_jsx_runtime.JSX.Element;
289
296
 
290
297
  interface SwapDetailListItemProps {
291
298
  label: string;
@@ -372,6 +379,10 @@ interface NavigationBarProps {
372
379
  declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, }: NavigationBarProps): react_jsx_runtime.JSX.Element;
373
380
 
374
381
  declare function ProductCard({ children }: React.PropsWithChildren): react_jsx_runtime.JSX.Element;
382
+ declare function BorderedContainer({ children, className, }: {
383
+ children: React.ReactNode;
384
+ className?: string;
385
+ }): react_jsx_runtime.JSX.Element;
375
386
 
376
387
  declare function ProfileHeaderBackground(): react_jsx_runtime.JSX.Element;
377
388
 
@@ -487,4 +498,4 @@ declare function useDropdownMenu(props?: {
487
498
  openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
488
499
  };
489
500
 
490
- 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, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, 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 };
501
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, 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.10.2",
8
+ "version": "0.11.1",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "scripts": {