@cosxai/ui 0.25.0 → 1.0.0-alpha.1
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/CHANGELOG.md +597 -0
- package/NOTICE +11 -0
- package/README.md +52 -0
- package/package.json +57 -7
- package/src/brand.css +13 -0
- package/src/components/Badge.tsx +68 -0
- package/src/components/Button.tsx +178 -0
- package/src/components/Card.tsx +42 -0
- package/src/components/Checkbox.tsx +67 -0
- package/src/components/Dialog.tsx +111 -0
- package/src/components/Field.tsx +66 -0
- package/src/components/Figure.tsx +30 -0
- package/src/components/Icon.tsx +32 -0
- package/src/components/IconButton.tsx +55 -0
- package/src/components/Input.tsx +74 -0
- package/src/components/Logo.tsx +62 -0
- package/src/components/Marker.tsx +26 -0
- package/src/components/MetaLabel.tsx +38 -0
- package/src/components/Radio.tsx +72 -0
- package/src/components/Select.tsx +351 -0
- package/src/components/Spinner.tsx +20 -0
- package/src/components/Switch.tsx +67 -0
- package/src/components/Table.tsx +196 -0
- package/src/components/Tabs.tsx +124 -0
- package/src/components/Tag.tsx +35 -0
- package/src/components/Textarea.tsx +46 -0
- package/src/components/ThemeProvider.tsx +80 -0
- package/src/components/Toast.tsx +159 -0
- package/src/components/Tooltip.tsx +57 -0
- package/src/components/core.test.tsx +242 -0
- package/src/components/forms-control.ts +36 -0
- package/src/components/forms.test.tsx +280 -0
- package/src/components/logo-art.ts +4 -0
- package/src/components/overlays.test.tsx +245 -0
- package/src/components/useButtonAction.ts +57 -0
- package/src/fonts.css +20 -0
- package/src/index.ts +34 -24
- package/src/lib/cn.ts +23 -6
- package/src/modes.css +10 -0
- package/src/styles.css +19 -0
- package/src/theme.css +143 -0
- package/src/tokens/colors.css +112 -0
- package/src/tokens/compat.css +36 -0
- package/src/tokens/elevation.css +14 -0
- package/src/tokens/motion.css +42 -0
- package/src/tokens/spacing.css +55 -0
- package/src/tokens/typography-cjk.css +42 -0
- package/src/tokens/typography.css +81 -0
- package/src/actionbar/ActionBar.tsx +0 -837
- package/src/actionbar/ActionBarButton.tsx +0 -111
- package/src/actionbar/ActionBarMenuGroup.tsx +0 -116
- package/src/actionbar/ActionBarModeHandle.tsx +0 -171
- package/src/actionbar/ActionBarProvider.tsx +0 -91
- package/src/actionbar/actionbar-context.ts +0 -45
- package/src/actionbar/index.ts +0 -28
- package/src/actionbar/types.ts +0 -147
- package/src/actionbar/useActionBarItems.ts +0 -60
- package/src/actionbar/useActionBarMode.ts +0 -144
- package/src/actionbar/useActionBarPanel.ts +0 -56
- package/src/actionbar/useActionBarStatusDot.ts +0 -49
- package/src/actionbar/useActionBarToast.ts +0 -33
- package/src/ambient/AmbientBackdrop.tsx +0 -74
- package/src/ambient/CommandInput.tsx +0 -107
- package/src/ambient/SuperbarStrip.tsx +0 -36
- package/src/ambient/index.ts +0 -6
- package/src/bento/BentoCell.tsx +0 -66
- package/src/bento/BentoGrid.tsx +0 -42
- package/src/bento/index.ts +0 -2
- package/src/command/CommandPalette.tsx +0 -329
- package/src/command/CommandProvider.tsx +0 -57
- package/src/command/command-context.ts +0 -12
- package/src/command/index.ts +0 -6
- package/src/command/rank.ts +0 -50
- package/src/command/types.ts +0 -37
- package/src/command/useCommandSource.ts +0 -37
- package/src/dialogs/DialogsProvider.tsx +0 -216
- package/src/dialogs/Modal.tsx +0 -260
- package/src/dialogs/Toast.tsx +0 -85
- package/src/dialogs/dialogs-context.ts +0 -6
- package/src/dialogs/index.ts +0 -10
- package/src/dialogs/types.ts +0 -37
- package/src/dialogs/useDialogs.ts +0 -8
- package/src/editorial/EditorialSpotlight.tsx +0 -63
- package/src/editorial/Folio.tsx +0 -52
- package/src/editorial/PlateMarker.tsx +0 -33
- package/src/editorial/RomanSection.tsx +0 -65
- package/src/editorial/RunningMarginalia.tsx +0 -65
- package/src/editorial/index.ts +0 -10
- package/src/hooks/index.ts +0 -5
- package/src/hooks/useKeyboardHotkey.ts +0 -93
- package/src/hooks/useReducedMotion.ts +0 -20
- package/src/hooks/useViewport.ts +0 -61
- package/src/layout/Breadcrumb.tsx +0 -74
- package/src/layout/LeftNavRail.tsx +0 -139
- package/src/layout/MobileTabBar.tsx +0 -101
- package/src/layout/NavItem.tsx +0 -128
- package/src/layout/NavSearchTrigger.tsx +0 -88
- package/src/layout/NavSection.tsx +0 -40
- package/src/layout/RightSidebarPanel.tsx +0 -111
- package/src/layout/Shell.tsx +0 -91
- package/src/layout/SidePanel.tsx +0 -316
- package/src/layout/StickyBanner.tsx +0 -83
- package/src/layout/Topbar.tsx +0 -68
- package/src/layout/index.ts +0 -24
- package/src/layout/useNavRailState.ts +0 -69
- package/src/lib/time-utils.ts +0 -44
- package/src/neobrutalism/Marquee.tsx +0 -81
- package/src/neobrutalism/Sticker.tsx +0 -71
- package/src/neobrutalism/index.ts +0 -4
- package/src/primitives/Avatar.tsx +0 -53
- package/src/primitives/Button.tsx +0 -67
- package/src/primitives/Card.tsx +0 -41
- package/src/primitives/Checkbox.tsx +0 -87
- package/src/primitives/Chip.tsx +0 -191
- package/src/primitives/Combobox.tsx +0 -507
- package/src/primitives/CopyField.tsx +0 -139
- package/src/primitives/CountBadge.tsx +0 -50
- package/src/primitives/Input.tsx +0 -204
- package/src/primitives/Kbd.tsx +0 -45
- package/src/primitives/MentionCombobox.tsx +0 -612
- package/src/primitives/MultiCombobox.tsx +0 -327
- package/src/primitives/PageHeader.tsx +0 -77
- package/src/primitives/Radio.tsx +0 -131
- package/src/primitives/SegmentedControl.tsx +0 -135
- package/src/primitives/Select.tsx +0 -779
- package/src/primitives/SignaturePad.tsx +0 -461
- package/src/primitives/Tag.tsx +0 -56
- package/src/primitives/Textarea.tsx +0 -62
- package/src/primitives/ToggleSwitch.tsx +0 -79
- package/src/primitives/Tooltip.tsx +0 -213
- package/src/primitives/index.ts +0 -53
- package/src/pwa/InstallPromptBanner.tsx +0 -132
- package/src/pwa/index.ts +0 -4
- package/src/pwa/manifest.template.json +0 -20
- package/src/pwa/registerSW.ts +0 -55
- package/src/riso/Halftone.tsx +0 -85
- package/src/riso/Misregister.tsx +0 -63
- package/src/riso/RisoStamp.tsx +0 -76
- package/src/riso/index.ts +0 -3
- package/src/sketch/HandUnderline.tsx +0 -53
- package/src/sketch/RoughArrow.tsx +0 -91
- package/src/sketch/RoughBox.tsx +0 -73
- package/src/sketch/StickyNote.tsx +0 -56
- package/src/sketch/index.ts +0 -4
- package/src/styles/base.css +0 -186
- package/src/styles/chrome-ambient.css +0 -235
- package/src/styles/chrome-bento.css +0 -192
- package/src/styles/chrome-editorial.css +0 -168
- package/src/styles/chrome-neobrutalism.css +0 -326
- package/src/styles/chrome-riso.css +0 -339
- package/src/styles/chrome-sketch.css +0 -362
- package/src/styles/chrome-swiss.css +0 -265
- package/src/styles/chrome-terminal.css +0 -272
- package/src/styles/fonts.css +0 -1034
- package/src/styles/index.css +0 -343
- package/src/styles/tokens.css +0 -941
- package/src/terminal/AsciiBox.tsx +0 -65
- package/src/terminal/BrailleSpinner.tsx +0 -46
- package/src/terminal/index.ts +0 -4
- package/src/theme/ThemeProvider.tsx +0 -99
- package/src/theme/index.ts +0 -6
- package/src/theme/inline-script.ts +0 -40
- package/src/theme/theme-context.ts +0 -7
- package/src/theme/types.ts +0 -39
- package/src/theme/useTheme.ts +0 -8
package/src/riso/RisoStamp.tsx
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
// Hand-stamped label — slightly rotated, bordered, with an offset
|
|
4
|
-
// ink block "shadow." The riso equivalent of a Tag but louder.
|
|
5
|
-
// Use for "NEW", "LIMITED", "ED. 01", "OUT NOW" annotations
|
|
6
|
-
// layered over photos / hero blocks.
|
|
7
|
-
|
|
8
|
-
export interface RisoStampProps {
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
// Ink color of the stamp face. Defaults to pink.
|
|
11
|
-
ink?: "pink" | "blue" | "yellow" | "orange" | "teal" | "violet" | "red" | "green";
|
|
12
|
-
// Ink color of the offset block behind. Defaults to ink-black.
|
|
13
|
-
offset?: "pink" | "blue" | "yellow" | "orange" | "teal" | "violet" | "red" | "green" | "ink";
|
|
14
|
-
// Rotation in degrees. Defaults to -4.
|
|
15
|
-
rotate?: number;
|
|
16
|
-
// Larger / smaller sizing presets.
|
|
17
|
-
size?: "sm" | "md" | "lg";
|
|
18
|
-
className?: string;
|
|
19
|
-
style?: CSSProperties;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const INKS: Record<string, string> = {
|
|
23
|
-
pink: "var(--ck-riso-pink, #FF48B0)",
|
|
24
|
-
blue: "var(--ck-riso-blue, #3D5AFE)",
|
|
25
|
-
yellow: "var(--ck-riso-yellow, #FFE100)",
|
|
26
|
-
orange: "var(--ck-riso-orange, #FF6F3C)",
|
|
27
|
-
teal: "var(--ck-riso-teal, #00A99D)",
|
|
28
|
-
violet: "var(--ck-riso-violet, #765BA7)",
|
|
29
|
-
red: "var(--ck-riso-red, #F02D2D)",
|
|
30
|
-
green: "var(--ck-riso-green, #00A95C)",
|
|
31
|
-
ink: "var(--ck-text-primary, #1A1A1A)",
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const SIZES = {
|
|
35
|
-
sm: { font: 10, padX: 6, padY: 3, offset: 2 },
|
|
36
|
-
md: { font: 12, padX: 10, padY: 5, offset: 3 },
|
|
37
|
-
lg: { font: 16, padX: 14, padY: 7, offset: 4 },
|
|
38
|
-
} as const;
|
|
39
|
-
|
|
40
|
-
export function RisoStamp({
|
|
41
|
-
children,
|
|
42
|
-
ink = "pink",
|
|
43
|
-
offset = "ink",
|
|
44
|
-
rotate = -4,
|
|
45
|
-
size = "md",
|
|
46
|
-
className,
|
|
47
|
-
style,
|
|
48
|
-
}: RisoStampProps) {
|
|
49
|
-
const inkColor = INKS[ink] ?? INKS.pink;
|
|
50
|
-
const offsetColor = INKS[offset] ?? INKS.ink;
|
|
51
|
-
const s = SIZES[size];
|
|
52
|
-
// Yellow / lime ink reads better with dark text.
|
|
53
|
-
const lightOnDark = ink === "yellow" || ink === "orange" || ink === "green" || ink === "pink";
|
|
54
|
-
return (
|
|
55
|
-
<span
|
|
56
|
-
className={className}
|
|
57
|
-
style={{
|
|
58
|
-
display: "inline-block",
|
|
59
|
-
background: inkColor,
|
|
60
|
-
color: lightOnDark ? "#1A1A1A" : "#F8F1DE",
|
|
61
|
-
border: "2px solid #1A1A1A",
|
|
62
|
-
borderRadius: 4,
|
|
63
|
-
padding: `${s.padY}px ${s.padX}px`,
|
|
64
|
-
font: `800 ${s.font}px/1 "Helvetica Neue", "Inter", system-ui, sans-serif`,
|
|
65
|
-
letterSpacing: "0.08em",
|
|
66
|
-
textTransform: "uppercase",
|
|
67
|
-
boxShadow: `${s.offset}px ${s.offset}px 0 ${offsetColor}`,
|
|
68
|
-
transform: `rotate(${rotate}deg)`,
|
|
69
|
-
whiteSpace: "nowrap",
|
|
70
|
-
...style,
|
|
71
|
-
}}
|
|
72
|
-
>
|
|
73
|
-
{children}
|
|
74
|
-
</span>
|
|
75
|
-
);
|
|
76
|
-
}
|
package/src/riso/index.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
// Wraps a string of text with a hand-drawn underline. The
|
|
4
|
-
// underline is a CSS-only wobble using the same SVG-filter trick
|
|
5
|
-
// the chrome uses on hr / .ck-card head strokes. Falls back to a
|
|
6
|
-
// solid 2px line in browsers that ignore the data-URL filter.
|
|
7
|
-
|
|
8
|
-
export interface HandUnderlineProps {
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
// Underline color. Defaults to the current text color.
|
|
11
|
-
ink?: string;
|
|
12
|
-
// Thickness in px. Defaults to 2.
|
|
13
|
-
thickness?: number;
|
|
14
|
-
className?: string;
|
|
15
|
-
style?: CSSProperties;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function HandUnderline({
|
|
19
|
-
children,
|
|
20
|
-
ink = "currentColor",
|
|
21
|
-
thickness = 2,
|
|
22
|
-
className,
|
|
23
|
-
style,
|
|
24
|
-
}: HandUnderlineProps) {
|
|
25
|
-
return (
|
|
26
|
-
<span
|
|
27
|
-
className={className}
|
|
28
|
-
style={{
|
|
29
|
-
position: "relative",
|
|
30
|
-
display: "inline-block",
|
|
31
|
-
paddingBottom: 2,
|
|
32
|
-
...style,
|
|
33
|
-
}}
|
|
34
|
-
>
|
|
35
|
-
{children}
|
|
36
|
-
<span
|
|
37
|
-
aria-hidden
|
|
38
|
-
style={{
|
|
39
|
-
position: "absolute",
|
|
40
|
-
left: 0,
|
|
41
|
-
right: 0,
|
|
42
|
-
bottom: -1,
|
|
43
|
-
height: thickness,
|
|
44
|
-
background: ink,
|
|
45
|
-
borderRadius: thickness,
|
|
46
|
-
filter: "var(--ck-sketch-wobble)",
|
|
47
|
-
opacity: 0.85,
|
|
48
|
-
pointerEvents: "none",
|
|
49
|
-
}}
|
|
50
|
-
/>
|
|
51
|
-
</span>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
|
|
3
|
-
// Inline SVG hand-drawn arrow. Used between elements on a canvas
|
|
4
|
-
// to indicate connection / flow, or as an annotation pointer.
|
|
5
|
-
// The path is hand-tuned to feel drawn, not generated — small
|
|
6
|
-
// kinks, asymmetric arrowhead. Stroke color + width controllable.
|
|
7
|
-
//
|
|
8
|
-
// The arrow draws on via stroke-dasharray animation on mount when
|
|
9
|
-
// `animated` is true.
|
|
10
|
-
|
|
11
|
-
export interface RoughArrowProps {
|
|
12
|
-
// Endpoints in px (relative to the SVG's own coordinate space).
|
|
13
|
-
from?: [number, number];
|
|
14
|
-
to?: [number, number];
|
|
15
|
-
// Stroke color. Defaults to ink.
|
|
16
|
-
ink?: string;
|
|
17
|
-
// Stroke thickness. Defaults to 2.
|
|
18
|
-
thickness?: number;
|
|
19
|
-
// Curve amount — 0 is a straight wobble, 1 is a strong arc.
|
|
20
|
-
curve?: number;
|
|
21
|
-
// Animate the draw-on. Defaults to false (instant).
|
|
22
|
-
animated?: boolean;
|
|
23
|
-
width?: number | string;
|
|
24
|
-
height?: number | string;
|
|
25
|
-
className?: string;
|
|
26
|
-
style?: CSSProperties;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function RoughArrow({
|
|
30
|
-
from = [10, 40],
|
|
31
|
-
to = [220, 40],
|
|
32
|
-
ink = "var(--ck-text-primary, #1A1A1A)",
|
|
33
|
-
thickness = 2,
|
|
34
|
-
curve = 0.4,
|
|
35
|
-
animated = false,
|
|
36
|
-
width = 240,
|
|
37
|
-
height = 80,
|
|
38
|
-
className,
|
|
39
|
-
style,
|
|
40
|
-
}: RoughArrowProps) {
|
|
41
|
-
const [x1, y1] = from;
|
|
42
|
-
const [x2, y2] = to;
|
|
43
|
-
const dx = x2 - x1;
|
|
44
|
-
const dy = y2 - y1;
|
|
45
|
-
const len = Math.sqrt(dx * dx + dy * dy);
|
|
46
|
-
// Perpendicular for the control offsets — produces a gentle arc.
|
|
47
|
-
const px = -dy / len;
|
|
48
|
-
const py = dx / len;
|
|
49
|
-
// Two control points with tiny irregular wobble.
|
|
50
|
-
const cx1 = x1 + dx * 0.3 + px * len * curve * 0.4;
|
|
51
|
-
const cy1 = y1 + dy * 0.3 + py * len * curve * 0.4;
|
|
52
|
-
const cx2 = x1 + dx * 0.7 + px * len * curve * 0.5 + 2;
|
|
53
|
-
const cy2 = y1 + dy * 0.7 + py * len * curve * 0.5 - 1;
|
|
54
|
-
|
|
55
|
-
const path = `M ${x1} ${y1} C ${cx1} ${cy1}, ${cx2} ${cy2}, ${x2} ${y2}`;
|
|
56
|
-
|
|
57
|
-
// Arrowhead — two strokes meeting at (x2,y2). Length and angle
|
|
58
|
-
// pre-computed from the (cx2 → x2) direction.
|
|
59
|
-
const ahLen = 14;
|
|
60
|
-
const angle = Math.atan2(y2 - cy2, x2 - cx2);
|
|
61
|
-
const aOpen = 0.45;
|
|
62
|
-
const ax1 = x2 - Math.cos(angle - aOpen) * ahLen;
|
|
63
|
-
const ay1 = y2 - Math.sin(angle - aOpen) * ahLen;
|
|
64
|
-
const ax2 = x2 - Math.cos(angle + aOpen) * ahLen;
|
|
65
|
-
const ay2 = y2 - Math.sin(angle + aOpen) * ahLen;
|
|
66
|
-
|
|
67
|
-
// Pen-press effect — slightly thicker stroke at start/end via
|
|
68
|
-
// overlaid short paths. Keeps SVG light, no shaders.
|
|
69
|
-
return (
|
|
70
|
-
<svg
|
|
71
|
-
className={className}
|
|
72
|
-
width={width}
|
|
73
|
-
height={height}
|
|
74
|
-
viewBox={`0 0 ${typeof width === "number" ? width : 240} ${typeof height === "number" ? height : 80}`}
|
|
75
|
-
style={{ overflow: "visible", display: "block", ...style }}
|
|
76
|
-
aria-hidden
|
|
77
|
-
>
|
|
78
|
-
<g
|
|
79
|
-
fill="none"
|
|
80
|
-
stroke={ink}
|
|
81
|
-
strokeLinecap="round"
|
|
82
|
-
strokeLinejoin="round"
|
|
83
|
-
strokeWidth={thickness}
|
|
84
|
-
>
|
|
85
|
-
<path d={path} className={animated ? "ck-sketch-drawon" : undefined} style={animated ? { ["--ck-sketch-len" as never]: len + 30 } : undefined} />
|
|
86
|
-
<path d={`M ${x2} ${y2} L ${ax1} ${ay1}`} />
|
|
87
|
-
<path d={`M ${x2} ${y2} L ${ax2} ${ay2}`} />
|
|
88
|
-
</g>
|
|
89
|
-
</svg>
|
|
90
|
-
);
|
|
91
|
-
}
|
package/src/sketch/RoughBox.tsx
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
// A drawn rectangle — used to wrap any content in a "sketched"
|
|
4
|
-
// container. CSS-only: asymmetric border-radius + 2px ink stroke
|
|
5
|
-
// + offset second stroke shadow. Pair with `tilt` and an optional
|
|
6
|
-
// `fill` (transparent | hatch | marker color) for emphasis.
|
|
7
|
-
//
|
|
8
|
-
// Why a primitive: this is the canonical "drawn rectangle" pattern
|
|
9
|
-
// — buttons, cards, sticky notes, tool tips all inherit from it.
|
|
10
|
-
// Wrapping it once keeps the wobble math + tilt presets DRY.
|
|
11
|
-
|
|
12
|
-
export interface RoughBoxProps {
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
// Tilt in degrees. Defaults to a small -1.
|
|
15
|
-
tilt?: number;
|
|
16
|
-
// Fill style. Defaults to "paper". "hatch" lays down diagonal
|
|
17
|
-
// marker strokes; "marker" floods a translucent marker color.
|
|
18
|
-
fill?: "paper" | "hatch" | "marker" | "transparent";
|
|
19
|
-
// Marker color when fill="hatch" or fill="marker". Accepts any
|
|
20
|
-
// CSS color, including the --ck-sketch-* vars.
|
|
21
|
-
ink?: string;
|
|
22
|
-
// Override radius. Defaults to a chrome-aware asymmetric value.
|
|
23
|
-
radius?: string;
|
|
24
|
-
// Drawing thickness, in px. Defaults to 2.
|
|
25
|
-
stroke?: number;
|
|
26
|
-
// Padding inside the box. Defaults to 16.
|
|
27
|
-
padding?: number | string;
|
|
28
|
-
// Set to true to skip the offset second-stroke shadow.
|
|
29
|
-
flat?: boolean;
|
|
30
|
-
className?: string;
|
|
31
|
-
style?: CSSProperties;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function RoughBox({
|
|
35
|
-
children,
|
|
36
|
-
tilt = -1,
|
|
37
|
-
fill = "paper",
|
|
38
|
-
ink = "var(--ck-sketch-yellow, #F2C94C)",
|
|
39
|
-
radius = "10px 14px 12px 16px / 14px 10px 16px 12px",
|
|
40
|
-
stroke = 2,
|
|
41
|
-
padding = 16,
|
|
42
|
-
flat = false,
|
|
43
|
-
className,
|
|
44
|
-
style,
|
|
45
|
-
}: RoughBoxProps) {
|
|
46
|
-
const inkColor = "var(--ck-text-primary, #1A1A1A)";
|
|
47
|
-
let background: string;
|
|
48
|
-
if (fill === "hatch") {
|
|
49
|
-
background = `repeating-linear-gradient(45deg, ${ink} 0 3px, transparent 3px 9px), var(--ck-bg-surface, #FFFEF9)`;
|
|
50
|
-
} else if (fill === "marker") {
|
|
51
|
-
background = `color-mix(in oklab, ${ink} 22%, transparent), var(--ck-bg-surface, #FFFEF9)`;
|
|
52
|
-
} else if (fill === "transparent") {
|
|
53
|
-
background = "transparent";
|
|
54
|
-
} else {
|
|
55
|
-
background = "var(--ck-bg-surface, #FFFEF9)";
|
|
56
|
-
}
|
|
57
|
-
return (
|
|
58
|
-
<div
|
|
59
|
-
className={className}
|
|
60
|
-
style={{
|
|
61
|
-
background,
|
|
62
|
-
border: `${stroke}px solid ${inkColor}`,
|
|
63
|
-
borderRadius: radius,
|
|
64
|
-
boxShadow: flat ? "none" : `3px 4px 0 ${inkColor}`,
|
|
65
|
-
padding,
|
|
66
|
-
transform: `rotate(${tilt}deg)`,
|
|
67
|
-
...style,
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
{children}
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
// Yellow / pink / green sticky note with a tiny rotation, hand-
|
|
4
|
-
// drawn second-stroke shadow, and handwriting-leaning font.
|
|
5
|
-
// Useful for callouts, empty-state captions, toasts.
|
|
6
|
-
|
|
7
|
-
export interface StickyNoteProps {
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
color?: "yellow" | "pink" | "green" | "blue" | "orange";
|
|
10
|
-
// Rotation in degrees. Defaults to a small alternating tilt.
|
|
11
|
-
tilt?: number;
|
|
12
|
-
width?: number | string;
|
|
13
|
-
className?: string;
|
|
14
|
-
style?: CSSProperties;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const COLORS: Record<NonNullable<StickyNoteProps["color"]>, string> = {
|
|
18
|
-
yellow: "#FFF3B0",
|
|
19
|
-
pink: "#FFD1E3",
|
|
20
|
-
green: "#D6F0DC",
|
|
21
|
-
blue: "#D6E8FF",
|
|
22
|
-
orange: "#FFE0C7",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export function StickyNote({
|
|
26
|
-
children,
|
|
27
|
-
color = "yellow",
|
|
28
|
-
tilt = -2,
|
|
29
|
-
width = 220,
|
|
30
|
-
className,
|
|
31
|
-
style,
|
|
32
|
-
}: StickyNoteProps) {
|
|
33
|
-
return (
|
|
34
|
-
<div
|
|
35
|
-
className={className}
|
|
36
|
-
style={{
|
|
37
|
-
background: COLORS[color],
|
|
38
|
-
width,
|
|
39
|
-
minHeight: 120,
|
|
40
|
-
padding: "18px 18px 22px",
|
|
41
|
-
border: "1.5px solid rgba(26,26,26,0.5)",
|
|
42
|
-
borderRadius: "4px 8px 5px 9px / 6px 4px 9px 5px",
|
|
43
|
-
boxShadow:
|
|
44
|
-
"3px 4px 0 rgba(26,26,26,0.85), 6px 10px 18px rgba(0,0,0,0.08)",
|
|
45
|
-
transform: `rotate(${tilt}deg)`,
|
|
46
|
-
font:
|
|
47
|
-
"500 17px/1.45 \"Caveat\", \"Patrick Hand\", \"Kalam\", \"Comic Sans MS\", cursive",
|
|
48
|
-
color: "#1A1A1A",
|
|
49
|
-
position: "relative",
|
|
50
|
-
...style,
|
|
51
|
-
}}
|
|
52
|
-
>
|
|
53
|
-
{children}
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
}
|
package/src/sketch/index.ts
DELETED
package/src/styles/base.css
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/* Global base — applied once at the consumer root so the kit's
|
|
2
|
-
typography, color, and motion behaviour kick in. Components
|
|
3
|
-
themselves are class-driven (`ck-*` prefix) and don't depend on
|
|
4
|
-
this file being loaded, but consumers should import it to get
|
|
5
|
-
the cross-fade theme transitions and reduced-motion handling. */
|
|
6
|
-
|
|
7
|
-
/* Inheritance-friendly box-sizing — modern reset best practice.
|
|
8
|
-
Without it, `min-height: 100vh` + padding silently extends the
|
|
9
|
-
element BEYOND the viewport (default `content-box` makes padding
|
|
10
|
-
stack ON TOP of the declared min-height), introducing a sneaky
|
|
11
|
-
scroll on any consumer page that combines those two properties.
|
|
12
|
-
Every modern reset (Eric Meyer 2014, Tailwind preflight,
|
|
13
|
-
Bootstrap, modern-normalize) ships this — @cosxai/ui matches. */
|
|
14
|
-
*,
|
|
15
|
-
*::before,
|
|
16
|
-
*::after {
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
html,
|
|
21
|
-
body {
|
|
22
|
-
background: var(--ck-bg-canvas);
|
|
23
|
-
color: var(--ck-text-primary);
|
|
24
|
-
font-family: var(--ck-font-sans);
|
|
25
|
-
font-feature-settings: "ss01", "cv11";
|
|
26
|
-
-webkit-font-smoothing: antialiased;
|
|
27
|
-
/* Cross-fade tones when --ck-bg-canvas / --ck-text-primary flip
|
|
28
|
-
on theme toggle. All component tokens read from the same vars
|
|
29
|
-
so they shift in lockstep without per-element transitions. */
|
|
30
|
-
transition: background-color 200ms var(--ck-ease), color 200ms var(--ck-ease);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* Anchor — defaults to the active chrome's accent + a clean
|
|
34
|
-
underline. Without this rule, the browser's visited-link
|
|
35
|
-
purple bleeds through any theme (most notably terminal /
|
|
36
|
-
editorial). Components that want different styling (NavItem,
|
|
37
|
-
TopBar nav, breadcrumbs, in-card secondary links) override
|
|
38
|
-
locally with a more-specific selector. */
|
|
39
|
-
a {
|
|
40
|
-
color: var(--ck-accent);
|
|
41
|
-
text-decoration: underline;
|
|
42
|
-
text-decoration-thickness: 1px;
|
|
43
|
-
text-underline-offset: 2px;
|
|
44
|
-
transition: color var(--ck-dur-fast) var(--ck-ease);
|
|
45
|
-
}
|
|
46
|
-
a:hover { color: var(--ck-accent-hover); }
|
|
47
|
-
a:visited { color: var(--ck-accent); }
|
|
48
|
-
|
|
49
|
-
/* ---------- Typography utilities ---------- */
|
|
50
|
-
.ck-h1 { font: 500 32px/1.2 var(--ck-font-sans); letter-spacing: -0.01em; color: var(--ck-text-primary); margin: 0; }
|
|
51
|
-
.ck-h2 { font: 500 24px/1.3 var(--ck-font-sans); letter-spacing: -0.005em; color: var(--ck-text-primary); margin: 0; }
|
|
52
|
-
.ck-h3 { font: 500 20px/1.4 var(--ck-font-sans); color: var(--ck-text-primary); margin: 0; }
|
|
53
|
-
.ck-body { font: 400 16px/1.55 var(--ck-font-sans); color: var(--ck-text-primary); }
|
|
54
|
-
.ck-body-sm { font: 400 14px/1.5 var(--ck-font-sans); color: var(--ck-text-primary); }
|
|
55
|
-
.ck-caption { font: 400 13px/1.4 var(--ck-font-sans); color: var(--ck-text-tertiary); }
|
|
56
|
-
|
|
57
|
-
.ck-mono { font-family: var(--ck-font-mono); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
|
|
58
|
-
|
|
59
|
-
/* Section eyebrow — small uppercase mono caption ("ACCESS · SHARES")
|
|
60
|
-
that sits above titles in cards / panels. */
|
|
61
|
-
.ck-eyebrow {
|
|
62
|
-
font: 500 var(--ck-mono-xs-size)/1 var(--ck-font-mono);
|
|
63
|
-
letter-spacing: 0.08em;
|
|
64
|
-
text-transform: uppercase;
|
|
65
|
-
color: var(--ck-text-tertiary);
|
|
66
|
-
display: inline-block;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* One-step-smaller sibling of eyebrow — for status pills (PENDING,
|
|
70
|
-
LIVE, Accepted, Revoked), meta tags inside list rows. */
|
|
71
|
-
.ck-tag {
|
|
72
|
-
font: 500 var(--ck-mono-tag-size)/1 var(--ck-font-mono);
|
|
73
|
-
letter-spacing: 0.08em;
|
|
74
|
-
text-transform: uppercase;
|
|
75
|
-
color: var(--ck-text-tertiary);
|
|
76
|
-
display: inline-block;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.ck-meta {
|
|
80
|
-
font: 400 var(--ck-mono-sm-size)/1.4 var(--ck-font-mono);
|
|
81
|
-
color: var(--ck-text-tertiary);
|
|
82
|
-
font-variant-numeric: tabular-nums;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/* ---------- Motion primitives ---------- */
|
|
86
|
-
@keyframes ck-slide-in-right { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
|
|
87
|
-
@keyframes ck-slide-in-left { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: translateX(0); } }
|
|
88
|
-
@keyframes ck-fade-in { from { opacity: 0; } to { opacity: 1; } }
|
|
89
|
-
@keyframes ck-popover-enter { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
|
|
90
|
-
@keyframes ck-page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
|
91
|
-
/* Full-distance entrances for phone modal presentations: a pushed
|
|
92
|
-
page slides in from the right edge, a sheet rises from the bottom.
|
|
93
|
-
Unlike the 14px nudges above these travel the whole viewport. */
|
|
94
|
-
@keyframes ck-page-push { from { transform: translateX(100%); } to { transform: translateX(0); } }
|
|
95
|
-
@keyframes ck-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
|
|
96
|
-
|
|
97
|
-
.ck-anim-slide-right { animation: ck-slide-in-right 180ms var(--ck-ease) both; }
|
|
98
|
-
.ck-anim-slide-left { animation: ck-slide-in-left 180ms var(--ck-ease) both; }
|
|
99
|
-
.ck-anim-fade { animation: ck-fade-in 180ms var(--ck-ease) both; }
|
|
100
|
-
.ck-anim-popover { animation: ck-popover-enter 160ms var(--ck-ease) both; transform-origin: top center; }
|
|
101
|
-
.ck-anim-page { animation: ck-page-enter var(--ck-dur-page) cubic-bezier(0.16, 1, 0.3, 1) both; }
|
|
102
|
-
.ck-anim-page-push { animation: ck-page-push 260ms cubic-bezier(0.32, 0.72, 0, 1) both; }
|
|
103
|
-
.ck-anim-sheet-up { animation: ck-sheet-up 260ms cubic-bezier(0.32, 0.72, 0, 1) both; }
|
|
104
|
-
|
|
105
|
-
/* Respect the user's OS-level motion preference. Cross-fade
|
|
106
|
-
transitions on bg/colour stay (below the meaningful-motion
|
|
107
|
-
threshold); element-level animations are killed. */
|
|
108
|
-
@media (prefers-reduced-motion: reduce) {
|
|
109
|
-
.ck-anim-slide-right,
|
|
110
|
-
.ck-anim-slide-left,
|
|
111
|
-
.ck-anim-fade,
|
|
112
|
-
.ck-anim-popover,
|
|
113
|
-
.ck-anim-page,
|
|
114
|
-
.ck-anim-page-push,
|
|
115
|
-
.ck-anim-sheet-up {
|
|
116
|
-
animation: none;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* Scrollbars — macOS renders auto-hiding overlay bars, but Windows
|
|
121
|
-
(and Linux) render CLASSIC opaque gutters that read as heavy grey
|
|
122
|
-
slabs against the kit's editorial surfaces (QA: Ben, 2026-07-19).
|
|
123
|
-
The standard properties slim them down and tint the thumb from
|
|
124
|
-
the theme's border token so both light and dark chrome stay
|
|
125
|
-
coherent. `scrollbar-color` inherits from :root; `scrollbar-width`
|
|
126
|
-
doesn't, hence the universal selector. Browsers without support
|
|
127
|
-
(older Safari) keep their native overlay bars — already fine. */
|
|
128
|
-
* {
|
|
129
|
-
scrollbar-width: thin;
|
|
130
|
-
}
|
|
131
|
-
:root {
|
|
132
|
-
scrollbar-color: var(--ck-border-strong, rgba(0, 0, 0, 0.25)) transparent;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/* Chromium < 121 doesn't know the standard properties above and fell
|
|
136
|
-
back to the classic arrow-button gutters (QA: Ben, 2026-07-24 —
|
|
137
|
-
the first pass "didn't cover everything"; it actually didn't cover
|
|
138
|
-
older ENGINES). The ::-webkit-scrollbar layer is the fallback for
|
|
139
|
-
those versions; engines that support scrollbar-width IGNORE these
|
|
140
|
-
pseudo-elements when it's set, so the two blocks never fight. */
|
|
141
|
-
*::-webkit-scrollbar {
|
|
142
|
-
width: 8px;
|
|
143
|
-
height: 8px;
|
|
144
|
-
}
|
|
145
|
-
*::-webkit-scrollbar-thumb {
|
|
146
|
-
background: var(--ck-border-strong, rgba(0, 0, 0, 0.25));
|
|
147
|
-
border-radius: 4px;
|
|
148
|
-
}
|
|
149
|
-
*::-webkit-scrollbar-track {
|
|
150
|
-
background: transparent;
|
|
151
|
-
}
|
|
152
|
-
*::-webkit-scrollbar-corner {
|
|
153
|
-
background: transparent;
|
|
154
|
-
}
|
|
155
|
-
*::-webkit-scrollbar-button {
|
|
156
|
-
display: none;
|
|
157
|
-
width: 0;
|
|
158
|
-
height: 0;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/* ── ActionBar panel + toast slots (design#13) ─────────────────────
|
|
162
|
-
Base chrome for the bar-intrinsic popover (useActionBarPanel) and
|
|
163
|
-
transient bubble (useActionBarToast). Token-driven so every theme
|
|
164
|
-
reads correctly by default; chrome-*.css sharpens identity themes
|
|
165
|
-
(neobrutalism ink shadows, sketch wobble, terminal flatness). */
|
|
166
|
-
.ck-actionbar-panel {
|
|
167
|
-
background: var(--ck-bg-surface, #fff);
|
|
168
|
-
border: 1px solid var(--ck-border-subtle, #e5e7eb);
|
|
169
|
-
border-radius: 12px;
|
|
170
|
-
box-shadow: var(--ck-shadow-3, 0 16px 48px rgba(0, 0, 0, 0.12));
|
|
171
|
-
padding: 16px;
|
|
172
|
-
font-family: var(--ck-font-sans, system-ui, sans-serif);
|
|
173
|
-
color: var(--ck-text-primary);
|
|
174
|
-
user-select: none;
|
|
175
|
-
}
|
|
176
|
-
.ck-actionbar-toast {
|
|
177
|
-
background: var(--ck-bg-surface, #fff);
|
|
178
|
-
border: 1px solid var(--ck-border-subtle, #e5e7eb);
|
|
179
|
-
border-radius: 10px;
|
|
180
|
-
box-shadow: var(--ck-shadow-3, 0 16px 48px rgba(0, 0, 0, 0.12));
|
|
181
|
-
padding: 10px 14px;
|
|
182
|
-
font-size: 12px;
|
|
183
|
-
font-family: var(--ck-font-sans, system-ui, sans-serif);
|
|
184
|
-
color: var(--ck-text-primary);
|
|
185
|
-
user-select: none;
|
|
186
|
-
}
|