-
Notifications
You must be signed in to change notification settings - Fork 220
[dev] [Marfuen] mariano/make-portal-great-again #1945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
github-actions
wants to merge
4
commits into
main
Choose a base branch
from
mariano/make-portal-great-again
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
834caad
feat(ui-new): add new UI components and update theme configurations
Marfuen b4d042f
feat(ui-new): enhance theme with typography tokens and semantic colors
Marfuen a2bbed2
feat(ui-new): add ButtonPaletteSwitcher component and update button s…
Marfuen 4b45872
chore(ui-new): update ButtonPaletteSwitcher and integrate palette sta…
Marfuen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,8 @@ | ||
| { | ||
| "mcpServers": { | ||
| "trigger": { | ||
| "command": "npx", | ||
| "args": [ | ||
| "trigger.dev@latest", | ||
| "mcp", | ||
| "--dev-only" | ||
| ] | ||
| "chakra-ui": { | ||
| "command": "bunx", | ||
| "args": ["-y", "@chakra-ui/react-mcp"] | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Portal AGENTS.md | ||
|
|
||
| ## Component usage | ||
|
|
||
| - Only use components from the `packages/ui-new` package. | ||
| - Import components from `@trycompai/ui-new` (or the appropriate package name). | ||
| - Do not use components from `packages/ui` or other UI packages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,4 +88,4 @@ export type MDM = { | |
| enrollment_status: string; | ||
| name?: string; | ||
| server_url?: string; | ||
| }; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
apps/portal/src/app/(public)/test-ui/components/ButtonPaletteSwitcher.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| 'use client'; | ||
|
|
||
| import { | ||
| Button, | ||
| HStack, | ||
| SUPPORTED_COLOR_PALETTES, | ||
| type SupportedColorPalette, | ||
| Text, | ||
| } from '@trycompai/ui-new'; | ||
|
|
||
| export type ButtonColorPalette = SupportedColorPalette; | ||
|
|
||
| export function ButtonPaletteSwitcher({ | ||
| value, | ||
| onChange, | ||
| }: { | ||
| value: ButtonColorPalette; | ||
| onChange: (value: ButtonColorPalette) => void; | ||
| }) { | ||
| return ( | ||
| <HStack gap={3} align="center" flexWrap="wrap"> | ||
| <Text color="fg" fontSize="sm" fontWeight="medium"> | ||
| Palette | ||
| </Text> | ||
| <HStack | ||
| gap="2" | ||
| flexWrap="wrap" | ||
| bg="bg" | ||
| borderWidth="1px" | ||
| borderColor="border" | ||
| borderRadius="lg" | ||
| p="1" | ||
| boxShadow="xs" | ||
| role="group" | ||
| aria-label="Button palette" | ||
| > | ||
| {SUPPORTED_COLOR_PALETTES.map((palette) => { | ||
| const isSelected = palette === value; | ||
|
|
||
| return ( | ||
| <Button | ||
| key={palette} | ||
| size="sm" | ||
| variant={isSelected ? 'solid' : 'outline'} | ||
| colorPalette={palette} | ||
| onClick={() => onChange(palette)} | ||
| aria-pressed={isSelected} | ||
| > | ||
| <HStack gap="2"> | ||
| <Text as="span" textTransform="capitalize"> | ||
| {palette} | ||
| </Text> | ||
| </HStack> | ||
| </Button> | ||
| ); | ||
| })} | ||
| </HStack> | ||
| </HStack> | ||
| ); | ||
| } |
51 changes: 51 additions & 0 deletions
51
apps/portal/src/app/(public)/test-ui/components/TestUiPage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| 'use client'; | ||
|
|
||
| import { | ||
| Box, | ||
| ColorModeButton, | ||
| Container, | ||
| Flex, | ||
| Heading, | ||
| type SupportedColorPalette, | ||
| } from '@trycompai/ui-new'; | ||
| import { useState } from 'react'; | ||
| import { ButtonPaletteSwitcher } from './ButtonPaletteSwitcher'; | ||
| import { TestUiSectionsBottom } from './TestUiSectionsBottom'; | ||
| import { TestUiSectionsTop } from './TestUiSectionsTop'; | ||
|
|
||
| export function TestUiPage() { | ||
| const [palette, setPalette] = useState<SupportedColorPalette>('primary'); | ||
|
|
||
| return ( | ||
| <Box pb="12"> | ||
| <Box | ||
| position="sticky" | ||
| top="0" | ||
| zIndex="sticky" | ||
| bg="bg" | ||
| borderBottomWidth="1px" | ||
| borderBottomColor="border" | ||
| > | ||
| <Container maxW="1400px" py="4"> | ||
| <Flex | ||
| align={{ base: 'stretch', md: 'center' }} | ||
| justify="space-between" | ||
| direction={{ base: 'column', md: 'row' }} | ||
| gap="4" | ||
| > | ||
| <Heading size="xl">Design System Preview</Heading> | ||
| <Flex align="center" justify="space-between" gap="4" flexWrap="wrap"> | ||
| <ButtonPaletteSwitcher value={palette} onChange={setPalette} /> | ||
| <ColorModeButton /> | ||
| </Flex> | ||
| </Flex> | ||
| </Container> | ||
| </Box> | ||
|
|
||
| <Container maxW="1400px" py={8}> | ||
| <TestUiSectionsTop palette={palette} /> | ||
| <TestUiSectionsBottom palette={palette} /> | ||
| </Container> | ||
| </Box> | ||
| ); | ||
| } |
96 changes: 96 additions & 0 deletions
96
apps/portal/src/app/(public)/test-ui/components/TestUiPrimitives.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| 'use client'; | ||
|
|
||
| import { Box, Flex, Heading, HStack, Text } from '@trycompai/ui-new'; | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| export function Section({ title, children }: { title: string; children: ReactNode }) { | ||
| return ( | ||
| <Box mb={12}> | ||
| <Heading size="lg" mb={6} pb={2} borderBottom="1px solid" borderColor="border"> | ||
| {title} | ||
| </Heading> | ||
| {children} | ||
| </Box> | ||
| ); | ||
| } | ||
|
|
||
| export function SubSection({ title, children }: { title: string; children: ReactNode }) { | ||
| return ( | ||
| <Box mb={4}> | ||
| <Text fontWeight="semibold" mb={2}> | ||
| {title} | ||
| </Text> | ||
| {children} | ||
| </Box> | ||
| ); | ||
| } | ||
|
|
||
| const DEFAULT_SHADES = [ | ||
| '50', | ||
| '100', | ||
| '200', | ||
| '300', | ||
| '400', | ||
| '500', | ||
| '600', | ||
| '700', | ||
| '800', | ||
| '900', | ||
| '950', | ||
| ] as const; | ||
|
|
||
| export function ColorRow({ | ||
| name, | ||
| description, | ||
| shades = DEFAULT_SHADES, | ||
| highlightShade = '700', | ||
| }: { | ||
| name: string; | ||
| description?: string; | ||
| shades?: readonly string[]; | ||
| highlightShade?: string; | ||
| }) { | ||
| return ( | ||
| <Box w="full"> | ||
| <HStack> | ||
| <Text fontWeight="semibold" fontSize="sm"> | ||
| {name} | ||
| </Text> | ||
| {description && ( | ||
| <Text fontSize="xs" color="gray.600"> | ||
| {description} | ||
| </Text> | ||
| )} | ||
| </HStack> | ||
| {/* Add top padding (lg+) so shade labels above swatches don't overlap the header */} | ||
| <Flex gap={1} mt={2} pt={{ base: 0, lg: 6 }}> | ||
| {shades.map((shade) => ( | ||
| <Box | ||
| key={shade} | ||
| bg={`${name}.${shade}`} | ||
| h={16} | ||
| flex={1} | ||
| borderRadius="sm" | ||
| title={`${name}.${shade}`} | ||
| position="relative" | ||
| outline={shade === highlightShade ? '2px solid' : undefined} | ||
| outlineColor={shade === highlightShade ? 'fg' : undefined} | ||
| outlineOffset={shade === highlightShade ? '2px' : undefined} | ||
| > | ||
| <Text | ||
| position="absolute" | ||
| bottom="calc(100% + 2px)" | ||
| left="50%" | ||
| transform="translateX(-50%)" | ||
| fontSize="xs" | ||
| color="gray.500" | ||
| display={{ base: 'none', lg: 'block' }} | ||
| > | ||
| {shade} | ||
| </Text> | ||
| </Box> | ||
| ))} | ||
| </Flex> | ||
| </Box> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Button variant incompatible with zero padding styling
The Button changed from
variant="link"(old UI library) tovariant="outline"withclassName="mt-2 p-0". Anoutlinevariant button has a visible border, andp-0removes all padding, causing the text content to touch the border directly. This creates a visually broken appearance. The equivalent variant in the new Chakra-based library for link-styled buttons isvariant="plain", which has no border and works correctly with zero padding.