@podoba/react 0.0.51 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podoba/react",
3
- "version": "0.0.51",
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.51",
32
- "@podoba/tailwind": "^0.0.51",
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
+ }
package/src/index.ts CHANGED
@@ -94,3 +94,5 @@ export * from './components/date-selection-calendar'
94
94
  export * from './components/compact-settings-dialog'
95
95
 
96
96
  export * from "./components/round-check-toggle";
97
+
98
+ export { InlineAlert, type InlineAlertProps } from './components/inline-alert'