) => {
const Component = as || 'label'
return (
diff --git a/libs/ui/lib/mini-table/mini-table.css b/libs/ui/lib/mini-table/mini-table.css
index 5e1ee4d352..16ba8c1f74 100644
--- a/libs/ui/lib/mini-table/mini-table.css
+++ b/libs/ui/lib/mini-table/mini-table.css
@@ -24,7 +24,14 @@
}
.ox-mini-table td > div {
- @apply border-y py-3 pl-3 text-default bg-default border-accent;
+ @apply flex h-11 items-center border-y py-3 pl-3 text-default bg-default border-accent;
+}
+
+.ox-mini-table td:last-child > div {
+ @apply w-12 justify-center pl-0 pr-0;
+}
+.ox-mini-table td:last-child > div > button {
+ @apply pl-4;
}
.ox-mini-table tr:hover td > div {
diff --git a/libs/ui/lib/radio/Radio.tsx b/libs/ui/lib/radio/Radio.tsx
index adc171d2da..395542f181 100644
--- a/libs/ui/lib/radio/Radio.tsx
+++ b/libs/ui/lib/radio/Radio.tsx
@@ -6,7 +6,7 @@
* difference is that label content is handled through children.
*/
-import type { PropsWithChildren } from 'react'
+import type { ComponentProps } from 'react'
import React from 'react'
import cn from 'classnames'
import { Field } from 'formik'
@@ -72,6 +72,12 @@ export function RadioCard({ children, className, ...inputProps }: RadioProps) {
}
// TODO: Remove importants after tailwind variantOrder bug fixed
-RadioCard.Unit = ({ children }: PropsWithChildren) => (
- {children}
+RadioCard.Unit = ({
+ children,
+ className,
+ ...props
+}: ComponentProps<'span'>) => (
+
+ {children}
+
)
diff --git a/libs/ui/lib/tabs/Tabs.tsx b/libs/ui/lib/tabs/Tabs.tsx
index 463dcf697d..1642e996e9 100644
--- a/libs/ui/lib/tabs/Tabs.tsx
+++ b/libs/ui/lib/tabs/Tabs.tsx
@@ -45,12 +45,13 @@ export function Tabs({
addKey((i) => `${id}-tab-${i}`)
)
const panels = pluckAllOfType(childArray, Tab.Panel).map(
- addProps((i) => ({
+ addProps((i, panelProps) => ({
key: `${id}-panel-${i}`,
index: i,
className: cn(
fullWidth &&
- 'children:mx-[var(--content-gutter)] children:w-[calc(100%-var(--content-gutter)*2)]'
+ 'children:mx-[var(--content-gutter)] children:w-[calc(100%-var(--content-gutter)*2)]',
+ panelProps.className
),
}))
)
@@ -98,7 +99,7 @@ export function Tab({ className, ...props }: TabProps) {
export interface TabPanelProps extends RTabPanelProps {
className?: string
}
-Tab.Panel = function Panel({ children, ...props }: TabPanelProps) {
+Tab.Panel = function Panel({ children, className, ...props }: TabPanelProps) {
const { selectedIndex } = useTabsContext()
// `index` is a secret prop that's automatically generated by the parents tab
// component. We use it here to determine if the panel's contents should
@@ -108,7 +109,7 @@ Tab.Panel = function Panel({ children, ...props }: TabPanelProps) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const isSelected = selectedIndex === (props as any).index
return (
-
+
{(isSelected && children) || }
)
diff --git a/libs/util/classed.ts b/libs/util/classed.ts
index c4e500a198..8b0331c387 100644
--- a/libs/util/classed.ts
+++ b/libs/util/classed.ts
@@ -15,7 +15,9 @@ const make =
)
// allow arbitrary components to hang off this one, e.g., Table.Body
Comp.displayName = `classed.${tag}`
- return Comp as typeof Comp & Record
+
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ return Comp as typeof Comp & Record>
}
// JSX.IntrinsicElements[T] ensures same props as the real DOM element. For example,
diff --git a/libs/util/str.spec.ts b/libs/util/str.spec.ts
index 0aed11ad1c..ac3333f9e6 100644
--- a/libs/util/str.spec.ts
+++ b/libs/util/str.spec.ts
@@ -4,11 +4,6 @@ describe('capitalize', () => {
it('capitalizes the first letter', () => {
expect(capitalize('this is a sentence')).toEqual('This is a sentence')
})
-
- it('passes through falsy values', () => {
- expect(capitalize('')).toEqual('')
- expect(capitalize(undefined)).toEqual(undefined)
- })
})
describe('camelCase', () => {
diff --git a/libs/util/str.ts b/libs/util/str.ts
index c2040ca059..5573cc5891 100644
--- a/libs/util/str.ts
+++ b/libs/util/str.ts
@@ -1,5 +1,4 @@
-// TODO: should this even accept undefined? kind of weird
-export const capitalize = (s: string | undefined) =>
+export const capitalize = (s: string) =>
s && s.charAt(0).toUpperCase() + s.slice(1)
export const pluralize = (s: string, n: number) =>