@infonomic/uikit 2.0.0 → 2.1.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 (312) hide show
  1. package/dist/components/card/card.d.ts.map +1 -1
  2. package/package.json +9 -5
  3. package/src/astro.d.ts +43 -0
  4. package/src/astro.js +2 -2
  5. package/src/components/@types/shared.ts +24 -0
  6. package/src/components/accordion/accordion.module.css +60 -0
  7. package/src/components/accordion/accordion.stories.tsx +117 -0
  8. package/src/components/accordion/accordion.tsx +105 -0
  9. package/src/components/animation/fade-in-lift.stories.tsx +81 -0
  10. package/src/components/animation/fade-in-lift.tsx +42 -0
  11. package/src/components/avatar/avatar.module.css +54 -0
  12. package/src/components/avatar/avatar.stories.tsx +28 -0
  13. package/src/components/avatar/avatar.tsx +19 -0
  14. package/src/components/button/@types/button.ts +17 -0
  15. package/src/components/button/button-group.module.css +17 -0
  16. package/src/components/button/button-group.stories.tsx +45 -0
  17. package/src/components/button/button-group.tsx +132 -0
  18. package/src/components/button/button-icon.stories.tsx +145 -0
  19. package/src/components/button/button-intents.stories.tsx +50 -0
  20. package/src/components/button/button-variants.stories.tsx +60 -0
  21. package/src/components/button/button.astro +86 -0
  22. package/src/components/button/button.module.css +533 -0
  23. package/src/components/button/button.tsx +81 -0
  24. package/src/components/button/control-buttons.module.css +144 -0
  25. package/src/components/button/control-buttons.stories.tsx +60 -0
  26. package/src/components/button/control-buttons.tsx +137 -0
  27. package/src/components/button/copy-button.module.css +31 -0
  28. package/src/components/button/copy-button.stories.tsx +50 -0
  29. package/src/components/button/copy-button.tsx +92 -0
  30. package/src/components/button/icon-button.astro +47 -0
  31. package/src/components/button/icon-button.tsx +44 -0
  32. package/src/components/button/index.ts +5 -0
  33. package/src/components/calendar/calendar.module.css +315 -0
  34. package/src/components/calendar/calendar.stories.tsx +139 -0
  35. package/src/components/calendar/calendar.tsx +173 -0
  36. package/src/components/card/card-content.astro +14 -0
  37. package/src/components/card/card-description.astro +14 -0
  38. package/src/components/card/card-footer.astro +14 -0
  39. package/src/components/card/card-header.astro +14 -0
  40. package/src/components/card/card-title.astro +14 -0
  41. package/src/components/card/card.astro +41 -0
  42. package/src/components/card/card.module.css +67 -0
  43. package/src/components/card/card.stories.tsx +61 -0
  44. package/src/components/card/card.tsx +86 -0
  45. package/src/components/container/container.astro +13 -0
  46. package/src/components/container/container.module.css +28 -0
  47. package/src/components/container/container.stories.tsx +42 -0
  48. package/src/components/container/container.tsx +23 -0
  49. package/src/components/dropdown/dropdown.module.css +131 -0
  50. package/src/components/dropdown/dropdown.stories.tsx +103 -0
  51. package/src/components/dropdown/dropdown.tsx +193 -0
  52. package/src/components/hamburger/hamburger.astro +30 -0
  53. package/src/components/hamburger/hamburger.tsx +66 -0
  54. package/src/components/input/@types/checkbox.ts +20 -0
  55. package/src/components/input/@types/input.ts +20 -0
  56. package/src/components/input/checkbox-group.tsx +78 -0
  57. package/src/components/input/checkbox.module.css +267 -0
  58. package/src/components/input/checkbox.stories.tsx +240 -0
  59. package/src/components/input/checkbox.tsx +95 -0
  60. package/src/components/input/error-text.astro +14 -0
  61. package/src/components/input/error-text.module.css +19 -0
  62. package/src/components/input/error-text.tsx +18 -0
  63. package/src/components/input/errors.tsx +37 -0
  64. package/src/components/input/help-text.astro +13 -0
  65. package/src/components/input/help-text.module.css +19 -0
  66. package/src/components/input/help-text.tsx +13 -0
  67. package/src/components/input/index.tsx +8 -0
  68. package/src/components/input/input-adornment.astro +26 -0
  69. package/src/components/input/input-adornment.module.css +18 -0
  70. package/src/components/input/input-adornment.tsx +36 -0
  71. package/src/components/input/input.astro +99 -0
  72. package/src/components/input/input.module.css +310 -0
  73. package/src/components/input/input.stories.tsx +174 -0
  74. package/src/components/input/input.tsx +103 -0
  75. package/src/components/input/label.astro +24 -0
  76. package/src/components/input/label.module.css +28 -0
  77. package/src/components/input/label.tsx +25 -0
  78. package/src/components/input/radio-group.module.css +219 -0
  79. package/src/components/input/radio-group.stories.tsx +73 -0
  80. package/src/components/input/radio-group.tsx +67 -0
  81. package/src/components/input/select.module.css +75 -0
  82. package/src/components/input/select.stories.tsx +34 -0
  83. package/src/components/input/select.tsx +115 -0
  84. package/src/components/input/text-area.module.css +9 -0
  85. package/src/components/input/text-area.stories.tsx +51 -0
  86. package/src/components/input/text-area.tsx +81 -0
  87. package/src/components/input/utils.ts +21 -0
  88. package/src/components/notifications/@types/alert.ts +12 -0
  89. package/src/components/notifications/@types/toast.ts +12 -0
  90. package/src/components/notifications/alert.module.css +114 -0
  91. package/src/components/notifications/alert.stories.tsx +39 -0
  92. package/src/components/notifications/alert.tsx +117 -0
  93. package/src/components/notifications/index.ts +2 -0
  94. package/src/components/notifications/toast.module.css +237 -0
  95. package/src/components/notifications/toast.stories.tsx +42 -0
  96. package/src/components/notifications/toast.tsx +124 -0
  97. package/src/components/overlay/index.stories.tsx +29 -0
  98. package/src/components/overlay/index.ts +2 -0
  99. package/src/components/overlay/overlay.module.css +41 -0
  100. package/src/components/overlay/overlay.tsx +61 -0
  101. package/src/components/pager/@types/index.ts +2 -0
  102. package/src/components/pager/ellipses.tsx +18 -0
  103. package/src/components/pager/event-pager.tsx +18 -0
  104. package/src/components/pager/first-button.tsx +53 -0
  105. package/src/components/pager/hooks/types/usePagination.ts +80 -0
  106. package/src/components/pager/hooks/usePagination.ts +140 -0
  107. package/src/components/pager/icons/first.tsx +33 -0
  108. package/src/components/pager/icons/index.tsx +4 -0
  109. package/src/components/pager/icons/last.tsx +33 -0
  110. package/src/components/pager/icons/next.tsx +20 -0
  111. package/src/components/pager/icons/previous.tsx +20 -0
  112. package/src/components/pager/index.ts +4 -0
  113. package/src/components/pager/last-button.tsx +57 -0
  114. package/src/components/pager/next-button.tsx +55 -0
  115. package/src/components/pager/number-button.tsx +83 -0
  116. package/src/components/pager/pagination.module.css +165 -0
  117. package/src/components/pager/pagination.stories.tsx +190 -0
  118. package/src/components/pager/pagination.tsx +266 -0
  119. package/src/components/pager/previous-button.tsx +51 -0
  120. package/src/components/scroll-area/scroll-area.module.css +80 -0
  121. package/src/components/scroll-area/scroll-area.stories.tsx +33 -0
  122. package/src/components/scroll-area/scroll-area.tsx +22 -0
  123. package/src/components/scroll-to-top/scroll-to-top.tsx +59 -0
  124. package/src/components/section/section.astro +13 -0
  125. package/src/components/section/section.module.css +7 -0
  126. package/src/components/section/section.tsx +23 -0
  127. package/src/components/shimmer/shimmer.module.css +53 -0
  128. package/src/components/shimmer/shimmer.stories.tsx +24 -0
  129. package/src/components/shimmer/shimmer.tsx +70 -0
  130. package/src/components/table/table.module.css +100 -0
  131. package/src/components/table/table.stories.tsx +95 -0
  132. package/src/components/table/table.tsx +165 -0
  133. package/src/components/tabs/tabs.module.css +64 -0
  134. package/src/components/tabs/tabs.stories.tsx +47 -0
  135. package/src/components/tabs/tabs.tsx +75 -0
  136. package/src/components/timeline/timeline.module.css +87 -0
  137. package/src/components/timeline/timeline.stories.tsx +50 -0
  138. package/src/components/timeline/timeline.tsx +177 -0
  139. package/src/components/tooltip/tooltip.module.css +55 -0
  140. package/src/components/tooltip/tooltip.stories.tsx +59 -0
  141. package/src/components/tooltip/tooltip.tsx +51 -0
  142. package/src/declarations.d.ts +4 -0
  143. package/src/hooks/use-media-query.ts +20 -0
  144. package/src/icons/activity-icon.tsx +40 -0
  145. package/src/icons/calendar-icon.tsx +39 -0
  146. package/src/icons/check-icon.tsx +33 -0
  147. package/src/icons/chevron-down-icon.tsx +39 -0
  148. package/src/icons/chevron-left-double-icon.tsx +58 -0
  149. package/src/icons/chevron-left-icon.tsx +58 -0
  150. package/src/icons/chevron-right-double-icon.tsx +58 -0
  151. package/src/icons/chevron-right-icon.tsx +58 -0
  152. package/src/icons/chevrons-up-down.tsx +37 -0
  153. package/src/icons/close-icon.astro +38 -0
  154. package/src/icons/close-icon.tsx +30 -0
  155. package/src/icons/copy-icon.tsx +35 -0
  156. package/src/icons/danger-icon.tsx +18 -0
  157. package/src/icons/dashboard-icon.tsx +41 -0
  158. package/src/icons/delete-icon.tsx +34 -0
  159. package/src/icons/document-icon.tsx +38 -0
  160. package/src/icons/download-icon.tsx +39 -0
  161. package/src/icons/edit-icon.tsx +35 -0
  162. package/src/icons/ellipsis-icon.tsx +38 -0
  163. package/src/icons/email-icon.tsx +33 -0
  164. package/src/icons/external-link-icon.tsx +39 -0
  165. package/src/icons/github-icon.tsx +27 -0
  166. package/src/icons/globe-icon.tsx +50 -0
  167. package/src/icons/google-icon.tsx +44 -0
  168. package/src/icons/gripper-vertical-icon.tsx +43 -0
  169. package/src/icons/history-icon.tsx +32 -0
  170. package/src/icons/home-icon.tsx +34 -0
  171. package/src/icons/icon-element.astro +27 -0
  172. package/src/icons/icon-element.tsx +32 -0
  173. package/src/icons/icon-sprite.tsx +18 -0
  174. package/src/icons/icons.module.css +147 -0
  175. package/src/icons/index.stories.tsx +25 -0
  176. package/src/icons/index.ts +39 -0
  177. package/src/icons/info-icon.tsx +18 -0
  178. package/src/icons/infonomic-icon.tsx +173 -0
  179. package/src/icons/light-icon.astro +36 -0
  180. package/src/icons/light-icon.tsx +29 -0
  181. package/src/icons/location-pin-icon.tsx +36 -0
  182. package/src/icons/moon-icon.astro +38 -0
  183. package/src/icons/moon-icon.tsx +42 -0
  184. package/src/icons/plus-icon.tsx +34 -0
  185. package/src/icons/primary-icon.tsx +22 -0
  186. package/src/icons/refresh-icon.tsx +33 -0
  187. package/src/icons/return-icon.tsx +36 -0
  188. package/src/icons/roles-icon.tsx +34 -0
  189. package/src/icons/search-icon.astro +40 -0
  190. package/src/icons/search-icon.tsx +29 -0
  191. package/src/icons/search-menu-icon.tsx +42 -0
  192. package/src/icons/settings-gear-icon.tsx +36 -0
  193. package/src/icons/settings-sliders-icon.tsx +43 -0
  194. package/src/icons/sign-out-icon.tsx +35 -0
  195. package/src/icons/source/icon-calendar.svg +1 -0
  196. package/src/icons/source/icon-check.svg +4 -0
  197. package/src/icons/source/icon-close.svg +3 -0
  198. package/src/icons/source/icon-coinbase.svg +9 -0
  199. package/src/icons/source/icon-copy.svg +4 -0
  200. package/src/icons/source/icon-document.svg +5 -0
  201. package/src/icons/source/icon-download.svg +4 -0
  202. package/src/icons/source/icon-edit.svg +6 -0
  203. package/src/icons/source/icon-eth-purple.svg +15 -0
  204. package/src/icons/source/icon-etherscan.svg +5 -0
  205. package/src/icons/source/icon-external-link.svg +4 -0
  206. package/src/icons/source/icon-globe.svg +7 -0
  207. package/src/icons/source/icon-gripper-vertical.svg +9 -0
  208. package/src/icons/source/icon-info.svg +4 -0
  209. package/src/icons/source/icon-infonomic.svg +43 -0
  210. package/src/icons/source/icon-ledger.svg +4 -0
  211. package/src/icons/source/icon-light.svg +3 -0
  212. package/src/icons/source/icon-location-pin.svg +8 -0
  213. package/src/icons/source/icon-logout.svg +6 -0
  214. package/src/icons/source/icon-metamask.svg +32 -0
  215. package/src/icons/source/icon-moon.svg +3 -0
  216. package/src/icons/source/icon-plus.svg +4 -0
  217. package/src/icons/source/icon-refresh.svg +4 -0
  218. package/src/icons/source/icon-return.svg +4 -0
  219. package/src/icons/source/icon-search-menu.svg +13 -0
  220. package/src/icons/source/icon-search.svg +3 -0
  221. package/src/icons/source/icon-settings-gear.svg +5 -0
  222. package/src/icons/source/icon-settings.svg +12 -0
  223. package/src/icons/source/icon-wallet.svg +3 -0
  224. package/src/icons/source/icon-walletconnect.svg +4 -0
  225. package/src/icons/source/icon-x.svg +4 -0
  226. package/src/icons/stopwatch-icon.tsx +39 -0
  227. package/src/icons/success-icon.tsx +18 -0
  228. package/src/icons/types/icon.ts +8 -0
  229. package/src/icons/user-icon.tsx +33 -0
  230. package/src/icons/users-icon.tsx +35 -0
  231. package/src/icons/wallet-icon.tsx +29 -0
  232. package/src/icons/warning-icon.tsx +18 -0
  233. package/src/icons/x-icon.tsx +33 -0
  234. package/src/loaders/ellipses.tsx +36 -0
  235. package/src/loaders/loaders.stories.tsx +46 -0
  236. package/src/loaders/ring.tsx +33 -0
  237. package/src/loaders/spinner.tsx +28 -0
  238. package/src/loaders/types/index.ts +6 -0
  239. package/src/react.ts +99 -0
  240. package/src/styles/base/animations.css +143 -0
  241. package/src/styles/base/base.css +5 -0
  242. package/src/styles/base/colors.css +163 -0
  243. package/src/styles/base/colors.stories.tsx +671 -0
  244. package/src/styles/base/reset.css +464 -0
  245. package/src/styles/base/typography.css +25 -0
  246. package/src/styles/base/vars.css +188 -0
  247. package/src/styles/components/card.css +20 -0
  248. package/src/styles/components/checkbox.css +55 -0
  249. package/src/styles/components/components.css +11 -0
  250. package/src/styles/components/directional-button.css +92 -0
  251. package/src/styles/components/dropdown.css +19 -0
  252. package/src/styles/components/fade-in-lift.css +13 -0
  253. package/src/styles/components/hamburger.css +107 -0
  254. package/src/styles/components/icon-element.css +4 -0
  255. package/src/styles/components/list-checkbox.css +60 -0
  256. package/src/styles/components/loaders.css +196 -0
  257. package/src/styles/components/popover.css +15 -0
  258. package/src/styles/components/scroll-to-top.css +89 -0
  259. package/src/styles/components/toast.css +18 -0
  260. package/src/styles/styles.css +6 -0
  261. package/src/styles/theme/autofill.css +58 -0
  262. package/src/styles/theme/scrollers.css +52 -0
  263. package/src/styles/theme/theme.css +130 -0
  264. package/src/styles/theme/theme.stories.tsx +33 -0
  265. package/src/styles/typography/code.stories.tsx +76 -0
  266. package/src/styles/typography/default.stories.tsx +51 -0
  267. package/src/styles/typography/fonts.css +30 -0
  268. package/src/styles/typography/lists.stories.tsx +50 -0
  269. package/src/styles/typography/prose.css +404 -0
  270. package/src/styles/typography/quote.stories.tsx +37 -0
  271. package/src/styles/typography.css +24 -0
  272. package/src/styles/utils/scroll-layout-shift.css +9 -0
  273. package/src/styles/utils/utility-classes.css +1278 -0
  274. package/src/styles/utils/utils.css +2 -0
  275. package/src/theme/theme-provider/index.ts +1 -0
  276. package/src/theme/theme-provider/provider.tsx +44 -0
  277. package/src/utils/capitalize.ts +6 -0
  278. package/src/utils/externalLinkProps.ts +6 -0
  279. package/src/utils/findMatch.ts +7 -0
  280. package/src/utils/getPortalRoot.ts +3 -0
  281. package/src/utils/isTouchDevice.ts +11 -0
  282. package/src/utils/objectsToArray.ts +15 -0
  283. package/src/utils/objectsToString.ts +5 -0
  284. package/src/utils/polymorphic.ts +16 -0
  285. package/src/utils/to-kebab-case.ts +5 -0
  286. package/src/widgets/datepicker/datepicker.module.css +189 -0
  287. package/src/widgets/datepicker/datepicker.stories.tsx +25 -0
  288. package/src/widgets/datepicker/datepicker.tsx +310 -0
  289. package/src/widgets/drawer/drawer-container.tsx +26 -0
  290. package/src/widgets/drawer/drawer-content.tsx +26 -0
  291. package/src/widgets/drawer/drawer-context.tsx +49 -0
  292. package/src/widgets/drawer/drawer-header.tsx +27 -0
  293. package/src/widgets/drawer/drawer-top-actions.tsx +27 -0
  294. package/src/widgets/drawer/drawer-wrapper.tsx +54 -0
  295. package/src/widgets/drawer/drawer.module.css +116 -0
  296. package/src/widgets/drawer/drawer.stories.tsx +224 -0
  297. package/src/widgets/drawer/drawer.tsx +115 -0
  298. package/src/widgets/drawer/motionDomAnimation.ts +4 -0
  299. package/src/widgets/drawer/motionDomMax.ts +4 -0
  300. package/src/widgets/modal/modal-actions.tsx +26 -0
  301. package/src/widgets/modal/modal-container.tsx +26 -0
  302. package/src/widgets/modal/modal-content.tsx +26 -0
  303. package/src/widgets/modal/modal-header.tsx +27 -0
  304. package/src/widgets/modal/modal-wrapper.tsx +50 -0
  305. package/src/widgets/modal/modal.module.css +85 -0
  306. package/src/widgets/modal/modal.stories.tsx +71 -0
  307. package/src/widgets/modal/modal.tsx +110 -0
  308. package/src/widgets/modal/motionDomAnimation.ts +4 -0
  309. package/src/widgets/modal/motionDomMax.ts +4 -0
  310. package/src/widgets/search/index.ts +1 -0
  311. package/src/widgets/search/search.stories.tsx +18 -0
  312. package/src/widgets/search/search.tsx +186 -0
