@podoba/react 0.0.50 → 0.0.52
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.
|
|
3
|
+
"version": "0.0.52",
|
|
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.
|
|
32
|
-
"@podoba/tailwind": "^0.0.
|
|
31
|
+
"@podoba/tokens": "^0.0.52",
|
|
32
|
+
"@podoba/tailwind": "^0.0.52",
|
|
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 { InlineAlert } from './inline-alert'
|
|
2
|
+
|
|
3
|
+
export const examples = {
|
|
4
|
+
default: () => <InlineAlert>The output could not be downloaded.</InlineAlert>,
|
|
5
|
+
status: () => <InlineAlert role="status">This file is already saved. No additional copy was created.</InlineAlert>,
|
|
6
|
+
longMessage: () => <InlineAlert>The original file is already available. Open the existing document to continue checking its details.</InlineAlert>,
|
|
7
|
+
}
|
|
8
|
+
export const meta = { category: 'Feedback', description: 'Inline GS output warning with its original exclamation glyph. Consumer supplies the message and live-region role.' }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react'
|
|
2
|
+
import { uic } from '../utils/uic'
|
|
3
|
+
|
|
4
|
+
// Extracted from GS outputs-actions-panel: same typography, spacing and glyph.
|
|
5
|
+
const InlineAlertRoot = uic('p', {
|
|
6
|
+
displayName: 'InlineAlertRoot',
|
|
7
|
+
baseClass: 'flex items-start gap-2 text-caption text-danger',
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export type InlineAlertProps = Omit<ComponentProps<'p'>, 'children'> & {
|
|
11
|
+
/** Consumer-provided, translated message. */
|
|
12
|
+
children: ReactNode
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function InlineAlert({ children, role = 'alert', ...props }: InlineAlertProps) {
|
|
16
|
+
return <InlineAlertRoot {...props} role={role}>
|
|
17
|
+
<svg aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="mt-0.5 shrink-0">
|
|
18
|
+
<path d="M10.3 3.9 1.8 18.5a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z" />
|
|
19
|
+
<path d="M12 9v4" /><path d="M12 17h.01" />
|
|
20
|
+
</svg>
|
|
21
|
+
<span>{children}</span>
|
|
22
|
+
</InlineAlertRoot>
|
|
23
|
+
}
|
|
@@ -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,7 @@ 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";
|
|
97
|
+
|
|
98
|
+
export { InlineAlert, type InlineAlertProps } from './components/inline-alert'
|