@passui/react 0.1.33 → 0.1.34
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.
- package/dist/types/src/components/keyboard-shortcut/keyboard-shortcut.d.ts +4 -1
- package/dist/types/src/components/status-indicator/status-indicator.d.ts +4 -1
- package/package.json +1 -1
- package/src/components/keyboard-shortcut/keyboard-shortcut.tsx +14 -3
- package/src/components/status-indicator/status-indicator.tsx +26 -3
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
|
+
export type KeyboardShortcutSize = "sm" | "md";
|
|
2
3
|
export interface KeyboardShortcutProps extends ComponentProps<"kbd"> {
|
|
4
|
+
/** Keycap padding density. Text stays at caption2 in both sizes. @default "md" */
|
|
5
|
+
size?: KeyboardShortcutSize;
|
|
3
6
|
}
|
|
4
7
|
/** A quiet keycap for a shortcut supplied and localized by the application. */
|
|
5
|
-
export declare function KeyboardShortcut({ className, ...props }: KeyboardShortcutProps): import("react").JSX.Element;
|
|
8
|
+
export declare function KeyboardShortcut({ size, className, ...props }: KeyboardShortcutProps): import("react").JSX.Element;
|
|
@@ -5,10 +5,13 @@ declare const dots: {
|
|
|
5
5
|
readonly offline: "bg-label-tertiary";
|
|
6
6
|
};
|
|
7
7
|
export type StatusIndicatorState = keyof typeof dots;
|
|
8
|
+
export type StatusIndicatorSize = "sm" | "md";
|
|
8
9
|
export interface StatusIndicatorProps extends HTMLAttributes<HTMLSpanElement> {
|
|
9
10
|
/** Visual treatment of the status dot. */
|
|
10
11
|
state: StatusIndicatorState;
|
|
11
12
|
children: ReactNode;
|
|
13
|
+
/** Dot diameter and text scale. @default "md" */
|
|
14
|
+
size?: StatusIndicatorSize;
|
|
12
15
|
}
|
|
13
|
-
export declare function StatusIndicator({ state, children, className, ...props }: StatusIndicatorProps): import("react").JSX.Element;
|
|
16
|
+
export declare function StatusIndicator({ state, children, size, className, ...props }: StatusIndicatorProps): import("react").JSX.Element;
|
|
14
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import type { ComponentProps } from "react"
|
|
2
2
|
import { cn } from "../../lib/class-names"
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export type KeyboardShortcutSize = "sm" | "md"
|
|
5
|
+
|
|
6
|
+
const sizes: Record<KeyboardShortcutSize, string> = {
|
|
7
|
+
sm: "px-1 py-0 text-caption2",
|
|
8
|
+
md: "px-1.5 py-0.5 text-caption2",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface KeyboardShortcutProps extends ComponentProps<"kbd"> {
|
|
12
|
+
/** Keycap padding density. Text stays at caption2 in both sizes. @default "md" */
|
|
13
|
+
size?: KeyboardShortcutSize
|
|
14
|
+
}
|
|
5
15
|
|
|
6
16
|
/** A quiet keycap for a shortcut supplied and localized by the application. */
|
|
7
|
-
export function KeyboardShortcut({ className, ...props }: KeyboardShortcutProps) {
|
|
17
|
+
export function KeyboardShortcut({ size = "md", className, ...props }: KeyboardShortcutProps) {
|
|
8
18
|
return (
|
|
9
19
|
<kbd
|
|
10
20
|
{...props}
|
|
11
21
|
className={cn(
|
|
12
|
-
"inline-flex shrink-0 items-center rounded-md border border-separator/70 bg-fill/50
|
|
22
|
+
"inline-flex shrink-0 items-center rounded-md border border-separator/70 bg-fill/50 font-mono leading-none text-label-secondary",
|
|
23
|
+
sizes[size],
|
|
13
24
|
className
|
|
14
25
|
)}
|
|
15
26
|
/>
|
|
@@ -8,20 +8,43 @@ const dots = {
|
|
|
8
8
|
} as const
|
|
9
9
|
|
|
10
10
|
export type StatusIndicatorState = keyof typeof dots
|
|
11
|
+
export type StatusIndicatorSize = "sm" | "md"
|
|
12
|
+
|
|
13
|
+
const dotSizes: Record<StatusIndicatorSize, string> = {
|
|
14
|
+
sm: "size-[6px]",
|
|
15
|
+
md: "size-[7px]",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const textSizes: Record<StatusIndicatorSize, string> = {
|
|
19
|
+
sm: "text-caption",
|
|
20
|
+
md: "text-footnote",
|
|
21
|
+
}
|
|
11
22
|
|
|
12
23
|
export interface StatusIndicatorProps extends HTMLAttributes<HTMLSpanElement> {
|
|
13
24
|
/** Visual treatment of the status dot. */
|
|
14
25
|
state: StatusIndicatorState
|
|
15
26
|
children: ReactNode
|
|
27
|
+
/** Dot diameter and text scale. @default "md" */
|
|
28
|
+
size?: StatusIndicatorSize
|
|
16
29
|
}
|
|
17
30
|
|
|
18
|
-
export function StatusIndicator({
|
|
31
|
+
export function StatusIndicator({
|
|
32
|
+
state,
|
|
33
|
+
children,
|
|
34
|
+
size = "md",
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: StatusIndicatorProps) {
|
|
19
38
|
return (
|
|
20
39
|
<span
|
|
21
|
-
className={cn(
|
|
40
|
+
className={cn(
|
|
41
|
+
"flex items-center gap-1.5 text-label-tertiary",
|
|
42
|
+
textSizes[size],
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
22
45
|
{...props}
|
|
23
46
|
>
|
|
24
|
-
<span aria-hidden="true" className={cn(
|
|
47
|
+
<span aria-hidden="true" className={cn(dotSizes[size], "rounded-full", dots[state])} />
|
|
25
48
|
{children}
|
|
26
49
|
</span>
|
|
27
50
|
)
|