@once-ui-system/core 1.7.11 → 1.7.12

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 (325) hide show
  1. package/ai/catalog.json +1650 -0
  2. package/ai/catalog.seed.json +411 -0
  3. package/ai/components/Accordion.json +136 -0
  4. package/ai/components/AccordionGroup.json +128 -0
  5. package/ai/components/Animation.json +146 -0
  6. package/ai/components/Arrow.json +128 -0
  7. package/ai/components/AutoScroll.json +130 -0
  8. package/ai/components/Avatar.json +133 -0
  9. package/ai/components/AvatarGroup.json +129 -0
  10. package/ai/components/Background.json +131 -0
  11. package/ai/components/Badge.json +132 -0
  12. package/ai/components/Banner.json +122 -0
  13. package/ai/components/BarChart.json +123 -0
  14. package/ai/components/BlobFx.json +125 -0
  15. package/ai/components/BlockQuote.json +132 -0
  16. package/ai/components/Button.json +26 -0
  17. package/ai/components/Card.json +129 -0
  18. package/ai/components/Carousel.json +134 -0
  19. package/ai/components/CelebrationFx.json +132 -0
  20. package/ai/components/ChartHeader.json +130 -0
  21. package/ai/components/ChartStatus.json +12 -0
  22. package/ai/components/Checkbox.json +13 -0
  23. package/ai/components/Chip.json +132 -0
  24. package/ai/components/CodeBlock.json +122 -0
  25. package/ai/components/ColorInput.json +13 -0
  26. package/ai/components/Column.json +128 -0
  27. package/ai/components/CompareImage.json +126 -0
  28. package/ai/components/ContextMenu.json +22 -0
  29. package/ai/components/CountFx.json +82 -0
  30. package/ai/components/CountdownFx.json +11 -0
  31. package/ai/components/Cursor.json +9 -0
  32. package/ai/components/CursorCard.json +128 -0
  33. package/ai/components/DataTooltip.json +15 -0
  34. package/ai/components/DateInput.json +21 -0
  35. package/ai/components/DatePicker.json +143 -0
  36. package/ai/components/DateRangeInput.json +18 -0
  37. package/ai/components/DateRangePicker.json +129 -0
  38. package/ai/components/Dialog.json +134 -0
  39. package/ai/components/DialogProvider.json +8 -0
  40. package/ai/components/Dropdown.json +128 -0
  41. package/ai/components/DropdownWrapper.json +28 -0
  42. package/ai/components/EmojiPicker.json +129 -0
  43. package/ai/components/EmojiPickerDropdown.json +13 -0
  44. package/ai/components/Fade.json +130 -0
  45. package/ai/components/FadingLettersFx.json +77 -0
  46. package/ai/components/Feedback.json +132 -0
  47. package/ai/components/Flex.json +125 -0
  48. package/ai/components/FlipFx.json +133 -0
  49. package/ai/components/GlitchFx.json +128 -0
  50. package/ai/components/Grid.json +121 -0
  51. package/ai/components/Heading.json +75 -0
  52. package/ai/components/HeadingLink.json +127 -0
  53. package/ai/components/HeadingNav.json +124 -0
  54. package/ai/components/HoloFx.json +128 -0
  55. package/ai/components/Hover.json +130 -0
  56. package/ai/components/HoverCard.json +122 -0
  57. package/ai/components/Icon.json +132 -0
  58. package/ai/components/IconButton.json +22 -0
  59. package/ai/components/InfiniteScroll.json +130 -0
  60. package/ai/components/InlineCode.json +126 -0
  61. package/ai/components/Input.json +24 -0
  62. package/ai/components/InteractiveDetails.json +14 -0
  63. package/ai/components/Kbar.json +10 -0
  64. package/ai/components/Kbd.json +127 -0
  65. package/ai/components/Legend.json +14 -0
  66. package/ai/components/LetterFx.json +14 -0
  67. package/ai/components/Line.json +125 -0
  68. package/ai/components/LineBarChart.json +123 -0
  69. package/ai/components/LineChart.json +123 -0
  70. package/ai/components/LinearGauge.json +130 -0
  71. package/ai/components/LinearGradient.json +15 -0
  72. package/ai/components/List.json +127 -0
  73. package/ai/components/ListItem.json +77 -0
  74. package/ai/components/Logo.json +16 -0
  75. package/ai/components/LogoCloud.json +124 -0
  76. package/ai/components/Mask.json +131 -0
  77. package/ai/components/MasonryGrid.json +132 -0
  78. package/ai/components/MatrixFx.json +135 -0
  79. package/ai/components/Media.json +142 -0
  80. package/ai/components/MediaUpload.json +122 -0
  81. package/ai/components/MegaMenu.json +125 -0
  82. package/ai/components/MobileMegaMenu.json +125 -0
  83. package/ai/components/Modal.json +12 -0
  84. package/ai/components/NavIcon.json +127 -0
  85. package/ai/components/NumberInput.json +16 -0
  86. package/ai/components/OTPInput.json +13 -0
  87. package/ai/components/OgCard.json +135 -0
  88. package/ai/components/Option.json +137 -0
  89. package/ai/components/Particle.json +135 -0
  90. package/ai/components/PasswordInput.json +8 -0
  91. package/ai/components/PieChart.json +123 -0
  92. package/ai/components/ProgressBar.json +131 -0
  93. package/ai/components/Pulse.json +129 -0
  94. package/ai/components/RadialGauge.json +134 -0
  95. package/ai/components/RadialGradient.json +16 -0
  96. package/ai/components/RadioButton.json +17 -0
  97. package/ai/components/RevealFx.json +131 -0
  98. package/ai/components/Row.json +128 -0
  99. package/ai/components/Schema.json +17 -0
  100. package/ai/components/ScrollContainer.json +126 -0
  101. package/ai/components/ScrollToTop.json +124 -0
  102. package/ai/components/Scroller.json +128 -0
  103. package/ai/components/SegmentedControl.json +132 -0
  104. package/ai/components/Select.json +21 -0
  105. package/ai/components/ShineFx.json +80 -0
  106. package/ai/components/Skeleton.json +129 -0
  107. package/ai/components/Slider.json +17 -0
  108. package/ai/components/SmartLink.json +17 -0
  109. package/ai/components/Spinner.json +127 -0
  110. package/ai/components/SplitView.json +129 -0
  111. package/ai/components/StatusIndicator.json +128 -0
  112. package/ai/components/StyleOverlay.json +126 -0
  113. package/ai/components/StylePanel.json +125 -0
  114. package/ai/components/Swiper.json +130 -0
  115. package/ai/components/Switch.json +20 -0
  116. package/ai/components/Table.json +125 -0
  117. package/ai/components/Tag.json +129 -0
  118. package/ai/components/TagInput.json +12 -0
  119. package/ai/components/Text.json +72 -0
  120. package/ai/components/Textarea.json +24 -0
  121. package/ai/components/ThemeSwitcher.json +122 -0
  122. package/ai/components/TiltFx.json +126 -0
  123. package/ai/components/Timeline.json +126 -0
  124. package/ai/components/Toast.json +13 -0
  125. package/ai/components/Toaster.json +14 -0
  126. package/ai/components/ToggleButton.json +24 -0
  127. package/ai/components/Tooltip.json +129 -0
  128. package/ai/components/TypeFx.json +15 -0
  129. package/ai/components/User.json +15 -0
  130. package/ai/components/UserMenu.json +16 -0
  131. package/ai/components/WeatherFx.json +133 -0
  132. package/ai/examples/auth.tsx +105 -0
  133. package/ai/examples/blocks/Background6.tsx +25 -0
  134. package/ai/examples/blocks/Chat1.tsx +70 -0
  135. package/ai/examples/blocks/Dashboard1.tsx +404 -0
  136. package/ai/examples/blocks/Feed3.tsx +151 -0
  137. package/ai/examples/blocks/Footer1.tsx +30 -0
  138. package/ai/examples/blocks/Footer2.tsx +96 -0
  139. package/ai/examples/blocks/Footer3.tsx +127 -0
  140. package/ai/examples/blocks/Footer4.tsx +406 -0
  141. package/ai/examples/blocks/Header1.tsx +370 -0
  142. package/ai/examples/blocks/Header2.tsx +98 -0
  143. package/ai/examples/blocks/Header3.tsx +133 -0
  144. package/ai/examples/blocks/Header4.tsx +123 -0
  145. package/ai/examples/blocks/Productivity1.tsx +318 -0
  146. package/ai/examples/blocks/Roadmap1.tsx +133 -0
  147. package/ai/examples/blocks/Sidebar1.tsx +34 -0
  148. package/ai/examples/blocks/Sidebar2.tsx +17 -0
  149. package/ai/examples/blocks/Sidebar4.tsx +92 -0
  150. package/ai/examples/blocks/Sidebar5.tsx +73 -0
  151. package/ai/examples/blocks/Streaming1.tsx +353 -0
  152. package/ai/examples/blocks/Table1.tsx +303 -0
  153. package/ai/examples/blocks/Waitlist1.tsx +141 -0
  154. package/ai/examples/blocks/content/chat1content.ts +65 -0
  155. package/ai/examples/blocks/content/resources.ts +5 -0
  156. package/ai/examples/blocks/content/roadmap1content.ts +51 -0
  157. package/ai/examples/blocks/manifest.json +191 -0
  158. package/ai/examples/dashboard.tsx +150 -0
  159. package/ai/examples/marketing-hero.tsx +152 -0
  160. package/ai/examples/pricing.tsx +219 -0
  161. package/ai/examples/settings.tsx +140 -0
  162. package/ai/gotchas.json +85 -0
  163. package/ai/manifest.json +21 -0
  164. package/ai/rules.compact.md +73 -0
  165. package/ai/spec.json +2679 -2701
  166. package/ai/tasks/auth.json +23 -0
  167. package/ai/tasks/chat.json +28 -0
  168. package/ai/tasks/dashboard.json +39 -0
  169. package/ai/tasks/index.json +12 -0
  170. package/ai/tasks/marketing-hero.json +38 -0
  171. package/ai/tasks/pricing.json +42 -0
  172. package/ai/tasks/roadmap.json +22 -0
  173. package/ai/tasks/settings.json +34 -0
  174. package/dist/ai/catalog.json +1650 -0
  175. package/dist/ai/catalog.seed.json +411 -0
  176. package/dist/ai/components/Accordion.json +136 -0
  177. package/dist/ai/components/AccordionGroup.json +128 -0
  178. package/dist/ai/components/Animation.json +146 -0
  179. package/dist/ai/components/Arrow.json +128 -0
  180. package/dist/ai/components/AutoScroll.json +130 -0
  181. package/dist/ai/components/Avatar.json +133 -0
  182. package/dist/ai/components/AvatarGroup.json +129 -0
  183. package/dist/ai/components/Background.json +131 -0
  184. package/dist/ai/components/Badge.json +132 -0
  185. package/dist/ai/components/Banner.json +122 -0
  186. package/dist/ai/components/BarChart.json +123 -0
  187. package/dist/ai/components/BlobFx.json +125 -0
  188. package/dist/ai/components/BlockQuote.json +132 -0
  189. package/dist/ai/components/Button.json +26 -0
  190. package/dist/ai/components/Card.json +129 -0
  191. package/dist/ai/components/Carousel.json +134 -0
  192. package/dist/ai/components/CelebrationFx.json +132 -0
  193. package/dist/ai/components/ChartHeader.json +130 -0
  194. package/dist/ai/components/ChartStatus.json +12 -0
  195. package/dist/ai/components/Checkbox.json +13 -0
  196. package/dist/ai/components/Chip.json +132 -0
  197. package/dist/ai/components/CodeBlock.json +122 -0
  198. package/dist/ai/components/ColorInput.json +13 -0
  199. package/dist/ai/components/Column.json +128 -0
  200. package/dist/ai/components/CompareImage.json +126 -0
  201. package/dist/ai/components/ContextMenu.json +22 -0
  202. package/dist/ai/components/CountFx.json +82 -0
  203. package/dist/ai/components/CountdownFx.json +11 -0
  204. package/dist/ai/components/Cursor.json +9 -0
  205. package/dist/ai/components/CursorCard.json +128 -0
  206. package/dist/ai/components/DataTooltip.json +15 -0
  207. package/dist/ai/components/DateInput.json +21 -0
  208. package/dist/ai/components/DatePicker.json +143 -0
  209. package/dist/ai/components/DateRangeInput.json +18 -0
  210. package/dist/ai/components/DateRangePicker.json +129 -0
  211. package/dist/ai/components/Dialog.json +134 -0
  212. package/dist/ai/components/DialogProvider.json +8 -0
  213. package/dist/ai/components/Dropdown.json +128 -0
  214. package/dist/ai/components/DropdownWrapper.json +28 -0
  215. package/dist/ai/components/EmojiPicker.json +129 -0
  216. package/dist/ai/components/EmojiPickerDropdown.json +13 -0
  217. package/dist/ai/components/Fade.json +130 -0
  218. package/dist/ai/components/FadingLettersFx.json +77 -0
  219. package/dist/ai/components/Feedback.json +132 -0
  220. package/dist/ai/components/Flex.json +125 -0
  221. package/dist/ai/components/FlipFx.json +133 -0
  222. package/dist/ai/components/GlitchFx.json +128 -0
  223. package/dist/ai/components/Grid.json +121 -0
  224. package/dist/ai/components/Heading.json +75 -0
  225. package/dist/ai/components/HeadingLink.json +127 -0
  226. package/dist/ai/components/HeadingNav.json +124 -0
  227. package/dist/ai/components/HoloFx.json +128 -0
  228. package/dist/ai/components/Hover.json +130 -0
  229. package/dist/ai/components/HoverCard.json +122 -0
  230. package/dist/ai/components/Icon.json +132 -0
  231. package/dist/ai/components/IconButton.json +22 -0
  232. package/dist/ai/components/InfiniteScroll.json +130 -0
  233. package/dist/ai/components/InlineCode.json +126 -0
  234. package/dist/ai/components/Input.json +24 -0
  235. package/dist/ai/components/InteractiveDetails.json +14 -0
  236. package/dist/ai/components/Kbar.json +10 -0
  237. package/dist/ai/components/Kbd.json +127 -0
  238. package/dist/ai/components/Legend.json +14 -0
  239. package/dist/ai/components/LetterFx.json +14 -0
  240. package/dist/ai/components/Line.json +125 -0
  241. package/dist/ai/components/LineBarChart.json +123 -0
  242. package/dist/ai/components/LineChart.json +123 -0
  243. package/dist/ai/components/LinearGauge.json +130 -0
  244. package/dist/ai/components/LinearGradient.json +15 -0
  245. package/dist/ai/components/List.json +127 -0
  246. package/dist/ai/components/ListItem.json +77 -0
  247. package/dist/ai/components/Logo.json +16 -0
  248. package/dist/ai/components/LogoCloud.json +124 -0
  249. package/dist/ai/components/Mask.json +131 -0
  250. package/dist/ai/components/MasonryGrid.json +132 -0
  251. package/dist/ai/components/MatrixFx.json +135 -0
  252. package/dist/ai/components/Media.json +142 -0
  253. package/dist/ai/components/MediaUpload.json +122 -0
  254. package/dist/ai/components/MegaMenu.json +125 -0
  255. package/dist/ai/components/MobileMegaMenu.json +125 -0
  256. package/dist/ai/components/Modal.json +12 -0
  257. package/dist/ai/components/NavIcon.json +127 -0
  258. package/dist/ai/components/NumberInput.json +16 -0
  259. package/dist/ai/components/OTPInput.json +13 -0
  260. package/dist/ai/components/OgCard.json +135 -0
  261. package/dist/ai/components/Option.json +137 -0
  262. package/dist/ai/components/Particle.json +135 -0
  263. package/dist/ai/components/PasswordInput.json +8 -0
  264. package/dist/ai/components/PieChart.json +123 -0
  265. package/dist/ai/components/ProgressBar.json +131 -0
  266. package/dist/ai/components/Pulse.json +129 -0
  267. package/dist/ai/components/RadialGauge.json +134 -0
  268. package/dist/ai/components/RadialGradient.json +16 -0
  269. package/dist/ai/components/RadioButton.json +17 -0
  270. package/dist/ai/components/RevealFx.json +131 -0
  271. package/dist/ai/components/Row.json +128 -0
  272. package/dist/ai/components/Schema.json +17 -0
  273. package/dist/ai/components/ScrollContainer.json +126 -0
  274. package/dist/ai/components/ScrollToTop.json +124 -0
  275. package/dist/ai/components/Scroller.json +128 -0
  276. package/dist/ai/components/SegmentedControl.json +132 -0
  277. package/dist/ai/components/Select.json +21 -0
  278. package/dist/ai/components/ShineFx.json +80 -0
  279. package/dist/ai/components/Skeleton.json +129 -0
  280. package/dist/ai/components/Slider.json +17 -0
  281. package/dist/ai/components/SmartLink.json +17 -0
  282. package/dist/ai/components/Spinner.json +127 -0
  283. package/dist/ai/components/SplitView.json +129 -0
  284. package/dist/ai/components/StatusIndicator.json +128 -0
  285. package/dist/ai/components/StyleOverlay.json +126 -0
  286. package/dist/ai/components/StylePanel.json +125 -0
  287. package/dist/ai/components/Swiper.json +130 -0
  288. package/dist/ai/components/Switch.json +20 -0
  289. package/dist/ai/components/Table.json +125 -0
  290. package/dist/ai/components/Tag.json +129 -0
  291. package/dist/ai/components/TagInput.json +12 -0
  292. package/dist/ai/components/Text.json +72 -0
  293. package/dist/ai/components/Textarea.json +24 -0
  294. package/dist/ai/components/ThemeSwitcher.json +122 -0
  295. package/dist/ai/components/TiltFx.json +126 -0
  296. package/dist/ai/components/Timeline.json +126 -0
  297. package/dist/ai/components/Toast.json +13 -0
  298. package/dist/ai/components/Toaster.json +14 -0
  299. package/dist/ai/components/ToggleButton.json +24 -0
  300. package/dist/ai/components/Tooltip.json +129 -0
  301. package/dist/ai/components/TypeFx.json +15 -0
  302. package/dist/ai/components/User.json +15 -0
  303. package/dist/ai/components/UserMenu.json +16 -0
  304. package/dist/ai/components/WeatherFx.json +133 -0
  305. package/dist/ai/eval-tasks.md +71 -0
  306. package/dist/ai/examples/blocks/manifest.json +191 -0
  307. package/dist/ai/gotchas.json +85 -0
  308. package/dist/ai/manifest.json +21 -0
  309. package/dist/ai/recipes.md +149 -0
  310. package/dist/ai/rules.compact.md +73 -0
  311. package/dist/ai/rules.md +217 -0
  312. package/dist/ai/spec.json +2680 -0
  313. package/dist/ai/tasks/auth.json +23 -0
  314. package/dist/ai/tasks/chat.json +28 -0
  315. package/dist/ai/tasks/dashboard.json +39 -0
  316. package/dist/ai/tasks/index.json +12 -0
  317. package/dist/ai/tasks/marketing-hero.json +38 -0
  318. package/dist/ai/tasks/pricing.json +42 -0
  319. package/dist/ai/tasks/roadmap.json +22 -0
  320. package/dist/ai/tasks/settings.json +34 -0
  321. package/dist/data/emoji-data.json +0 -18
  322. package/dist/package.json +13 -2
  323. package/package.json +139 -127
  324. package/LICENSE.md +0 -21
  325. package/next-env.d.ts +0 -5
