@og-ui/cli 0.0.0-stage → 0.1.0

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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/bin/ogui.js +102 -0
  3. package/lib/registry.js +92 -0
  4. package/package.json +32 -3
  5. package/registry/accordion-react.json +33 -0
  6. package/registry/accordion.json +36 -0
  7. package/registry/alert-react.json +33 -0
  8. package/registry/alert.json +41 -0
  9. package/registry/avatar-react.json +33 -0
  10. package/registry/avatar.json +48 -0
  11. package/registry/badge-react.json +33 -0
  12. package/registry/badge.json +52 -0
  13. package/registry/button-react.json +33 -0
  14. package/registry/button.json +51 -0
  15. package/registry/card-react.json +33 -0
  16. package/registry/card.json +51 -0
  17. package/registry/checkbox-react.json +33 -0
  18. package/registry/checkbox.json +46 -0
  19. package/registry/dialog-react.json +33 -0
  20. package/registry/dialog.json +53 -0
  21. package/registry/index.json +1155 -0
  22. package/registry/input-react.json +33 -0
  23. package/registry/input.json +45 -0
  24. package/registry/menu-react.json +33 -0
  25. package/registry/menu.json +11 -0
  26. package/registry/og-ui.json +21 -0
  27. package/registry/pagination-react.json +33 -0
  28. package/registry/pagination.json +37 -0
  29. package/registry/popover-react.json +33 -0
  30. package/registry/popover.json +46 -0
  31. package/registry/progress-react.json +33 -0
  32. package/registry/progress.json +35 -0
  33. package/registry/select-react.json +33 -0
  34. package/registry/select.json +35 -0
  35. package/registry/skeleton-react.json +33 -0
  36. package/registry/skeleton.json +37 -0
  37. package/registry/slider-react.json +33 -0
  38. package/registry/slider.json +38 -0
  39. package/registry/surface.json +37 -0
  40. package/registry/switch-react.json +33 -0
  41. package/registry/switch.json +35 -0
  42. package/registry/table-react.json +33 -0
  43. package/registry/table.json +38 -0
  44. package/registry/tabs-react.json +33 -0
  45. package/registry/tabs.json +41 -0
  46. package/registry/theme-aurora.json +135 -0
  47. package/registry/theme-brutal.json +135 -0
  48. package/registry/theme-clay.json +135 -0
  49. package/registry/theme-clean.json +135 -0
  50. package/registry/theme-glass.json +135 -0
  51. package/registry/theme-liquid-glass.json +135 -0
  52. package/registry/theme-neumorphism.json +135 -0
  53. package/registry/theme-provider-react.json +33 -0
  54. package/registry/toast-react.json +33 -0
  55. package/registry/toast.json +46 -0
  56. package/registry/tooltip.json +37 -0
  57. package/README.md +0 -3
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "input-react",
4
+ "type": "registry:component",
5
+ "title": "input (React)",
6
+ "description": "React component(s) from @og-ui/react's components.tsx, copied into your project.",
7
+ "dependencies": [
8
+ "@og-ui/core"
9
+ ],
10
+ "registryDependencies": [
11
+ "https://ui.ogom.in/r/input.json"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "components/og/components.tsx",
16
+ "type": "registry:file",
17
+ "target": "components/og/components.tsx",
18
+ "content": "import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type ReactNode,\n} from 'react';\nimport { cx, useOgUI } from './util.js';\n\ntype Palette = 1 | 2 | 3 | 4 | 5 | 6;\ntype Status = 'accent' | 'success' | 'warning' | 'danger';\n\n// ---------------------------------------------------------------------------\n// Button\n\nexport interface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n variant?: 'primary' | 'ghost' | 'danger';\n size?: 'sm' | 'lg';\n /** Square icon button. Give it an aria-label. */\n icon?: boolean;\n block?: boolean;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { variant, size, icon, block, className, type = 'button', ...props },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type}\n className={cx(\n 'og-button',\n variant && `og-button--${variant}`,\n size && `og-button--${size}`,\n icon && 'og-button--icon',\n block && 'og-button--block',\n className,\n )}\n {...props}\n />\n );\n});\n\n// ---------------------------------------------------------------------------\n// Card\n\nexport interface CardProps extends Omit<ComponentPropsWithoutRef<'article'>, 'title'> {\n title?: ReactNode;\n description?: ReactNode;\n footer?: ReactNode;\n /** Palette tint 1–6. */\n tint?: Palette;\n}\n\nexport const Card = forwardRef<HTMLElement, CardProps>(function Card(\n { title, description, footer, tint, className, children, ...props },\n ref,\n) {\n return (\n <article ref={ref} className={cx('og-card', tint && `og-card--tint-${tint}`, className)} {...props}>\n {(title || description) && (\n <header className=\"og-card__header\">\n {title && <h3 className=\"og-card__title\">{title}</h3>}\n {description && <p className=\"og-card__description\">{description}</p>}\n </header>\n )}\n {children !== undefined && <div className=\"og-card__body\">{children}</div>}\n {footer && <footer className=\"og-card__footer\">{footer}</footer>}\n </article>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Form controls\n\n/** Wraps a control in og-field with a label and hint when they are given. */\nfunction Field({ label, hint, children }: { label?: ReactNode; hint?: ReactNode; children: ReactNode }) {\n if (!label && !hint) return <>{children}</>;\n return (\n <label className=\"og-field\">\n {label && <span className=\"og-label\">{label}</span>}\n {children}\n {hint && <span className=\"og-hint\">{hint}</span>}\n </label>\n );\n}\n\nexport interface InputProps extends ComponentPropsWithoutRef<'input'> {\n label?: ReactNode;\n hint?: ReactNode;\n invalid?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { label, hint, invalid, className, ...props },\n ref,\n) {\n return (\n <Field label={label} hint={hint}>\n <input\n ref={ref}\n className={cx('og-input', className)}\n aria-invalid={invalid || props['aria-invalid']}\n {...props}\n />\n </Field>\n );\n});\n\nexport interface SelectProps extends ComponentPropsWithoutRef<'select'> {\n label?: ReactNode;\n hint?: ReactNode;\n}\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { label, hint, className, ...props },\n ref,\n) {\n return (\n <Field label={label} hint={hint}>\n <span className={cx('og-select', className)}>\n <select ref={ref} {...props} />\n </span>\n </Field>\n );\n});\n\nexport interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type'> {\n label?: ReactNode;\n /** Shows the dash state. Sets the DOM property, which has no HTML attribute. */\n indeterminate?: boolean;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, indeterminate, className, ...props },\n ref,\n) {\n const setRef = (el: HTMLInputElement | null) => {\n if (el) el.indeterminate = !!indeterminate;\n if (typeof ref === 'function') ref(el);\n else if (ref) ref.current = el;\n };\n return (\n <label className=\"og-check\">\n <input ref={setRef} type=\"checkbox\" className={cx('og-checkbox', className)} {...props} />\n {label}\n </label>\n );\n});\n\nexport interface SwitchProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'role'> {\n label?: ReactNode;\n}\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n { label, className, ...props },\n ref,\n) {\n return (\n <label className=\"og-check\">\n <input ref={ref} type=\"checkbox\" role=\"switch\" className={cx('og-switch', className)} {...props} />\n {label}\n </label>\n );\n});\n\nexport interface SliderProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type'> {\n label?: ReactNode;\n}\n\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(function Slider(\n { label, className, style, min = 0, max = 100, ...props },\n ref,\n) {\n useOgUI();\n // og-ui.js keeps the fill in sync while dragging; this covers the first render and\n // controlled value changes that don't come from the user.\n const value = Number(props.value ?? props.defaultValue ?? (Number(min) + Number(max)) / 2);\n const span = Number(max) - Number(min);\n const pct = span ? ((value - Number(min)) / span) * 100 : 0;\n return (\n <Field label={label}>\n <input\n ref={ref}\n type=\"range\"\n min={min}\n max={max}\n className={cx('og-slider', className)}\n style={{ '--_value': `${pct}%`, ...style } as CSSProperties}\n {...props}\n />\n </Field>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Display\n\nexport interface BadgeProps extends ComponentPropsWithoutRef<'span'> {\n variant?: Status | Palette;\n /** Filled. Documented for variant=\"accent\". */\n solid?: boolean;\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { variant, solid, className, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cx('og-badge', variant && `og-badge--${variant}`, solid && 'og-badge--solid', className)}\n {...props}\n />\n );\n});\n\nexport interface AvatarProps extends Omit<ComponentPropsWithoutRef<'span'>, 'color'> {\n /** Full name: used for the initials and the accessible name. */\n name: string;\n src?: string;\n color?: Palette;\n size?: 'sm' | 'lg';\n}\n\nconst initials = (name: string) =>\n name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((w) => w[0]?.toUpperCase())\n .join('');\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { name, src, color, size, className, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cx('og-avatar', color && `og-avatar--${color}`, size && `og-avatar--${size}`, className)}\n role={src ? undefined : 'img'}\n aria-label={src ? undefined : name}\n {...props}\n >\n {src ? <img src={src} alt={name} /> : initials(name)}\n </span>\n );\n});\n\nexport interface AlertProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {\n variant?: Status;\n title?: ReactNode;\n}\n\n/** role=\"status\" by default; pass role=\"alert\" only for urgent errors. */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { variant, title, className, children, role = 'status', ...props },\n ref,\n) {\n return (\n <div ref={ref} role={role} className={cx('og-alert', variant && `og-alert--${variant}`, className)} {...props}>\n {title && <p className=\"og-alert__title\">{title}</p>}\n {children && <p className=\"og-alert__description\">{children}</p>}\n </div>\n );\n});\n\n/** Leave out value for an indeterminate bar. Give it an aria-label. */\nexport const Progress = forwardRef<HTMLProgressElement, ComponentPropsWithoutRef<'progress'>>(function Progress(\n { className, max = 100, ...props },\n ref,\n) {\n return <progress ref={ref} max={max} className={cx('og-progress', className)} {...props} />;\n});\n\nexport interface SkeletonProps extends ComponentPropsWithoutRef<'div'> {\n shape?: 'text' | 'circle';\n}\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { shape, className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={cx('og-skeleton', shape && `og-skeleton--${shape}`, className)}\n {...props}\n />\n );\n});\n\n/** The wrapper scrolls sideways on small screens. Use className=\"og-table__num\" on number cells. */\nexport const Table = forwardRef<HTMLTableElement, ComponentPropsWithoutRef<'table'>>(function Table(\n { className, ...props },\n ref,\n) {\n return (\n <div className=\"og-table-wrap\">\n <table ref={ref} className={cx('og-table', className)} {...props} />\n </div>\n );\n});\n"
19
+ },
20
+ {
21
+ "path": "components/og/util.ts",
22
+ "type": "registry:file",
23
+ "target": "components/og/util.ts",
24
+ "content": "import { useEffect } from 'react';\nimport { initOgUI } from '@og-ui/core/og-ui.js';\n\n/** Join class names, skipping falsy ones. */\nexport const cx = (...parts: (string | false | null | undefined)[]) => parts.filter(Boolean).join(' ');\n\n/**\n * Start og-ui.js (keyboard for menus and tabs, slider fill, popover placement, toasts).\n * Safe to call from every component: it only wires the document once, and only in the browser.\n */\nexport function useOgUI() {\n useEffect(() => initOgUI(), []);\n}\n\n/** Pages to show, with gaps: 1 … 4 5 [6] 7 8 … 20 */\nexport function pageList(page: number, count: number, siblings = 1): (number | 'gap')[] {\n const out: (number | 'gap')[] = [1];\n const from = Math.max(2, page - siblings);\n const to = Math.min(count - 1, page + siblings);\n if (from > 2) out.push('gap');\n for (let p = from; p <= to; p++) out.push(p);\n if (to < count - 1) out.push('gap');\n if (count > 1) out.push(count);\n return out;\n}\n"
25
+ },
26
+ {
27
+ "path": "components/og/og-ui.d.ts",
28
+ "type": "registry:file",
29
+ "target": "components/og/og-ui.d.ts",
30
+ "content": "declare module '@og-ui/core/og-ui.js' {\n export function initOgUI(root?: Document | Element): void;\n export function ogToast(\n title: string,\n options?: {\n description?: string;\n variant?: 'success' | 'warning' | 'danger' | 'accent';\n duration?: number;\n },\n ): () => void;\n}\n"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "input",
4
+ "type": "registry:component",
5
+ "title": "Input",
6
+ "description": "Text fields and textareas with a visible label, hint and invalid state.",
7
+ "meta": {
8
+ "classes": [
9
+ "og-input",
10
+ "og-input--multiline",
11
+ "og-field",
12
+ "og-label",
13
+ "og-hint"
14
+ ],
15
+ "group": "Forms",
16
+ "markup": [
17
+ {
18
+ "label": "Field",
19
+ "html": "<label class=\"og-field\" style=\"max-width: 20rem\">\n <span class=\"og-label\">Email</span>\n <input class=\"og-input\" type=\"email\" placeholder=\"you@example.com\" />\n <span class=\"og-hint\">We never share it.</span>\n</label>"
20
+ },
21
+ {
22
+ "label": "Invalid and multiline",
23
+ "html": "<label class=\"og-field\" style=\"max-width: 20rem\">\n <span class=\"og-label\">Company</span>\n <input class=\"og-input\" aria-invalid=\"true\" aria-describedby=\"input-err\" value=\"?\" />\n <span class=\"og-hint\" id=\"input-err\">Enter your company name.</span>\n</label>\n<label class=\"og-field\" style=\"max-width: 20rem\">\n <span class=\"og-label\">Notes</span>\n <textarea class=\"og-input og-input--multiline\" placeholder=\"Anything we should know?\"></textarea>\n</label>"
24
+ }
25
+ ],
26
+ "react": "import { Input } from '@og-ui/react';\n\n<Input label=\"Email\" type=\"email\" hint=\"We never share it.\" />\n<Input label=\"Company\" invalid aria-describedby=\"company-err\" />",
27
+ "keyboard": [
28
+ "Native input: Tab to focus, typing as usual."
29
+ ],
30
+ "notes": [
31
+ "Link the error text with aria-describedby so screen readers read it with the field."
32
+ ]
33
+ },
34
+ "registryDependencies": [
35
+ "https://ui.ogom.in/r/og-ui.json"
36
+ ],
37
+ "files": [
38
+ {
39
+ "path": "og-ui/components/input.css",
40
+ "type": "registry:file",
41
+ "target": "og-ui/components/input.css",
42
+ "content": "/*! OG UI input | MIT | https://ui.ogom.in */\n.og-input {\n background: var(--og-surface-inset-fill);\n border: var(--og-border-width) solid var(--og-surface-inset-border);\n box-shadow: var(--og-surface-inset-shadow);\n -webkit-backdrop-filter: var(--og-surface-inset-filter);\n backdrop-filter: var(--og-surface-inset-filter);\n transition-property: transform, background-color, border-color, color, box-shadow;\n transition-duration: var(--og-motion-duration);\n transition-timing-function: var(--og-easing);\n display: block;\n width: 100%;\n height: var(--og-control-h-md);\n padding: 0 calc(var(--og-control-px) * 0.875);\n border-radius: var(--og-radius-control);\n color: var(--og-color-text);\n font: inherit;\n font-family: var(--og-font);\n font-size: 0.875rem;\n line-height: 1.4;\n appearance: none;\n}\n.og-input:disabled, .og-input[aria-disabled=true] {\n opacity: 0.5;\n cursor: not-allowed;\n transform: none;\n pointer-events: none;\n}\n.og-input::placeholder {\n color: var(--og-color-text-muted);\n opacity: 1;\n}\n.og-input:focus-visible {\n outline: 2px solid var(--og-color-focus-ring);\n outline-offset: 2px;\n}\n.og-input[aria-invalid=true] {\n border-color: var(--og-color-danger);\n outline-color: var(--og-color-danger);\n}\n.og-input--multiline {\n height: auto;\n min-height: 6rem;\n padding: 0.625rem calc(var(--og-control-px) * 0.875);\n border-radius: var(--og-radius-md);\n resize: vertical;\n}\n\n.og-field {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n}\n\n.og-label {\n color: var(--og-color-text);\n font-size: 0.8125rem;\n font-weight: var(--og-font-weight-strong);\n}\n\n.og-hint {\n color: var(--og-color-text-muted);\n font-size: 0.75rem;\n}\n[aria-invalid=true] ~ .og-hint {\n color: var(--og-color-danger);\n}\n"
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "menu-react",
4
+ "type": "registry:component",
5
+ "title": "menu (React)",
6
+ "description": "React component(s) from @og-ui/react's overlays.tsx, copied into your project.",
7
+ "dependencies": [
8
+ "@og-ui/core"
9
+ ],
10
+ "registryDependencies": [
11
+ "https://ui.ogom.in/r/menu.json"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "components/og/overlays.tsx",
16
+ "type": "registry:file",
17
+ "target": "components/og/overlays.tsx",
18
+ "content": "import {\n cloneElement,\n forwardRef,\n useEffect,\n useId,\n useRef,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { cx, useOgUI } from './util.js';\n\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]) {\n return (el: T | null) => {\n for (const ref of refs) {\n if (typeof ref === 'function') ref(el);\n else if (ref) (ref as { current: T | null }).current = el;\n }\n };\n}\n\n// ---------------------------------------------------------------------------\n// Dialog and drawer\n\nexport interface DialogProps extends Omit<ComponentPropsWithoutRef<'dialog'>, 'title' | 'open'> {\n open: boolean;\n /** Called with false when Esc, the close button, a [data-og-close] button or the backdrop closes it. */\n onOpenChange?: (open: boolean) => void;\n title: ReactNode;\n description?: ReactNode;\n footer?: ReactNode;\n /** Render as a drawer from the right, or from the left / bottom. */\n drawer?: boolean | 'left' | 'bottom';\n /** aria-label for the close button. */\n closeLabel?: string;\n}\n\n/**\n * A modal <dialog>: the browser traps focus, handles Esc and returns focus to the trigger.\n * Buttons inside with data-og-close close it; data-og-close=\"value\" sets returnValue.\n */\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(function Dialog(\n { open, onOpenChange, title, description, footer, drawer, closeLabel = 'Close', className, children, onClose, ...props },\n ref,\n) {\n useOgUI();\n const inner = useRef<HTMLDialogElement>(null);\n const titleId = useId();\n const descId = useId();\n\n useEffect(() => {\n const el = inner.current;\n if (!el || el.open === open) return;\n if (open) el.showModal();\n else el.close();\n }, [open]);\n\n return (\n <dialog\n ref={mergeRefs(ref, inner)}\n aria-labelledby={titleId}\n aria-describedby={description ? descId : undefined}\n className={cx(\n 'og-dialog',\n drawer && 'og-drawer',\n typeof drawer === 'string' && `og-drawer--${drawer}`,\n className,\n )}\n onClose={(e) => {\n onClose?.(e);\n onOpenChange?.(false);\n }}\n {...props}\n >\n <header className=\"og-dialog__header\">\n <div>\n <h2 className=\"og-dialog__title\" id={titleId}>\n {title}\n </h2>\n {description && (\n <p className=\"og-dialog__description\" id={descId}>\n {description}\n </p>\n )}\n </div>\n <button type=\"button\" className=\"og-dialog__close\" data-og-close=\"\" aria-label={closeLabel} />\n </header>\n <div className=\"og-dialog__body\">{children}</div>\n {footer && <footer className=\"og-dialog__footer\">{footer}</footer>}\n </dialog>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Popover and menu (native popover API: light dismiss, Esc, top layer, focus return)\n\ntype Trigger = ReactElement<{ popoverTarget?: string; 'aria-haspopup'?: 'menu' }>;\n\nexport interface PopoverProps extends ComponentPropsWithoutRef<'div'> {\n /** The button that opens it, e.g. <Button>Share</Button>. */\n trigger: Trigger;\n}\n\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(function Popover(\n { trigger, className, id, ...props },\n ref,\n) {\n useOgUI();\n const autoId = useId();\n const popId = id ?? autoId;\n return (\n <>\n {cloneElement(trigger, { popoverTarget: popId })}\n <div ref={ref} popover=\"auto\" id={popId} className={cx('og-popover', className)} {...props} />\n </>\n );\n});\n\nexport interface MenuProps extends ComponentPropsWithoutRef<'div'> {\n trigger: Trigger;\n /** Accessible name of the menu, e.g. \"Project actions\". */\n label: string;\n}\n\n/** og-ui.js focuses the first item and adds arrow keys, Home/End and close-on-choice. */\nexport const Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu(\n { trigger, label, className, id, ...props },\n ref,\n) {\n useOgUI();\n const autoId = useId();\n const menuId = id ?? autoId;\n return (\n <>\n {cloneElement(trigger, { popoverTarget: menuId, 'aria-haspopup': 'menu' })}\n <div\n ref={ref}\n popover=\"auto\"\n id={menuId}\n role=\"menu\"\n aria-label={label}\n className={cx('og-popover og-menu', className)}\n {...props}\n />\n </>\n );\n});\n\nexport interface MenuItemProps extends ComponentPropsWithoutRef<'button'> {\n danger?: boolean;\n}\n\nexport const MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(function MenuItem(\n { danger, className, type = 'button', ...props },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type}\n role=\"menuitem\"\n className={cx('og-menu__item', danger && 'og-menu__item--danger', className)}\n {...props}\n />\n );\n});\n\nexport const MenuSeparator = () => <hr className=\"og-menu__separator\" />;\n"
19
+ },
20
+ {
21
+ "path": "components/og/util.ts",
22
+ "type": "registry:file",
23
+ "target": "components/og/util.ts",
24
+ "content": "import { useEffect } from 'react';\nimport { initOgUI } from '@og-ui/core/og-ui.js';\n\n/** Join class names, skipping falsy ones. */\nexport const cx = (...parts: (string | false | null | undefined)[]) => parts.filter(Boolean).join(' ');\n\n/**\n * Start og-ui.js (keyboard for menus and tabs, slider fill, popover placement, toasts).\n * Safe to call from every component: it only wires the document once, and only in the browser.\n */\nexport function useOgUI() {\n useEffect(() => initOgUI(), []);\n}\n\n/** Pages to show, with gaps: 1 … 4 5 [6] 7 8 … 20 */\nexport function pageList(page: number, count: number, siblings = 1): (number | 'gap')[] {\n const out: (number | 'gap')[] = [1];\n const from = Math.max(2, page - siblings);\n const to = Math.min(count - 1, page + siblings);\n if (from > 2) out.push('gap');\n for (let p = from; p <= to; p++) out.push(p);\n if (to < count - 1) out.push('gap');\n if (count > 1) out.push(count);\n return out;\n}\n"
25
+ },
26
+ {
27
+ "path": "components/og/og-ui.d.ts",
28
+ "type": "registry:file",
29
+ "target": "components/og/og-ui.d.ts",
30
+ "content": "declare module '@og-ui/core/og-ui.js' {\n export function initOgUI(root?: Document | Element): void;\n export function ogToast(\n title: string,\n options?: {\n description?: string;\n variant?: 'success' | 'warning' | 'danger' | 'accent';\n duration?: number;\n },\n ): () => void;\n}\n"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "menu",
4
+ "type": "registry:component",
5
+ "title": "menu",
6
+ "description": "Alias: menu is styled by popover.",
7
+ "registryDependencies": [
8
+ "https://ui.ogom.in/r/popover.json"
9
+ ],
10
+ "files": []
11
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "og-ui",
4
+ "type": "registry:style",
5
+ "title": "OG UI base",
6
+ "description": "Default theme (clean) on :root, density and motion variables, and page styles.",
7
+ "files": [
8
+ {
9
+ "path": "og-ui/theme.css",
10
+ "type": "registry:file",
11
+ "target": "og-ui/theme.css",
12
+ "content": "/*! OG UI tokens: Clean SaaS. Generated from packages/tokens/src. Do not edit by hand. */\n\n/* Clean SaaS: Crisp and quiet: hairline borders, soft shadows, lots of white space. */\n:root, [data-og-theme=\"clean\"] {\n --og-radius-sm: 6px;\n --og-radius-md: 8px;\n --og-radius-lg: 12px;\n --og-radius-full: 9999px;\n --og-radius-control: 8px;\n --og-border-width: 1px;\n --og-font: Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --og-font-display: Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --og-font-mono: \"Geist Mono\", \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n --og-font-weight-strong: 500;\n --og-tint-strength: 14%;\n --og-press: translateY(1px);\n --og-hover: none;\n --og-duration: 150ms;\n --og-easing: cubic-bezier(0.2, 0, 0, 1);\n --og-color-bg: #fafafa;\n --og-color-bg-image: none;\n --og-color-bg-size: auto;\n --og-color-text: #0a0a0b;\n --og-color-on-tint: #0a0a0b;\n --og-color-text-muted: #62626d;\n --og-color-border: #e4e4e7;\n --og-color-accent: var(--og-accent, #4f46e5);\n --og-color-accent-contrast: var(--og-accent-contrast, #ffffff);\n --og-color-accent-border: transparent;\n --og-color-focus-ring: var(--og-accent, #4f46e5);\n --og-color-success: #15803d;\n --og-color-warning: #b45309;\n --og-color-danger: #b91c1c;\n --og-palette-1: #2563eb;\n --og-palette-2: #db2777;\n --og-palette-3: #059669;\n --og-palette-4: #d97706;\n --og-palette-5: #7c3aed;\n --og-palette-6: #0891b2;\n --og-effect-glow: 0 0 0 transparent;\n --og-surface-raised-bg: #ffffff;\n --og-surface-raised-bg-solid: #ffffff;\n --og-surface-raised-border: #e4e4e7;\n --og-surface-raised-shadow: 0 1px 2px rgba(10, 10, 11, 0.05);\n --og-surface-raised-backdrop: none;\n --og-surface-raised-highlight: none;\n --og-surface-inset-bg: #ffffff;\n --og-surface-inset-bg-solid: #ffffff;\n --og-surface-inset-border: #d4d4d8;\n --og-surface-inset-shadow: inset 0 1px 1px rgba(10, 10, 11, 0.04);\n --og-surface-inset-backdrop: none;\n --og-surface-inset-highlight: none;\n --og-surface-overlay-bg: #ffffff;\n --og-surface-overlay-bg-solid: #ffffff;\n --og-surface-overlay-border: #e4e4e7;\n --og-surface-overlay-shadow: 0 12px 32px -12px rgba(10, 10, 11, 0.22), 0 2px 6px rgba(10, 10, 11, 0.06);\n --og-surface-overlay-backdrop: none;\n --og-surface-overlay-highlight: none;\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-og-mode=\"light\"]), [data-og-theme=\"clean\"]:not([data-og-mode=\"light\"]) {\n --og-color-bg: #09090b;\n --og-color-bg-image: none;\n --og-color-bg-size: auto;\n --og-color-text: #fafafa;\n --og-color-on-tint: #fafafa;\n --og-color-text-muted: #a1a1aa;\n --og-color-border: #27272a;\n --og-color-accent: var(--og-accent, #818cf8);\n --og-color-accent-contrast: var(--og-accent-contrast, #0b0b1a);\n --og-color-accent-border: transparent;\n --og-color-focus-ring: var(--og-accent, #818cf8);\n --og-color-success: #22c55e;\n --og-color-warning: #f59e0b;\n --og-color-danger: #fc8181;\n --og-palette-1: #60a5fa;\n --og-palette-2: #f472b6;\n --og-palette-3: #34d399;\n --og-palette-4: #fbbf24;\n --og-palette-5: #a78bfa;\n --og-palette-6: #22d3ee;\n --og-effect-glow: 0 0 0 transparent;\n --og-surface-raised-bg: #18181b;\n --og-surface-raised-bg-solid: #18181b;\n --og-surface-raised-border: #27272a;\n --og-surface-raised-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);\n --og-surface-raised-backdrop: none;\n --og-surface-raised-highlight: none;\n --og-surface-inset-bg: #0f0f11;\n --og-surface-inset-bg-solid: #0f0f11;\n --og-surface-inset-border: #3f3f46;\n --og-surface-inset-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);\n --og-surface-inset-backdrop: none;\n --og-surface-inset-highlight: none;\n --og-surface-overlay-bg: #18181b;\n --og-surface-overlay-bg-solid: #18181b;\n --og-surface-overlay-border: #3f3f46;\n --og-surface-overlay-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.75);\n --og-surface-overlay-backdrop: none;\n --og-surface-overlay-highlight: none;\n }\n}\n\n:root[data-og-mode=\"dark\"], [data-og-theme=\"clean\"][data-og-mode=\"dark\"] {\n --og-color-bg: #09090b;\n --og-color-bg-image: none;\n --og-color-bg-size: auto;\n --og-color-text: #fafafa;\n --og-color-on-tint: #fafafa;\n --og-color-text-muted: #a1a1aa;\n --og-color-border: #27272a;\n --og-color-accent: var(--og-accent, #818cf8);\n --og-color-accent-contrast: var(--og-accent-contrast, #0b0b1a);\n --og-color-accent-border: transparent;\n --og-color-focus-ring: var(--og-accent, #818cf8);\n --og-color-success: #22c55e;\n --og-color-warning: #f59e0b;\n --og-color-danger: #fc8181;\n --og-palette-1: #60a5fa;\n --og-palette-2: #f472b6;\n --og-palette-3: #34d399;\n --og-palette-4: #fbbf24;\n --og-palette-5: #a78bfa;\n --og-palette-6: #22d3ee;\n --og-effect-glow: 0 0 0 transparent;\n --og-surface-raised-bg: #18181b;\n --og-surface-raised-bg-solid: #18181b;\n --og-surface-raised-border: #27272a;\n --og-surface-raised-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);\n --og-surface-raised-backdrop: none;\n --og-surface-raised-highlight: none;\n --og-surface-inset-bg: #0f0f11;\n --og-surface-inset-bg-solid: #0f0f11;\n --og-surface-inset-border: #3f3f46;\n --og-surface-inset-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);\n --og-surface-inset-backdrop: none;\n --og-surface-inset-highlight: none;\n --og-surface-overlay-bg: #18181b;\n --og-surface-overlay-bg-solid: #18181b;\n --og-surface-overlay-border: #3f3f46;\n --og-surface-overlay-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.75);\n --og-surface-overlay-backdrop: none;\n --og-surface-overlay-highlight: none;\n}\n\n/* Density: data-og-density=\"compact\" | \"comfortable\" (default) on any element. */\n:root, [data-og-density=\"comfortable\"] {\n --og-control-h-sm: 2rem;\n --og-control-h-md: 2.5rem;\n --og-control-h-lg: 3rem;\n --og-control-px: 1rem;\n --og-card-pad: 1.25rem;\n --og-gap: 1rem;\n}\n\n[data-og-density=\"compact\"] {\n --og-control-h-sm: 1.75rem;\n --og-control-h-md: 2.125rem;\n --og-control-h-lg: 2.5rem;\n --og-control-px: 0.75rem;\n --og-card-pad: 0.875rem;\n --og-gap: 0.625rem;\n}\n\n/* Derived values: components read these, never the raw tokens above. */\n:root, [data-og-theme] {\n --og-surface-raised-fill: var(--og-surface-raised-bg);\n --og-surface-raised-filter: var(--og-surface-raised-backdrop);\n --og-surface-inset-fill: var(--og-surface-inset-bg);\n --og-surface-inset-filter: var(--og-surface-inset-backdrop);\n --og-surface-overlay-fill: var(--og-surface-overlay-bg);\n --og-surface-overlay-filter: var(--og-surface-overlay-backdrop);\n --og-motion-hover: var(--og-hover);\n --og-motion-press: var(--og-press);\n --og-motion-duration: var(--og-duration);\n}\n\n@media (prefers-reduced-transparency: reduce) {\n :root, [data-og-theme] {\n --og-surface-raised-fill: var(--og-surface-raised-bg-solid);\n --og-surface-raised-filter: none;\n --og-surface-inset-fill: var(--og-surface-inset-bg-solid);\n --og-surface-inset-filter: none;\n --og-surface-overlay-fill: var(--og-surface-overlay-bg-solid);\n --og-surface-overlay-filter: none;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n :root, [data-og-theme] {\n --og-motion-hover: none;\n --og-motion-press: none;\n --og-motion-duration: 0.01ms;\n }\n}\n"
13
+ },
14
+ {
15
+ "path": "og-ui/base.css",
16
+ "type": "registry:file",
17
+ "target": "og-ui/base.css",
18
+ "content": "/*! OG UI base | MIT | https://ui.ogom.in */\n:root,\n[data-og-theme] {\n background-color: var(--og-color-bg);\n background-image: var(--og-color-bg-image);\n background-size: var(--og-color-bg-size);\n color: var(--og-color-text);\n font-family: var(--og-font);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[data-og-mode=dark] {\n color-scheme: dark;\n}\n\n[data-og-mode=light] {\n color-scheme: light;\n}\n\n:root {\n min-height: 100%;\n}\n\n[data-og-switching] *,\n[data-og-switching] *::before,\n[data-og-switching] *::after {\n transition: none !important;\n}\n\n[class^=og-],\n[class*=\" og-\"],\n[class^=og-]::before,\n[class*=\" og-\"]::before {\n box-sizing: border-box;\n}\n\n[data-og-backdrop=none] {\n background-image: none;\n}\n\n[data-og-backdrop=grid] {\n --_line: color-mix(in oklab, var(--og-color-text) 7%, transparent);\n background-image: linear-gradient(var(--_line) 1px, transparent 1px), linear-gradient(90deg, var(--_line) 1px, transparent 1px);\n background-size: 24px 24px;\n}\n\n[data-og-backdrop=dots] {\n background-image: radial-gradient(color-mix(in oklab, var(--og-color-text) 16%, transparent) 1px, transparent 1.5px);\n background-size: 18px 18px;\n}\n\n:root[data-og-backdrop=grain]::before {\n content: \"\";\n position: fixed;\n inset: 0;\n z-index: 2147483000;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .28 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\");\n background-size: 160px 160px;\n opacity: 0.55;\n pointer-events: none;\n}\n\n[data-og-backdrop=photo] {\n background-image: linear-gradient(color-mix(in oklab, var(--og-color-bg) 30%, transparent), color-mix(in oklab, var(--og-color-bg) 55%, transparent)), var(--og-backdrop-photo, none);\n background-size: cover;\n background-position: center;\n background-attachment: fixed;\n}\n\n:root[data-og-mode=dark][data-og-backdrop=grain]::before {\n filter: invert(1);\n opacity: 0.3;\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-og-mode=light])[data-og-backdrop=grain]::before {\n filter: invert(1);\n opacity: 0.3;\n }\n}"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "pagination-react",
4
+ "type": "registry:component",
5
+ "title": "pagination (React)",
6
+ "description": "React component(s) from @og-ui/react's navigation.tsx, copied into your project.",
7
+ "dependencies": [
8
+ "@og-ui/core"
9
+ ],
10
+ "registryDependencies": [
11
+ "https://ui.ogom.in/r/pagination.json"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "components/og/navigation.tsx",
16
+ "type": "registry:file",
17
+ "target": "components/og/navigation.tsx",
18
+ "content": "import {\n createContext,\n forwardRef,\n Fragment,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\nimport { cx, pageList, useOgUI } from './util.js';\n\n// ---------------------------------------------------------------------------\n// Tabs\n\nexport interface TabItem {\n value: string;\n label: ReactNode;\n content: ReactNode;\n disabled?: boolean;\n}\n\nexport interface TabsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'onChange'> {\n /** Accessible name of the tab list. */\n label: string;\n items: TabItem[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n}\n\n/**\n * WAI-ARIA tabs with automatic activation. og-ui.js handles clicks and arrow keys/Home/End\n * and reports the change, so React state follows the DOM rather than fighting it.\n */\nexport function Tabs({ label, items, value, defaultValue, onValueChange, className, ...props }: TabsProps) {\n useOgUI();\n const root = useRef<HTMLDivElement>(null);\n const base = useId();\n const [internal, setInternal] = useState(defaultValue ?? items[0]?.value);\n const current = value ?? internal;\n const change = useRef(onValueChange);\n change.current = onValueChange;\n\n useEffect(() => {\n const el = root.current;\n const onChange = (e: Event) => {\n const next = (e as CustomEvent<{ tab: HTMLElement }>).detail.tab.dataset.value;\n if (next === undefined) return;\n setInternal(next);\n change.current?.(next);\n };\n el?.addEventListener('og-tab-change', onChange);\n return () => el?.removeEventListener('og-tab-change', onChange);\n }, []);\n\n return (\n <div ref={root} className={cx('og-tabs', className)} data-og-tabs=\"\" {...props}>\n <div className=\"og-tabs__list\" role=\"tablist\" aria-label={label}>\n {items.map((item, i) => {\n const selected = item.value === current;\n return (\n <button\n key={item.value}\n type=\"button\"\n role=\"tab\"\n id={`${base}-t${i}`}\n aria-controls={`${base}-p${i}`}\n aria-selected={selected}\n tabIndex={selected ? 0 : -1}\n disabled={item.disabled}\n data-value={item.value}\n className=\"og-tabs__tab\"\n >\n {item.label}\n </button>\n );\n })}\n </div>\n {items.map((item, i) => (\n <div\n key={item.value}\n role=\"tabpanel\"\n id={`${base}-p${i}`}\n aria-labelledby={`${base}-t${i}`}\n tabIndex={0}\n hidden={item.value !== current}\n className=\"og-tabs__panel\"\n >\n {item.content}\n </div>\n ))}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Accordion (native <details>: keyboard and screen readers work without JS)\n\nconst GroupName = createContext<string | undefined>(undefined);\n\nexport interface AccordionProps extends ComponentPropsWithoutRef<'div'> {\n /** Only one item open at a time (shared <details name>). */\n single?: boolean;\n}\n\nexport const Accordion = forwardRef<HTMLDivElement, AccordionProps>(function Accordion(\n { single, className, ...props },\n ref,\n) {\n const name = useId();\n return (\n <GroupName.Provider value={single ? name : undefined}>\n <div ref={ref} className={cx('og-accordion', className)} {...props} />\n </GroupName.Provider>\n );\n});\n\nexport interface AccordionItemProps extends Omit<ComponentPropsWithoutRef<'details'>, 'title'> {\n title: ReactNode;\n}\n\nexport const AccordionItem = forwardRef<HTMLDetailsElement, AccordionItemProps>(function AccordionItem(\n { title, children, ...props },\n ref,\n) {\n const name = useContext(GroupName);\n return (\n <details ref={ref} name={name} {...props}>\n <summary>{title}</summary>\n <div className=\"og-accordion__content\">{children}</div>\n </details>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Pagination\n\nexport interface PaginationProps extends Omit<ComponentPropsWithoutRef<'nav'>, 'onChange'> {\n page: number;\n pageCount: number;\n /** Render links. Without it, items are buttons that call onPageChange. */\n getHref?: (page: number) => string;\n onPageChange?: (page: number) => void;\n /** Pages shown either side of the current one. */\n siblings?: number;\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n { page, pageCount, getHref, onPageChange, siblings = 1, className, 'aria-label': label = 'Pagination', ...props },\n ref,\n) {\n useOgUI();\n const item = (to: number, content: ReactNode, extra: { label?: string; current?: boolean } = {}) => {\n const disabled = to < 1 || to > pageCount;\n const common = {\n className: 'og-pagination__item',\n 'aria-label': extra.label,\n 'aria-current': extra.current ? ('page' as const) : undefined,\n 'aria-disabled': disabled || undefined,\n };\n return getHref ? (\n // Disabled links keep an href so they stay focusable; og-ui.js stops them activating.\n <a {...common} href={getHref(Math.min(Math.max(to, 1), pageCount))} onClick={() => !disabled && onPageChange?.(to)}>\n {content}\n </a>\n ) : (\n <button {...common} type=\"button\" onClick={() => !disabled && onPageChange?.(to)}>\n {content}\n </button>\n );\n };\n\n return (\n <nav ref={ref} aria-label={label} className={cx('og-pagination', className)} {...props}>\n {item(page - 1, '‹', { label: 'Previous page' })}\n {pageList(page, pageCount, siblings).map((p, i) =>\n p === 'gap' ? (\n <span key={`gap${i}`} className=\"og-pagination__gap\" aria-hidden=\"true\">\n …\n </span>\n ) : (\n <Fragment key={p}>{item(p, p, { current: p === page })}</Fragment>\n ),\n )}\n {item(page + 1, '›', { label: 'Next page' })}\n </nav>\n );\n});\n"
19
+ },
20
+ {
21
+ "path": "components/og/util.ts",
22
+ "type": "registry:file",
23
+ "target": "components/og/util.ts",
24
+ "content": "import { useEffect } from 'react';\nimport { initOgUI } from '@og-ui/core/og-ui.js';\n\n/** Join class names, skipping falsy ones. */\nexport const cx = (...parts: (string | false | null | undefined)[]) => parts.filter(Boolean).join(' ');\n\n/**\n * Start og-ui.js (keyboard for menus and tabs, slider fill, popover placement, toasts).\n * Safe to call from every component: it only wires the document once, and only in the browser.\n */\nexport function useOgUI() {\n useEffect(() => initOgUI(), []);\n}\n\n/** Pages to show, with gaps: 1 … 4 5 [6] 7 8 … 20 */\nexport function pageList(page: number, count: number, siblings = 1): (number | 'gap')[] {\n const out: (number | 'gap')[] = [1];\n const from = Math.max(2, page - siblings);\n const to = Math.min(count - 1, page + siblings);\n if (from > 2) out.push('gap');\n for (let p = from; p <= to; p++) out.push(p);\n if (to < count - 1) out.push('gap');\n if (count > 1) out.push(count);\n return out;\n}\n"
25
+ },
26
+ {
27
+ "path": "components/og/og-ui.d.ts",
28
+ "type": "registry:file",
29
+ "target": "components/og/og-ui.d.ts",
30
+ "content": "declare module '@og-ui/core/og-ui.js' {\n export function initOgUI(root?: Document | Element): void;\n export function ogToast(\n title: string,\n options?: {\n description?: string;\n variant?: 'success' | 'warning' | 'danger' | 'accent';\n duration?: number;\n },\n ): () => void;\n}\n"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "pagination",
4
+ "type": "registry:component",
5
+ "title": "Pagination",
6
+ "description": "Page links in a labelled nav with the current page marked.",
7
+ "meta": {
8
+ "classes": [
9
+ "og-pagination",
10
+ "og-pagination__item",
11
+ "og-pagination__gap"
12
+ ],
13
+ "group": "Navigation & data",
14
+ "markup": [
15
+ {
16
+ "label": "Pagination",
17
+ "html": "<nav class=\"og-pagination\" aria-label=\"Pagination\">\n <a class=\"og-pagination__item\" href=\"#\" aria-label=\"Previous page\" aria-disabled=\"true\">‹</a>\n <a class=\"og-pagination__item\" href=\"#\" aria-current=\"page\">1</a>\n <a class=\"og-pagination__item\" href=\"#\">2</a>\n <a class=\"og-pagination__item\" href=\"#\">3</a>\n <span class=\"og-pagination__gap\" aria-hidden=\"true\">…</span>\n <a class=\"og-pagination__item\" href=\"#\">12</a>\n <a class=\"og-pagination__item\" href=\"#\" aria-label=\"Next page\">›</a>\n</nav>"
18
+ }
19
+ ],
20
+ "react": "import { Pagination } from '@og-ui/react';\n\n<Pagination page={page} pageCount={12} onPageChange={setPage} />\n// or links: getHref={(p) => `?page=${p}`}",
21
+ "keyboard": [
22
+ "Tab moves through the links; Enter follows one. A disabled link stays focusable but does nothing."
23
+ ],
24
+ "notes": []
25
+ },
26
+ "registryDependencies": [
27
+ "https://ui.ogom.in/r/og-ui.json"
28
+ ],
29
+ "files": [
30
+ {
31
+ "path": "og-ui/components/pagination.css",
32
+ "type": "registry:file",
33
+ "target": "og-ui/components/pagination.css",
34
+ "content": "/*! OG UI pagination | MIT | https://ui.ogom.in */\n.og-pagination {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.25rem;\n font-family: var(--og-font);\n}\n.og-pagination__item {\n transition-property: transform, background-color, border-color, color, box-shadow;\n transition-duration: var(--og-motion-duration);\n transition-timing-function: var(--og-easing);\n display: inline-grid;\n place-items: center;\n min-width: var(--og-control-h-sm);\n height: var(--og-control-h-sm);\n padding: 0 0.5rem;\n border: var(--og-border-width) solid transparent;\n border-radius: var(--og-radius-control);\n background: transparent;\n color: var(--og-color-text-muted);\n font: inherit;\n font-size: 0.875rem;\n font-variant-numeric: tabular-nums;\n text-decoration: none;\n cursor: pointer;\n}\n.og-pagination__item:focus-visible {\n outline: 2px solid var(--og-color-focus-ring);\n outline-offset: 2px;\n}\n.og-pagination__item:hover {\n background: color-mix(in oklab, var(--og-color-text) 8%, transparent);\n color: var(--og-color-text);\n}\n.og-pagination__item[aria-current=page] {\n background: var(--og-surface-raised-fill);\n border: var(--og-border-width) solid var(--og-surface-raised-border);\n box-shadow: var(--og-surface-raised-shadow);\n -webkit-backdrop-filter: var(--og-surface-raised-filter);\n backdrop-filter: var(--og-surface-raised-filter);\n color: var(--og-color-text);\n font-weight: var(--og-font-weight-strong);\n}\n.og-pagination__item[aria-disabled=true] {\n opacity: 0.4;\n pointer-events: none;\n}\n.og-pagination__gap {\n padding: 0 0.25rem;\n color: var(--og-color-text-muted);\n}\n"
35
+ }
36
+ ]
37
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "popover-react",
4
+ "type": "registry:component",
5
+ "title": "popover (React)",
6
+ "description": "React component(s) from @og-ui/react's overlays.tsx, copied into your project.",
7
+ "dependencies": [
8
+ "@og-ui/core"
9
+ ],
10
+ "registryDependencies": [
11
+ "https://ui.ogom.in/r/popover.json"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "components/og/overlays.tsx",
16
+ "type": "registry:file",
17
+ "target": "components/og/overlays.tsx",
18
+ "content": "import {\n cloneElement,\n forwardRef,\n useEffect,\n useId,\n useRef,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { cx, useOgUI } from './util.js';\n\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]) {\n return (el: T | null) => {\n for (const ref of refs) {\n if (typeof ref === 'function') ref(el);\n else if (ref) (ref as { current: T | null }).current = el;\n }\n };\n}\n\n// ---------------------------------------------------------------------------\n// Dialog and drawer\n\nexport interface DialogProps extends Omit<ComponentPropsWithoutRef<'dialog'>, 'title' | 'open'> {\n open: boolean;\n /** Called with false when Esc, the close button, a [data-og-close] button or the backdrop closes it. */\n onOpenChange?: (open: boolean) => void;\n title: ReactNode;\n description?: ReactNode;\n footer?: ReactNode;\n /** Render as a drawer from the right, or from the left / bottom. */\n drawer?: boolean | 'left' | 'bottom';\n /** aria-label for the close button. */\n closeLabel?: string;\n}\n\n/**\n * A modal <dialog>: the browser traps focus, handles Esc and returns focus to the trigger.\n * Buttons inside with data-og-close close it; data-og-close=\"value\" sets returnValue.\n */\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(function Dialog(\n { open, onOpenChange, title, description, footer, drawer, closeLabel = 'Close', className, children, onClose, ...props },\n ref,\n) {\n useOgUI();\n const inner = useRef<HTMLDialogElement>(null);\n const titleId = useId();\n const descId = useId();\n\n useEffect(() => {\n const el = inner.current;\n if (!el || el.open === open) return;\n if (open) el.showModal();\n else el.close();\n }, [open]);\n\n return (\n <dialog\n ref={mergeRefs(ref, inner)}\n aria-labelledby={titleId}\n aria-describedby={description ? descId : undefined}\n className={cx(\n 'og-dialog',\n drawer && 'og-drawer',\n typeof drawer === 'string' && `og-drawer--${drawer}`,\n className,\n )}\n onClose={(e) => {\n onClose?.(e);\n onOpenChange?.(false);\n }}\n {...props}\n >\n <header className=\"og-dialog__header\">\n <div>\n <h2 className=\"og-dialog__title\" id={titleId}>\n {title}\n </h2>\n {description && (\n <p className=\"og-dialog__description\" id={descId}>\n {description}\n </p>\n )}\n </div>\n <button type=\"button\" className=\"og-dialog__close\" data-og-close=\"\" aria-label={closeLabel} />\n </header>\n <div className=\"og-dialog__body\">{children}</div>\n {footer && <footer className=\"og-dialog__footer\">{footer}</footer>}\n </dialog>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Popover and menu (native popover API: light dismiss, Esc, top layer, focus return)\n\ntype Trigger = ReactElement<{ popoverTarget?: string; 'aria-haspopup'?: 'menu' }>;\n\nexport interface PopoverProps extends ComponentPropsWithoutRef<'div'> {\n /** The button that opens it, e.g. <Button>Share</Button>. */\n trigger: Trigger;\n}\n\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(function Popover(\n { trigger, className, id, ...props },\n ref,\n) {\n useOgUI();\n const autoId = useId();\n const popId = id ?? autoId;\n return (\n <>\n {cloneElement(trigger, { popoverTarget: popId })}\n <div ref={ref} popover=\"auto\" id={popId} className={cx('og-popover', className)} {...props} />\n </>\n );\n});\n\nexport interface MenuProps extends ComponentPropsWithoutRef<'div'> {\n trigger: Trigger;\n /** Accessible name of the menu, e.g. \"Project actions\". */\n label: string;\n}\n\n/** og-ui.js focuses the first item and adds arrow keys, Home/End and close-on-choice. */\nexport const Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu(\n { trigger, label, className, id, ...props },\n ref,\n) {\n useOgUI();\n const autoId = useId();\n const menuId = id ?? autoId;\n return (\n <>\n {cloneElement(trigger, { popoverTarget: menuId, 'aria-haspopup': 'menu' })}\n <div\n ref={ref}\n popover=\"auto\"\n id={menuId}\n role=\"menu\"\n aria-label={label}\n className={cx('og-popover og-menu', className)}\n {...props}\n />\n </>\n );\n});\n\nexport interface MenuItemProps extends ComponentPropsWithoutRef<'button'> {\n danger?: boolean;\n}\n\nexport const MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(function MenuItem(\n { danger, className, type = 'button', ...props },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type}\n role=\"menuitem\"\n className={cx('og-menu__item', danger && 'og-menu__item--danger', className)}\n {...props}\n />\n );\n});\n\nexport const MenuSeparator = () => <hr className=\"og-menu__separator\" />;\n"
19
+ },
20
+ {
21
+ "path": "components/og/util.ts",
22
+ "type": "registry:file",
23
+ "target": "components/og/util.ts",
24
+ "content": "import { useEffect } from 'react';\nimport { initOgUI } from '@og-ui/core/og-ui.js';\n\n/** Join class names, skipping falsy ones. */\nexport const cx = (...parts: (string | false | null | undefined)[]) => parts.filter(Boolean).join(' ');\n\n/**\n * Start og-ui.js (keyboard for menus and tabs, slider fill, popover placement, toasts).\n * Safe to call from every component: it only wires the document once, and only in the browser.\n */\nexport function useOgUI() {\n useEffect(() => initOgUI(), []);\n}\n\n/** Pages to show, with gaps: 1 … 4 5 [6] 7 8 … 20 */\nexport function pageList(page: number, count: number, siblings = 1): (number | 'gap')[] {\n const out: (number | 'gap')[] = [1];\n const from = Math.max(2, page - siblings);\n const to = Math.min(count - 1, page + siblings);\n if (from > 2) out.push('gap');\n for (let p = from; p <= to; p++) out.push(p);\n if (to < count - 1) out.push('gap');\n if (count > 1) out.push(count);\n return out;\n}\n"
25
+ },
26
+ {
27
+ "path": "components/og/og-ui.d.ts",
28
+ "type": "registry:file",
29
+ "target": "components/og/og-ui.d.ts",
30
+ "content": "declare module '@og-ui/core/og-ui.js' {\n export function initOgUI(root?: Document | Element): void;\n export function ogToast(\n title: string,\n options?: {\n description?: string;\n variant?: 'success' | 'warning' | 'danger' | 'accent';\n duration?: number;\n },\n ): () => void;\n}\n"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "popover",
4
+ "type": "registry:component",
5
+ "title": "Popover and menu",
6
+ "description": "Native popover API (light dismiss, Esc, top layer), placed next to its trigger. A menu is a popover with role=\"menu\".",
7
+ "meta": {
8
+ "classes": [
9
+ "og-popover",
10
+ "og-menu",
11
+ "og-menu__item",
12
+ "og-menu__item--danger",
13
+ "og-menu__separator"
14
+ ],
15
+ "group": "Overlays",
16
+ "markup": [
17
+ {
18
+ "label": "Popover",
19
+ "html": "<button class=\"og-button\" popovertarget=\"popover\">Share</button>\n<div popover id=\"popover\" class=\"og-popover\">\n <strong>Share this project</strong>\n <p>Anyone with the link can view it.</p>\n</div>"
20
+ },
21
+ {
22
+ "label": "Menu",
23
+ "html": "<button class=\"og-button\" popovertarget=\"popover\" aria-haspopup=\"menu\">Actions ▾</button>\n<div popover id=\"popover\" class=\"og-popover og-menu\" role=\"menu\" aria-label=\"Project actions\">\n <button class=\"og-menu__item\" role=\"menuitem\">Rename</button>\n <button class=\"og-menu__item\" role=\"menuitem\">Duplicate</button>\n <hr class=\"og-menu__separator\" />\n <button class=\"og-menu__item og-menu__item--danger\" role=\"menuitem\">Delete</button>\n</div>"
24
+ }
25
+ ],
26
+ "react": "import { Popover, Menu, MenuItem, MenuSeparator, Button } from '@og-ui/react';\n\n<Popover trigger={<Button>Share</Button>}>Anyone with the link can view it.</Popover>\n\n<Menu trigger={<Button>Actions ▾</Button>} label=\"Project actions\">\n <MenuItem onClick={rename}>Rename</MenuItem>\n <MenuSeparator />\n <MenuItem danger onClick={remove}>Delete</MenuItem>\n</Menu>",
27
+ "keyboard": [
28
+ "Enter or Space on the trigger opens it; a menu focuses its first item.",
29
+ "Menu: Down/Up move (and wrap), Home/End jump to the first/last item.",
30
+ "Esc closes and returns focus to the trigger; choosing an item does too.",
31
+ "Tab closes a menu and moves on."
32
+ ],
33
+ "notes": []
34
+ },
35
+ "registryDependencies": [
36
+ "https://ui.ogom.in/r/og-ui.json"
37
+ ],
38
+ "files": [
39
+ {
40
+ "path": "og-ui/components/popover.css",
41
+ "type": "registry:file",
42
+ "target": "og-ui/components/popover.css",
43
+ "content": "/*! OG UI popover | MIT | https://ui.ogom.in */\n.og-popover {\n background: var(--og-surface-overlay-fill);\n border: var(--og-border-width) solid var(--og-surface-overlay-border);\n box-shadow: var(--og-surface-overlay-shadow);\n -webkit-backdrop-filter: var(--og-surface-overlay-filter);\n backdrop-filter: var(--og-surface-overlay-filter);\n position: fixed;\n inset: auto;\n min-width: 12rem;\n max-width: min(22rem, 100vw - 1rem);\n margin: 0;\n padding: 0.75rem;\n border-radius: var(--og-radius-md);\n color: var(--og-color-text);\n font-family: var(--og-font);\n font-size: 0.875rem;\n transition: opacity var(--og-motion-duration) var(--og-easing), transform var(--og-motion-duration) var(--og-easing), overlay var(--og-motion-duration) allow-discrete, display var(--og-motion-duration) allow-discrete;\n opacity: 0;\n transform: translateY(4px) scale(0.98);\n}\n.og-popover:popover-open, .og-popover[open] {\n opacity: 1;\n transform: none;\n}\n@starting-style {\n .og-popover:popover-open, .og-popover[open] {\n opacity: 0;\n transform: translateY(4px) scale(0.98);\n }\n}\n\n.og-menu {\n display: none;\n min-width: 11rem;\n padding: 0.25rem;\n}\n.og-menu:popover-open {\n display: flex;\n flex-direction: column;\n}\n.og-menu__item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.5rem 0.625rem;\n border: 0;\n border-radius: calc(var(--og-radius-md) * 0.6);\n background: transparent;\n color: var(--og-color-text);\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n.og-menu__item:hover, .og-menu__item:focus-visible {\n background: color-mix(in oklab, var(--og-color-text) 8%, transparent);\n outline: none;\n}\n.og-menu__item:focus-visible {\n box-shadow: inset 0 0 0 2px var(--og-color-focus-ring);\n}\n.og-menu__item--danger {\n color: var(--og-color-danger);\n}\n.og-menu__separator {\n width: 100%;\n margin: 0.25rem 0;\n border: 0;\n border-top: 1px solid color-mix(in oklab, var(--og-color-text) 12%, transparent);\n}\n"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "progress-react",
4
+ "type": "registry:component",
5
+ "title": "progress (React)",
6
+ "description": "React component(s) from @og-ui/react's components.tsx, copied into your project.",
7
+ "dependencies": [
8
+ "@og-ui/core"
9
+ ],
10
+ "registryDependencies": [
11
+ "https://ui.ogom.in/r/progress.json"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "components/og/components.tsx",
16
+ "type": "registry:file",
17
+ "target": "components/og/components.tsx",
18
+ "content": "import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type ReactNode,\n} from 'react';\nimport { cx, useOgUI } from './util.js';\n\ntype Palette = 1 | 2 | 3 | 4 | 5 | 6;\ntype Status = 'accent' | 'success' | 'warning' | 'danger';\n\n// ---------------------------------------------------------------------------\n// Button\n\nexport interface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n variant?: 'primary' | 'ghost' | 'danger';\n size?: 'sm' | 'lg';\n /** Square icon button. Give it an aria-label. */\n icon?: boolean;\n block?: boolean;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { variant, size, icon, block, className, type = 'button', ...props },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type}\n className={cx(\n 'og-button',\n variant && `og-button--${variant}`,\n size && `og-button--${size}`,\n icon && 'og-button--icon',\n block && 'og-button--block',\n className,\n )}\n {...props}\n />\n );\n});\n\n// ---------------------------------------------------------------------------\n// Card\n\nexport interface CardProps extends Omit<ComponentPropsWithoutRef<'article'>, 'title'> {\n title?: ReactNode;\n description?: ReactNode;\n footer?: ReactNode;\n /** Palette tint 1–6. */\n tint?: Palette;\n}\n\nexport const Card = forwardRef<HTMLElement, CardProps>(function Card(\n { title, description, footer, tint, className, children, ...props },\n ref,\n) {\n return (\n <article ref={ref} className={cx('og-card', tint && `og-card--tint-${tint}`, className)} {...props}>\n {(title || description) && (\n <header className=\"og-card__header\">\n {title && <h3 className=\"og-card__title\">{title}</h3>}\n {description && <p className=\"og-card__description\">{description}</p>}\n </header>\n )}\n {children !== undefined && <div className=\"og-card__body\">{children}</div>}\n {footer && <footer className=\"og-card__footer\">{footer}</footer>}\n </article>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Form controls\n\n/** Wraps a control in og-field with a label and hint when they are given. */\nfunction Field({ label, hint, children }: { label?: ReactNode; hint?: ReactNode; children: ReactNode }) {\n if (!label && !hint) return <>{children}</>;\n return (\n <label className=\"og-field\">\n {label && <span className=\"og-label\">{label}</span>}\n {children}\n {hint && <span className=\"og-hint\">{hint}</span>}\n </label>\n );\n}\n\nexport interface InputProps extends ComponentPropsWithoutRef<'input'> {\n label?: ReactNode;\n hint?: ReactNode;\n invalid?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { label, hint, invalid, className, ...props },\n ref,\n) {\n return (\n <Field label={label} hint={hint}>\n <input\n ref={ref}\n className={cx('og-input', className)}\n aria-invalid={invalid || props['aria-invalid']}\n {...props}\n />\n </Field>\n );\n});\n\nexport interface SelectProps extends ComponentPropsWithoutRef<'select'> {\n label?: ReactNode;\n hint?: ReactNode;\n}\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { label, hint, className, ...props },\n ref,\n) {\n return (\n <Field label={label} hint={hint}>\n <span className={cx('og-select', className)}>\n <select ref={ref} {...props} />\n </span>\n </Field>\n );\n});\n\nexport interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type'> {\n label?: ReactNode;\n /** Shows the dash state. Sets the DOM property, which has no HTML attribute. */\n indeterminate?: boolean;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, indeterminate, className, ...props },\n ref,\n) {\n const setRef = (el: HTMLInputElement | null) => {\n if (el) el.indeterminate = !!indeterminate;\n if (typeof ref === 'function') ref(el);\n else if (ref) ref.current = el;\n };\n return (\n <label className=\"og-check\">\n <input ref={setRef} type=\"checkbox\" className={cx('og-checkbox', className)} {...props} />\n {label}\n </label>\n );\n});\n\nexport interface SwitchProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'role'> {\n label?: ReactNode;\n}\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n { label, className, ...props },\n ref,\n) {\n return (\n <label className=\"og-check\">\n <input ref={ref} type=\"checkbox\" role=\"switch\" className={cx('og-switch', className)} {...props} />\n {label}\n </label>\n );\n});\n\nexport interface SliderProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type'> {\n label?: ReactNode;\n}\n\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(function Slider(\n { label, className, style, min = 0, max = 100, ...props },\n ref,\n) {\n useOgUI();\n // og-ui.js keeps the fill in sync while dragging; this covers the first render and\n // controlled value changes that don't come from the user.\n const value = Number(props.value ?? props.defaultValue ?? (Number(min) + Number(max)) / 2);\n const span = Number(max) - Number(min);\n const pct = span ? ((value - Number(min)) / span) * 100 : 0;\n return (\n <Field label={label}>\n <input\n ref={ref}\n type=\"range\"\n min={min}\n max={max}\n className={cx('og-slider', className)}\n style={{ '--_value': `${pct}%`, ...style } as CSSProperties}\n {...props}\n />\n </Field>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Display\n\nexport interface BadgeProps extends ComponentPropsWithoutRef<'span'> {\n variant?: Status | Palette;\n /** Filled. Documented for variant=\"accent\". */\n solid?: boolean;\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { variant, solid, className, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cx('og-badge', variant && `og-badge--${variant}`, solid && 'og-badge--solid', className)}\n {...props}\n />\n );\n});\n\nexport interface AvatarProps extends Omit<ComponentPropsWithoutRef<'span'>, 'color'> {\n /** Full name: used for the initials and the accessible name. */\n name: string;\n src?: string;\n color?: Palette;\n size?: 'sm' | 'lg';\n}\n\nconst initials = (name: string) =>\n name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((w) => w[0]?.toUpperCase())\n .join('');\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { name, src, color, size, className, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cx('og-avatar', color && `og-avatar--${color}`, size && `og-avatar--${size}`, className)}\n role={src ? undefined : 'img'}\n aria-label={src ? undefined : name}\n {...props}\n >\n {src ? <img src={src} alt={name} /> : initials(name)}\n </span>\n );\n});\n\nexport interface AlertProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {\n variant?: Status;\n title?: ReactNode;\n}\n\n/** role=\"status\" by default; pass role=\"alert\" only for urgent errors. */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { variant, title, className, children, role = 'status', ...props },\n ref,\n) {\n return (\n <div ref={ref} role={role} className={cx('og-alert', variant && `og-alert--${variant}`, className)} {...props}>\n {title && <p className=\"og-alert__title\">{title}</p>}\n {children && <p className=\"og-alert__description\">{children}</p>}\n </div>\n );\n});\n\n/** Leave out value for an indeterminate bar. Give it an aria-label. */\nexport const Progress = forwardRef<HTMLProgressElement, ComponentPropsWithoutRef<'progress'>>(function Progress(\n { className, max = 100, ...props },\n ref,\n) {\n return <progress ref={ref} max={max} className={cx('og-progress', className)} {...props} />;\n});\n\nexport interface SkeletonProps extends ComponentPropsWithoutRef<'div'> {\n shape?: 'text' | 'circle';\n}\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { shape, className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={cx('og-skeleton', shape && `og-skeleton--${shape}`, className)}\n {...props}\n />\n );\n});\n\n/** The wrapper scrolls sideways on small screens. Use className=\"og-table__num\" on number cells. */\nexport const Table = forwardRef<HTMLTableElement, ComponentPropsWithoutRef<'table'>>(function Table(\n { className, ...props },\n ref,\n) {\n return (\n <div className=\"og-table-wrap\">\n <table ref={ref} className={cx('og-table', className)} {...props} />\n </div>\n );\n});\n"
19
+ },
20
+ {
21
+ "path": "components/og/util.ts",
22
+ "type": "registry:file",
23
+ "target": "components/og/util.ts",
24
+ "content": "import { useEffect } from 'react';\nimport { initOgUI } from '@og-ui/core/og-ui.js';\n\n/** Join class names, skipping falsy ones. */\nexport const cx = (...parts: (string | false | null | undefined)[]) => parts.filter(Boolean).join(' ');\n\n/**\n * Start og-ui.js (keyboard for menus and tabs, slider fill, popover placement, toasts).\n * Safe to call from every component: it only wires the document once, and only in the browser.\n */\nexport function useOgUI() {\n useEffect(() => initOgUI(), []);\n}\n\n/** Pages to show, with gaps: 1 … 4 5 [6] 7 8 … 20 */\nexport function pageList(page: number, count: number, siblings = 1): (number | 'gap')[] {\n const out: (number | 'gap')[] = [1];\n const from = Math.max(2, page - siblings);\n const to = Math.min(count - 1, page + siblings);\n if (from > 2) out.push('gap');\n for (let p = from; p <= to; p++) out.push(p);\n if (to < count - 1) out.push('gap');\n if (count > 1) out.push(count);\n return out;\n}\n"
25
+ },
26
+ {
27
+ "path": "components/og/og-ui.d.ts",
28
+ "type": "registry:file",
29
+ "target": "components/og/og-ui.d.ts",
30
+ "content": "declare module '@og-ui/core/og-ui.js' {\n export function initOgUI(root?: Document | Element): void;\n export function ogToast(\n title: string,\n options?: {\n description?: string;\n variant?: 'success' | 'warning' | 'danger' | 'accent';\n duration?: number;\n },\n ): () => void;\n}\n"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "progress",
4
+ "type": "registry:component",
5
+ "title": "Progress",
6
+ "description": "A native <progress>; leave out value for an indeterminate bar.",
7
+ "meta": {
8
+ "classes": [
9
+ "og-progress"
10
+ ],
11
+ "group": "Feedback",
12
+ "markup": [
13
+ {
14
+ "label": "Determinate and indeterminate",
15
+ "html": "<progress class=\"og-progress\" value=\"40\" max=\"100\" aria-label=\"Upload\"></progress>\n<progress class=\"og-progress\" aria-label=\"Loading\"></progress>"
16
+ }
17
+ ],
18
+ "react": "import { Progress } from '@og-ui/react';\n\n<Progress value={40} aria-label=\"Upload\" />",
19
+ "keyboard": [
20
+ "Not focusable. Give it an aria-label."
21
+ ],
22
+ "notes": []
23
+ },
24
+ "registryDependencies": [
25
+ "https://ui.ogom.in/r/og-ui.json"
26
+ ],
27
+ "files": [
28
+ {
29
+ "path": "og-ui/components/progress.css",
30
+ "type": "registry:file",
31
+ "target": "og-ui/components/progress.css",
32
+ "content": "/*! OG UI progress | MIT | https://ui.ogom.in */\n.og-progress {\n --_h: 0.5rem;\n display: block;\n width: 100%;\n height: var(--_h);\n overflow: hidden;\n border: 0;\n border-radius: var(--og-radius-full);\n background: var(--og-surface-inset-fill);\n box-shadow: var(--og-surface-inset-shadow);\n color: var(--og-color-accent);\n appearance: none;\n}\n.og-progress::-webkit-progress-bar {\n background: transparent;\n}\n.og-progress::-webkit-progress-value {\n border-radius: var(--og-radius-full);\n background: var(--og-color-accent);\n transition: width var(--og-motion-duration) var(--og-easing);\n}\n.og-progress::-moz-progress-bar {\n border-radius: var(--og-radius-full);\n background: var(--og-color-accent);\n}\n.og-progress:indeterminate {\n background-image: linear-gradient(90deg, transparent 0%, var(--og-color-accent) 40%, var(--og-color-accent) 60%, transparent 100%);\n background-repeat: no-repeat;\n background-size: 40% 100%;\n animation: og-progress-slide 1.2s ease-in-out infinite;\n}\n.og-progress:indeterminate::-webkit-progress-bar {\n background: transparent;\n}\n.og-progress:indeterminate::-moz-progress-bar {\n background: transparent;\n}\n\n@keyframes og-progress-slide {\n from {\n background-position: -40% 0;\n }\n to {\n background-position: 140% 0;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .og-progress:indeterminate {\n animation: none;\n background-position: 50% 0;\n }\n}\n"
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "select-react",
4
+ "type": "registry:component",
5
+ "title": "select (React)",
6
+ "description": "React component(s) from @og-ui/react's components.tsx, copied into your project.",
7
+ "dependencies": [
8
+ "@og-ui/core"
9
+ ],
10
+ "registryDependencies": [
11
+ "https://ui.ogom.in/r/select.json"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "components/og/components.tsx",
16
+ "type": "registry:file",
17
+ "target": "components/og/components.tsx",
18
+ "content": "import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type ReactNode,\n} from 'react';\nimport { cx, useOgUI } from './util.js';\n\ntype Palette = 1 | 2 | 3 | 4 | 5 | 6;\ntype Status = 'accent' | 'success' | 'warning' | 'danger';\n\n// ---------------------------------------------------------------------------\n// Button\n\nexport interface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n variant?: 'primary' | 'ghost' | 'danger';\n size?: 'sm' | 'lg';\n /** Square icon button. Give it an aria-label. */\n icon?: boolean;\n block?: boolean;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { variant, size, icon, block, className, type = 'button', ...props },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type}\n className={cx(\n 'og-button',\n variant && `og-button--${variant}`,\n size && `og-button--${size}`,\n icon && 'og-button--icon',\n block && 'og-button--block',\n className,\n )}\n {...props}\n />\n );\n});\n\n// ---------------------------------------------------------------------------\n// Card\n\nexport interface CardProps extends Omit<ComponentPropsWithoutRef<'article'>, 'title'> {\n title?: ReactNode;\n description?: ReactNode;\n footer?: ReactNode;\n /** Palette tint 1–6. */\n tint?: Palette;\n}\n\nexport const Card = forwardRef<HTMLElement, CardProps>(function Card(\n { title, description, footer, tint, className, children, ...props },\n ref,\n) {\n return (\n <article ref={ref} className={cx('og-card', tint && `og-card--tint-${tint}`, className)} {...props}>\n {(title || description) && (\n <header className=\"og-card__header\">\n {title && <h3 className=\"og-card__title\">{title}</h3>}\n {description && <p className=\"og-card__description\">{description}</p>}\n </header>\n )}\n {children !== undefined && <div className=\"og-card__body\">{children}</div>}\n {footer && <footer className=\"og-card__footer\">{footer}</footer>}\n </article>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Form controls\n\n/** Wraps a control in og-field with a label and hint when they are given. */\nfunction Field({ label, hint, children }: { label?: ReactNode; hint?: ReactNode; children: ReactNode }) {\n if (!label && !hint) return <>{children}</>;\n return (\n <label className=\"og-field\">\n {label && <span className=\"og-label\">{label}</span>}\n {children}\n {hint && <span className=\"og-hint\">{hint}</span>}\n </label>\n );\n}\n\nexport interface InputProps extends ComponentPropsWithoutRef<'input'> {\n label?: ReactNode;\n hint?: ReactNode;\n invalid?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { label, hint, invalid, className, ...props },\n ref,\n) {\n return (\n <Field label={label} hint={hint}>\n <input\n ref={ref}\n className={cx('og-input', className)}\n aria-invalid={invalid || props['aria-invalid']}\n {...props}\n />\n </Field>\n );\n});\n\nexport interface SelectProps extends ComponentPropsWithoutRef<'select'> {\n label?: ReactNode;\n hint?: ReactNode;\n}\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { label, hint, className, ...props },\n ref,\n) {\n return (\n <Field label={label} hint={hint}>\n <span className={cx('og-select', className)}>\n <select ref={ref} {...props} />\n </span>\n </Field>\n );\n});\n\nexport interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type'> {\n label?: ReactNode;\n /** Shows the dash state. Sets the DOM property, which has no HTML attribute. */\n indeterminate?: boolean;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, indeterminate, className, ...props },\n ref,\n) {\n const setRef = (el: HTMLInputElement | null) => {\n if (el) el.indeterminate = !!indeterminate;\n if (typeof ref === 'function') ref(el);\n else if (ref) ref.current = el;\n };\n return (\n <label className=\"og-check\">\n <input ref={setRef} type=\"checkbox\" className={cx('og-checkbox', className)} {...props} />\n {label}\n </label>\n );\n});\n\nexport interface SwitchProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'role'> {\n label?: ReactNode;\n}\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n { label, className, ...props },\n ref,\n) {\n return (\n <label className=\"og-check\">\n <input ref={ref} type=\"checkbox\" role=\"switch\" className={cx('og-switch', className)} {...props} />\n {label}\n </label>\n );\n});\n\nexport interface SliderProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type'> {\n label?: ReactNode;\n}\n\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(function Slider(\n { label, className, style, min = 0, max = 100, ...props },\n ref,\n) {\n useOgUI();\n // og-ui.js keeps the fill in sync while dragging; this covers the first render and\n // controlled value changes that don't come from the user.\n const value = Number(props.value ?? props.defaultValue ?? (Number(min) + Number(max)) / 2);\n const span = Number(max) - Number(min);\n const pct = span ? ((value - Number(min)) / span) * 100 : 0;\n return (\n <Field label={label}>\n <input\n ref={ref}\n type=\"range\"\n min={min}\n max={max}\n className={cx('og-slider', className)}\n style={{ '--_value': `${pct}%`, ...style } as CSSProperties}\n {...props}\n />\n </Field>\n );\n});\n\n// ---------------------------------------------------------------------------\n// Display\n\nexport interface BadgeProps extends ComponentPropsWithoutRef<'span'> {\n variant?: Status | Palette;\n /** Filled. Documented for variant=\"accent\". */\n solid?: boolean;\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { variant, solid, className, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cx('og-badge', variant && `og-badge--${variant}`, solid && 'og-badge--solid', className)}\n {...props}\n />\n );\n});\n\nexport interface AvatarProps extends Omit<ComponentPropsWithoutRef<'span'>, 'color'> {\n /** Full name: used for the initials and the accessible name. */\n name: string;\n src?: string;\n color?: Palette;\n size?: 'sm' | 'lg';\n}\n\nconst initials = (name: string) =>\n name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((w) => w[0]?.toUpperCase())\n .join('');\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { name, src, color, size, className, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cx('og-avatar', color && `og-avatar--${color}`, size && `og-avatar--${size}`, className)}\n role={src ? undefined : 'img'}\n aria-label={src ? undefined : name}\n {...props}\n >\n {src ? <img src={src} alt={name} /> : initials(name)}\n </span>\n );\n});\n\nexport interface AlertProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {\n variant?: Status;\n title?: ReactNode;\n}\n\n/** role=\"status\" by default; pass role=\"alert\" only for urgent errors. */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { variant, title, className, children, role = 'status', ...props },\n ref,\n) {\n return (\n <div ref={ref} role={role} className={cx('og-alert', variant && `og-alert--${variant}`, className)} {...props}>\n {title && <p className=\"og-alert__title\">{title}</p>}\n {children && <p className=\"og-alert__description\">{children}</p>}\n </div>\n );\n});\n\n/** Leave out value for an indeterminate bar. Give it an aria-label. */\nexport const Progress = forwardRef<HTMLProgressElement, ComponentPropsWithoutRef<'progress'>>(function Progress(\n { className, max = 100, ...props },\n ref,\n) {\n return <progress ref={ref} max={max} className={cx('og-progress', className)} {...props} />;\n});\n\nexport interface SkeletonProps extends ComponentPropsWithoutRef<'div'> {\n shape?: 'text' | 'circle';\n}\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { shape, className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={cx('og-skeleton', shape && `og-skeleton--${shape}`, className)}\n {...props}\n />\n );\n});\n\n/** The wrapper scrolls sideways on small screens. Use className=\"og-table__num\" on number cells. */\nexport const Table = forwardRef<HTMLTableElement, ComponentPropsWithoutRef<'table'>>(function Table(\n { className, ...props },\n ref,\n) {\n return (\n <div className=\"og-table-wrap\">\n <table ref={ref} className={cx('og-table', className)} {...props} />\n </div>\n );\n});\n"
19
+ },
20
+ {
21
+ "path": "components/og/util.ts",
22
+ "type": "registry:file",
23
+ "target": "components/og/util.ts",
24
+ "content": "import { useEffect } from 'react';\nimport { initOgUI } from '@og-ui/core/og-ui.js';\n\n/** Join class names, skipping falsy ones. */\nexport const cx = (...parts: (string | false | null | undefined)[]) => parts.filter(Boolean).join(' ');\n\n/**\n * Start og-ui.js (keyboard for menus and tabs, slider fill, popover placement, toasts).\n * Safe to call from every component: it only wires the document once, and only in the browser.\n */\nexport function useOgUI() {\n useEffect(() => initOgUI(), []);\n}\n\n/** Pages to show, with gaps: 1 … 4 5 [6] 7 8 … 20 */\nexport function pageList(page: number, count: number, siblings = 1): (number | 'gap')[] {\n const out: (number | 'gap')[] = [1];\n const from = Math.max(2, page - siblings);\n const to = Math.min(count - 1, page + siblings);\n if (from > 2) out.push('gap');\n for (let p = from; p <= to; p++) out.push(p);\n if (to < count - 1) out.push('gap');\n if (count > 1) out.push(count);\n return out;\n}\n"
25
+ },
26
+ {
27
+ "path": "components/og/og-ui.d.ts",
28
+ "type": "registry:file",
29
+ "target": "components/og/og-ui.d.ts",
30
+ "content": "declare module '@og-ui/core/og-ui.js' {\n export function initOgUI(root?: Document | Element): void;\n export function ogToast(\n title: string,\n options?: {\n description?: string;\n variant?: 'success' | 'warning' | 'danger' | 'accent';\n duration?: number;\n },\n ): () => void;\n}\n"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "select",
4
+ "type": "registry:component",
5
+ "title": "Select",
6
+ "description": "A styled native <select>: keyboard, mobile pickers and screen readers work for free.",
7
+ "meta": {
8
+ "classes": [
9
+ "og-select"
10
+ ],
11
+ "group": "Forms",
12
+ "markup": [
13
+ {
14
+ "label": "Select",
15
+ "html": "<label class=\"og-field\" style=\"max-width: 16rem\">\n <span class=\"og-label\">Plan</span>\n <span class=\"og-select\"><select><option>Free</option><option selected>Pro</option><option>Team</option></select></span>\n</label>"
16
+ }
17
+ ],
18
+ "react": "import { Select } from '@og-ui/react';\n\n<Select label=\"Plan\" defaultValue=\"pro\">\n <option value=\"free\">Free</option>\n <option value=\"pro\">Pro</option>\n</Select>",
19
+ "keyboard": [
20
+ "Tab focuses; arrow keys change the value; Alt+Down (Windows) or Space opens the list."
21
+ ],
22
+ "notes": []
23
+ },
24
+ "registryDependencies": [
25
+ "https://ui.ogom.in/r/og-ui.json"
26
+ ],
27
+ "files": [
28
+ {
29
+ "path": "og-ui/components/select.css",
30
+ "type": "registry:file",
31
+ "target": "og-ui/components/select.css",
32
+ "content": "/*! OG UI select | MIT | https://ui.ogom.in */\n.og-select {\n position: relative;\n display: block;\n}\n.og-select select {\n background: var(--og-surface-inset-fill);\n border: var(--og-border-width) solid var(--og-surface-inset-border);\n box-shadow: var(--og-surface-inset-shadow);\n -webkit-backdrop-filter: var(--og-surface-inset-filter);\n backdrop-filter: var(--og-surface-inset-filter);\n transition-property: transform, background-color, border-color, color, box-shadow;\n transition-duration: var(--og-motion-duration);\n transition-timing-function: var(--og-easing);\n display: block;\n width: 100%;\n height: var(--og-control-h-md);\n padding: 0 2.25rem 0 calc(var(--og-control-px) * 0.875);\n border-radius: var(--og-radius-control);\n color: var(--og-color-text);\n font: inherit;\n font-family: var(--og-font);\n font-size: 0.875rem;\n appearance: none;\n cursor: pointer;\n}\n.og-select select:disabled, .og-select select[aria-disabled=true] {\n opacity: 0.5;\n cursor: not-allowed;\n transform: none;\n pointer-events: none;\n}\n.og-select select:focus-visible {\n outline: 2px solid var(--og-color-focus-ring);\n outline-offset: 2px;\n}\n.og-select::after {\n content: \"\";\n display: inline-block;\n width: 1rem;\n height: 1rem;\n background: currentColor;\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") center/contain no-repeat;\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") center/contain no-repeat;\n position: absolute;\n top: 50%;\n right: 0.75rem;\n color: var(--og-color-text-muted);\n transform: translateY(-50%);\n pointer-events: none;\n}\n"
33
+ }
34
+ ]
35
+ }