@boyernick/standard-ui-react 0.1.1-canary.3 → 0.1.1-canary.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/package.json +5 -3
- package/src/accordion.tsx +5 -2
- package/src/alert-dialog.tsx +1 -1
- package/src/attachment.tsx +5 -2
- package/src/autocomplete.tsx +12 -9
- package/src/badge.tsx +73 -9
- package/src/block-editor.tsx +1747 -0
- package/src/brand.tsx +2 -2
- package/src/breadcrumb.tsx +46 -21
- package/src/button.tsx +23 -12
- package/src/calendar.tsx +25 -11
- package/src/card.tsx +57 -14
- package/src/carousel.tsx +339 -15
- package/src/checkbox.tsx +36 -13
- package/src/code-block.tsx +66 -5
- package/src/collapsible.tsx +7 -3
- package/src/combobox.tsx +17 -15
- package/src/command.tsx +41 -14
- package/src/context-menu.tsx +6 -3
- package/src/date-picker.tsx +174 -0
- package/src/dialog.tsx +33 -10
- package/src/empty.tsx +4 -4
- package/src/field.tsx +4 -3
- package/src/filter-group.tsx +143 -0
- package/src/icons.tsx +55 -1
- package/src/illustrations.tsx +219 -141
- package/src/index.ts +263 -18
- package/src/input.tsx +8 -5
- package/src/kbd.tsx +49 -0
- package/src/lib/focus.ts +41 -0
- package/src/lib/motion.ts +16 -1
- package/src/lib/popup.ts +45 -0
- package/src/lifeline/company-icon.tsx +71 -0
- package/src/lifeline/index.ts +42 -0
- package/src/lifeline/lifeline-data.ts +97 -0
- package/src/lifeline/lifeline-desktop.tsx +204 -0
- package/src/lifeline/lifeline-event.tsx +108 -0
- package/src/lifeline/lifeline-fireworks.tsx +302 -0
- package/src/lifeline/lifeline-hover-image.tsx +269 -0
- package/src/lifeline/lifeline-icons.tsx +39 -0
- package/src/lifeline/lifeline-intro-timing.ts +105 -0
- package/src/lifeline/lifeline-labels.tsx +24 -0
- package/src/lifeline/lifeline-layout.ts +1 -0
- package/src/lifeline/lifeline-legend.tsx +31 -0
- package/src/lifeline/lifeline-lightbox.tsx +309 -0
- package/src/lifeline/lifeline-marker.tsx +183 -0
- package/src/lifeline/lifeline-people.tsx +99 -0
- package/src/lifeline/lifeline-photos.tsx +366 -0
- package/src/lifeline/lifeline-shell.tsx +135 -0
- package/src/lifeline/lifeline-utils.ts +83 -0
- package/src/lifeline/lifeline-vertical.tsx +482 -0
- package/src/lifeline/lifeline.tsx +69 -0
- package/src/lifeline/types.ts +112 -0
- package/src/lifeline/use-lifeline-intro.ts +130 -0
- package/src/lifeline/use-lifeline-scroll.ts +1011 -0
- package/src/lifeline/use-lifeline-vertical-scroll.ts +271 -0
- package/src/menu.tsx +7 -4
- package/src/menubar.tsx +9 -2
- package/src/minimap.tsx +296 -0
- package/src/modal.tsx +608 -0
- package/src/navigation-menu.tsx +340 -67
- package/src/number-field.tsx +336 -61
- package/src/otp-field.tsx +4 -3
- package/src/pagination.tsx +262 -42
- package/src/password-protection.tsx +345 -0
- package/src/popover.tsx +3 -1
- package/src/preview-card.tsx +3 -1
- package/src/progress.tsx +5 -0
- package/src/questionnaire.tsx +284 -0
- package/src/radio.tsx +4 -2
- package/src/scroll-area.tsx +4 -1
- package/src/select.tsx +12 -7
- package/src/sidebar.tsx +113 -28
- package/src/slider.tsx +66 -6
- package/src/sounds.tsx +6 -10
- package/src/spinner.tsx +105 -32
- package/src/switch.tsx +4 -1
- package/src/table.tsx +82 -15
- package/src/tabs.tsx +189 -38
- package/src/text-animate.tsx +71 -28
- package/src/textarea.tsx +6 -1
- package/src/timeline.tsx +378 -0
- package/src/toast.tsx +214 -35
- package/src/toggle.tsx +4 -2
- package/src/toolbar.tsx +12 -7
- package/src/tooltip.tsx +43 -3
- package/src/video-player.tsx +396 -127
- package/src/image-modal.tsx +0 -110
- package/src/markdown-editor.tsx +0 -302
package/src/toggle.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { Toggle as BaseToggle } from "@base-ui/react/toggle"
|
|
|
4
4
|
import { ToggleGroup as BaseToggleGroup } from "@base-ui/react/toggle-group"
|
|
5
5
|
import type { ComponentProps } from "react"
|
|
6
6
|
import { cn } from "./lib/cn"
|
|
7
|
+
import { focusRing } from "./lib/focus"
|
|
7
8
|
import { motion } from "./lib/motion"
|
|
8
9
|
|
|
9
10
|
export type ToggleProps = ComponentProps<typeof BaseToggle>
|
|
@@ -12,9 +13,10 @@ export type ToggleGroupProps = ComponentProps<typeof BaseToggleGroup>
|
|
|
12
13
|
export const Toggle = ({ className, ...props }: ToggleProps) => (
|
|
13
14
|
<BaseToggle
|
|
14
15
|
className={cn(
|
|
15
|
-
"inline-flex h-8 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2.5 text-sm text-fg-secondary
|
|
16
|
+
"inline-flex h-8 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2.5 text-sm text-fg-secondary",
|
|
16
17
|
motion.colors,
|
|
17
|
-
|
|
18
|
+
focusRing,
|
|
19
|
+
"hover:bg-background-tertiary data-disabled:cursor-not-allowed data-disabled:opacity-50 data-pressed:bg-background-tertiary data-pressed:text-fg-primary",
|
|
18
20
|
className,
|
|
19
21
|
)}
|
|
20
22
|
{...props}
|
package/src/toolbar.tsx
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar"
|
|
4
4
|
import type { ComponentProps } from "react"
|
|
5
5
|
import { cn } from "./lib/cn"
|
|
6
|
+
import { focusRing, focusRingBorder } from "./lib/focus"
|
|
6
7
|
import { motion } from "./lib/motion"
|
|
7
8
|
|
|
8
9
|
export type ToolbarProps = ComponentProps<typeof BaseToolbar.Root>
|
|
@@ -15,7 +16,7 @@ export type ToolbarSeparatorProps = ComponentProps<typeof BaseToolbar.Separator>
|
|
|
15
16
|
export const Toolbar = ({ className, ...props }: ToolbarProps) => (
|
|
16
17
|
<BaseToolbar.Root
|
|
17
18
|
className={cn(
|
|
18
|
-
"inline-flex items-center gap-0.5 rounded-lg
|
|
19
|
+
"inline-flex items-center gap-0.5 rounded-lg py-0.5 pr-1.5 pl-0.5 shadow-lg",
|
|
19
20
|
className,
|
|
20
21
|
)}
|
|
21
22
|
{...props}
|
|
@@ -32,9 +33,11 @@ export const ToolbarGroup = ({ className, ...props }: ToolbarGroupProps) => (
|
|
|
32
33
|
export const ToolbarButton = ({ className, ...props }: ToolbarButtonProps) => (
|
|
33
34
|
<BaseToolbar.Button
|
|
34
35
|
className={cn(
|
|
35
|
-
"inline-flex h-8 cursor-pointer items-center justify-center gap-1.5 rounded-md px-2.5 text-sm text-fg-secondary
|
|
36
|
+
"inline-flex h-8 cursor-pointer items-center justify-center gap-1.5 rounded-md px-2.5 text-sm text-fg-secondary",
|
|
37
|
+
focusRingBorder,
|
|
36
38
|
motion.colors,
|
|
37
|
-
|
|
39
|
+
focusRing,
|
|
40
|
+
"hover:bg-background-tertiary hover:text-fg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50 data-pressed:bg-background-tertiary data-pressed:text-fg-primary",
|
|
38
41
|
className,
|
|
39
42
|
)}
|
|
40
43
|
{...props}
|
|
@@ -44,9 +47,11 @@ export const ToolbarButton = ({ className, ...props }: ToolbarButtonProps) => (
|
|
|
44
47
|
export const ToolbarLink = ({ className, ...props }: ToolbarLinkProps) => (
|
|
45
48
|
<BaseToolbar.Link
|
|
46
49
|
className={cn(
|
|
47
|
-
"inline-flex h-8 cursor-pointer items-center justify-center gap-1.5 rounded-md px-2.5 text-sm text-fg-secondary
|
|
50
|
+
"inline-flex h-8 cursor-pointer items-center justify-center gap-1.5 rounded-md px-2.5 text-sm text-fg-secondary",
|
|
51
|
+
focusRingBorder,
|
|
48
52
|
motion.colors,
|
|
49
|
-
|
|
53
|
+
focusRing,
|
|
54
|
+
"hover:bg-background-tertiary hover:text-fg-primary",
|
|
50
55
|
className,
|
|
51
56
|
)}
|
|
52
57
|
{...props}
|
|
@@ -56,8 +61,8 @@ export const ToolbarLink = ({ className, ...props }: ToolbarLinkProps) => (
|
|
|
56
61
|
export const ToolbarInput = ({ className, ...props }: ToolbarInputProps) => (
|
|
57
62
|
<BaseToolbar.Input
|
|
58
63
|
className={cn(
|
|
59
|
-
"h-8 min-w-28 cursor-text rounded-md border border-border-secondary bg-surface px-2.5 text-sm text-fg-primary
|
|
60
|
-
|
|
64
|
+
"h-8 min-w-28 cursor-text rounded-md border border-border-secondary bg-surface px-2.5 text-sm text-fg-primary placeholder:text-fg-quaternary",
|
|
65
|
+
focusRing,
|
|
61
66
|
className,
|
|
62
67
|
)}
|
|
63
68
|
{...props}
|
package/src/tooltip.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import { Tooltip as BaseTooltip } from "@base-ui/react/tooltip"
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
5
|
import type { ComponentProps } from "react"
|
|
5
6
|
import { cn } from "./lib/cn"
|
|
6
7
|
import { motion } from "./lib/motion"
|
|
@@ -12,7 +13,8 @@ export type TooltipPortalProps = ComponentProps<typeof BaseTooltip.Portal>
|
|
|
12
13
|
export type TooltipPositionerProps = ComponentProps<
|
|
13
14
|
typeof BaseTooltip.Positioner
|
|
14
15
|
>
|
|
15
|
-
export type TooltipPopupProps = ComponentProps<typeof BaseTooltip.Popup>
|
|
16
|
+
export type TooltipPopupProps = ComponentProps<typeof BaseTooltip.Popup> &
|
|
17
|
+
VariantProps<typeof tooltipPopupVariants>
|
|
16
18
|
|
|
17
19
|
export const TooltipProvider = (props: TooltipProviderProps) => (
|
|
18
20
|
<BaseTooltip.Provider {...props} />
|
|
@@ -43,13 +45,51 @@ export const TooltipPositioner = ({
|
|
|
43
45
|
/>
|
|
44
46
|
)
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
// Neither variant carries a border — `shadow-md` already composes
|
|
49
|
+
// `--elevation-hairline`, so one would stack a second edge. That hairline is
|
|
50
|
+
// what gives the default popup its edge against a same-coloured page.
|
|
51
|
+
const tooltipPopupVariants = cva(
|
|
52
|
+
cn(
|
|
53
|
+
"z-50 max-w-xs rounded-md px-2.5 py-1 text-xs shadow-md outline-none",
|
|
54
|
+
// A trailing keycap already carries its own inset, so the full 10px beside
|
|
55
|
+
// it reads as a gap rather than padding — but sitting flush on the vertical
|
|
56
|
+
// inset crowds the corner, so it gets a touch more than that.
|
|
57
|
+
//
|
|
58
|
+
// Laying the row out as flex is what centres it. On a text line the keycap
|
|
59
|
+
// is an inline-flex aligned `middle`, which sets its centre against the
|
|
60
|
+
// baseline plus half an x-height rather than the line's centre — at 16px it
|
|
61
|
+
// hung 1.18px low, leaving 6.36px above and 4px below. Scoped to `has-[kbd]`
|
|
62
|
+
// because making every popup a flex container would turn a multi-child
|
|
63
|
+
// tooltip from stacked blocks into a row.
|
|
64
|
+
"has-[kbd]:flex has-[kbd]:items-center has-[kbd]:pr-1.5",
|
|
65
|
+
),
|
|
66
|
+
{
|
|
67
|
+
variants: {
|
|
68
|
+
variant: {
|
|
69
|
+
// Sits on the page's own surface: white in light mode, dark in dark.
|
|
70
|
+
default: "bg-surface text-fg-primary",
|
|
71
|
+
// Flipped against the page — dark in light mode, light in dark — for
|
|
72
|
+
// a hint that should read as separate from what it floats over.
|
|
73
|
+
inverted: "bg-surface-inverted text-fg-inverted",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: { variant: "default" },
|
|
77
|
+
},
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
export const TooltipPopup = ({
|
|
81
|
+
className,
|
|
82
|
+
variant,
|
|
83
|
+
...props
|
|
84
|
+
}: TooltipPopupProps) => (
|
|
47
85
|
<BaseTooltip.Popup
|
|
48
86
|
className={cn(
|
|
49
|
-
|
|
87
|
+
tooltipPopupVariants({ variant }),
|
|
50
88
|
motion.popupAnchor,
|
|
51
89
|
className,
|
|
52
90
|
)}
|
|
53
91
|
{...props}
|
|
54
92
|
/>
|
|
55
93
|
)
|
|
94
|
+
|
|
95
|
+
export { tooltipPopupVariants }
|