@0xsquid/ui 0.10.1 → 0.11.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 (29) hide show
  1. package/dist/cjs/index.js +94 -48
  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/SettingsItem.d.ts +9 -7
  9. package/dist/cjs/types/components/views/MainView.d.ts +0 -4
  10. package/dist/cjs/types/stories/badges/BadgeImage.stories.d.ts +11 -0
  11. package/dist/cjs/types/stories/badges/LoadingSkeleton.stories.d.ts +6 -0
  12. package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +2 -2
  13. package/dist/cjs/types/stories/lists/HistoryItem.stories.d.ts +2 -1
  14. package/dist/esm/index.js +94 -49
  15. package/dist/esm/types/components/buttons/SettingsButton.d.ts +2 -1
  16. package/dist/esm/types/components/controls/SettingsSlider.d.ts +5 -2
  17. package/dist/esm/types/components/icons/EmojiSad.d.ts +3 -1
  18. package/dist/esm/types/components/icons/Loader.d.ts +2 -1
  19. package/dist/esm/types/components/layout/ProductCard.d.ts +4 -0
  20. package/dist/esm/types/components/lists/HistoryItem.d.ts +3 -3
  21. package/dist/esm/types/components/lists/SettingsItem.d.ts +9 -7
  22. package/dist/esm/types/components/views/MainView.d.ts +0 -4
  23. package/dist/esm/types/stories/badges/BadgeImage.stories.d.ts +11 -0
  24. package/dist/esm/types/stories/badges/LoadingSkeleton.stories.d.ts +6 -0
  25. package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +2 -2
  26. package/dist/esm/types/stories/lists/HistoryItem.stories.d.ts +2 -1
  27. package/dist/index.css +102 -26
  28. package/dist/index.d.ts +24 -14
  29. 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
  }
@@ -685,6 +689,10 @@ video {
685
689
  left: calc(50% - 1.5px);
686
690
  }
687
691
 
692
+ .tw-left-squid-l {
693
+ left: 1.875rem;
694
+ }
695
+
688
696
  .tw-left-squid-xs {
689
697
  left: 0.625rem;
690
698
  }
@@ -936,6 +944,14 @@ video {
936
944
  height: 60px;
937
945
  }
938
946
 
947
+ .tw-h-\[660px\] {
948
+ height: 660px;
949
+ }
950
+
951
+ .tw-h-\[94px\] {
952
+ height: 94px;
953
+ }
954
+
939
955
  .tw-h-\[95px\] {
940
956
  height: 95px;
941
957
  }
@@ -1008,10 +1024,6 @@ video {
1008
1024
  max-height: 60px;
1009
1025
  }
1010
1026
 
1011
- .tw-max-h-\[660px\] {
1012
- max-height: 660px;
1013
- }
1014
-
1015
1027
  .tw-max-h-\[80px\] {
1016
1028
  max-height: 80px;
1017
1029
  }
@@ -1096,6 +1108,14 @@ video {
1096
1108
  width: 1.5px;
1097
1109
  }
1098
1110
 
1111
+ .tw-w-\[1260px\] {
1112
+ width: 1260px;
1113
+ }
1114
+
1115
+ .tw-w-\[135px\] {
1116
+ width: 135px;
1117
+ }
1118
+
1099
1119
  .tw-w-\[140px\] {
1100
1120
  width: 140px;
1101
1121
  }
@@ -1112,6 +1132,10 @@ video {
1112
1132
  width: 190px;
1113
1133
  }
1114
1134
 
1135
+ .tw-w-\[22px\] {
1136
+ width: 22px;
1137
+ }
1138
+
1115
1139
  .tw-w-\[299px\] {
1116
1140
  width: 299px;
1117
1141
  }
@@ -1176,14 +1200,14 @@ video {
1176
1200
  width: 72px;
1177
1201
  }
1178
1202
 
1179
- .tw-w-\[76px\] {
1180
- width: 76px;
1181
- }
1182
-
1183
1203
  .tw-w-\[80px\] {
1184
1204
  width: 80px;
1185
1205
  }
1186
1206
 
1207
+ .tw-w-\[84px\] {
1208
+ width: 84px;
1209
+ }
1210
+
1187
1211
  .tw-w-\[90px\] {
1188
1212
  width: 90px;
1189
1213
  }
@@ -1325,11 +1349,6 @@ video {
1325
1349
  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));
1326
1350
  }
1327
1351
 
1328
- .-tw-translate-x-\[2px\] {
1329
- --tw-translate-x: -2px;
1330
- 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));
1331
- }
1332
-
1333
1352
  .-tw-translate-x-full {
1334
1353
  --tw-translate-x: -100%;
1335
1354
  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));
