@infonomic/uikit 2.0.0 → 2.1.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 (314) hide show
  1. package/dist/components/button/index.js +1 -17
  2. package/dist/components/card/card.d.ts.map +1 -1
  3. package/dist/tsconfig.build.tsbuildinfo +1 -1
  4. package/package.json +35 -31
  5. package/src/astro.d.ts +43 -0
  6. package/src/astro.js +2 -2
  7. package/src/components/@types/shared.ts +24 -0
  8. package/src/components/accordion/accordion.module.css +60 -0
  9. package/src/components/accordion/accordion.stories.tsx +117 -0
  10. package/src/components/accordion/accordion.tsx +105 -0
  11. package/src/components/animation/fade-in-lift.stories.tsx +81 -0
  12. package/src/components/animation/fade-in-lift.tsx +42 -0
  13. package/src/components/avatar/avatar.module.css +54 -0
  14. package/src/components/avatar/avatar.stories.tsx +28 -0
  15. package/src/components/avatar/avatar.tsx +19 -0
  16. package/src/components/button/@types/button.ts +17 -0
  17. package/src/components/button/button-group.module.css +17 -0
  18. package/src/components/button/button-group.stories.tsx +45 -0
  19. package/src/components/button/button-group.tsx +132 -0
  20. package/src/components/button/button-icon.stories.tsx +145 -0
  21. package/src/components/button/button-intents.stories.tsx +50 -0
  22. package/src/components/button/button-variants.stories.tsx +60 -0
  23. package/src/components/button/button.astro +86 -0
  24. package/src/components/button/button.module.css +533 -0
  25. package/src/components/button/button.tsx +81 -0
  26. package/src/components/button/control-buttons.module.css +144 -0
  27. package/src/components/button/control-buttons.stories.tsx +60 -0
  28. package/src/components/button/control-buttons.tsx +137 -0
  29. package/src/components/button/copy-button.module.css +31 -0
  30. package/src/components/button/copy-button.stories.tsx +50 -0
  31. package/src/components/button/copy-button.tsx +92 -0
  32. package/src/components/button/icon-button.astro +47 -0
  33. package/src/components/button/icon-button.tsx +44 -0
  34. package/src/components/button/index.ts +5 -0
  35. package/src/components/calendar/calendar.module.css +315 -0
  36. package/src/components/calendar/calendar.stories.tsx +139 -0
  37. package/src/components/calendar/calendar.tsx +173 -0
  38. package/src/components/card/card-content.astro +14 -0
  39. package/src/components/card/card-description.astro +14 -0
  40. package/src/components/card/card-footer.astro +14 -0
  41. package/src/components/card/card-header.astro +14 -0
  42. package/src/components/card/card-title.astro +14 -0
  43. package/src/components/card/card.astro +41 -0
  44. package/src/components/card/card.module.css +67 -0
  45. package/src/components/card/card.stories.tsx +61 -0
  46. package/src/components/card/card.tsx +86 -0
  47. package/src/components/container/container.astro +13 -0
  48. package/src/components/container/container.module.css +28 -0
  49. package/src/components/container/container.stories.tsx +42 -0
  50. package/src/components/container/container.tsx +23 -0
  51. package/src/components/dropdown/dropdown.module.css +131 -0
  52. package/src/components/dropdown/dropdown.stories.tsx +103 -0
  53. package/src/components/dropdown/dropdown.tsx +193 -0
  54. package/src/components/hamburger/hamburger.astro +30 -0
  55. package/src/components/hamburger/hamburger.tsx +66 -0
  56. package/src/components/input/@types/checkbox.ts +20 -0
  57. package/src/components/input/@types/input.ts +20 -0
  58. package/src/components/input/checkbox-group.tsx +78 -0
  59. package/src/components/input/checkbox.module.css +267 -0
  60. package/src/components/input/checkbox.stories.tsx +240 -0
  61. package/src/components/input/checkbox.tsx +95 -0
  62. package/src/components/input/error-text.astro +14 -0
  63. package/src/components/input/error-text.module.css +19 -0
  64. package/src/components/input/error-text.tsx +18 -0
  65. package/src/components/input/errors.tsx +37 -0
  66. package/src/components/input/help-text.astro +13 -0
  67. package/src/components/input/help-text.module.css +19 -0
  68. package/src/components/input/help-text.tsx +13 -0
  69. package/src/components/input/index.tsx +8 -0
  70. package/src/components/input/input-adornment.astro +26 -0
  71. package/src/components/input/input-adornment.module.css +18 -0
  72. package/src/components/input/input-adornment.tsx +36 -0
  73. package/src/components/input/input.astro +99 -0
  74. package/src/components/input/input.module.css +310 -0
  75. package/src/components/input/input.stories.tsx +174 -0
  76. package/src/components/input/input.tsx +103 -0
  77. package/src/components/input/label.astro +24 -0
  78. package/src/components/input/label.module.css +28 -0
  79. package/src/components/input/label.tsx +25 -0
  80. package/src/components/input/radio-group.module.css +219 -0
  81. package/src/components/input/radio-group.stories.tsx +73 -0
  82. package/src/components/input/radio-group.tsx +67 -0
  83. package/src/components/input/select.module.css +75 -0
  84. package/src/components/input/select.stories.tsx +34 -0
  85. package/src/components/input/select.tsx +115 -0
  86. package/src/components/input/text-area.module.css +9 -0
  87. package/src/components/input/text-area.stories.tsx +51 -0
  88. package/src/components/input/text-area.tsx +81 -0
  89. package/src/components/input/utils.ts +21 -0
  90. package/src/components/notifications/@types/alert.ts +12 -0
  91. package/src/components/notifications/@types/toast.ts +12 -0
  92. package/src/components/notifications/alert.module.css +114 -0
  93. package/src/components/notifications/alert.stories.tsx +39 -0
  94. package/src/components/notifications/alert.tsx +117 -0
  95. package/src/components/notifications/index.ts +2 -0
  96. package/src/components/notifications/toast.module.css +237 -0
  97. package/src/components/notifications/toast.stories.tsx +42 -0
  98. package/src/components/notifications/toast.tsx +124 -0
  99. package/src/components/overlay/index.stories.tsx +29 -0
  100. package/src/components/overlay/index.ts +2 -0
  101. package/src/components/overlay/overlay.module.css +41 -0
  102. package/src/components/overlay/overlay.tsx +61 -0
  103. package/src/components/pager/@types/index.ts +2 -0
  104. package/src/components/pager/ellipses.tsx +18 -0
  105. package/src/components/pager/event-pager.tsx +18 -0
  106. package/src/components/pager/first-button.tsx +53 -0
  107. package/src/components/pager/hooks/types/usePagination.ts +80 -0
  108. package/src/components/pager/hooks/usePagination.ts +140 -0
  109. package/src/components/pager/icons/first.tsx +33 -0
  110. package/src/components/pager/icons/index.tsx +4 -0
  111. package/src/components/pager/icons/last.tsx +33 -0
  112. package/src/components/pager/icons/next.tsx +20 -0
  113. package/src/components/pager/icons/previous.tsx +20 -0
  114. package/src/components/pager/index.ts +4 -0
  115. package/src/components/pager/last-button.tsx +57 -0
  116. package/src/components/pager/next-button.tsx +55 -0
  117. package/src/components/pager/number-button.tsx +83 -0
  118. package/src/components/pager/pagination.module.css +165 -0
  119. package/src/components/pager/pagination.stories.tsx +190 -0
  120. package/src/components/pager/pagination.tsx +266 -0
  121. package/src/components/pager/previous-button.tsx +51 -0
  122. package/src/components/scroll-area/scroll-area.module.css +80 -0
  123. package/src/components/scroll-area/scroll-area.stories.tsx +33 -0
  124. package/src/components/scroll-area/scroll-area.tsx +22 -0
  125. package/src/components/scroll-to-top/scroll-to-top.tsx +59 -0
  126. package/src/components/section/section.astro +13 -0
  127. package/src/components/section/section.module.css +7 -0
  128. package/src/components/section/section.tsx +23 -0
  129. package/src/components/shimmer/shimmer.module.css +53 -0
  130. package/src/components/shimmer/shimmer.stories.tsx +24 -0
  131. package/src/components/shimmer/shimmer.tsx +70 -0
  132. package/src/components/table/table.module.css +100 -0
  133. package/src/components/table/table.stories.tsx +95 -0
  134. package/src/components/table/table.tsx +165 -0
  135. package/src/components/tabs/tabs.module.css +64 -0
  136. package/src/components/tabs/tabs.stories.tsx +47 -0
  137. package/src/components/tabs/tabs.tsx +75 -0
  138. package/src/components/timeline/timeline.module.css +87 -0
  139. package/src/components/timeline/timeline.stories.tsx +50 -0
  140. package/src/components/timeline/timeline.tsx +177 -0
  141. package/src/components/tooltip/tooltip.module.css +55 -0
  142. package/src/components/tooltip/tooltip.stories.tsx +59 -0
  143. package/src/components/tooltip/tooltip.tsx +51 -0
  144. package/src/declarations.d.ts +4 -0
  145. package/src/hooks/use-media-query.ts +20 -0
  146. package/src/icons/activity-icon.tsx +40 -0
  147. package/src/icons/calendar-icon.tsx +39 -0
  148. package/src/icons/check-icon.tsx +33 -0
  149. package/src/icons/chevron-down-icon.tsx +39 -0
  150. package/src/icons/chevron-left-double-icon.tsx +58 -0
  151. package/src/icons/chevron-left-icon.tsx +58 -0
  152. package/src/icons/chevron-right-double-icon.tsx +58 -0
  153. package/src/icons/chevron-right-icon.tsx +58 -0
  154. package/src/icons/chevrons-up-down.tsx +37 -0
  155. package/src/icons/close-icon.astro +38 -0
  156. package/src/icons/close-icon.tsx +30 -0
  157. package/src/icons/copy-icon.tsx +35 -0
  158. package/src/icons/danger-icon.tsx +18 -0
  159. package/src/icons/dashboard-icon.tsx +41 -0
  160. package/src/icons/delete-icon.tsx +34 -0
  161. package/src/icons/document-icon.tsx +38 -0
  162. package/src/icons/download-icon.tsx +39 -0
  163. package/src/icons/edit-icon.tsx +35 -0
  164. package/src/icons/ellipsis-icon.tsx +38 -0
  165. package/src/icons/email-icon.tsx +33 -0
  166. package/src/icons/external-link-icon.tsx +39 -0
  167. package/src/icons/github-icon.tsx +27 -0
  168. package/src/icons/globe-icon.tsx +50 -0
  169. package/src/icons/google-icon.tsx +44 -0
  170. package/src/icons/gripper-vertical-icon.tsx +43 -0
  171. package/src/icons/history-icon.tsx +32 -0
  172. package/src/icons/home-icon.tsx +34 -0
  173. package/src/icons/icon-element.astro +27 -0
  174. package/src/icons/icon-element.tsx +32 -0
  175. package/src/icons/icon-sprite.tsx +18 -0
  176. package/src/icons/icons.module.css +147 -0
  177. package/src/icons/index.stories.tsx +25 -0
  178. package/src/icons/index.ts +39 -0
  179. package/src/icons/info-icon.tsx +18 -0
  180. package/src/icons/infonomic-icon.tsx +173 -0
  181. package/src/icons/light-icon.astro +36 -0
  182. package/src/icons/light-icon.tsx +29 -0
  183. package/src/icons/location-pin-icon.tsx +36 -0
  184. package/src/icons/moon-icon.astro +38 -0
  185. package/src/icons/moon-icon.tsx +42 -0
  186. package/src/icons/plus-icon.tsx +34 -0
  187. package/src/icons/primary-icon.tsx +22 -0
  188. package/src/icons/refresh-icon.tsx +33 -0
  189. package/src/icons/return-icon.tsx +36 -0
  190. package/src/icons/roles-icon.tsx +34 -0
  191. package/src/icons/search-icon.astro +40 -0
  192. package/src/icons/search-icon.tsx +29 -0
  193. package/src/icons/search-menu-icon.tsx +42 -0
  194. package/src/icons/settings-gear-icon.tsx +36 -0
  195. package/src/icons/settings-sliders-icon.tsx +43 -0
  196. package/src/icons/sign-out-icon.tsx +35 -0
  197. package/src/icons/source/icon-calendar.svg +1 -0
  198. package/src/icons/source/icon-check.svg +4 -0
  199. package/src/icons/source/icon-close.svg +3 -0
  200. package/src/icons/source/icon-coinbase.svg +9 -0
  201. package/src/icons/source/icon-copy.svg +4 -0
  202. package/src/icons/source/icon-document.svg +5 -0
  203. package/src/icons/source/icon-download.svg +4 -0
  204. package/src/icons/source/icon-edit.svg +6 -0
  205. package/src/icons/source/icon-eth-purple.svg +15 -0
  206. package/src/icons/source/icon-etherscan.svg +5 -0
  207. package/src/icons/source/icon-external-link.svg +4 -0
  208. package/src/icons/source/icon-globe.svg +7 -0
  209. package/src/icons/source/icon-gripper-vertical.svg +9 -0
  210. package/src/icons/source/icon-info.svg +4 -0
  211. package/src/icons/source/icon-infonomic.svg +43 -0
  212. package/src/icons/source/icon-ledger.svg +4 -0
  213. package/src/icons/source/icon-light.svg +3 -0
  214. package/src/icons/source/icon-location-pin.svg +8 -0
  215. package/src/icons/source/icon-logout.svg +6 -0
  216. package/src/icons/source/icon-metamask.svg +32 -0
  217. package/src/icons/source/icon-moon.svg +3 -0
  218. package/src/icons/source/icon-plus.svg +4 -0
  219. package/src/icons/source/icon-refresh.svg +4 -0
  220. package/src/icons/source/icon-return.svg +4 -0
  221. package/src/icons/source/icon-search-menu.svg +13 -0
  222. package/src/icons/source/icon-search.svg +3 -0
  223. package/src/icons/source/icon-settings-gear.svg +5 -0
  224. package/src/icons/source/icon-settings.svg +12 -0
  225. package/src/icons/source/icon-wallet.svg +3 -0
  226. package/src/icons/source/icon-walletconnect.svg +4 -0
  227. package/src/icons/source/icon-x.svg +4 -0
  228. package/src/icons/stopwatch-icon.tsx +39 -0
  229. package/src/icons/success-icon.tsx +18 -0
  230. package/src/icons/types/icon.ts +8 -0
  231. package/src/icons/user-icon.tsx +33 -0
  232. package/src/icons/users-icon.tsx +35 -0
  233. package/src/icons/wallet-icon.tsx +29 -0
  234. package/src/icons/warning-icon.tsx +18 -0
  235. package/src/icons/x-icon.tsx +33 -0
  236. package/src/loaders/ellipses.tsx +36 -0
  237. package/src/loaders/loaders.stories.tsx +46 -0
  238. package/src/loaders/ring.tsx +33 -0
  239. package/src/loaders/spinner.tsx +28 -0
  240. package/src/loaders/types/index.ts +6 -0
  241. package/src/react.ts +99 -0
  242. package/src/styles/base/animations.css +143 -0
  243. package/src/styles/base/base.css +5 -0
  244. package/src/styles/base/colors.css +163 -0
  245. package/src/styles/base/colors.stories.tsx +671 -0
  246. package/src/styles/base/reset.css +464 -0
  247. package/src/styles/base/typography.css +25 -0
  248. package/src/styles/base/vars.css +188 -0
  249. package/src/styles/components/card.css +20 -0
  250. package/src/styles/components/checkbox.css +55 -0
  251. package/src/styles/components/components.css +11 -0
  252. package/src/styles/components/directional-button.css +92 -0
  253. package/src/styles/components/dropdown.css +19 -0
  254. package/src/styles/components/fade-in-lift.css +13 -0
  255. package/src/styles/components/hamburger.css +107 -0
  256. package/src/styles/components/icon-element.css +4 -0
  257. package/src/styles/components/list-checkbox.css +60 -0
  258. package/src/styles/components/loaders.css +196 -0
  259. package/src/styles/components/popover.css +15 -0
  260. package/src/styles/components/scroll-to-top.css +89 -0
  261. package/src/styles/components/toast.css +18 -0
  262. package/src/styles/styles.css +6 -0
  263. package/src/styles/theme/autofill.css +58 -0
  264. package/src/styles/theme/scrollers.css +52 -0
  265. package/src/styles/theme/theme.css +130 -0
  266. package/src/styles/theme/theme.stories.tsx +33 -0
  267. package/src/styles/typography/code.stories.tsx +76 -0
  268. package/src/styles/typography/default.stories.tsx +51 -0
  269. package/src/styles/typography/fonts.css +30 -0
  270. package/src/styles/typography/lists.stories.tsx +50 -0
  271. package/src/styles/typography/prose.css +404 -0
  272. package/src/styles/typography/quote.stories.tsx +37 -0
  273. package/src/styles/typography.css +24 -0
  274. package/src/styles/utils/scroll-layout-shift.css +9 -0
  275. package/src/styles/utils/utility-classes.css +1278 -0
  276. package/src/styles/utils/utils.css +2 -0
  277. package/src/theme/theme-provider/index.ts +1 -0
  278. package/src/theme/theme-provider/provider.tsx +44 -0
  279. package/src/utils/capitalize.ts +6 -0
  280. package/src/utils/externalLinkProps.ts +6 -0
  281. package/src/utils/findMatch.ts +7 -0
  282. package/src/utils/getPortalRoot.ts +3 -0
  283. package/src/utils/isTouchDevice.ts +11 -0
  284. package/src/utils/objectsToArray.ts +15 -0
  285. package/src/utils/objectsToString.ts +5 -0
  286. package/src/utils/polymorphic.ts +16 -0
  287. package/src/utils/to-kebab-case.ts +5 -0
  288. package/src/widgets/datepicker/datepicker.module.css +189 -0
  289. package/src/widgets/datepicker/datepicker.stories.tsx +25 -0
  290. package/src/widgets/datepicker/datepicker.tsx +310 -0
  291. package/src/widgets/drawer/drawer-container.tsx +26 -0
  292. package/src/widgets/drawer/drawer-content.tsx +26 -0
  293. package/src/widgets/drawer/drawer-context.tsx +49 -0
  294. package/src/widgets/drawer/drawer-header.tsx +27 -0
  295. package/src/widgets/drawer/drawer-top-actions.tsx +27 -0
  296. package/src/widgets/drawer/drawer-wrapper.tsx +54 -0
  297. package/src/widgets/drawer/drawer.module.css +116 -0
  298. package/src/widgets/drawer/drawer.stories.tsx +224 -0
  299. package/src/widgets/drawer/drawer.tsx +115 -0
  300. package/src/widgets/drawer/motionDomAnimation.ts +4 -0
  301. package/src/widgets/drawer/motionDomMax.ts +4 -0
  302. package/src/widgets/modal/modal-actions.tsx +26 -0
  303. package/src/widgets/modal/modal-container.tsx +26 -0
  304. package/src/widgets/modal/modal-content.tsx +26 -0
  305. package/src/widgets/modal/modal-header.tsx +27 -0
  306. package/src/widgets/modal/modal-wrapper.tsx +50 -0
  307. package/src/widgets/modal/modal.module.css +85 -0
  308. package/src/widgets/modal/modal.stories.tsx +71 -0
  309. package/src/widgets/modal/modal.tsx +110 -0
  310. package/src/widgets/modal/motionDomAnimation.ts +4 -0
  311. package/src/widgets/modal/motionDomMax.ts +4 -0
  312. package/src/widgets/search/index.ts +1 -0
  313. package/src/widgets/search/search.stories.tsx +18 -0
  314. package/src/widgets/search/search.tsx +186 -0
