feat: datum-ui v0.2 — monorepo scaffold, component library, tests, storybook, docs#13
Conversation
|
There are errors trying to run storybook in this branch I could not get it to load but it looks like it heads in a great direction. Do you have any reservations keeping this as a Draft for now? I think we can merge this before we merge the Button replacement in the staff portal if we are happy with this. Once we decide on this we can expand on the component adoption in the staff portal / begin adoption in the cloud portal. |
|
@kevwilliams Hi Kevin, sorry for the error experience. This PR is still a draft when you tested it, so I'm still developing it. However, you can try it again. I've completed this PR with all the components from the base cloud portal, Vitest, Storybook, and the docs site. |
e46a23a to
f3e403a
Compare
|
@yahyafakhroji I have a concern about data table component. Since staff portal relies heavily on tables, its layout will likely be different from cloud portal. Can we make data table more generic and flexible component instead of having a fixed layout? From what I see, the current implementation seems to be tightly based on the cloud portal’s layout. For example, it would be great if we could freely position components like the filter or search bar (e.g., on the right or left). Is it possible to allow each portal to arrange the layout as needed while still using the same shared data table component? |
|
Just to give you an idea, this is what I implemented in staff portal though I’m sure the approach can still be improved. The main concept is that we wrap the table with a provider. By doing that, we can freely place any related components anywhere in the layout, as long as they are inside the provider. This gives us flexibility to arrange the UI differently for each portal, while still using the same underlying data table logic. |
|
@gaghan430 That makes sense, perhaps we can spend some time on the data-table area in a separate issue. Because data-table are quite complex components, and considering our integration with client-side, server-side, search and filter |
|
yes, sounds good... we can create new ticket for that |
a9116c1 to
4020ff9
Compare
|
@gaghan430 i take out the data-table component from current version, and created the ticket for setup it #14 |
4020ff9 to
064ef6c
Compare
|
@yahyafakhroji could you also include this component https://github.com/datum-cloud/staff-portal/tree/main/app/modules/datum-ui/typography? |
|
Nice work @yahyafakhroji! |
|
@yahyafakhroji Right now the main @datum-cloud/datum-ui entrypoint re‑exports all components (base + features) through barrel files. That means consumers are required to install all peer dependencies, even if they only import a few components. For example, I have to install @conform-to/react even when I’m only using the theme component, if not then I'll get an error It would be great to have separate entrypoints per feature/component so heavy dependencies are truly opt‑in. For example, consumers who need the form system could import from a dedicated entrypoint: This way, only projects that use a given feature need to install its extra peer dependencies. |
|
Hey @gaghan430, this is now available in You can now import components either way: Barrel import (all components): import { Button, Form, FormField } from '@datum-cloud/datum-ui'Per-component import (only pulls in the deps you need): import { Button } from '@datum-cloud/datum-ui/button'
import { Form, FormField, FormInput } from '@datum-cloud/datum-ui/form'With per-component imports, you'll only need to install peer dependencies for the components you actually use — so no more Give it a try and let me know if you run into anything! |
|
Awesome, good job! It works now 🙌 One thing I noticed though: I don’t think we should load the styles entrypoint inside the provider. Since it will load all the styles only after the provider is ready, there’s a small delay that makes the styles appear a bit glitchy at first. https://monosnap.ai/file/7Z6uIIz8ONSfKmnDnOf456Mrrauwht let consumer load the styles entrypoint at their root, I think that would solve the issue |
|
Hey @gaghan430 — great catch on the FOUC issue! That's been fully addressed in Here's what changed: CSS loading: /* app.css */
@import 'tailwindcss';
@import '@datum-cloud/datum-ui/styles';Theme switching: Use import { ThemeProvider } from '@datum-cloud/datum-ui/theme'
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
{children}
</ThemeProvider>Consumer-owned Tailwind: Consumers now own their Tailwind setup, which means custom utilities (e.g. Other changes:
See the updated installation docs and package README for the full setup guide. |
|
@yahyafakhroji I got this error, can you help me check? |
|
@gaghan430 Sorry my bad. can you try it again with |
gaghan430
left a comment
There was a problem hiding this comment.
@yahyafakhroji
I think the current progress looks good and we can merge this PR for now.
However, I found a critical issue that is still blocking my work #16.
Could you please take a look when you have a chance? After that, we can raise another PR to address the issue.
67e0e2a
b8c2891 to
17af729
Compare
CSS Architecture Fix —
|
gaghan430
left a comment
There was a problem hiding this comment.
@yahyafakhroji Nice.... this works like a charm! 🎉 The base is finally ready.
Let’s get this merged, and then we can iterate!
17af729 to
3e11370
Compare
3e11370 to
99e72fd
Compare


Summary
Complete restructure of the datum-ui package from a flat component library into a scalable monorepo-based design system with a two-layer architecture (shadcn primitives + datum components), full test suite, Storybook explorer, and Fumadocs documentation site.
What Changed
Architecture
src/components/with individual barrel filesTesting (new)
Storybook (new)
Documentation Site (new)
'use client'wrapper layerQuality
Old Setup vs New Setup
src/<component>/directoriessrc/components/<component>/with single top-level barrelForm.*API with validation, field arrays, multi-stepTest Plan
pnpm --filter datum-ui test— 204 tests passingpnpm --filter storybook build— builds successfullypnpm --filter docs build— 57 static pages generatedpnpm --filter datum-ui typecheck— no type errors