@@ -0,0 +1,92 @@
1
+ "use client";
2
+
3
+ import { Column, Row, Media, Fade, Scroller, Text, Line, ToggleButton, IconButton, Avatar } from "@once-ui-system/core";
4
+ import { sidebar } from "./content/chat1content";
5
+ import { useState } from "react";
6
+
7
+ export const Sidebar4: React.FC<React.ComponentProps<typeof Column> & {
8
+ activeItem?: string;
9
+ onSelectItem?: (label: string) => void;
10
+ }> = ({ activeItem, onSelectItem, ...flex }) => {
11
+ const [activeRoom, setActiveRoom] = useState<string | null>("👋 ┃ intro");
12
+
13
+ return (
14
+ <Column fillHeight maxWidth={18} background="surface" {...flex}>
15
+ <Row fillWidth aspectRatio="2/1">
16
+ <Media src="/images/blocks/vibe-coding-dark.jpg" fill sizes="240px"/>
17
+ <Fade position="absolute" top="0" to="bottom" fillWidth height={6} opacity={70}/>
18
+ <Row fillWidth paddingY="12" paddingX="24" position="absolute" top="0" textVariant="label-strong-s" horizontal="center" align="center">
19
+ Design Engineers Club
20
+ </Row>
21
+ </Row>
22
+ <Scroller fillHeight direction="column">
23
+ <Column fillWidth padding="8">
24
+ <Column fillWidth gap="2">
25
+ {(sidebar.find((s) => s.items)?.items ?? []).map((item, idx) => {
26
+ const selected = activeRoom === null && !!activeItem && item.label === activeItem;
27
+ return (
28
+ <ToggleButton
29
+ key={idx}
30
+ fillWidth
31
+ horizontal="start"
32
+ selected={selected}
33
+ onClick={() => {
34
+ setActiveRoom(null);
35
+ onSelectItem?.(item.label);
36
+ }}
37
+ >
38
+ {item.label}
39
+ </ToggleButton>
40
+ );
41
+ })}
42
+ </Column>
43
+ <Line background="neutral-alpha-weak" marginY="12"/>
44
+ <Column fillWidth gap="24">
45
+ {sidebar.filter((s) => s.title).map((section, sIdx) => (
46
+ <Column key={sIdx} fillWidth gap="2">
47
+ <Text
48
+ variant="label-default-s"
49
+ onBackground="neutral-weak"
50
+ marginLeft="16"
51
+ marginTop="4"
52
+ marginBottom="8"
53
+ >
54
+ {section!.title as string}
55
+ </Text>
56
+ {(section.rooms ?? []).map((room, rIdx) => {
57
+ const selected = room.label === activeRoom;
58
+ return (
59
+ <ToggleButton
60
+ key={rIdx}
61
+ fillWidth
62
+ horizontal="start"
63
+ selected={selected}
64
+ onClick={() => {
65
+ setActiveRoom(room.label);
66
+ onSelectItem?.(""); // clear top-level selection
67
+ }}
68
+ >
69
+ <Text weight="strong" onBackground={selected ? undefined : "neutral-weak"}>
70
+ {room.label}
71
+ </Text>
72
+ </ToggleButton>
73
+ );
74
+ })}
75
+ </Column>
76
+ ))}
77
+ </Column>
78
+ </Column>
79
+ </Scroller>
80
+ <Row fillWidth padding="8">
81
+ <Row fillWidth vertical="center" padding="12" radius="l" gap="16" background="neutral-alpha-weak">
82
+ <Avatar src="/images/creators/lorant.jpg" statusIndicator={{color: "green"}}/>
83
+ <Column fillWidth gap="2">
84
+ <Text variant="label-strong-s" truncate>Lorant</Text>
85
+ <Text variant="body-default-xs" onBackground="neutral-weak" truncate>Coding something...</Text>
86
+ </Column>
87
+ <IconButton icon="settings" variant="secondary" tooltip="User settings"/>
88
+ </Row>
89
+ </Row>
90
+ </Column>
91
+ )
92
+ }
@@ -0,0 +1,73 @@
1
+ import { Column, Row, Text, Media, Avatar, IconButton, Heading, Card, DropdownWrapper } from "@once-ui-system/core";
2
+ import { chatMembers } from "./content/chat1content";
3
+
4
+ export const Sidebar5: React.FC<React.ComponentProps<typeof Column>> = ({ ...flex }) => {
5
+ return (
6
+ <Column fillHeight maxWidth={18} background="surface" gap="20" {...flex}>
7
+ <Row paddingX="24" paddingTop="12">
8
+ <Heading as="h2" variant="label-strong-m">
9
+ Members
10
+ </Heading>
11
+ </Row>
12
+ <Column
13
+ fill
14
+ gap="32"
15
+ data-scaling="90"
16
+ paddingX="12"
17
+ paddingBottom="16"
18
+ overflowY="auto"
19
+ >
20
+ {chatMembers.map((group, gIndex) => (
21
+ <Column key={gIndex} fillWidth gap="2">
22
+ <Row vertical="center" gap="8" paddingLeft="16" textVariant="label-default-s" onBackground="neutral-weak" paddingBottom="4">
23
+ <Text>{group.title}</Text>
24
+ <Row width="4" height="4" radius="full" background="neutral-strong"/>
25
+ <Text>{group.members.length}</Text>
26
+ </Row>
27
+ {group.members.map((member, index) => (
28
+ <DropdownWrapper
29
+ fillWidth
30
+ key={index}
31
+ placement="left-start"
32
+ trigger={
33
+ <Card paddingY="8" paddingX="16" border="transparent" background="transparent" radius="m" key={index} fillWidth gap="16" vertical="center">
34
+ <Avatar src={member.avatar} statusIndicator={{ color: member.statusColor as "green" | "gray" }} />
35
+ <Column fillWidth gap="2">
36
+ <Text variant="label-strong-s" truncate>{member.name}</Text>
37
+ {member.status && (
38
+ <Text variant="body-default-xs" onBackground="neutral-weak" truncate>{member.status}</Text>
39
+ )}
40
+ </Column>
41
+ </Card>
42
+ }
43
+ dropdown={
44
+ <Column maxWidth={20} fitHeight tabIndex={-1}>
45
+ <Row fillWidth>
46
+ <Media src="/images/backgrounds/1.jpg" sizes="320px" aspectRatio="2/1" />
47
+ <Row position="absolute" right="12" top="12" data-border="rounded" gap="8">
48
+ <IconButton icon="personRemove" tooltip="Remove" tooltipPosition="bottom"/>
49
+ <IconButton icon="settings" tooltip="Settings" tooltipPosition="bottom"/>
50
+ </Row>
51
+ <Avatar position="absolute" left="12" bottom="0" src={member.avatar} size={6} statusIndicator={{ color: member.statusColor as "green" | "gray" }} style={{transform: "translateY(50%)"}} borderWidth={4} border="surface" />
52
+ </Row>
53
+ <Column fillWidth padding="20" marginTop="40" gap="12">
54
+ <Column fillWidth gap="2">
55
+ <Text variant="heading-strong-s">{member.name}</Text>
56
+ <Text variant="body-default-xs" onBackground="neutral-weak">{member.status}</Text>
57
+ </Column>
58
+ {member.bio && (
59
+ <Row fillWidth>
60
+ <Text variant="body-default-xs" onBackground="neutral-weak">{member.bio}</Text>
61
+ </Row>
62
+ )}
63
+ </Column>
64
+ </Column>
65
+ }
66
+ />
67
+ ))}
68
+ </Column>
69
+ ))}
70
+ </Column>
71
+ </Column>
72
+ )
73
+ }
@@ -0,0 +1,353 @@
1
+ "use client";
2
+
3
+ import React, { useState, useRef, useEffect } from "react";
4
+ import { Column, Media, ProgressBar, Row, Scroller, Heading, Fade, Text, Button, Carousel, IconButton, Flex } from "@once-ui-system/core";
5
+ import { Footer2 } from "./Footer2";
6
+ import { Header3 } from "./Header3";
7
+ import { useFloating, offset, autoUpdate } from "@floating-ui/react-dom";
8
+ import { createPortal } from "react-dom";
9
+
10
+ const MediaList = ({ image, progress, title, description, categories }: { image: string, progress: number, title: string, description: string, categories?: string[] }) => {
11
+ const [isHovered, setIsHovered] = useState(false);
12
+ const [isVisible, setIsVisible] = useState(false);
13
+ const [hasPosition, setHasPosition] = useState(false);
14
+ const [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);
15
+ const referenceRef = useRef<HTMLDivElement>(null);
16
+
17
+ useEffect(() => {
18
+ if (typeof document !== 'undefined') {
19
+ setPortalContainer(document.body);
20
+ }
21
+ }, []);
22
+
23
+ const { x, y, strategy, refs, update } = useFloating({
24
+ middleware: [
25
+ offset(({rects}) => {
26
+ return (
27
+ -rects.reference.height / 2 - rects.floating.height / 2
28
+ );
29
+ }),
30
+ ],
31
+ whileElementsMounted: autoUpdate
32
+ });
33
+
34
+ // Ensure reference is set as soon as the element is available
35
+ useEffect(() => {
36
+ if (referenceRef.current) {
37
+ refs.setReference(referenceRef.current);
38
+ }
39
+ }, [refs]);
40
+
41
+ useEffect(() => {
42
+ let raf = 0;
43
+ if (isHovered && referenceRef.current) {
44
+ refs.setReference(referenceRef.current);
45
+ update();
46
+ raf = requestAnimationFrame(() => setHasPosition(true));
47
+ } else {
48
+ setHasPosition(false);
49
+ }
50
+ return () => {
51
+ if (raf) cancelAnimationFrame(raf);
52
+ };
53
+ }, [isHovered, refs, update]);
54
+
55
+ // Mark visible on the frame AFTER coordinates are ready to ensure transition runs
56
+ useEffect(() => {
57
+ let raf = 0;
58
+ const ready = isHovered && hasPosition && x != null && y != null && !(x === 0 && y === 0);
59
+ if (ready) {
60
+ // First frame: render at correct top/left with opacity 0
61
+ // Next frame: flip to visible so CSS transition can animate opacity/blur/transform
62
+ raf = requestAnimationFrame(() => setIsVisible(true));
63
+ } else {
64
+ setIsVisible(false);
65
+ }
66
+ return () => { if (raf) cancelAnimationFrame(raf); };
67
+ }, [isHovered, hasPosition, x, y]);
68
+
69
+ return (
70
+ <Column
71
+ minWidth={24}
72
+ gap="24"
73
+ onMouseEnter={() => setIsHovered(true)}
74
+ onMouseLeave={() => setIsHovered(false)}
75
+ ref={referenceRef}
76
+ >
77
+ <Media aspectRatio="16/9" src={image} alt={title} sizes="400px" radius="l" />
78
+ {progress > 0 && <ProgressBar label={false} value={progress} paddingX="l" />}
79
+
80
+ {(portalContainer && (isHovered || isVisible)) && (
81
+ createPortal(
82
+ <Column
83
+ maxWidth={28}
84
+ background="surface"
85
+ transition="macro-short"
86
+ gap="24"
87
+ padding="8"
88
+ radius="l-4"
89
+ zIndex={9}
90
+ ref={refs.setFloating}
91
+ style={{
92
+ transform: isVisible ? "scale(1)" : "scale(0.9)",
93
+ transformOrigin: "center",
94
+ position: strategy,
95
+ top: hasPosition && y != null ? y : -99999,
96
+ left: hasPosition && x != null ? x : -99999,
97
+ opacity: isVisible ? 1 : 0,
98
+ filter: isVisible ? "blur(0px)" : "blur(0.25rem)",
99
+ willChange: "transform, top, left, opacity",
100
+ transitionProperty: "opacity, transform, filter",
101
+ // Respect design system timing if provided by transition prop; these are fallbacks
102
+ transitionDuration: "160ms",
103
+ transitionTimingFunction: "cubic-bezier(0.2, 0.8, 0.2, 1)",
104
+ }}
105
+ >
106
+ <Media aspectRatio="16/9" src={image} alt={title} sizes="400px" radius="l" />
107
+ {progress > 0 && <ProgressBar label={false} value={progress} paddingX="l" />}
108
+ <Column fillWidth paddingX="16" paddingBottom="20" paddingTop="8" gap="8">
109
+ <Row fillWidth horizontal="between" paddingBottom="12">
110
+ <Row gap="8" data-border="rounded">
111
+ <IconButton size="l" icon="play" />
112
+ <IconButton size="l" icon="plus" variant="secondary" />
113
+ </Row>
114
+ <Row gap="8" data-border="rounded">
115
+ <IconButton size="l" icon="like" variant="secondary" />
116
+ <IconButton size="l" icon="dislike" variant="secondary" />
117
+ </Row>
118
+ </Row>
119
+ <Heading as="h3" variant="heading-strong-l">{title}</Heading>
120
+ <Text variant="body-default-m" onBackground="neutral-weak">{description}</Text>
121
+ <Row paddingTop="12" gap="16" vertical="center">
122
+ {categories && categories.map((category, index) => (
123
+ <React.Fragment key={index}>
124
+ <Text variant="label-default-s" onBackground="neutral-medium">{category}</Text>
125
+ {index < categories.length - 1 && <Flex height={0.4} width={0.4} radius="full" background="neutral-strong"/>}
126
+ </React.Fragment>
127
+ ))}
128
+ </Row>
129
+ </Column>
130
+ </Column>,
131
+ portalContainer
132
+ )
133
+ )}
134
+ </Column>
135
+ )
136
+ }
137
+
138
+ const FeedSection = ({ title, items }: { title: string, items: Array<{ image: string, progress: number, title: string, description: string, categories?: string[] }> }) => {
139
+ return (
140
+ <Column fillWidth padding="l">
141
+ <Column fillWidth gap="24">
142
+ <Column fillWidth paddingX="24">
143
+ <Heading as="h2" variant="display-strong-s">
144
+ {title}
145
+ </Heading>
146
+ </Column>
147
+ <Scroller>
148
+ <Row fitWidth gap="24">
149
+ {items.map((item, index) => (
150
+ <MediaList
151
+ key={index}
152
+ image={item.image}
153
+ progress={item.progress}
154
+ title={item.title}
155
+ description={item.description}
156
+ categories={item.categories} />
157
+ ))}
158
+ </Row>
159
+ </Scroller>
160
+ </Column>
161
+ </Column>
162
+ );
163
+ };
164
+
165
+ export const Streaming1: React.FC = () => {
166
+ const featured = [
167
+ {
168
+ image: "/images/movies/01.jpg",
169
+ title: "The Incredible Adventures of Selene Yu",
170
+ description: "The incredible adventures of Selene Yu follows the story of a young woman who discovers she has the ability to turn back time",
171
+ categories: ["Sci-Fi", "Adventure", "Drama"]
172
+ },
173
+ {
174
+ image: "/images/movies/02.jpg",
175
+ title: "Awakening",
176
+ description: "Matt finds himself in a disturbing place when he wakes up in this Emmy award winning movie",
177
+ categories: ["Thriller", "Mystery", "Drama"]
178
+ },
179
+ {
180
+ image: "/images/movies/03.jpg",
181
+ title: "Family Reunion",
182
+ description: "An intense thriller that will keep you on the edge of your seat when the holiday for a family reunion turns into a nightmare",
183
+ categories: ["Horror", "Thriller", "Mystery"]
184
+ }
185
+ ];
186
+
187
+ const feed = [
188
+ {
189
+ title: "Continue Watching",
190
+ items: [
191
+ {
192
+ image: "/images/movies/02.jpg",
193
+ progress: 45,
194
+ title: "Design System",
195
+ description: "A comprehensive UI kit for modern web applications",
196
+ categories: ["Dark", "Mystic", "Space"]
197
+ },
198
+ {
199
+ image: "/images/movies/03.jpg",
200
+ progress: 72,
201
+ title: "Component Library",
202
+ description: "Reusable components for faster development",
203
+ categories: ["Humor", "Thriller", "Drama"]
204
+ },
205
+ {
206
+ image: "/images/movies/04.jpg",
207
+ progress: 30,
208
+ title: "Animation Framework",
209
+ description: "Smooth transitions and interactive elements",
210
+ categories: ["Documentary", "Media", "Real Events"]
211
+ },
212
+ {
213
+ image: "/images/movies/01.jpg",
214
+ progress: 88,
215
+ title: "Responsive Layouts",
216
+ description: "Adaptive designs for all screen sizes",
217
+ categories: ["Horror", "Thriller", "Drama"]
218
+ },
219
+ {
220
+ image: "/images/movies/05.jpg",
221
+ progress: 15,
222
+ title: "Accessibility Tools",
223
+ description: "Creating inclusive user experiences",
224
+ categories: ["Documentary", "Tech", "Real Events"]
225
+ },
226
+ {
227
+ image: "/images/movies/06.jpg",
228
+ progress: 60,
229
+ title: "Theme Builder",
230
+ description: "Customize your application's look and feel",
231
+ categories: ["Parody", "Humor", "Gossip"]
232
+ }
233
+ ]
234
+ },
235
+ {
236
+ title: "Popular",
237
+ items: [
238
+ {
239
+ image: "/images/movies/07.jpg",
240
+ progress: 0,
241
+ title: "Design System",
242
+ description: "A comprehensive UI kit for modern web applications",
243
+ categories: ["Dark", "Mystic", "Space"]
244
+ },
245
+ {
246
+ image: "/images/movies/03.jpg",
247
+ progress: 0,
248
+ title: "Component Library",
249
+ description: "Reusable components for faster development",
250
+ categories: ["Documentary", "Tech", "Real Events"]
251
+ },
252
+ {
253
+ image: "/images/movies/08.jpg",
254
+ progress: 0,
255
+ title: "Animation Framework",
256
+ description: "Smooth transitions and interactive elements",
257
+ categories: ["Horror", "Thriller", "Drama"]
258
+ },
259
+ {
260
+ image: "/images/movies/02.jpg",
261
+ progress: 0,
262
+ title: "Responsive Layouts",
263
+ description: "Adaptive designs for all screen sizes",
264
+ categories: ["Documentary", "Tech", "Real Events"]
265
+ },
266
+ {
267
+ image: "/images/movies/05.jpg",
268
+ progress: 0,
269
+ title: "Accessibility Tools",
270
+ description: "Creating inclusive user experiences",
271
+ categories: ["Thriller", "Drama", "Cyberpunk"]
272
+ },
273
+ {
274
+ image: "/images/movies/06.jpg",
275
+ progress: 0,
276
+ title: "Theme Builder",
277
+ description: "Customize your application's look and feel",
278
+ categories: ["Mind-Bending", "Offbeat", "Animation"]
279
+ }
280
+ ]
281
+ }
282
+ ]
283
+
284
+ return (
285
+ <Column fillWidth>
286
+ <Header3 position="sticky" top="0" />
287
+ <Column fillWidth style={{marginTop: "calc(-1 * var(--static-space-64))"}}>
288
+ <Row fillWidth style={{height: "80vh"}} paddingBottom="xl">
289
+ <Carousel
290
+ fill
291
+ border="transparent"
292
+ radius="none"
293
+ position="absolute"
294
+ pointerEvents="none"
295
+ controls={false}
296
+ indicator={false}
297
+ play={{auto: true, interval: 10000, controls: false, progress: false}}
298
+ items={featured.map(item => ({ slide: item.image, alt: item.title }))} />
299
+ <Fade
300
+ fillWidth
301
+ position="absolute"
302
+ pointerEvents="none"
303
+ bottom="0"
304
+ to="top"
305
+ height={32}
306
+ pattern={{ display: true, size: "2" }}
307
+ />
308
+ <Carousel
309
+ fill
310
+ pointerEvents="none"
311
+ border="transparent"
312
+ radius="none"
313
+ position="absolute"
314
+ translateY="48"
315
+ controls={false}
316
+ indicator={false}
317
+ play={{auto: true, interval: 10000, controls: false, progress: false}}
318
+ items={featured.map(item => ({
319
+ slide: (
320
+ <Column fillHeight maxWidth={48} vertical="end" padding="xl" gap="l">
321
+ <Heading variant="display-strong-m" onSolid="neutral-strong">
322
+ #1 in Movies Today
323
+ </Heading>
324
+ <Text variant="heading-default-xl" onSolid="neutral-weak" wrap="balance">
325
+ {item.description}
326
+ </Text>
327
+ <Row gap="8" pointerEvents="all" s={{direction: "column"}}>
328
+ <Button size="l" prefixIcon="play">
329
+ Start watching
330
+ </Button>
331
+ <Button size="l" prefixIcon="info" variant="secondary">
332
+ More info
333
+ </Button>
334
+ </Row>
335
+ </Column>
336
+ )
337
+ }))}
338
+ />
339
+ </Row>
340
+
341
+ {feed.map((section, index) => (
342
+ <FeedSection
343
+ key={index}
344
+ title={section.title}
345
+ items={section.items}
346
+ />
347
+ ))}
348
+
349
+ <Footer2 paddingX="xl"/>
350
+ </Column>
351
+ </Column>
352
+ )
353
+ }