@@ -1458,6 +1477,20 @@ video {
1458
1477
  animation: tw-loading-gradient 1s ease-in-out both infinite;
1459
1478
  }
1460
1479
 
1480
+ @keyframes tw-move-loading-cover-to-right {
1481
+ 0% {
1482
+ transform: translateX(-64%);
1483
+ }
1484
+
1485
+ 100% {
1486
+ transform: translateX(0%);
1487
+ }
1488
+ }
1489
+
1490
+ .tw-animate-move-loading-cover-to-right {
1491
+ animation: tw-move-loading-cover-to-right 1.4s linear infinite;
1492
+ }
1493
+
1461
1494
  @keyframes tw-slide-to-bottom {
1462
1495
  0% {
1463
1496
  transform: translateY(0);
@@ -1698,10 +1731,6 @@ video {
1698
1731
  border-radius: 0.75rem;
1699
1732
  }
1700
1733
 
1701
- .tw-rounded-bl-full {
1702
- border-bottom-left-radius: 9999px;
1703
- }
1704
-
1705
1734
  .tw-rounded-bl-squid-l {
1706
1735
  border-bottom-left-radius: 1.875rem;
1707
1736
  }
@@ -1718,10 +1747,6 @@ video {
1718
1747
  border-top-left-radius: 25px;
1719
1748
  }
1720
1749
 
1721
- .tw-rounded-tl-full {
1722
- border-top-left-radius: 9999px;
1723
- }
1724
-
1725
1750
  .tw-rounded-tl-squid-l {
1726
1751
  border-top-left-radius: 1.875rem;
1727
1752
  }
@@ -1815,13 +1840,12 @@ video {
1815
1840
  background-color: var(--squid-theme-grey-600) !important;
1816
1841
  }
1817
1842
 
1818
- .\!tw-bg-royal-400 {
1819
- background-color: var(--squid-theme-royal-400) !important;
1843
+ .\!tw-bg-grey-800 {
1844
+ background-color: var(--squid-theme-grey-800) !important;
1820
1845
  }
1821
1846
 
1822
- .tw-bg-\[\#FBFBFD\] {
1823
- --tw-bg-opacity: 1;
1824
- background-color: rgb(251 251 253 / var(--tw-bg-opacity));
1847
+ .\!tw-bg-royal-400 {
1848
+ background-color: var(--squid-theme-royal-400) !important;
1825
1849
  }
1826
1850
 
1827
1851
  .tw-bg-blue-950 {
@@ -1891,6 +1915,10 @@ video {
1891
1915
  background-color: rgb(2 6 23 / var(--tw-bg-opacity));
1892
1916
  }
1893
1917
 
1918
+ .tw-bg-status-negative {
1919
+ background-color: var(--squid-theme-status-negative);
1920
+ }
1921
+
1894
1922
  .tw-bg-status-positive {
1895
1923
  background-color: var(--squid-theme-status-positive);
1896
1924
  }
@@ -1899,6 +1927,10 @@ video {
1899
1927
  background-color: transparent;
1900
1928
  }
1901
1929
 
1930
+ .tw-bg-dark-cover {
1931
+ background-image: linear-gradient(90deg, var(--squid-theme-material-dark-thick) 45.4%, transparent 50.85%, var(--squid-theme-material-dark-thick) 55.61%);
1932
+ }
1933
+
1902
1934
  .tw-bg-gradient-to-b {
1903
1935
  background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
1904
1936
  }
@@ -2374,6 +2406,10 @@ video {
2374
2406
  letter-spacing: -1.05px;
2375
2407
  }
2376
2408
 
2409
+ .\!tw-text-grey-600 {
2410
+ color: var(--squid-theme-grey-600) !important;
2411
+ }
2412
+
2377
2413
  .tw-text-\[\#FBFBFD\] {
2378
2414
  --tw-text-opacity: 1;
2379
2415
  color: rgb(251 251 253 / var(--tw-text-opacity));
@@ -2444,6 +2480,10 @@ video {
2444
2480
  opacity: 0.33;
2445
2481
  }
2446
2482
 
2483
+ .tw-opacity-50 {
2484
+ opacity: 0.5;
2485
+ }
2486
+
2447
2487
  .tw-opacity-66 {
2448
2488
  opacity: 0.66;
2449
2489
  }
@@ -2632,6 +2672,10 @@ input[type='number'] {
2632
2672
  -moz-appearance: textfield;
2633
2673
  }
2634
2674
 
2675
+ :invalid {
2676
+ outline-color: var(--squid-theme-status-negative);
2677
+ }
2678
+
2635
2679
  .placeholder\:tw-text-grey-600::-moz-placeholder {
2636
2680
  color: var(--squid-theme-grey-600);
2637
2681
  }
@@ -2828,6 +2872,14 @@ input[type='number'] {
2828
2872
  left: calc(50% - 6px);
2829
2873
  }
2830
2874
 
2875
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-bg-grey-100 {
2876
+ background-color: var(--squid-theme-grey-100);
2877
+ }
2878
+
2879
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-bg-grey-900 {
2880
+ background-color: var(--squid-theme-grey-900);
2881
+ }
2882
+
2831
2883
  .tw-group[data-squid-theme-type='dark'] .group-data-\[squid-theme-type\=\'dark\'\]\:tw-bg-royal-dark {
2832
2884
  background-image: linear-gradient(180deg, #BF91F2 0%, #A577D8 100%);
2833
2885
  }
@@ -2840,10 +2892,34 @@ input[type='number'] {
2840
2892
  color: var(--squid-theme-grey-100);
2841
2893
  }
2842
2894
 
2895
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-text-material-light-average {
2896
+ color: var(--squid-theme-material-light-average);
2897
+ }
2898
+
2899
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-text-material-light-thick {
2900
+ color: var(--squid-theme-material-light-thick);
2901
+ }
2902
+
2903
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-text-material-light-thin {
2904
+ color: var(--squid-theme-material-light-thin);
2905
+ }
2906
+
2843
2907
  .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-text-grey-900 {
2844
2908
  color: var(--squid-theme-grey-900);
2845
2909
  }
2846
2910
 
2911
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-text-material-dark-thick {
2912
+ color: var(--squid-theme-material-dark-thick);
2913
+ }
2914
+
2915
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-text-material-dark-thin {
2916
+ color: var(--squid-theme-material-dark-thin);
2917
+ }
2918
+
2919
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-text-transparent {
2920
+ color: transparent;
2921
+ }
2922
+
2847
2923
  .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-shadow-elevation-dark-2 {
2848
2924
  --tw-shadow: 0px 2px 5px 1px rgba(0, 0, 0, 0.20), 0px 5px 20px -1px rgba(0, 0, 0, 0.33);
2849
2925
  --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;
@@ -253,22 +257,24 @@ type SettingsControl = {
253
257
  type: 'percentage';
254
258
  value: number;
255
259
  onChange: (value: number) => void;
260
+ min?: number;
261
+ max?: number;
262
+ hasDecimals?: boolean;
256
263
  resetValueControl: {
257
264
  label: string;
258
265
  onSelect: () => void;
259
- isSelected?: boolean;
266
+ value: number;
260
267
  };
261
268
  } | {
262
269
  type: 'amount';
270
+ value: number;
271
+ onChange: (value: number) => void;
263
272
  options: {
264
273
  value: number;
265
- isSelected?: boolean;
266
- onSelect?: () => void;
267
274
  }[];
268
275
  resetValueControl: {
269
276
  label: string;
270
- onSelect: () => void;
271
- isSelected?: boolean;
277
+ value: number;
272
278
  };
273
279
  } | {
274
280
  type: 'switch';
@@ -280,12 +286,12 @@ type SettingsControl = {
280
286
  interface SettingsItemProps {
281
287
  icon: React.ReactNode;
282
288
  label: string;
283
- controls?: SettingsControl[];
289
+ control?: SettingsControl;
284
290
  link?: string;
285
291
  transparent?: boolean;
286
292
  helpTooltip?: Omit<TooltipProps, 'children'>;
287
293
  }
288
- declare function SettingsItem({ icon, label, controls, link, transparent, helpTooltip, }: SettingsItemProps): react_jsx_runtime.JSX.Element;
294
+ declare function SettingsItem({ icon, label, control, link, transparent, helpTooltip, }: SettingsItemProps): react_jsx_runtime.JSX.Element;
289
295
 
290
296
  interface SwapDetailListItemProps {
291
297
  label: string;
@@ -372,6 +378,10 @@ interface NavigationBarProps {
372
378
  declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, }: NavigationBarProps): react_jsx_runtime.JSX.Element;
373
379
 
374
380
  declare function ProductCard({ children }: React.PropsWithChildren): react_jsx_runtime.JSX.Element;
381
+ declare function BorderedContainer({ children, className, }: {
382
+ children: React.ReactNode;
383
+ className?: string;
384
+ }): react_jsx_runtime.JSX.Element;
375
385
 
376
386
  declare function ProfileHeaderBackground(): react_jsx_runtime.JSX.Element;
377
387
 
@@ -487,4 +497,4 @@ declare function useDropdownMenu(props?: {
487
497
  openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
488
498
  };
489
499
 
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 };
500
+ 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.1",
8
+ "version": "0.11.0",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "scripts": {