lucent-ui 0.25.0 → 0.25.1
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.
|
@@ -177,8 +177,9 @@ export const COMPONENT_MANIFEST = {
|
|
|
177
177
|
type: 'ReactNode',
|
|
178
178
|
required: false,
|
|
179
179
|
description: 'Full-bleed content rendered at the top of the card (before header). No padding is applied. ' +
|
|
180
|
-
'Use for hero images, illustrations, or any edge-to-edge top content. The
|
|
181
|
-
'
|
|
180
|
+
'Use for hero images, illustrations, or any edge-to-edge top content. The media slot self-clips ' +
|
|
181
|
+
'to the card\'s top border-radius. Cards without media default to overflow:visible so nested child ' +
|
|
182
|
+
'shadows (e.g. an elevated Card inside a Collapsible) are never cut off.',
|
|
182
183
|
},
|
|
183
184
|
],
|
|
184
185
|
usageExamples: [
|
|
@@ -274,17 +275,17 @@ export const COMPONENT_MANIFEST = {
|
|
|
274
275
|
},
|
|
275
276
|
{
|
|
276
277
|
title: 'CollapsibleCard recipe — outline',
|
|
277
|
-
code: `<Card variant="outline"
|
|
278
|
+
code: `<Card variant="outline" hoverable>
|
|
278
279
|
<Collapsible trigger={<Text as="span" weight="semibold" size="sm">Filters</Text>} defaultOpen>
|
|
279
|
-
<Text size="sm" color="secondary">Card + Collapsible composed together.</Text>
|
|
280
|
+
<Text size="sm" color="secondary">Card + Collapsible composed together. Collapsible auto-bleeds to card edges.</Text>
|
|
280
281
|
</Collapsible>
|
|
281
282
|
</Card>`,
|
|
282
283
|
},
|
|
283
284
|
{
|
|
284
285
|
title: 'CollapsibleCard recipe — combo (filled + elevated)',
|
|
285
|
-
code: `<Card variant="filled"
|
|
286
|
+
code: `<Card variant="filled" hoverable>
|
|
286
287
|
<Collapsible trigger={<Text as="span" weight="semibold" size="sm">Details</Text>} padded={false}>
|
|
287
|
-
<Card variant="elevated" padding="sm">
|
|
288
|
+
<Card variant="elevated" padding="sm" style={{ margin: 'var(--lucent-space-1) var(--lucent-space-2) var(--lucent-space-2)' }}>
|
|
288
289
|
<Text size="sm" color="secondary">Two-tone: flat trigger on filled surface, content in elevated body.</Text>
|
|
289
290
|
</Card>
|
|
290
291
|
</Collapsible>
|
|
@@ -11,13 +11,19 @@ export const COMPONENT_MANIFEST = {
|
|
|
11
11
|
'on expand, scrollHeight is snapshotted and transitioned to, then the fixed height is cleared for reflow; ' +
|
|
12
12
|
'on collapse, the current height is flushed to the DOM, a reflow is forced, then height is set to 0. ' +
|
|
13
13
|
'Content fades in/out with opacity + translateY(-4px) at 80ms, while height transitions at 180ms ' +
|
|
14
|
-
'using the easing-default token. ' +
|
|
14
|
+
'using the easing-default token. The animated content wrapper uses overflow:hidden only during the ' +
|
|
15
|
+
'height transition and switches to overflow:visible once open, so nested child shadows (e.g. an ' +
|
|
16
|
+
'elevated Card in the combo recipe) are never clipped in the resting state.\n\n' +
|
|
15
17
|
'A built-in chevron rotates 180° on open, giving clear directional affordance. ' +
|
|
16
18
|
'Hover feedback uses a CSS rule via data-lucent-collapsible-trigger (same pattern as NavMenu): ' +
|
|
17
19
|
'5% text-primary tint on the trigger background, chevron darkens to text-primary. ' +
|
|
18
20
|
'The `trigger` prop accepts only label content — the chevron and button chrome are owned by the component ' +
|
|
19
21
|
'so callers cannot accidentally break the expand/collapse contract. ' +
|
|
20
|
-
'The component supports controlled (open + onOpenChange) and uncontrolled (defaultOpen) modes
|
|
22
|
+
'The component supports controlled (open + onOpenChange) and uncontrolled (defaultOpen) modes.\n\n' +
|
|
23
|
+
'**Card-aware auto-bleed** — when placed inside a Card, Collapsible consumes CardPaddingContext and ' +
|
|
24
|
+
'applies negative margins to cancel the Card body\'s padding, so the trigger spans the full card width ' +
|
|
25
|
+
'and only the Collapsible\'s own padding applies. This means `<Card hoverable><Collapsible>` just works — ' +
|
|
26
|
+
'no `padding="none"` on Card required.',
|
|
21
27
|
props: [
|
|
22
28
|
{
|
|
23
29
|
name: 'trigger',
|
|
@@ -95,18 +101,18 @@ export const COMPONENT_MANIFEST = {
|
|
|
95
101
|
</Collapsible>`,
|
|
96
102
|
},
|
|
97
103
|
{
|
|
98
|
-
title: 'CollapsibleCard recipe',
|
|
99
|
-
code: `<Card variant="outline"
|
|
104
|
+
title: 'CollapsibleCard recipe (auto-bleed)',
|
|
105
|
+
code: `<Card variant="outline" hoverable>
|
|
100
106
|
<Collapsible trigger={<Text as="span" weight="semibold" size="sm">Filters</Text>} defaultOpen>
|
|
101
|
-
<Text size="sm" color="secondary">Card + Collapsible composed together.</Text>
|
|
107
|
+
<Text size="sm" color="secondary">Card + Collapsible composed together. No padding="none" needed.</Text>
|
|
102
108
|
</Collapsible>
|
|
103
109
|
</Card>`,
|
|
104
110
|
},
|
|
105
111
|
{
|
|
106
112
|
title: 'CollapsibleCard combo recipe (padded={false})',
|
|
107
|
-
code: `<Card variant="filled"
|
|
113
|
+
code: `<Card variant="filled" hoverable>
|
|
108
114
|
<Collapsible trigger={<Text as="span" weight="semibold" size="sm">Details</Text>} padded={false}>
|
|
109
|
-
<Card variant="elevated" padding="sm">
|
|
115
|
+
<Card variant="elevated" padding="sm" style={{ margin: 'var(--lucent-space-1) var(--lucent-space-2) var(--lucent-space-2)' }}>
|
|
110
116
|
<Text size="sm" color="secondary">Nested elevated card inside a filled card.</Text>
|
|
111
117
|
</Card>
|
|
112
118
|
</Collapsible>
|