@podoba/react 0.0.50 → 0.0.51

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/README.md CHANGED
@@ -23,3 +23,7 @@ export default { presets: [podobaPreset], content: ["./src/**/*.{ts,tsx}", "./no
23
23
  Scope is **atomic primitives + layout only**. GS product patterns (schema renderer,
24
24
  delivery/approval modals, brand page header) live in GS and consume this. See
25
25
  [../../EXTRACTION.md](../../EXTRACTION.md).
26
+
27
+ `RoundCheckToggle` is the shared circular GS annotation control. Supply a translated
28
+ `aria-label`, `isSelected`, `onChange`, and optionally `isDisabled`; it owns the
29
+ 24px green checked appearance and React Aria keyboard/pressed-state behavior.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podoba/react",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "type": "module",
5
5
  "description": "podoba React components — React Aria Components + Tailwind primitives + layout, built with uic.",
6
6
  "repository": {
@@ -28,8 +28,8 @@
28
28
  "typecheck": "tsc --build"
29
29
  },
30
30
  "dependencies": {
31
- "@podoba/tokens": "^0.0.50",
32
- "@podoba/tailwind": "^0.0.50",
31
+ "@podoba/tokens": "^0.0.51",
32
+ "@podoba/tailwind": "^0.0.51",
33
33
  "react-aria-components": "1.18.0",
34
34
  "class-variance-authority": "0.7.1",
35
35
  "clsx": "2.1.1",
@@ -0,0 +1,8 @@
1
+ import { RoundCheckToggle } from './round-check-toggle'
2
+
3
+ export const examples = {
4
+ default: () => <RoundCheckToggle aria-label="Mark comment complete" />,
5
+ states: () => <div className="flex items-center gap-3"><RoundCheckToggle aria-label="Open comment" /><RoundCheckToggle aria-label="Completed comment" defaultSelected /></div>,
6
+ disabled: () => <div className="flex items-center gap-3"><RoundCheckToggle aria-label="Open read-only item" isDisabled /><RoundCheckToggle aria-label="Completed read-only item" defaultSelected isDisabled /></div>,
7
+ }
8
+ export const meta = { category: 'Primitives', description: 'GS 24px circular check toggle. Space/Enter toggle aria-pressed; selected uses brand-green. Labels and persistence belong to the consumer.' }
@@ -0,0 +1,20 @@
1
+ import { ToggleButton, type ToggleButtonProps } from 'react-aria-components'
2
+ import { uic } from '../utils/uic'
3
+
4
+ /** GS output-annotation done control, shared without task or billing logic. */
5
+ const RoundCheckControl = uic(ToggleButton, {
6
+ displayName: 'RoundCheckControl',
7
+ baseClass: 'grid h-6 w-6 shrink-0 place-items-center rounded-full border border-border bg-surface-card text-fg-subtle outline-none transition-colors data-[hovered]:border-fg-subtle data-[hovered]:text-fg data-[selected]:border-brand-green data-[selected]:bg-brand-green data-[selected]:text-fg-on-brand data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring data-[disabled]:cursor-default',
8
+ })
9
+
10
+ export type RoundCheckToggleProps = Omit<ToggleButtonProps, 'children' | 'aria-label' | 'className'> & {
11
+ /** Required accessible name; the consumer supplies its translated item/action. */
12
+ 'aria-label': string
13
+ className?: string
14
+ }
15
+
16
+ export function RoundCheckToggle(props: RoundCheckToggleProps) {
17
+ return <RoundCheckControl {...props}>
18
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 13l4 4L19 7" /></svg>
19
+ </RoundCheckControl>
20
+ }
package/src/index.ts CHANGED
@@ -92,3 +92,5 @@ export * from "./components/delivery/publish-modal";
92
92
  export * from "./components/delivery/delivery-status-module";
93
93
  export * from './components/date-selection-calendar'
94
94
  export * from './components/compact-settings-dialog'
95
+
96
+ export * from "./components/round-check-toggle";