@wheelhouse/ui 0.2.13 → 0.2.16

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.
@@ -11,7 +11,7 @@ function AvatarImage({ className, ...props }) {
11
11
  return _jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full rounded-full object-cover', className), ...props });
12
12
  }
13
13
  function AvatarFallback({ className, ...props }) {
14
- return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('flex size-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground group-data-[size=sm]/avatar:text-xxs', className), ...props }));
14
+ return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('group-data-[size=sm]/avatar:text-xxs flex size-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground', className), ...props }));
15
15
  }
16
16
  function AvatarBadge({ className, ...props }) {
17
17
  return (_jsx("span", { "data-slot": "avatar-badge", className: cn('absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none', 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden', 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2', 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2', className), ...props }));
@@ -1,3 +1,3 @@
1
1
  export { Text, textVariants, textLineClampKeys, textSizeKeys, textToneKeys, textWeightKeys } from './text';
2
- export type { TextLines, TextProps } from './text';
2
+ export type { TextLines, TextProps, TextSize } from './text';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC3G,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC3G,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { useRender } from '@base-ui/react/use-render';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const textSizeStyles: {
4
- readonly xxs: "text-xxs";
5
4
  readonly xs: "text-xs";
6
5
  readonly sm: "text-sm";
7
6
  readonly default: "text-base";
@@ -21,18 +20,18 @@ declare const textWeightStyles: {
21
20
  readonly semibold: "font-semibold";
22
21
  readonly bold: "font-bold";
23
22
  };
24
- export declare const textSizeKeys: (keyof typeof textSizeStyles)[];
23
+ export type TextSize = 'xxs' | keyof typeof textSizeStyles;
24
+ export declare const textSizeKeys: readonly TextSize[];
25
25
  export declare const textToneKeys: (keyof typeof textToneStyles)[];
26
26
  export declare const textWeightKeys: (keyof typeof textWeightStyles)[];
27
27
  export declare const textLineClampKeys: readonly [1, 2, 3, 4, 5, 6];
28
28
  export type TextLines = (typeof textLineClampKeys)[number];
29
29
  declare const textVariants: (props?: ({
30
- size?: "default" | "xs" | "sm" | "lg" | "xl" | "2xl" | "xxs" | "3xl" | "4xl" | null | undefined;
30
+ size?: "default" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | null | undefined;
31
31
  tone?: "default" | "muted" | null | undefined;
32
32
  weight?: "bold" | "normal" | "medium" | "semibold" | null | undefined;
33
33
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
34
34
  type TextVariantProps = VariantProps<typeof textVariants>;
35
- type TextSize = TextVariantProps['size'];
36
35
  type TextTone = TextVariantProps['tone'];
37
36
  type TextWeight = TextVariantProps['weight'];
38
37
  /** Props for `Text`. */
@@ -43,6 +42,6 @@ export interface TextProps extends useRender.ComponentProps<'span'> {
43
42
  truncate?: boolean;
44
43
  lines?: TextLines;
45
44
  }
46
- declare function Text({ className, size, tone, weight, truncate, lines, render, ...props }: TextProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
45
+ declare function Text({ className, size, tone, weight, truncate, lines, render, style, ...props }: TextProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
47
46
  export { Text, textVariants };
48
47
  //# sourceMappingURL=text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;;;;;;;;CAUV,CAAC;AAEX,QAAA,MAAM,cAAc;;;CAGV,CAAC;AAEX,QAAA,MAAM,gBAAgB;;;;;CAKZ,CAAC;AAEX,eAAO,MAAM,YAAY,EAAkC,CAAC,MAAM,OAAO,cAAc,CAAC,EAAE,CAAC;AAC3F,eAAO,MAAM,YAAY,EAAkC,CAAC,MAAM,OAAO,cAAc,CAAC,EAAE,CAAC;AAC3F,eAAO,MAAM,cAAc,EAAoC,CAAC,MAAM,OAAO,gBAAgB,CAAC,EAAE,CAAC;AAEjG,eAAO,MAAM,iBAAiB,6BAA8B,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,QAAA,MAAM,YAAY;;;;8EAWhB,CAAC;AAEH,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AAC1D,KAAK,QAAQ,GAAG,gBAAgB,CAAC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A8B,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,QAAA,MAAM,YAAY;;;;8EAWhB,CAAC;AAEH,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AAC1D,KAAK,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACzC,KAAK,UAAU,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AAE7C,wBAAwB;AACxB,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC;IAC/D,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAgB,EAAE,IAAgB,EAAE,MAAiB,EAAE,QAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,8FAe9I;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC"}
@@ -3,7 +3,6 @@ import { useRender } from '@base-ui/react/use-render';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { cn } from '../../lib/utils';
5
5
  const textSizeStyles = {
6
- xxs: 'text-xxs',
7
6
  xs: 'text-xs',
8
7
  sm: 'text-sm',
9
8
  default: 'text-base',
@@ -13,6 +12,10 @@ const textSizeStyles = {
13
12
  '3xl': 'text-3xl',
14
13
  '4xl': 'text-4xl',
15
14
  };
15
+ const textXxsStyle = {
16
+ fontSize: 'var(--font-size-xxs)',
17
+ lineHeight: 'var(--font-size-xxs--line-height)',
18
+ };
16
19
  const textToneStyles = {
17
20
  default: 'text-foreground',
18
21
  muted: 'text-muted-foreground',
@@ -23,7 +26,7 @@ const textWeightStyles = {
23
26
  semibold: 'font-semibold',
24
27
  bold: 'font-bold',
25
28
  };
26
- export const textSizeKeys = Object.keys(textSizeStyles);
29
+ export const textSizeKeys = ['xxs', ...Object.keys(textSizeStyles)];
27
30
  export const textToneKeys = Object.keys(textToneStyles);
28
31
  export const textWeightKeys = Object.keys(textWeightStyles);
29
32
  export const textLineClampKeys = [1, 2, 3, 4, 5, 6];
@@ -39,11 +42,12 @@ const textVariants = cva('text-start', {
39
42
  weight: 'normal',
40
43
  },
41
44
  });
42
- function Text({ className, size = 'default', tone = 'default', weight = 'normal', truncate = false, lines, render, ...props }) {
45
+ function Text({ className, size = 'default', tone = 'default', weight = 'normal', truncate = false, lines, render, style, ...props }) {
43
46
  const layoutClass = lines !== undefined ? cn(`line-clamp-${lines}`, 'inline-block max-w-full min-w-0') : truncate ? 'inline-block min-w-0 max-w-full truncate' : undefined;
44
47
  const defaultProps = {
45
48
  'data-slot': 'text',
46
- className: cn(layoutClass, textVariants({ size, tone, weight, className })),
49
+ className: cn(layoutClass, textVariants({ size: size === 'xxs' ? null : size, tone, weight, className })),
50
+ style: size === 'xxs' ? { ...textXxsStyle, ...style } : style,
47
51
  };
48
52
  return useRender({
49
53
  defaultTagName: 'span',