@@ -0,0 +1,29 @@
1
+ import type React from 'react'
2
+
3
+ import cx from 'classnames'
4
+
5
+ import { IconElement } from './icon-element.js'
6
+
7
+ import type { IconProps } from './types/icon.js'
8
+
9
+ import styles from './icons.module.css'
10
+
11
+ export const WalletIcon = ({ className, svgClassName, ...rest }: IconProps): React.JSX.Element => {
12
+ const applied = cx(styles['fill-contrast'], svgClassName)
13
+
14
+ return (
15
+ <IconElement className={cx('wallet-icon', className)} {...rest}>
16
+ <svg
17
+ className={applied}
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ focusable="false"
20
+ aria-hidden="true"
21
+ viewBox="0 0 24 24"
22
+ >
23
+ <path d="M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72zM20 9v6h-7V9h7zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2H5z"></path>
24
+ </svg>
25
+ </IconElement>
26
+ )
27
+ }
28
+
29
+ WalletIcon.displayName = 'WalletIcon'
@@ -0,0 +1,18 @@
1
+ import cx from 'classnames'
2
+ import type React from 'react'
3
+
4
+ import { IconElement } from './icon-element.js'
5
+ import styles from './icons.module.css'
6
+ import type { IconProps } from './types/icon.js'
7
+
8
+ export const WarningIcon = ({ className, svgClassName, ...rest }: IconProps): React.JSX.Element => {
9
+ const applied = cx(styles['fill-warning'], svgClassName)
10
+
11
+ return (
12
+ <IconElement className={cx('warning-icon', className)} {...rest}>
13
+ <svg className={applied} focusable="false" aria-hidden="true" viewBox="0 0 24 24">
14
+ <path d="M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"></path>
15
+ </svg>
16
+ </IconElement>
17
+ )
18
+ }
@@ -0,0 +1,33 @@
1
+ import type React from 'react'
2
+
3
+ import cx from 'classnames'
4
+
5
+ import { IconElement } from './icon-element.js'
6
+
7
+ import type { IconProps } from './types/icon.js'
8
+
9
+ import styles from './icons.module.css'
10
+
11
+ export const XIcon = ({ className, svgClassName, ...rest }: IconProps): React.JSX.Element => {
12
+ const applied = cx(styles['fill-gray'], svgClassName)
13
+
14
+ return (
15
+ <IconElement className={cx('x-icon', className)} {...rest}>
16
+ <svg
17
+ className={applied}
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ focusable="false"
20
+ aria-hidden="true"
21
+ viewBox="0 0 15 15"
22
+ >
23
+ <path
24
+ d="M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z"
25
+ fillRule="evenodd"
26
+ clipRule="evenodd"
27
+ ></path>
28
+ </svg>
29
+ </IconElement>
30
+ )
31
+ }
32
+
33
+ XIcon.displayName = 'XIcon'
@@ -0,0 +1,36 @@
1
+ // https://github.com/JoshK2/react-spinners-css
2
+ import type React from 'react'
3
+
4
+ import classNames from 'classnames'
5
+
6
+ import type { LoaderProps } from './types/index.js'
7
+
8
+ export function LoaderEllipsis({
9
+ color,
10
+ size = 80,
11
+ className,
12
+ style,
13
+ ...rest
14
+ }: LoaderProps): React.JSX.Element {
15
+ const height = size * 0.5
16
+
17
+ const circles = [...Array(4)].map((_, index) => (
18
+ <div
19
+ // biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
20
+ key={index}
21
+ style={{
22
+ backgroundColor: color ? color : 'var(--loader-color)',
23
+ }}
24
+ />
25
+ ))
26
+
27
+ return (
28
+ <div
29
+ className={classNames('lds-ellipsis', className)}
30
+ style={{ ...style, width: size, height }}
31
+ {...rest}
32
+ >
33
+ {circles}
34
+ </div>
35
+ )
36
+ }
@@ -0,0 +1,46 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import type React from 'react'
3
+
4
+ import { LoaderEllipsis } from './ellipses.js'
5
+ import { LoaderRing } from './ring.js'
6
+ import { LoaderSpinner } from './spinner.js'
7
+
8
+ interface LoaderProps {
9
+ loader: React.JSX.Element
10
+ label: string
11
+ }
12
+
13
+ function Loader({ loader, label }: LoaderProps): React.JSX.Element {
14
+ return (
15
+ <div className="flex flex-col items-center">
16
+ {loader}
17
+ <span className="text-sm text-gray-500">{label}</span>
18
+ </div>
19
+ )
20
+ }
21
+
22
+ const LoaderDemo = (): React.JSX.Element => (
23
+ <div className="loader-demo grid grid-cols-4 gap-5">
24
+ <Loader loader={<LoaderRing size={48} />} label="Ring" />
25
+ <Loader loader={<LoaderEllipsis size={48} />} label="Ellipsis" />
26
+ <Loader loader={<LoaderSpinner />} label="Spinner" />
27
+ </div>
28
+ )
29
+
30
+ export default {
31
+ title: 'Loaders/All',
32
+ component: LoaderDemo,
33
+ argTypes: {},
34
+ }
35
+
36
+ export const Default = (): React.JSX.Element => {
37
+ return (
38
+ <>
39
+ <div className="mb-6">
40
+ <div className="max-w-[700px]">
41
+ <LoaderDemo />
42
+ </div>
43
+ </div>
44
+ </>
45
+ )
46
+ }
@@ -0,0 +1,33 @@
1
+ // https://github.com/JoshK2/react-spinners-css
2
+ import type React from 'react'
3
+
4
+ import classNames from 'classnames'
5
+
6
+ import type { LoaderProps } from './types/index.js'
7
+
8
+ export function LoaderRing({ color, size = 60, className, style }: LoaderProps): React.JSX.Element {
9
+ const circles = [...Array(4)].map((_, index) => {
10
+ return (
11
+ <div
12
+ // biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
13
+ key={index}
14
+ style={{
15
+ borderColor: `${color || 'var(--loader-color)'} transparent transparent transparent`,
16
+ width: size * 0.8,
17
+ height: size * 0.8,
18
+ margin: size * 0.1,
19
+ borderWidth: size * 0.1,
20
+ }}
21
+ />
22
+ )
23
+ })
24
+
25
+ return (
26
+ <div
27
+ className={classNames('lds-ring', className)}
28
+ style={{ width: size, height: size, ...style }}
29
+ >
30
+ {circles}
31
+ </div>
32
+ )
33
+ }
@@ -0,0 +1,28 @@
1
+ // https://github.com/JoshK2/react-spinners-css
2
+ import type React from 'react'
3
+
4
+ import classNames from 'classnames'
5
+
6
+ import type { LoaderProps } from './types/index.js'
7
+
8
+ type SpinnerProps = Omit<LoaderProps, 'size'>
9
+
10
+ export function LoaderSpinner({ color, className, style }: SpinnerProps): React.JSX.Element {
11
+ const circles = [...Array(12)].map((_, index) => {
12
+ return (
13
+ // biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
14
+ <div key={index}>
15
+ <div
16
+ className={classNames('div-after')}
17
+ style={{ backgroundColor: color ? color : 'var(--loader-color)' }}
18
+ />
19
+ </div>
20
+ )
21
+ })
22
+
23
+ return (
24
+ <div className={classNames('lds-spinner', className)} style={{ ...style }}>
25
+ {circles}
26
+ </div>
27
+ )
28
+ }
@@ -0,0 +1,6 @@
1
+ export type LoaderProps = {
2
+ /** hex color */
3
+ color?: string
4
+ /** size in pixel */
5
+ size?: number
6
+ } & React.HTMLAttributes<HTMLDivElement>
package/src/react.ts ADDED
@@ -0,0 +1,99 @@
1
+ /**
2
+ * NOTE: We put a .js ending on imports here to satisfy
3
+ * TS / dist output
4
+ */
5
+ export * from './components/@types/shared.js'
6
+
7
+ export * from './components/accordion/accordion.js'
8
+ export * from './components/animation/fade-in-lift.js'
9
+ export * from './components/avatar/avatar.js'
10
+ export * from './components/button/button.js'
11
+ export * from './components/button/button-group.js'
12
+ export * from './components/button/control-buttons.js'
13
+ export * from './components/button/copy-button.js'
14
+ export * from './components/button/icon-button.js'
15
+ export * from './components/calendar/calendar.js'
16
+ export * from './components/card/card.js'
17
+ export * from './components/container/container.js'
18
+ export * from './components/dropdown/dropdown.js'
19
+ export * from './components/hamburger/hamburger.js'
20
+ export * from './components/input/checkbox.js'
21
+ export * from './components/input/checkbox-group.js'
22
+ export * from './components/input/error-text.js'
23
+ export * from './components/input/errors.js'
24
+ export * from './components/input/help-text.js'
25
+ export * from './components/input/input.js'
26
+ export * from './components/input/input-adornment.js'
27
+ export * from './components/input/label.js'
28
+ export * from './components/input/radio-group.js'
29
+ export * from './components/input/select.js'
30
+ export * from './components/input/text-area.js'
31
+ export * from './components/input/utils.js'
32
+ export * from './components/notifications/alert.js'
33
+ export * from './components/notifications/toast.js'
34
+ export * from './components/pager/pagination.js'
35
+ export * from './components/scroll-area/scroll-area.js'
36
+ export * from './components/scroll-to-top/scroll-to-top.js'
37
+ export * from './components/section/section.js'
38
+ export * from './components/shimmer/shimmer.js'
39
+ export * from './components/table/table.js'
40
+ export * from './components/tabs/tabs.js'
41
+ export * from './components/timeline/timeline.js'
42
+ export * from './components/tooltip/tooltip.js'
43
+ export * from './icons/activity-icon.js'
44
+ export * from './icons/calendar-icon.js'
45
+ export * from './icons/check-icon.js'
46
+ export * from './icons/chevron-down-icon.js'
47
+ export * from './icons/chevron-left-double-icon.js'
48
+ export * from './icons/chevron-left-icon.js'
49
+ export * from './icons/chevron-right-double-icon.js'
50
+ export * from './icons/chevron-right-icon.js'
51
+ export * from './icons/chevrons-up-down.js'
52
+ export * from './icons/close-icon.js'
53
+ export * from './icons/copy-icon.js'
54
+ export * from './icons/danger-icon.js'
55
+ export * from './icons/dashboard-icon.js'
56
+ export * from './icons/delete-icon.js'
57
+ export * from './icons/document-icon.js'
58
+ export * from './icons/download-icon.js'
59
+ export * from './icons/edit-icon.js'
60
+ export * from './icons/ellipsis-icon.js'
61
+ export * from './icons/email-icon.js'
62
+ export * from './icons/external-link-icon.js'
63
+ export * from './icons/github-icon.js'
64
+ export * from './icons/globe-icon.js'
65
+ export * from './icons/google-icon.js'
66
+ export * from './icons/gripper-vertical-icon.js'
67
+ export * from './icons/history-icon.js'
68
+ export * from './icons/home-icon.js'
69
+ export * from './icons/icon-element.js'
70
+ export * from './icons/info-icon.js'
71
+ export * from './icons/infonomic-icon.js'
72
+ export * from './icons/light-icon.js'
73
+ export * from './icons/location-pin-icon.js'
74
+ export * from './icons/moon-icon.js'
75
+ export * from './icons/plus-icon.js'
76
+ export * from './icons/primary-icon.js'
77
+ export * from './icons/refresh-icon.js'
78
+ export * from './icons/return-icon.js'
79
+ export * from './icons/roles-icon.js'
80
+ export * from './icons/search-icon.js'
81
+ export * from './icons/search-menu-icon.js'
82
+ export * from './icons/settings-gear-icon.js'
83
+ export * from './icons/settings-sliders-icon.js'
84
+ export * from './icons/sign-out-icon.js'
85
+ export * from './icons/stopwatch-icon.js'
86
+ export * from './icons/success-icon.js'
87
+ export * from './icons/user-icon.js'
88
+ export * from './icons/users-icon.js'
89
+ export * from './icons/wallet-icon.js'
90
+ export * from './icons/warning-icon.js'
91
+ export * from './icons/x-icon.js'
92
+
93
+ export * from './loaders/ellipses.js'
94
+ export * from './loaders/ring.js'
95
+ export * from './loaders/spinner.js'
96
+ export * from './widgets/drawer/drawer.js'
97
+ export * from './widgets/drawer/drawer-context.js'
98
+ export * from './widgets/modal/modal.js'
99
+ export * from './widgets/search/search.js'
@@ -0,0 +1,143 @@
1
+ @layer infonomic-base {
2
+
3
+ @keyframes enterFromRight {
4
+ from {
5
+ opacity: 0;
6
+ transform: translateX(200px);
7
+ }
8
+
9
+ to {
10
+ opacity: 1;
11
+ transform: translateX(0);
12
+ }
13
+ }
14
+
15
+ @keyframes enterFromLeft {
16
+ from {
17
+ opacity: 0;
18
+ transform: translateX(-200px);
19
+ }
20
+
21
+ to {
22
+ opacity: 1;
23
+ transform: translateX(0);
24
+ }
25
+ }
26
+
27
+ @keyframes exitToRight {
28
+ from {
29
+ opacity: 1;
30
+ transform: translateX(0);
31
+ }
32
+
33
+ to {
34
+ opacity: 0;
35
+ transform: translateX(200px);
36
+ }
37
+ }
38
+
39
+ @keyframes exitToLeft {
40
+ from {
41
+ opacity: 1;
42
+ transform: translateX(0);
43
+ }
44
+
45
+ to {
46
+ opacity: 0;
47
+ transform: translateX(-200px);
48
+ }
49
+ }
50
+
51
+ @keyframes scaleIn {
52
+ from {
53
+ opacity: 0;
54
+ transform: rotateX(-30deg) scale(0.9);
55
+ }
56
+
57
+ to {
58
+ opacity: 1;
59
+ transform: rotateX(0deg) scale(1);
60
+ }
61
+ }
62
+
63
+ @keyframes scaleOut {
64
+ from {
65
+ opacity: 1;
66
+ transform: rotateX(0deg) scale(1);
67
+ }
68
+
69
+ to {
70
+ opacity: 0;
71
+ transform: rotateX(-10deg) scale(0.95);
72
+ }
73
+ }
74
+
75
+ @keyframes fadeIn {
76
+ from {
77
+ opacity: 0;
78
+ }
79
+
80
+ to {
81
+ opacity: 1;
82
+ }
83
+ }
84
+
85
+ @keyframes fadeOut {
86
+ from {
87
+ opacity: 1;
88
+ }
89
+
90
+ to {
91
+ opacity: 0;
92
+ }
93
+ }
94
+
95
+
96
+ @keyframes slideUpAndFade {
97
+ from {
98
+ opacity: 0;
99
+ transform: translateY(2px);
100
+ }
101
+
102
+ to {
103
+ opacity: 1;
104
+ transform: translateY(0);
105
+ }
106
+ }
107
+
108
+ @keyframes slideRightAndFade {
109
+ from {
110
+ opacity: 0;
111
+ transform: translateX(-2px);
112
+ }
113
+
114
+ to {
115
+ opacity: 1;
116
+ transform: translateX(0);
117
+ }
118
+ }
119
+
120
+ @keyframes slideDownAndFade {
121
+ from {
122
+ opacity: 0;
123
+ transform: translateY(-2px);
124
+ }
125
+
126
+ to {
127
+ opacity: 1;
128
+ transform: translateY(0);
129
+ }
130
+ }
131
+
132
+ @keyframes slideLeftAndFade {
133
+ from {
134
+ opacity: 0;
135
+ transform: translateX(2px);
136
+ }
137
+
138
+ to {
139
+ opacity: 1;
140
+ transform: translateX(0);
141
+ }
142
+ }
143
+ }
@@ -0,0 +1,5 @@
1
+ @import "./reset.css";
2
+ @import "./colors.css";
3
+ @import "./vars.css";
4
+ @import "./animations.css";
5
+ @import "./typography.css";
@@ -0,0 +1,163 @@
1
+ @layer infonomic-base {
2
+ :root {
3
+ /* Theme base color */
4
+ --theme-base: oklch(43.11% 0.1 317.53);
5
+
6
+ --theme-25: oklch(from var(--theme-base) calc(l * 2) c h);
7
+ --theme-50: oklch(from var(--theme-base) calc(l * 1.75) c h);
8
+ --theme-100: oklch(from var(--theme-base) calc(l * 1.5) c h);
9
+ --theme-200: oklch(from var(--theme-base) calc(l * 1.25) c h);
10
+ --theme-300: oklch(from var(--theme-base) calc(l * 1.1) c h);
11
+ --theme-400: var(--theme-base);
12
+ --theme-500: oklch(from var(--theme-base) calc(l * 0.95) c h);
13
+ --theme-600: oklch(from var(--theme-base) calc(l * 0.9) c h);
14
+ --theme-700: oklch(from var(--theme-base) calc(l * 0.85) c h);
15
+ --theme-800: oklch(from var(--theme-base) calc(l * 0.8) c h);
16
+ --theme-900: oklch(from var(--theme-base) calc(l * 0.75) c h);
17
+ --theme-950: oklch(from var(--theme-base) calc(l * 0.7) c h);
18
+
19
+ /* Primary base */
20
+ --primary-base: oklch(49.7% 0.189 295.76);
21
+
22
+ --primary-25: oklch(from var(--primary-base) calc(l * 2) c h);
23
+ --primary-50: oklch(from var(--primary-base) calc(l * 1.75) c h);
24
+ --primary-100: oklch(from var(--primary-base) calc(l * 1.5) c h);
25
+ --primary-200: oklch(from var(--primary-base) calc(l * 1.25) c h);
26
+ --primary-300: oklch(from var(--primary-base) calc(l * 1.1) c h);
27
+ --primary-400: var(--primary-base);
28
+ --primary-500: oklch(from var(--primary-base) calc(l * 0.95) c h);
29
+ --primary-600: oklch(from var(--primary-base) calc(l * 0.9) c h);
30
+ --primary-700: oklch(from var(--primary-base) calc(l * 0.85) c h);
31
+ --primary-800: oklch(from var(--primary-base) calc(l * 0.8) c h);
32
+ --primary-900: oklch(from var(--primary-base) calc(l * 0.75) c h);
33
+ --primary-950: oklch(from var(--primary-base) calc(l * 0.7) c h);
34
+
35
+ /* Secondary base */
36
+ --secondary-base: oklch(0.8461 0.15 82.94);
37
+
38
+ --secondary-25: oklch(from var(--secondary-base) calc(l * 2.25) 0.1 h);
39
+ --secondary-50: oklch(from var(--secondary-base) calc(l * 2) c h);
40
+ --secondary-100: oklch(from var(--secondary-base) calc(l * 1.75) c h);
41
+ --secondary-200: oklch(from var(--secondary-base) calc(l * 1.5) c h);
42
+ --secondary-300: oklch(from var(--secondary-base) calc(l * 1.1) c h);
43
+ --secondary-400: var(--secondary-base);
44
+ --secondary-500: oklch(from var(--secondary-base) calc(l * 0.95) c h);
45
+ --secondary-600: oklch(from var(--secondary-base) calc(l * 0.9) c h);
46
+ --secondary-700: oklch(from var(--secondary-base) calc(l * 0.85) c h);
47
+ --secondary-800: oklch(from var(--secondary-base) calc(l * 0.8) c h);
48
+ --secondary-900: oklch(from var(--secondary-base) calc(l * 0.75) c h);
49
+ --secondary-950: oklch(from var(--secondary-base) calc(l * 0.7) c h);
50
+
51
+ /* Accent base */
52
+ --accent-base: oklch(0.754 0.1 324.9);
53
+
54
+ --accent-25: oklch(from var(--accent-base) 0.985 0.06 h);
55
+ --accent-50: oklch(from var(--accent-base) 0.975 0.08 h);
56
+ --accent-100: oklch(from var(--accent-base) 0.9 0.07 h);
57
+ --accent-200: oklch(from var(--accent-base) 0.85 c h);
58
+ --accent-300: oklch(from var(--accent-base) 0.8 c h);
59
+ --accent-400: var(--accent-base);
60
+ --accent-500: oklch(from var(--accent-base) 0.7 c h);
61
+ --accent-600: oklch(from var(--accent-base) 0.68 c h);
62
+ --accent-700: oklch(from var(--accent-base) 0.62 0.1 h);
63
+ --accent-800: oklch(from var(--accent-base) 0.6 0.1 h);
64
+ --accent-900: oklch(from var(--accent-base) 0.58 0.1 h);
65
+ --accent-950: oklch(from var(--accent-base) 0.5 0.11 h);
66
+
67
+ /* Gray base */
68
+ --gray-base: oklch(0.5984 0 0);
69
+
70
+ --gray-25: oklch(from var(--gray-base) calc(l * 1.625) c h);
71
+ --gray-50: oklch(from var(--gray-base) calc(l * 1.575) c h);
72
+ --gray-100: oklch(from var(--gray-base) calc(l * 1.475) c h);
73
+ --gray-200: oklch(from var(--gray-base) calc(l * 1.35) c h);
74
+ --gray-300: oklch(from var(--gray-base) calc(l * 1.175) c h);
75
+ --gray-400: var(--gray-base);
76
+ --gray-500: oklch(from var(--gray-base) calc(l * 0.85) c h);
77
+ --gray-600: oklch(from var(--gray-base) calc(l * 0.725) c h);
78
+ --gray-700: oklch(from var(--gray-base) calc(l * 0.6126) c h);
79
+ --gray-800: oklch(from var(--gray-base) calc(l * 0.5) c h);
80
+ --gray-900: oklch(from var(--gray-base) calc(l * 0.4) c h);
81
+ --gray-950: oklch(from var(--gray-base) calc(l * 0.3) c h);
82
+
83
+ /* Canvas base */
84
+ --canvas-base: oklch(0.542 0.0037 275.34);
85
+
86
+ --canvas-25: oklch(from var(--canvas-base) calc(l * 1.9) c h);
87
+ --canvas-50: oklch(from var(--canvas-base) calc(l * 1.75) c h);
88
+ --canvas-100: oklch(from var(--canvas-base) calc(l * 1.6) c h);
89
+ --canvas-200: oklch(from var(--canvas-base) calc(l * 1.4) c h);
90
+ --canvas-300: oklch(from var(--canvas-base) calc(l * 1.2) c h);
91
+ --canvas-400: var(--canvas-base);
92
+ --canvas-500: oklch(from var(--canvas-base) calc(l * 0.9) c h);
93
+ --canvas-600: oklch(from var(--canvas-base) calc(l * 0.7) c h);
94
+ --canvas-700: oklch(from var(--canvas-base) calc(l * 0.5) c h);
95
+ --canvas-800: oklch(from var(--canvas-base) calc(l * 0.335) c h);
96
+ --canvas-900: oklch(from var(--canvas-base) calc(l * 0.3) c h);
97
+ --canvas-950: oklch(from var(--canvas-base) calc(l * 0.225) c h);
98
+
99
+ /* Red base */
100
+ --red-base: oklch(54.27% 0.18 31.76);
101
+
102
+ --red-25: oklch(from var(--red-base) calc(l * 2) c h);
103
+ --red-50: oklch(from var(--red-base) calc(l * 1.75) c h);
104
+ --red-100: oklch(from var(--red-base) calc(l * 1.5) c h);
105
+ --red-200: oklch(from var(--red-base) calc(l * 1.25) c h);
106
+ --red-300: oklch(from var(--red-base) calc(l * 1.1) c h);
107
+ --red-400: var(--red-base);
108
+ --red-500: oklch(from var(--red-base) calc(l * 0.95) c h);
109
+ --red-600: oklch(from var(--red-base) calc(l * 0.9) c h);
110
+ --red-700: oklch(from var(--red-base) calc(l * 0.85) c h);
111
+ --red-800: oklch(from var(--red-base) calc(l * 0.8) c h);
112
+ --red-900: oklch(from var(--red-base) calc(l * 0.75) c h);
113
+ --red-950: oklch(from var(--red-base) calc(l * 0.7) c h);
114
+
115
+ /* Green base */
116
+ --green-base: oklch(65.26% 0.18 142.58);
117
+
118
+ --green-25: oklch(from var(--green-base) calc(l * 2) c h);
119
+ --green-50: oklch(from var(--green-base) calc(l * 1.75) c h);
120
+ --green-100: oklch(from var(--green-base) calc(l * 1.5) c h);
121
+ --green-200: oklch(from var(--green-base) calc(l * 1.25) c h);
122
+ --green-300: oklch(from var(--green-base) calc(l * 1.1) c h);
123
+ --green-400: var(--green-base);
124
+ --green-500: oklch(from var(--green-base) calc(l * 0.95) c h);
125
+ --green-600: oklch(from var(--green-base) calc(l * 0.9) c h);
126
+ --green-700: oklch(from var(--green-base) calc(l * 0.85) c h);
127
+ --green-800: oklch(from var(--green-base) calc(l * 0.8) c h);
128
+ --green-900: oklch(from var(--green-base) calc(l * 0.75) c h);
129
+ --green-950: oklch(from var(--green-base) calc(l * 0.7) c h);
130
+
131
+ /* Blue base */
132
+ --blue-base: oklch(53.66% 0.1942 265.89);
133
+
134
+ --blue-25: oklch(from var(--blue-base) calc(l * 2) c h);
135
+ --blue-50: oklch(from var(--blue-base) calc(l * 1.75) c h);
136
+ --blue-100: oklch(from var(--blue-base) calc(l * 1.5) c h);
137
+ --blue-200: oklch(from var(--blue-base) calc(l * 1.25) c h);
138
+ --blue-300: oklch(from var(--blue-base) calc(l * 1.1) c h);
139
+ --blue-400: var(--blue-base);
140
+ --blue-500: oklch(from var(--blue-base) calc(l * 0.95) c h);
141
+ --blue-600: oklch(from var(--blue-base) calc(l * 0.9) c h);
142
+ --blue-700: oklch(from var(--blue-base) calc(l * 0.85) c h);
143
+ --blue-800: oklch(from var(--blue-base) calc(l * 0.8) c h);
144
+ --blue-900: oklch(from var(--blue-base) calc(l * 0.75) c h);
145
+ --blue-950: oklch(from var(--blue-base) calc(l * 0.7) c h);
146
+
147
+ /* Yellow base */
148
+ --yellow-base: oklch(0.75 0.15 82.94);
149
+
150
+ --yellow-25: oklch(from var(--yellow-base) calc(l * 2) c h);
151
+ --yellow-50: oklch(from var(--yellow-base) calc(l * 1.75) c h);
152
+ --yellow-100: oklch(from var(--yellow-base) calc(l * 1.5) c h);
153
+ --yellow-200: oklch(from var(--yellow-base) calc(l * 1.25) c h);
154
+ --yellow-300: oklch(from var(--yellow-base) calc(l * 1.1) c h);
155
+ --yellow-400: var(--yellow-base);
156
+ --yellow-500: oklch(from var(--yellow-base) calc(l * 0.95) c h);
157
+ --yellow-600: oklch(from var(--yellow-base) calc(l * 0.9) c h);
158
+ --yellow-700: oklch(from var(--yellow-base) calc(l * 0.85) c h);
159
+ --yellow-800: oklch(from var(--yellow-base) calc(l * 0.8) c h);
160
+ --yellow-900: oklch(from var(--yellow-base) calc(l * 0.75) c h);
161
+ --yellow-950: oklch(from var(--yellow-base) calc(l * 0.7) c h);
162
+ }
163
+ }