@podoba/react 0.0.35 → 0.0.36
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.
|
|
3
|
+
"version": "0.0.36",
|
|
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.36",
|
|
32
|
+
"@podoba/tailwind": "^0.0.36",
|
|
33
33
|
"react-aria-components": "1.18.0",
|
|
34
34
|
"class-variance-authority": "0.7.1",
|
|
35
35
|
"clsx": "2.1.1",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef, useState } from 'react'
|
|
2
2
|
import { AssetSelectionSurface, AssetSelectionGrid, AssetSelectionEmpty, AssetLibraryPreview } from './asset-selection-surface'
|
|
3
3
|
import { Button } from './button'
|
|
4
|
+
import { Subtle } from './subtle'
|
|
4
5
|
import { SectionTabs } from './section-tabs'
|
|
5
6
|
|
|
6
7
|
function Example({ linked = false, pending = false, error = false }) {
|
|
@@ -9,7 +10,7 @@ function Example({ linked = false, pending = false, error = false }) {
|
|
|
9
10
|
return <>
|
|
10
11
|
<Button onPress={() => setOpen(true)}>Open asset selection</Button>
|
|
11
12
|
<AssetSelectionSurface isOpen={open} onOpenChange={setOpen} closeLabel="Close" isPending={pending}
|
|
12
|
-
title={linked ? <>Review linked assets <
|
|
13
|
+
title={linked ? <>Review linked assets <Subtle>and add more</Subtle><br />to this <Subtle>project.</Subtle></> : <>Choose assets <Subtle>from storage</Subtle><br />and add them to <Subtle>this project.</Subtle></>}
|
|
13
14
|
filters={<SectionTabs active="all" onChange={() => {}} tabs={[{key:'all',label:'All'},{key:'print',label:'Print'}]} />}
|
|
14
15
|
error={error ? 'The selected asset could not be added. Please try again.' : undefined}
|
|
15
16
|
footer={<><Button variant="secondary" isDisabled={pending} onPress={() => setOpen(false)}>Close</Button><Button isDisabled={pending} isPending={pending}>{pending ? 'Adding…' : linked ? 'Add another asset' : 'Add selected asset'}</Button></>}
|
|
@@ -17,9 +17,11 @@ export const TeamSelectionCard = uic(AriaButton, {
|
|
|
17
17
|
})
|
|
18
18
|
export const MemberSelectionInfo = uic('span', { displayName: 'MemberSelectionInfo', baseClass: 'min-w-0 flex-1' })
|
|
19
19
|
export const MemberSelectionName = uic('span', { displayName: 'MemberSelectionName', baseClass: 'mb-1 block text-heading5 font-medium text-fg' })
|
|
20
|
-
|
|
20
|
+
// #25: an email address and a team's meta line are CONTENT — `fg-muted` (5.98:1 on
|
|
21
|
+
// surface, 5.53:1 on surface-card), never the ornamental `fg-subtle` (2.10 / 1.94:1).
|
|
22
|
+
export const MemberSelectionEmail = uic('span', { displayName: 'MemberSelectionEmail', baseClass: 'block text-compact font-normal text-fg-muted' })
|
|
21
23
|
export const TeamSelectionName = uic('span', { displayName: 'TeamSelectionName', baseClass: 'mb-1 block font-medium text-fg' })
|
|
22
|
-
export const TeamSelectionMeta = uic('span', { displayName: 'TeamSelectionMeta', baseClass: 'block text-small font-normal text-fg-
|
|
24
|
+
export const TeamSelectionMeta = uic('span', { displayName: 'TeamSelectionMeta', baseClass: 'block text-small font-normal text-fg-muted' })
|
|
23
25
|
|
|
24
26
|
/** Intrinsic-height form surface. The tall settings and catalog surfaces remain separate. */
|
|
25
27
|
export function CompactSettingsDialog({ isOpen, onOpenChange, isPending = false, title, description, closeLabel, children }: {
|
|
@@ -88,7 +88,7 @@ export function SettingsDialogSurface({ variant, isOpen, onOpenChange, isPending
|
|
|
88
88
|
<header className={catalog ? 'flex shrink-0 flex-col gap-2' : basic ? headerBottomPadding ? 'shrink-0 pb-4' : 'shrink-0' : create || csv ? 'shrink-0 pb-4' : 'shrink-0 pb-10 max-md:pb-8'}>
|
|
89
89
|
<Container className={containerClass}>
|
|
90
90
|
{catalog ? <Heading id={titleId} level="1" className="m-0 mb-4 max-w-5/6 whitespace-pre-line" style={{ letterSpacing: 0 }}>{title}</Heading>
|
|
91
|
-
: <DisplayHeading id={titleId} className={`m-0 whitespace-pre-line pb-0.5 text-fg-
|
|
91
|
+
: <DisplayHeading id={titleId} className={`m-0 whitespace-pre-line pb-0.5 text-fg-muted ${create ? 'mb-4 max-w-5/6' : ''}`} style={{ letterSpacing: 0, ...(basic ? { maxWidth: '18ch' } : csv && isWide ? { maxWidth: '34ch' } : {}) }}>{title}</DisplayHeading>}
|
|
92
92
|
{description ? <p id={descriptionId} className="mb-0 mt-3 text-small font-normal text-fg-workflow-muted" style={{ maxWidth: '48ch' }}>{description}</p> : null}
|
|
93
93
|
</Container>
|
|
94
94
|
{filters ? <div className="w-full max-w-80">{filters}</div> : null}
|
|
@@ -128,7 +128,7 @@ export function WizardFormDialog({ isOpen, onOpenChange, isPending = false, isEx
|
|
|
128
128
|
<Button variant="ghost" aria-label={closeLabel} isDisabled={isPending} onPress={() => onOpenChange(false)} className="absolute end-4 top-3.5 z-10 h-8 w-8 rounded-md p-0 text-fg-subtle">
|
|
129
129
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true"><path d="m6 6 12 12M18 6 6 18" /></svg>
|
|
130
130
|
</Button>
|
|
131
|
-
<header className="shrink-0"><Container className="max-w-384 px-5 min-[901px]:px-6"><DisplayHeading id={titleId} className="m-0 whitespace-pre-line pb-0.5 text-fg-
|
|
131
|
+
<header className="shrink-0"><Container className="max-w-384 px-5 min-[901px]:px-6"><DisplayHeading id={titleId} className="m-0 whitespace-pre-line pb-0.5 text-fg-muted" style={{ letterSpacing: 0 }}>{title}</DisplayHeading></Container></header>
|
|
132
132
|
<ScrollBody style={{ scrollbarGutter: 'stable' }}><Container className="max-w-384 px-5 min-[901px]:px-6"><Body className="gap-8">{children}</Body></Container></ScrollBody>
|
|
133
133
|
<footer className="shrink-0 border-t border-border bg-surface pt-5"><Container className="max-w-384 px-5 min-[901px]:px-6"><div className="flex flex-wrap justify-end gap-2">{footer}</div></Container></footer>
|
|
134
134
|
</Layout>
|
|
@@ -65,7 +65,8 @@ export function CatalogMetadataSummary({ title, ariaLabel, items }: {
|
|
|
65
65
|
const second = !item.fullWidth && column % 2 === 1
|
|
66
66
|
column = item.fullWidth ? 0 : column + 1
|
|
67
67
|
return <div key={item.label} className={`flex min-w-0 flex-col gap-1 border-b border-border py-3 ${item.fullWidth ? 'col-span-full' : ''} ${second ? 'min-[641px]:border-l min-[641px]:pl-3' : ''}`}>
|
|
68
|
-
|
|
68
|
+
{/* #25: the term of a definition list is meaningful copy — AA `fg-muted`. */}
|
|
69
|
+
<dt className="m-0 text-body font-normal text-fg-muted">{item.label}</dt>
|
|
69
70
|
<dd className="m-0 text-body font-normal text-fg [overflow-wrap:anywhere]">{item.value}</dd>
|
|
70
71
|
</div>
|
|
71
72
|
})}
|
|
@@ -99,7 +100,7 @@ export function TemplateReferenceItem({ title, meta, preview, view, isDisabled,
|
|
|
99
100
|
}) {
|
|
100
101
|
return <ReferenceButton type="button" view={view} isDisabled={isDisabled} onPress={onOpen} aria-label={title} data-template-id={templateId}>
|
|
101
102
|
<span aria-hidden="true" className={view === 'compact_list' ? 'flex size-12 items-center justify-center overflow-hidden rounded-sm bg-surface-card [&>div]:w-full' : 'flex h-full w-full items-center justify-center [&>div]:w-full'}>{preview}</span>
|
|
102
|
-
{view === 'compact_list' ? <span className="flex min-w-0 flex-col gap-1"><span className="truncate text-small font-medium text-fg">{title}</span><span className="truncate text-label font-medium text-fg-
|
|
103
|
+
{view === 'compact_list' ? <span className="flex min-w-0 flex-col gap-1"><span className="truncate text-small font-medium text-fg">{title}</span><span className="truncate text-label font-medium text-fg-muted">{meta}</span></span> : null}
|
|
103
104
|
</ReferenceButton>
|
|
104
105
|
}
|
|
105
106
|
|