@@ -0,0 +1,50 @@
1
+ import type React from 'react'
2
+
3
+ import type { Meta } from '@storybook/react-vite'
4
+
5
+ import { Timeline as TimelineComponent } from './timeline.js'
6
+
7
+ const meta: Meta = {
8
+ /* 👇 The title prop is optional.
9
+ * See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
10
+ * to learn how to generate automatic titles
11
+ */
12
+ title: 'Components',
13
+ component: TimelineComponent,
14
+ }
15
+
16
+ export default meta
17
+
18
+ export const Timeline = (): React.JSX.Element => (
19
+ <div
20
+ style={{
21
+ maxWidth: '400px',
22
+ marginBottom: '24px',
23
+ display: 'flex',
24
+ justifyContent: 'center',
25
+ }}
26
+ >
27
+ <TimelineComponent>
28
+ <TimelineComponent.Root>
29
+ <TimelineComponent.Item>
30
+ <TimelineComponent.Icon />
31
+ <TimelineComponent.Heading>Website Launch</TimelineComponent.Heading>
32
+ <TimelineComponent.Date>September 2023</TimelineComponent.Date>
33
+ <TimelineComponent.Content>Some cool content here....</TimelineComponent.Content>
34
+ </TimelineComponent.Item>
35
+ <TimelineComponent.Item>
36
+ <TimelineComponent.Icon />
37
+ <TimelineComponent.Heading>Website Launch</TimelineComponent.Heading>
38
+ <TimelineComponent.Date>September 2023</TimelineComponent.Date>
39
+ <TimelineComponent.Content>Some cool content here....</TimelineComponent.Content>
40
+ </TimelineComponent.Item>
41
+ <TimelineComponent.Item>
42
+ <TimelineComponent.Icon />
43
+ <TimelineComponent.Heading>Website Launch</TimelineComponent.Heading>
44
+ <TimelineComponent.Date>September 2023</TimelineComponent.Date>
45
+ <TimelineComponent.Content>Some cool content here....</TimelineComponent.Content>
46
+ </TimelineComponent.Item>
47
+ </TimelineComponent.Root>
48
+ </TimelineComponent>
49
+ </div>
50
+ )
@@ -0,0 +1,177 @@
1
+ 'use client'
2
+
3
+ import type React from 'react'
4
+
5
+ import cx from 'classnames'
6
+
7
+ import styles from './timeline.module.css'
8
+
9
+ // Timeline Container
10
+ export interface TimelineProps {
11
+ id?: string
12
+ className?: string
13
+ 'aria-label'?: string
14
+ children?: React.ReactNode
15
+ }
16
+
17
+ export const Timeline = ({
18
+ id,
19
+ className,
20
+ children,
21
+ ...rest
22
+ }: TimelineProps): React.JSX.Element => {
23
+ return (
24
+ <div id={id} className={cx(styles.timeline, 'timeline', className)} {...rest}>
25
+ {children}
26
+ </div>
27
+ )
28
+ }
29
+
30
+ // Timeline Root
31
+ type RootElement = React.ComponentRef<'ol'>
32
+ type PrimitiveRootProps = React.ComponentPropsWithoutRef<'ol'>
33
+ interface RootProps extends PrimitiveRootProps {
34
+ className?: string
35
+ }
36
+ const Root = function TimelineRoot({
37
+ ref,
38
+ children,
39
+ className,
40
+ ...props
41
+ }: RootProps & {
42
+ ref?: React.RefObject<RootElement>
43
+ }) {
44
+ const classes = cx(styles['timeline-root'], 'timeline-root', className)
45
+ return (
46
+ <ol ref={ref} {...props} className={classes}>
47
+ {children}
48
+ </ol>
49
+ )
50
+ }
51
+
52
+ // Timeline Item
53
+ type ItemElement = React.ComponentRef<'li'>
54
+ type PrimitiveItemProps = React.ComponentPropsWithoutRef<'li'>
55
+ interface ItemProps extends PrimitiveItemProps {
56
+ className?: string
57
+ }
58
+ const Item = function TimelineItem({
59
+ ref,
60
+ children,
61
+ className,
62
+ ...props
63
+ }: ItemProps & {
64
+ ref?: React.RefObject<ItemElement>
65
+ }) {
66
+ return (
67
+ <li ref={ref} {...props} className={cx(styles['timeline-item'], 'timeline-item', className)}>
68
+ {children}
69
+ </li>
70
+ )
71
+ }
72
+
73
+ // Timeline Item Icon
74
+ type IconElement = React.ComponentRef<'span'>
75
+ type PrimitiveIconProps = React.ComponentPropsWithoutRef<'span'>
76
+ interface IconProps extends PrimitiveIconProps {
77
+ className?: string
78
+ }
79
+ const Icon = function TimelineIcon({
80
+ ref,
81
+ children,
82
+ className,
83
+ ...props
84
+ }: IconProps & {
85
+ ref?: React.RefObject<IconElement>
86
+ }) {
87
+ return (
88
+ <span ref={ref} {...props} className={cx(styles['timeline-icon'], 'time-line-icon', className)}>
89
+ <svg
90
+ aria-hidden="true"
91
+ xmlns="http://www.w3.org/2000/svg"
92
+ fill="currentColor"
93
+ viewBox="0 0 20 20"
94
+ >
95
+ <path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" />
96
+ </svg>
97
+ </span>
98
+ )
99
+ }
100
+
101
+ // Timeline Item Heading
102
+ type HeadingElement = React.ComponentRef<'h3'>
103
+ type PrimitiveHeadingProps = React.ComponentPropsWithoutRef<'h3'>
104
+ interface HeadingProps extends PrimitiveHeadingProps {
105
+ className?: string
106
+ }
107
+ const Heading = function TimelineHeading({
108
+ ref,
109
+ children,
110
+ className,
111
+ ...props
112
+ }: HeadingProps & {
113
+ ref?: React.RefObject<HeadingElement>
114
+ }) {
115
+ return (
116
+ <h3
117
+ ref={ref}
118
+ {...props}
119
+ className={cx(styles['timeline-heading'], 'timeline-heading', className)}
120
+ >
121
+ {children}
122
+ </h3>
123
+ )
124
+ }
125
+
126
+ // Timeline Item Date
127
+ type DateElement = React.ComponentRef<'time'>
128
+ type PrimitiveDateProps = React.ComponentPropsWithoutRef<'time'>
129
+ interface DateProps extends PrimitiveDateProps {
130
+ className?: string
131
+ }
132
+ const DateItem = function TimelineDate({
133
+ ref,
134
+ children,
135
+ className,
136
+ ...props
137
+ }: DateProps & {
138
+ ref?: React.RefObject<DateElement>
139
+ }) {
140
+ return (
141
+ <time ref={ref} {...props} className={cx(styles['timeline-date'], 'timeline-date', className)}>
142
+ {children}
143
+ </time>
144
+ )
145
+ }
146
+
147
+ // Timeline Item Content
148
+ type ContentElement = React.ComponentRef<'p'>
149
+ type PrimitiveContentProps = React.ComponentPropsWithoutRef<'div'>
150
+ interface ContentProps extends PrimitiveContentProps {
151
+ className?: string
152
+ }
153
+ const Content = function TimelineContent({
154
+ ref,
155
+ children,
156
+ className,
157
+ ...props
158
+ }: ContentProps & {
159
+ ref?: React.RefObject<ContentElement>
160
+ }) {
161
+ return (
162
+ <div
163
+ ref={ref}
164
+ {...props}
165
+ className={cx(styles['timeline-content'], 'timeline-content', className)}
166
+ >
167
+ {children}
168
+ </div>
169
+ )
170
+ }
171
+
172
+ Timeline.Root = Root
173
+ Timeline.Item = Item
174
+ Timeline.Icon = Icon
175
+ Timeline.Heading = Heading
176
+ Timeline.Date = DateItem
177
+ Timeline.Content = Content
@@ -0,0 +1,55 @@
1
+ @layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-typography, infonomic-components;
2
+
3
+ @layer infonomic-components {
4
+ .tooltip {
5
+ font-size: 0.75rem;
6
+ line-height: 1;
7
+ color: var(--canvas-900);
8
+ user-select: none;
9
+ padding: 0.625rem 1rem;
10
+ border-radius: var(--border-radius-sm);
11
+ border-width: var(--border-width-thin);
12
+ border-style: var(--border-style-solid);
13
+ background-color: var(--gray-25);
14
+ border-color: var(--gray-100);
15
+ box-shadow: var(--shadow-xs);
16
+ will-change: transform, opacity;
17
+ animation: var(--transition-normal);
18
+ }
19
+
20
+ :global(.dark) {
21
+ .tooltip {
22
+ color: var(--gray-50);
23
+ border-color: var(--canvas-700);
24
+ background-color: var(--canvas-800);
25
+ }
26
+ }
27
+
28
+ .tooltip[data-state="delayed-open"][data-side="top"] :global {
29
+ animation-name: slideDownAndFade;
30
+ }
31
+
32
+ .tooltip[data-state="delayed-open"][data-side="right"] :global {
33
+ animation-name: slideLeftAndFade;
34
+ }
35
+
36
+
37
+ .tooltip[data-state="delayed-open"][data-side="left"] :global {
38
+ animation-name: slideRightAndFade;
39
+ }
40
+
41
+ .tooltip[data-state="delayed-open"][data-side="bottom"] :global {
42
+ animation-name: slideUpAndFade;
43
+
44
+ }
45
+
46
+ .tooltip-arrow {
47
+ fill: var(--gray-100)
48
+ }
49
+
50
+ :global(.dark) {
51
+ .tooltip-arrow {
52
+ fill: var(--canvas-700);
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,59 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import type React from 'react'
3
+
4
+ import type { Meta, StoryObj } from '@storybook/react-vite'
5
+
6
+ import { Button } from '../button/button.js'
7
+ import { Tooltip as TooltipComponent } from './tooltip.js'
8
+
9
+ export const Tooltip = (): React.JSX.Element => {
10
+ return (
11
+ <>
12
+ <div
13
+ style={{
14
+ maxWidth: '100px',
15
+ marginLeft: '12rem',
16
+ marginTop: '3rem',
17
+ display: 'flex',
18
+ flexDirection: 'column',
19
+ gap: '46px',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ padding: '16px',
23
+ }}
24
+ >
25
+ <TooltipComponent text="I'm a tooltip" side="top" sideOffset={5}>
26
+ <Button fullWidth={true} size="sm">
27
+ Top
28
+ </Button>
29
+ </TooltipComponent>
30
+ <TooltipComponent text="I'm a tooltip" side="left" sideOffset={5}>
31
+ <Button fullWidth={true} size="sm">
32
+ Left
33
+ </Button>
34
+ </TooltipComponent>
35
+ <TooltipComponent text="I'm a tooltip" side="right" sideOffset={5}>
36
+ <Button fullWidth={true} size="sm">
37
+ Right
38
+ </Button>
39
+ </TooltipComponent>
40
+ <TooltipComponent text="I'm a tooltip" side="bottom" sideOffset={5}>
41
+ <Button fullWidth={true} size="sm">
42
+ Bottom
43
+ </Button>
44
+ </TooltipComponent>
45
+ </div>
46
+ </>
47
+ )
48
+ }
49
+
50
+ const meta: Meta<typeof TooltipComponent> = {
51
+ /* 👇 The title prop is optional.
52
+ * See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
53
+ * to learn how to generate automatic titles
54
+ */
55
+ title: 'Components',
56
+ component: TooltipComponent,
57
+ }
58
+
59
+ export default meta
@@ -0,0 +1,51 @@
1
+ 'use client'
2
+
3
+ import { Tooltip as TooltipPrimitive } from 'radix-ui'
4
+ import type React from 'react'
5
+
6
+ type TooltipIntrinsicProps = React.JSX.IntrinsicElements['div']
7
+ export interface TooltipProps extends TooltipIntrinsicProps {
8
+ text: string
9
+ delay?: number
10
+ side?: 'bottom' | 'top' | 'right' | 'left' | undefined
11
+ sideOffset?: number
12
+ disableHoverableContent?: boolean
13
+ open?: boolean
14
+ onOpenChange?: (open: boolean) => void
15
+ }
16
+
17
+ import styles from './tooltip.module.css'
18
+
19
+ export const Tooltip = function Tooltip({
20
+ ref,
21
+ text,
22
+ delay = 500,
23
+ side = 'top',
24
+ sideOffset = 0,
25
+ disableHoverableContent,
26
+ open,
27
+ onOpenChange,
28
+ children,
29
+ }: TooltipProps & {
30
+ ref?: React.RefObject<HTMLDivElement>
31
+ }): React.JSX.Element {
32
+ return (
33
+ <TooltipPrimitive.Provider
34
+ delayDuration={delay}
35
+ disableHoverableContent={disableHoverableContent}
36
+ >
37
+ <TooltipPrimitive.Root open={open} onOpenChange={onOpenChange}>
38
+ <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
39
+ <TooltipPrimitive.Content
40
+ ref={ref}
41
+ side={side}
42
+ sideOffset={sideOffset}
43
+ className={styles.tooltip}
44
+ >
45
+ {text}
46
+ <TooltipPrimitive.Arrow className={styles['tooltip-arrow']} />
47
+ </TooltipPrimitive.Content>
48
+ </TooltipPrimitive.Root>
49
+ </TooltipPrimitive.Provider>
50
+ )
51
+ }
@@ -0,0 +1,4 @@
1
+ declare module '*.css' {
2
+ const classes: { [key: string]: string }
3
+ export default classes
4
+ }
@@ -0,0 +1,20 @@
1
+ import React, { useEffect, useState } from 'react'
2
+
3
+ export const useMediaQuery = (query: string): boolean | null => {
4
+ const [matches, setMatches] = useState<boolean | null>(null)
5
+ useEffect(() => {
6
+ const mediaMatch = window.matchMedia(query)
7
+ if (matches == null) {
8
+ setMatches(mediaMatch.matches)
9
+ }
10
+ const handler = (e: MediaQueryListEvent): void => {
11
+ setMatches(e.matches)
12
+ }
13
+ mediaMatch.addEventListener('change', handler)
14
+ return () => {
15
+ mediaMatch.removeEventListener('change', handler)
16
+ }
17
+ }, [matches, query])
18
+
19
+ return matches
20
+ }
@@ -0,0 +1,40 @@
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 ActivityIcon = ({
9
+ className,
10
+ svgClassName,
11
+ ...rest
12
+ }: IconProps): React.JSX.Element => {
13
+ const applied = cx(styles['fill-none'], styles['stroke-contrast'], svgClassName)
14
+
15
+ return (
16
+ <IconElement className={cx('activity-icon', className)} {...rest}>
17
+ <svg
18
+ className={applied}
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ focusable="false"
21
+ aria-hidden="true"
22
+ viewBox="0 0 24 24"
23
+ fill="none"
24
+ stroke="currentColor"
25
+ strokeLinecap="round"
26
+ strokeLinejoin="round"
27
+ strokeWidth={1.75}
28
+ >
29
+ <path d="M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4" />
30
+ <path d="M2 6h4" />
31
+ <path d="M2 10h4" />
32
+ <path d="M2 14h4" />
33
+ <path d="M2 18h4" />
34
+ <path d="M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" />
35
+ </svg>
36
+ </IconElement>
37
+ )
38
+ }
39
+
40
+ ActivityIcon.displayName = 'ActivityIcon'
@@ -0,0 +1,39 @@
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 CalendarIcon = ({
12
+ className,
13
+ svgClassName,
14
+ ...rest
15
+ }: IconProps): React.JSX.Element => {
16
+ const applied = cx(styles['fill-contrast'], svgClassName)
17
+
18
+ return (
19
+ <IconElement className={cx('calendar-icon', className)} {...rest}>
20
+ <svg
21
+ className={applied}
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ focusable="false"
24
+ aria-hidden="true"
25
+ viewBox="0 0 15 15"
26
+ strokeWidth="0"
27
+ >
28
+ <path
29
+ d="M4.5 1C4.77614 1 5 1.22386 5 1.5V2H10V1.5C10 1.22386 10.2239 1 10.5 1C10.7761 1 11 1.22386 11 1.5V2H12.5C13.3284 2 14 2.67157 14 3.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H4V1.5C4 1.22386 4.22386 1 4.5 1ZM10 3V3.5C10 3.77614 10.2239 4 10.5 4C10.7761 4 11 3.77614 11 3.5V3H12.5C12.7761 3 13 3.22386 13 3.5V5H2V3.5C2 3.22386 2.22386 3 2.5 3H4V3.5C4 3.77614 4.22386 4 4.5 4C4.77614 4 5 3.77614 5 3.5V3H10ZM2 6V12.5C2 12.7761 2.22386 13 2.5 13H12.5C12.7761 13 13 12.7761 13 12.5V6H2ZM7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 7.22386 9.77614 7 9.5 7ZM11 7.5C11 7.22386 11.2239 7 11.5 7C11.7761 7 12 7.22386 12 7.5C12 7.77614 11.7761 8 11.5 8C11.2239 8 11 7.77614 11 7.5ZM11.5 9C11.2239 9 11 9.22386 11 9.5C11 9.77614 11.2239 10 11.5 10C11.7761 10 12 9.77614 12 9.5C12 9.22386 11.7761 9 11.5 9ZM9 9.5C9 9.22386 9.22386 9 9.5 9C9.77614 9 10 9.22386 10 9.5C10 9.77614 9.77614 10 9.5 10C9.22386 10 9 9.77614 9 9.5ZM7.5 9C7.22386 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10C7.77614 10 8 9.77614 8 9.5C8 9.22386 7.77614 9 7.5 9ZM5 9.5C5 9.22386 5.22386 9 5.5 9C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10C5.22386 10 5 9.77614 5 9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5C3 9.77614 3.22386 10 3.5 10C3.77614 10 4 9.77614 4 9.5C4 9.22386 3.77614 9 3.5 9ZM3 11.5C3 11.2239 3.22386 11 3.5 11C3.77614 11 4 11.2239 4 11.5C4 11.7761 3.77614 12 3.5 12C3.22386 12 3 11.7761 3 11.5ZM5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11ZM7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5ZM9.5 11C9.22386 11 9 11.2239 9 11.5C9 11.7761 9.22386 12 9.5 12C9.77614 12 10 11.7761 10 11.5C10 11.2239 9.77614 11 9.5 11Z"
30
+ // fill="currentColor"
31
+ fillRule="evenodd"
32
+ clipRule="evenodd"
33
+ />
34
+ </svg>
35
+ </IconElement>
36
+ )
37
+ }
38
+
39
+ CalendarIcon.displayName = 'Calendar'
@@ -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 CheckIcon = ({ className, svgClassName, ...rest }: IconProps): React.JSX.Element => {
12
+ const applied = cx(styles['fill-contrast'], svgClassName)
13
+
14
+ return (
15
+ <IconElement className={cx('check-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="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z"
25
+ fillRule="evenodd"
26
+ clipRule="evenodd"
27
+ />
28
+ </svg>
29
+ </IconElement>
30
+ )
31
+ }
32
+
33
+ CheckIcon.displayName = 'CheckIcon'
@@ -0,0 +1,39 @@
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 ChevronDownIcon = ({
12
+ className,
13
+ svgClassName,
14
+ ...rest
15
+ }: IconProps): React.JSX.Element => {
16
+ const applied = cx(styles['fill-contrast'], svgClassName)
17
+
18
+ return (
19
+ <IconElement className={cx('chevron-down-icon', className)} {...rest}>
20
+ <svg
21
+ xmlns="http://www.w3.org/2000/svg"
22
+ className={applied}
23
+ role="presentation"
24
+ focusable="false"
25
+ aria-hidden="true"
26
+ viewBox="0 0 15 15"
27
+ strokeWidth={2}
28
+ >
29
+ <path
30
+ d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z"
31
+ fillRule="evenodd"
32
+ clipRule="evenodd"
33
+ ></path>
34
+ </svg>
35
+ </IconElement>
36
+ )
37
+ }
38
+
39
+ ChevronDownIcon.displayName = 'ChevronDownIcon'
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Byline CMS
3
+ *
4
+ * Copyright © 2025 Anthony Bouch and contributors.
5
+ *
6
+ * This file is part of Byline CMS.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Affero General Public License as
10
+ * published by the Free Software Foundation, either version 3 of the
11
+ * License, or (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Affero General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Affero General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ import cx from 'classnames'
23
+ import type React from 'react'
24
+
25
+ import { IconElement } from './icon-element.jsx'
26
+ import styles from './icons.module.css'
27
+ import type { IconProps } from './types/icon.js'
28
+
29
+ export const ChevronLeftDoubleIcon = ({
30
+ className,
31
+ svgClassName,
32
+ ...rest
33
+ }: IconProps): React.JSX.Element => {
34
+ const applied = cx(styles['fill-contrast'], svgClassName)
35
+
36
+ return (
37
+ <IconElement className={cx('chevron-left-double-icon', className)} {...rest}>
38
+ <svg
39
+ xmlns="http://www.w3.org/2000/svg"
40
+ className={applied}
41
+ role="presentation"
42
+ focusable="false"
43
+ aria-hidden="true"
44
+ viewBox="0 0 15 15"
45
+ strokeWidth={1}
46
+ >
47
+ <path
48
+ d="M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"
49
+ fill="currentColor"
50
+ fillRule="evenodd"
51
+ clipRule="evenodd"
52
+ ></path>
53
+ </svg>
54
+ </IconElement>
55
+ )
56
+ }
57
+
58
+ ChevronLeftDoubleIcon.displayName = 'ChevronLeftDoubleIcon'