Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit aee072a

Browse files
committed
Update package versions and refactor UI components
Updated package versions in package.json and refactored size definitions in various UI components. The refactor replaced explicit 'height' and 'width' values with the shorthand 'size' to improve code readability and ease of maintenance across multiple components.
1 parent 82030aa commit aee072a

36 files changed

+113
-112
lines changed

apps/docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"@storybook/testing-library": "^0.2.2",
2929
"@storybook/theming": "^7.6.6",
3030
"@storybook/types": "^7.6.6",
31-
"@tanstack/react-table": "^8.11.0",
31+
"@tanstack/react-table": "^8.11.2",
3232
"class-variance-authority": "^0.7.0",
33-
"date-fns": "^3.0.1",
34-
"lucide-react": "^0.298.0",
33+
"date-fns": "^3.0.5",
34+
"lucide-react": "^0.299.0",
3535
"next": "^14.0.4",
3636
"react": "^18.2.0",
3737
"react-day-picker": "^8.9.1",

apps/docs/src/app/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function Page(): React.JSX.Element {
4545
</CardHeader>
4646
<CardBody className="grid gap-4">
4747
<div className="flex items-center space-x-4 rounded-md border p-4">
48-
<BellIcon className="h-4 w-4 shrink-0" />
48+
<BellIcon className="size-4 shrink-0" />
4949
<div className="flex-1 space-y-1">
5050
<p className="text-sm font-medium">Push Notifications</p>
5151
<p className="text-muted-foreground text-sm">
@@ -60,7 +60,7 @@ export default function Page(): React.JSX.Element {
6060
className="mb-4 grid grid-cols-[25px_1fr] items-start pb-4 last:mb-0 last:pb-0"
6161
key={notification.title}
6262
>
63-
<span className="flex h-2 w-2 translate-y-1 rounded-full bg-sky-500" />
63+
<span className="flex size-2 translate-y-1 rounded-full bg-sky-500" />
6464
<div className="space-y-1">
6565
<p className="text-sm font-medium">{notification.title}</p>
6666
<p className="text-muted-foreground text-sm">
@@ -74,7 +74,7 @@ export default function Page(): React.JSX.Element {
7474
<CardFooter>
7575
<Button
7676
className="w-full"
77-
startIcon={<CheckIcon className="h-4 w-4" />}
77+
startIcon={<CheckIcon className="size-4" />}
7878
>
7979
Mark all as read
8080
</Button>

apps/docs/src/stories/aspect-ratio/aspect-radio.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const Basic: Story = {
2424
<AspectRatio {...args}>
2525
<Image
2626
alt="Landscape photograph by Tobias Tullius"
27-
className="h-full w-full object-cover"
27+
className="size-full object-cover"
2828
height={774}
2929
src="https://images.unsplash.com/flagged/photo-1570700005880-4ecdb8595d4a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774"
3030
width={1162}

apps/docs/src/stories/avatar/avatar.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ export const Sizes: Story = {
3131
<Avatar
3232
{...args}
3333
alt="Colm Tuite"
34-
className="h-6 w-6"
34+
className="size-6"
3535
fallback="CT"
3636
src="https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80"
3737
/>
3838

3939
<Avatar
4040
{...args}
4141
alt="Colm Tuite"
42-
className="h-8 w-8"
42+
className="size-8"
4343
fallback="CT"
4444
src="https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80"
4545
/>
@@ -54,15 +54,15 @@ export const Sizes: Story = {
5454
<Avatar
5555
{...args}
5656
alt="Colm Tuite"
57-
className="h-16 w-16"
57+
className="size-16"
5858
fallback="CT"
5959
src="https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80"
6060
/>
6161

6262
<Avatar
6363
{...args}
6464
alt="Colm Tuite"
65-
className="h-20 w-20"
65+
className="size-20"
6666
fallback="CT"
6767
src="https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80"
6868
/>

apps/docs/src/stories/card/card.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const Basic: Story = {
7474
className="mb-2 grid grid-cols-[25px_1fr] items-start pb-2 last:mb-0 last:pb-0"
7575
key={notification.title}
7676
>
77-
<span className="flex h-2 w-2 translate-y-1 rounded-full bg-sky-500" />
77+
<span className="flex size-2 translate-y-1 rounded-full bg-sky-500" />
7878
<div className="space-y-1">
7979
<p className="text-sm font-medium">{notification.title}</p>
8080
<p className="text-muted-foreground text-sm">
@@ -168,7 +168,7 @@ export const WithShadow: Story = {
168168
className="mb-2 grid grid-cols-[25px_1fr] items-start pb-2 last:mb-0 last:pb-0"
169169
key={notification.title}
170170
>
171-
<span className="flex h-2 w-2 translate-y-1 rounded-full bg-sky-500" />
171+
<span className="flex size-2 translate-y-1 rounded-full bg-sky-500" />
172172
<div className="space-y-1">
173173
<p className="text-sm font-medium">{notification.title}</p>
174174
<p className="text-muted-foreground text-sm">

apps/docs/src/stories/collapsible/collapsible.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ function CollapsibleWithHooks(): React.JSX.Element {
2525
const [isOpen, setIsOpen] = useState(false);
2626

2727
return (
28-
<Collapsible className="w-[350px]" onOpenChange={setIsOpen} open={isOpen}>
28+
<Collapsible
29+
className="w-[21.875rem]"
30+
onOpenChange={setIsOpen}
31+
open={isOpen}
32+
>
2933
<div className="flex items-center justify-between space-x-4 px-4">
3034
<h4 className="text-sm font-semibold">
3135
@peduarte starred 3 repositories

apps/docs/src/stories/combobox/combobox.stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ function ComboboxAssignMember(): React.JSX.Element {
156156
{currentMember ? (
157157
<Avatar
158158
alt={getFirstInitials(currentMember.name)}
159-
className="h-9 w-9"
159+
className="size-9"
160160
fallback={currentMember.name}
161161
src={currentMember.avatar}
162162
/>
163163
) : (
164-
<div className="flex h-9 w-9 items-center justify-center rounded-full border border-dashed">
164+
<div className="flex size-9 items-center justify-center rounded-full border border-dashed">
165165
<UserPlus2Icon size={24} />
166166
</div>
167167
)}
@@ -191,14 +191,14 @@ function ComboboxAssignMember(): React.JSX.Element {
191191
>
192192
<Avatar
193193
alt={getFirstInitials(member.name)}
194-
className="h-9 w-9"
194+
className="size-9"
195195
fallback={member.name}
196196
src={member.avatar}
197197
/>
198198
{member.name}
199199
<CheckIcon
200200
className={cx(
201-
'ml-auto h-4 w-4',
201+
'ml-auto size-4',
202202
member.id === currentMember?.id
203203
? 'opacity-100'
204204
: 'opacity-0',
@@ -253,7 +253,7 @@ function ComboboxAssignMemberWithCustomTrigger(): React.JSX.Element {
253253
>
254254
<Avatar
255255
alt={getFirstInitials(member.name)}
256-
className="h-9 w-9"
256+
className="size-9"
257257
fallback={member.name}
258258
src={member.avatar}
259259
/>

apps/docs/src/stories/context-menu/context-menu.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function ContextMenuWithHooks(
3838

3939
return (
4040
<ContextMenu {...args}>
41-
<ContextMenuTrigger className="block w-[300px] select-none rounded border-2 border-dashed py-[45px] text-center text-[15px]">
41+
<ContextMenuTrigger className="py-11.25 text-3.75 block w-[18.75rem] select-none rounded border-2 border-dashed text-center">
4242
Right click here.
4343
</ContextMenuTrigger>
4444

apps/docs/src/stories/editor/editor.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default meta;
1919

2020
type Story = StoryObj<typeof Editor>;
2121

22-
const content = `<p class="lead">Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS.</p><div data-youtube-video><iframe src="https://www.youtube.com/watch?v=3VJqq0M2O8M"></iframe></div><p>By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you <em>really are</em> just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive.</p><p>We get lots of complaints about it actually, with people regularly asking us things like:</p><blockquote><p>Why is Tailwind removing the default styles on my <code>h1</code> elements? How do I disable this? What do you mean I lose all the other base styles too?</p></blockquote><p>We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a <code>p</code> element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look <em>awesome</em>, not awful.</p><p>The <code>@tailwindcss/typography</code> plugin is our attempt to give you what you <em>actually</em> want, without any of the downsides of doing something stupid like disabling our base styles.</p><p>It adds a new <code>prose</code> class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document:</p><pre><code class="language-html">&lt;article class="prose"&gt;
22+
const content = `<p class="lead">Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS.</p><div data-youtube-video><iframe src="https://www.youtube.com/watch?v=zpOULjyy-n8"></iframe></div><p>By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you <em>really are</em> just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive.</p><p>We get lots of complaints about it actually, with people regularly asking us things like:</p><blockquote><p>Why is Tailwind removing the default styles on my <code>h1</code> elements? How do I disable this? What do you mean I lose all the other base styles too?</p></blockquote><p>We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a <code>p</code> element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look <em>awesome</em>, not awful.</p><p>The <code>@tailwindcss/typography</code> plugin is our attempt to give you what you <em>actually</em> want, without any of the downsides of doing something stupid like disabling our base styles.</p><p>It adds a new <code>prose</code> class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document:</p><pre><code class="language-html">&lt;article class="prose"&gt;
2323
&lt;h1&gt;Garlic bread with cheese: What the science tells us&lt;/h1&gt;
2424
&lt;p&gt;
2525
For years parents have espoused the health benefits of eating garlic bread with cheese to their
@@ -44,7 +44,7 @@ export const Basic: Story = {
4444
args: {
4545
content,
4646
classNames: {
47-
editor: 'max-h-[620px] overflow-y-auto',
47+
editor: 'max-h-[38.75rem] overflow-y-auto',
4848
},
4949
},
5050
};

apps/docs/src/stories/navigation-menu/navigation-menu.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const meta: Meta<typeof NavigationMenu> = {
2121
component: NavigationMenu,
2222
decorators: [
2323
(Story): React.JSX.Element => (
24-
<div className="min-h-[600px]">
24+
<div className="min-h-[37.5rem]">
2525
<Story />
2626
</div>
2727
),
@@ -68,11 +68,11 @@ export const Basic: Story = {
6868
<NavigationMenuItem>
6969
<NavigationMenuTrigger>Learn</NavigationMenuTrigger>
7070
<NavigationMenuContent>
71-
<ul className="grid gap-x-2.5 p-5 sm:w-[500px] sm:grid-cols-[0.75fr_1fr]">
71+
<ul className="grid gap-x-2.5 p-5 sm:w-[31.25rem] sm:grid-cols-[0.75fr_1fr]">
7272
<li className="row-span-3 grid">
7373
<NavigationMenuLink asChild>
7474
<Link
75-
className="focus:ring-primary flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-purple-800 to-indigo-800 p-6 no-underline outline-none focus:ring-2"
75+
className="focus:ring-primary flex size-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-purple-800 to-indigo-800 p-6 no-underline outline-none focus:ring-2"
7676
href="/"
7777
>
7878
<svg
@@ -114,7 +114,7 @@ export const Basic: Story = {
114114
<NavigationMenuItem>
115115
<NavigationMenuTrigger>Overview</NavigationMenuTrigger>
116116
<NavigationMenuContent>
117-
<ul className="grid gap-x-2.5 p-5 sm:w-[600px] sm:grid-flow-col sm:grid-rows-3">
117+
<ul className="grid gap-x-2.5 p-5 sm:w-[37.5rem] sm:grid-flow-col sm:grid-rows-3">
118118
<ListItem
119119
href="/docs/primitives/overview/introduction"
120120
title="Introduction"

apps/docs/src/stories/separator/separator.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Story = StoryObj<typeof Separator>;
1313

1414
export const Basic: Story = {
1515
render: (args) => (
16-
<div className="mx-4 w-full max-w-[300px]">
16+
<div className="mx-4 w-full max-w-[18.75rem]">
1717
<div className="text-sm font-medium">Radix Primitives</div>
1818
<p className="text-muted-foreground text-sm">
1919
An open-source UI component library.

apps/docs/src/stories/skeleton/skeleton.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export const Basic: Story = {
2020
export const ProfileLoading: Story = {
2121
render: () => (
2222
<div className="flex items-center space-x-4">
23-
<Skeleton className="h-12 w-12 rounded-full" />
23+
<Skeleton className="size-12 rounded-full" />
2424
<div className="space-y-2">
25-
<Skeleton className="h-4 w-[250px]" />
26-
<Skeleton className="h-4 w-[200px]" />
25+
<Skeleton className="h-4 w-[15.625rem]" />
26+
<Skeleton className="h-4 w-[12.5rem]" />
2727
</div>
2828
</div>
2929
),

apps/docs/src/ui/notification.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function Notification({
4242
</CardHeader>
4343
<CardBody className="grid gap-4">
4444
<div className="flex items-center space-x-4 rounded-md border p-4">
45-
<BellIcon className="h-4 w-4 shrink-0" />
45+
<BellIcon className="size-4 shrink-0" />
4646
<div className="flex-1 space-y-1">
4747
<p className="text-sm font-medium">Push Notifications</p>
4848
<p className="text-muted-foreground text-sm">
@@ -57,7 +57,7 @@ export function Notification({
5757
className="mb-4 grid grid-cols-[25px_1fr] items-start pb-4 last:mb-0 last:pb-0"
5858
key={notification.title}
5959
>
60-
<span className="flex h-2 w-2 translate-y-1 rounded-full bg-sky-500" />
60+
<span className="flex size-2 translate-y-1 rounded-full bg-sky-500" />
6161
<div className="space-y-1">
6262
<p className="text-sm font-medium">{notification.title}</p>
6363
<p className="text-muted-foreground text-sm">
@@ -71,7 +71,7 @@ export function Notification({
7171
<CardFooter>
7272
<Button
7373
className="w-full"
74-
startIcon={<CheckIcon className="h-4 w-4" />}
74+
startIcon={<CheckIcon className="size-4" />}
7575
>
7676
Mark all as read
7777
</Button>

packages/tailwindcss/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/tailwindcss
22

3+
## 0.1.38
4+
5+
### Patch Changes
6+
7+
- Update package versions and refactor UI components
8+
39
## 0.1.37
410

511
### Patch Changes

packages/tailwindcss/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefixlabs/tailwindcss",
3-
"version": "0.1.37",
3+
"version": "0.1.38",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {

packages/tailwindcss/src/tailwind.config.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,6 @@ export const sharedConfig: Config = {
222222
sans: [`var(--font-sans, ${fontFamily.sans.join(', ')})`],
223223
serif: [`var(--font-serif, ${fontFamily.serif.join(', ')})`],
224224
},
225-
height: {
226-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- allow for now
227-
// @ts-expect-error
228-
screen: ['100vh', '100dvh'],
229-
},
230225
keyframes: {
231226
'collapsible-down': {
232227
from: { height: '0' },
@@ -422,16 +417,6 @@ export const sharedConfig: Config = {
422417
},
423418
},
424419
},
425-
maxHeight: {
426-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- allow for now
427-
// @ts-expect-error
428-
screen: ['100vh', '100dvh'],
429-
},
430-
minHeight: {
431-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- allow for now
432-
// @ts-expect-error
433-
screen: ['100vh', '100dvh'],
434-
},
435420
spacing: {
436421
0.75: '0.1875rem' /* 3px */,
437422
1.25: '0.3125rem' /* 5px */,

packages/ui/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/ui
22

3+
## 0.1.73
4+
5+
### Patch Changes
6+
7+
- Update package versions and refactor UI components
8+
39
## 0.1.72
410

511
### Patch Changes

packages/ui/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefixlabs/ui",
3-
"version": "0.1.72",
3+
"version": "0.1.73",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
@@ -65,8 +65,8 @@
6565
"@radix-ui/react-toggle-group": "^1.0.4",
6666
"@radix-ui/react-toolbar": "^1.0.4",
6767
"@radix-ui/react-tooltip": "^1.0.7",
68-
"@tanstack/react-table": "^8.11.0",
69-
"@tanstack/table-core": "^8.11.0",
68+
"@tanstack/react-table": "^8.11.2",
69+
"@tanstack/table-core": "^8.11.2",
7070
"@tiptap/extension-highlight": "^2.1.13",
7171
"@tiptap/extension-image": "^2.1.13",
7272
"@tiptap/extension-table": "^2.1.13",
@@ -83,8 +83,8 @@
8383
"class-variance-authority": "^0.7.0",
8484
"clsx": "^2.0.0",
8585
"cmdk": "^0.2.0",
86-
"date-fns": "^3.0.1",
87-
"lucide-react": "^0.298.0",
86+
"date-fns": "^3.0.5",
87+
"lucide-react": "^0.299.0",
8888
"pluralize": "^8.0.0",
8989
"react": "^18.2.0",
9090
"react-day-picker": "^8.9.1",

packages/ui/src/react/accordion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const AccordionTrigger = forwardRef<
7676
<ChevronDownIcon
7777
aria-hidden
7878
className={twMerge(
79-
'group-data-state-open:rotate-180 text-accent-foreground h-4 w-4 transition-transform duration-300 ease-[cubic-bezier(0.87,_0,_0.13,_1)]',
79+
'group-data-state-open:rotate-180 text-accent-foreground size-4 transition-transform duration-300 ease-[cubic-bezier(0.87,_0,_0.13,_1)]',
8080
classNames?.icon,
8181
)}
8282
/>

packages/ui/src/react/alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const alertVariants = cva(
1212
[
1313
'relative w-full rounded-lg border p-4',
1414
'[&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4',
15-
'[&>svg+div]:translate-y-[-3px]',
15+
'[&>svg+div]:-translate-y-0.75',
1616
'[&:has(svg)]:pl-11',
1717
],
1818
{

0 commit comments

Comments
 (0)