@fpkit/acss 1.0.0-beta.1 → 2.0.0
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 +92 -0
- package/docs/README.md +325 -0
- package/docs/guides/accessibility.md +764 -0
- package/docs/guides/architecture.md +705 -0
- package/docs/guides/composition.md +688 -0
- package/docs/guides/css-variables.md +522 -0
- package/docs/guides/storybook.md +828 -0
- package/docs/guides/testing.md +817 -0
- package/docs/testing/focus-indicator-testing.md +437 -0
- package/libs/{chunk-7XPFW7CB.js → chunk-43TK2ICH.js} +2 -2
- package/libs/chunk-5PJYLVFY.cjs +17 -0
- package/libs/chunk-5PJYLVFY.cjs.map +1 -0
- package/libs/chunk-E4OSROCA.cjs +17 -0
- package/libs/chunk-E4OSROCA.cjs.map +1 -0
- package/libs/chunk-KVKQLRJG.js +10 -0
- package/libs/chunk-KVKQLRJG.js.map +1 -0
- package/libs/{chunk-QVW6W76L.cjs → chunk-MGPWZRBX.cjs} +3 -3
- package/libs/chunk-NNTBIHSD.js +8 -0
- package/libs/chunk-NNTBIHSD.js.map +1 -0
- package/libs/{chunk-X3JCTEPD.js → chunk-QKHPHMG2.js} +2 -2
- package/libs/{chunk-T4T6GWYQ.cjs → chunk-R7NLLZU2.cjs} +3 -3
- package/libs/{chunk-X5LGFCWG.js → chunk-UJAQVHWC.js} +3 -3
- package/libs/{chunk-DKTHCQ5P.cjs → chunk-X5RKCLDC.cjs} +3 -3
- package/libs/components/breadcrumbs/breadcrumb.cjs +5 -5
- package/libs/components/breadcrumbs/breadcrumb.d.cts +1 -1
- package/libs/components/breadcrumbs/breadcrumb.d.ts +1 -1
- package/libs/components/breadcrumbs/breadcrumb.js +2 -2
- package/libs/components/button.cjs +3 -3
- package/libs/components/button.d.cts +1 -1
- package/libs/components/button.d.ts +1 -1
- package/libs/components/button.js +1 -1
- package/libs/components/buttons/button.css +1 -1
- package/libs/components/buttons/button.css.map +1 -1
- package/libs/components/buttons/button.min.css +2 -2
- package/libs/components/dialog/dialog.cjs +4 -4
- package/libs/components/dialog/dialog.js +2 -2
- package/libs/components/icons/icon.d.cts +32 -32
- package/libs/components/icons/icon.d.ts +32 -32
- package/libs/components/link/link.cjs +11 -3
- package/libs/components/link/link.d.cts +131 -3
- package/libs/components/link/link.d.ts +131 -3
- package/libs/components/link/link.js +1 -1
- package/libs/components/list/list.css +1 -1
- package/libs/components/list/list.min.css +1 -1
- package/libs/components/modal.cjs +3 -3
- package/libs/components/modal.js +2 -2
- package/libs/hooks.cjs +3 -3
- package/libs/hooks.d.cts +1 -1
- package/libs/hooks.d.ts +1 -1
- package/libs/hooks.js +2 -2
- package/libs/index.cjs +12 -12
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +237 -2
- package/libs/index.d.ts +237 -2
- package/libs/index.js +5 -5
- package/package.json +4 -3
- package/src/components/README.mdx +1 -1
- package/src/components/breadcrumbs/breadcrumb.test.tsx +1 -2
- package/src/components/buttons/README.mdx +19 -9
- package/src/components/buttons/button.scss +5 -0
- package/src/components/buttons/button.stories.tsx +8 -5
- package/src/components/buttons/button.tsx +19 -15
- package/src/components/cards/card.stories.tsx +1 -1
- package/src/components/details/details.stories.tsx +1 -1
- package/src/components/form/form.stories.tsx +1 -1
- package/src/components/form/input.stories.tsx +1 -1
- package/src/components/form/select.stories.tsx +1 -1
- package/src/components/heading/README.mdx +292 -0
- package/src/components/icons/icon.stories.tsx +1 -1
- package/src/components/link/link.stories.tsx +205 -8
- package/src/components/link/link.test.tsx +1 -1
- package/src/components/link/link.tsx +22 -0
- package/src/components/link/link.types.ts +11 -3
- package/src/components/list/list.scss +1 -1
- package/src/components/nav/nav.stories.tsx +1 -1
- package/src/components/ui.stories.tsx +53 -19
- package/src/docs/accessibility.mdx +484 -0
- package/src/docs/composition.mdx +549 -0
- package/src/docs/css-variables.mdx +380 -0
- package/src/docs/fpkit-developer.mdx +623 -0
- package/src/introduction.mdx +356 -0
- package/src/styles/buttons/button.css +4 -0
- package/src/styles/buttons/button.css.map +1 -1
- package/src/styles/index.css +9 -3
- package/src/styles/index.css.map +1 -1
- package/src/styles/list/list.css +1 -1
- package/src/styles/utilities/_disabled.scss +5 -4
- package/libs/chunk-33PNJ4LO.cjs +0 -15
- package/libs/chunk-33PNJ4LO.cjs.map +0 -1
- package/libs/chunk-GT77BX4L.cjs +0 -17
- package/libs/chunk-GT77BX4L.cjs.map +0 -1
- package/libs/chunk-OVWLQYMK.js +0 -10
- package/libs/chunk-OVWLQYMK.js.map +0 -1
- package/libs/chunk-UEPAWMDF.js +0 -8
- package/libs/chunk-UEPAWMDF.js.map +0 -1
- package/libs/link-5192f411.d.ts +0 -323
- /package/libs/{chunk-7XPFW7CB.js.map → chunk-43TK2ICH.js.map} +0 -0
- /package/libs/{chunk-QVW6W76L.cjs.map → chunk-MGPWZRBX.cjs.map} +0 -0
- /package/libs/{chunk-X3JCTEPD.js.map → chunk-QKHPHMG2.js.map} +0 -0
- /package/libs/{chunk-T4T6GWYQ.cjs.map → chunk-R7NLLZU2.cjs.map} +0 -0
- /package/libs/{chunk-X5LGFCWG.js.map → chunk-UJAQVHWC.js.map} +0 -0
- /package/libs/{chunk-DKTHCQ5P.cjs.map → chunk-X5RKCLDC.cjs.map} +0 -0
|
@@ -9,7 +9,7 @@ const buttonClicked = fn();
|
|
|
9
9
|
const meta = {
|
|
10
10
|
title: "FP.React Components/Buttons",
|
|
11
11
|
component: Button,
|
|
12
|
-
tags: ["
|
|
12
|
+
tags: ["beta"],
|
|
13
13
|
args: {
|
|
14
14
|
children: "Click me",
|
|
15
15
|
onClick: buttonClicked,
|
|
@@ -149,10 +149,13 @@ export const Disabled: Story = {
|
|
|
149
149
|
expect(button).toHaveAttribute("aria-disabled", "true");
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
await step(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
await step(
|
|
153
|
+
"Disabled button remains focusable for accessibility",
|
|
154
|
+
async () => {
|
|
155
|
+
await userEvent.tab();
|
|
156
|
+
expect(button).toHaveFocus();
|
|
157
|
+
}
|
|
158
|
+
);
|
|
156
159
|
|
|
157
160
|
await step("Disabled button prevents click interactions", async () => {
|
|
158
161
|
const clickHandler = fn();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import UI from
|
|
2
|
-
import React from
|
|
3
|
-
import { useDisabledState } from
|
|
4
|
-
import { resolveDisabledState } from
|
|
5
|
-
import type { DisabledStateProps } from
|
|
1
|
+
import UI from "../ui";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useDisabledState } from "../../hooks/use-disabled-state";
|
|
4
|
+
import { resolveDisabledState } from "../../utils/accessibility";
|
|
5
|
+
import type { DisabledStateProps } from "../../types/shared";
|
|
6
6
|
|
|
7
7
|
export type ButtonProps = Partial<React.ComponentProps<typeof UI>> &
|
|
8
8
|
DisabledStateProps & {
|
|
@@ -10,8 +10,8 @@ export type ButtonProps = Partial<React.ComponentProps<typeof UI>> &
|
|
|
10
10
|
* The button type
|
|
11
11
|
* Required - 'button' | 'submit' | 'reset'
|
|
12
12
|
*/
|
|
13
|
-
type:
|
|
14
|
-
}
|
|
13
|
+
type: "button" | "submit" | "reset";
|
|
14
|
+
};
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Accessible Button component with WCAG 2.1 Level AA compliant disabled state.
|
|
@@ -67,7 +67,7 @@ export type ButtonProps = Partial<React.ComponentProps<typeof UI>> &
|
|
|
67
67
|
* @see {@link file://./../../hooks/useDisabledState.md useDisabledState Hook Documentation}
|
|
68
68
|
*/
|
|
69
69
|
export const Button = ({
|
|
70
|
-
type =
|
|
70
|
+
type = "button",
|
|
71
71
|
children,
|
|
72
72
|
styles,
|
|
73
73
|
disabled,
|
|
@@ -81,7 +81,7 @@ export const Button = ({
|
|
|
81
81
|
...props
|
|
82
82
|
}: ButtonProps) => {
|
|
83
83
|
// Resolve disabled state from both props (disabled takes precedence)
|
|
84
|
-
const isActuallyDisabled = resolveDisabledState(disabled, isDisabled)
|
|
84
|
+
const isActuallyDisabled = resolveDisabledState(disabled, isDisabled);
|
|
85
85
|
|
|
86
86
|
// Use the disabled state hook with enhanced API for automatic className merging
|
|
87
87
|
const { disabledProps, handlers } = useDisabledState<HTMLButtonElement>(
|
|
@@ -97,14 +97,14 @@ export const Button = ({
|
|
|
97
97
|
// Note: onPointerOver and onPointerLeave are intentionally NOT wrapped
|
|
98
98
|
// to allow hover effects on disabled buttons for visual feedback
|
|
99
99
|
}
|
|
100
|
-
)
|
|
100
|
+
);
|
|
101
101
|
|
|
102
102
|
/* Returning a button element with accessible disabled state */
|
|
103
103
|
return (
|
|
104
104
|
<UI
|
|
105
105
|
as="button"
|
|
106
106
|
type={type}
|
|
107
|
-
aria-disabled={disabledProps[
|
|
107
|
+
aria-disabled={disabledProps["aria-disabled"]}
|
|
108
108
|
onPointerOver={onPointerOver}
|
|
109
109
|
onPointerLeave={onPointerLeave}
|
|
110
110
|
style={styles}
|
|
@@ -114,8 +114,12 @@ export const Button = ({
|
|
|
114
114
|
>
|
|
115
115
|
{children}
|
|
116
116
|
</UI>
|
|
117
|
-
)
|
|
118
|
-
}
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
119
|
|
|
120
|
-
export
|
|
121
|
-
Button
|
|
120
|
+
export const IconButton = ({ icon, ...props }: ButtonProps) => {
|
|
121
|
+
return <Button {...props}>{icon}</Button>;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default Button;
|
|
125
|
+
Button.displayName = "Button";
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="FP.REACT Components/Heading (Deprecated)/Readme" />
|
|
4
|
+
|
|
5
|
+
# Heading (Deprecated)
|
|
6
|
+
|
|
7
|
+
> ⚠️ **DEPRECATED**: This component is deprecated and will be removed in **v3.0.0**. Please use the [`Title`](?path=/docs/fp-react-components-title--docs) component instead.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Deprecation Notice
|
|
12
|
+
|
|
13
|
+
<div style={{ padding: '1.5rem', background: '#fef3c7', border: '2px solid #f59e0b', borderRadius: '0.5rem', marginBottom: '2rem' }}>
|
|
14
|
+
<strong style={{ color: '#92400e', fontSize: '1.125rem' }}>⚠️ This component is deprecated</strong>
|
|
15
|
+
<p style={{ marginTop: '0.5rem', color: '#78350f' }}>
|
|
16
|
+
The <code>Heading</code> component has been replaced by the new <code>Title</code> component
|
|
17
|
+
which offers improved API design, better accessibility features, and enhanced performance.
|
|
18
|
+
</p>
|
|
19
|
+
<p style={{ marginTop: '0.5rem', color: '#78350f' }}>
|
|
20
|
+
<strong>Removal Timeline:</strong> This component will be removed in v3.0.0 (TBD)
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Quick Migration
|
|
27
|
+
|
|
28
|
+
### Before (Deprecated)
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { Heading } from '@fpkit/acss';
|
|
32
|
+
|
|
33
|
+
<Heading type="h2">Section Title</Heading>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### After (Recommended)
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { Title } from '@fpkit/acss';
|
|
40
|
+
|
|
41
|
+
<Title level="h2">Section Title</Title>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Why We Deprecated Heading
|
|
47
|
+
|
|
48
|
+
The new `Title` component provides several advantages over the deprecated `Heading` component:
|
|
49
|
+
|
|
50
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))', gap: '1rem', margin: '1.5rem 0' }}>
|
|
51
|
+
<div style={{ padding: '1rem', border: '1px solid #e0e0e0', borderRadius: '0.5rem' }}>
|
|
52
|
+
<strong>✅ Better API</strong>
|
|
53
|
+
<p style={{ fontSize: '0.875rem', color: '#666' }}>The <code>level</code> prop is more semantic and descriptive than <code>type</code></p>
|
|
54
|
+
</div>
|
|
55
|
+
<div style={{ padding: '1rem', border: '1px solid #e0e0e0', borderRadius: '0.5rem' }}>
|
|
56
|
+
<strong>✅ Improved Accessibility</strong>
|
|
57
|
+
<p style={{ fontSize: '0.875rem', color: '#666' }}>Enhanced WCAG 2.1 AA compliance with better screen reader support</p>
|
|
58
|
+
</div>
|
|
59
|
+
<div style={{ padding: '1rem', border: '1px solid #e0e0e0', borderRadius: '0.5rem' }}>
|
|
60
|
+
<strong>✅ Better Documentation</strong>
|
|
61
|
+
<p style={{ fontSize: '0.875rem', color: '#666' }}>Comprehensive JSDoc comments for improved TypeScript IntelliSense</p>
|
|
62
|
+
</div>
|
|
63
|
+
<div style={{ padding: '1rem', border: '1px solid #e0e0e0', borderRadius: '0.5rem' }}>
|
|
64
|
+
<strong>✅ Performance</strong>
|
|
65
|
+
<p style={{ fontSize: '0.875rem', color: '#666' }}>React.memo optimization prevents unnecessary re-renders</p>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Migration Guide
|
|
72
|
+
|
|
73
|
+
### Step-by-Step Migration
|
|
74
|
+
|
|
75
|
+
#### 1. Update Imports
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
// Before
|
|
79
|
+
import { Heading } from '@fpkit/acss';
|
|
80
|
+
|
|
81
|
+
// After
|
|
82
|
+
import { Title } from '@fpkit/acss';
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### 2. Rename the Component
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
// Before
|
|
89
|
+
<Heading type="h2">Section Title</Heading>
|
|
90
|
+
|
|
91
|
+
// After
|
|
92
|
+
<Title level="h2">Section Title</Title>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### 3. Update the Prop Name
|
|
96
|
+
|
|
97
|
+
The only prop that changed is `type` → `level`:
|
|
98
|
+
|
|
99
|
+
| Old Prop | New Prop | Description |
|
|
100
|
+
|----------|----------|-------------|
|
|
101
|
+
| `type` | `level` | The semantic heading level (h1-h6) |
|
|
102
|
+
|
|
103
|
+
#### 4. Review Default Behavior
|
|
104
|
+
|
|
105
|
+
**IMPORTANT:** The default heading level changed:
|
|
106
|
+
|
|
107
|
+
- **Heading (old)**: Default is `h3`
|
|
108
|
+
- **Title (new)**: Default is `h2`
|
|
109
|
+
|
|
110
|
+
If you relied on the default, you may need to explicitly specify `h3`:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
// Before (implicitly h3)
|
|
114
|
+
<Heading>Default Heading</Heading>
|
|
115
|
+
|
|
116
|
+
// After (explicitly h3 to maintain behavior)
|
|
117
|
+
<Title level="h3">Default Heading</Title>
|
|
118
|
+
|
|
119
|
+
// Or use the new default (h2)
|
|
120
|
+
<Title>Default Title</Title>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## All Heading Levels
|
|
126
|
+
|
|
127
|
+
The `Heading` component supports all six semantic heading levels, just like `Title`:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
// h1 - Page title (use once per page)
|
|
131
|
+
<Heading type="h1">Main Page Title</Heading>
|
|
132
|
+
|
|
133
|
+
// h2 - Major sections
|
|
134
|
+
<Heading type="h2">Section Heading</Heading>
|
|
135
|
+
|
|
136
|
+
// h3 - Subsections (default)
|
|
137
|
+
<Heading type="h3">Subsection Heading</Heading>
|
|
138
|
+
|
|
139
|
+
// h4-h6 - Deeper nesting
|
|
140
|
+
<Heading type="h4">Level Four Heading</Heading>
|
|
141
|
+
<Heading type="h5">Level Five Heading</Heading>
|
|
142
|
+
<Heading type="h6">Level Six Heading</Heading>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Migrate to:**
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
// h1 - Page title (use once per page)
|
|
149
|
+
<Title level="h1">Main Page Title</Title>
|
|
150
|
+
|
|
151
|
+
// h2 - Major sections (now default)
|
|
152
|
+
<Title level="h2">Section Heading</Title>
|
|
153
|
+
|
|
154
|
+
// h3 - Subsections
|
|
155
|
+
<Title level="h3">Subsection Heading</Title>
|
|
156
|
+
|
|
157
|
+
// h4-h6 - Deeper nesting
|
|
158
|
+
<Title level="h4">Level Four Heading</Title>
|
|
159
|
+
<Title level="h5">Level Five Heading</Title>
|
|
160
|
+
<Title level="h6">Level Six Heading</Title>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Props
|
|
166
|
+
|
|
167
|
+
> **Note**: These props still work but are deprecated. Refer to the [Title component documentation](?path=/docs/fp-react-components-title--docs) for the current API.
|
|
168
|
+
|
|
169
|
+
| Prop | Type | Default | Description |
|
|
170
|
+
|------|------|---------|-------------|
|
|
171
|
+
| `type` | `"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6"` | `"h3"` | **Deprecated.** Use `level` on Title component instead |
|
|
172
|
+
| `children` | `React.ReactNode` | *required* | The content to display in the heading |
|
|
173
|
+
| `ui` | `string` | - | Data attribute for fpkit styling hooks |
|
|
174
|
+
| `className` | `string` | - | CSS class names to apply |
|
|
175
|
+
| `ref` | `React.Ref<HTMLHeadingElement>` | - | Forwarded ref to the heading element |
|
|
176
|
+
|
|
177
|
+
All other standard HTML heading attributes and ARIA properties are also supported.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Current Behavior
|
|
182
|
+
|
|
183
|
+
The `Heading` component still works for backwards compatibility but:
|
|
184
|
+
|
|
185
|
+
### Development Warnings
|
|
186
|
+
|
|
187
|
+
In development mode, the component logs deprecation warnings to the console:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
[@fpkit/acss] Heading component is deprecated and will be removed in v3.0.0.
|
|
191
|
+
Please use the Title component instead.
|
|
192
|
+
Migration: <Heading type="h2"> → <Title level="h2">
|
|
193
|
+
See documentation: https://fpkit.dev/components/title
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Production Behavior
|
|
197
|
+
|
|
198
|
+
- No console warnings in production builds
|
|
199
|
+
- Full backwards compatibility maintained
|
|
200
|
+
- All props forwarded correctly to Title component
|
|
201
|
+
- Performance identical to direct Title usage
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## TypeScript Support
|
|
206
|
+
|
|
207
|
+
The component maintains full TypeScript support:
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { Heading, type TitleProps } from '@fpkit/acss';
|
|
211
|
+
|
|
212
|
+
// Old API (still typed correctly)
|
|
213
|
+
<Heading type="h2">Typed Heading</Heading>
|
|
214
|
+
|
|
215
|
+
// Type-safe with all Title props
|
|
216
|
+
const props: TitleProps = {
|
|
217
|
+
type: 'h3',
|
|
218
|
+
children: 'Section Title',
|
|
219
|
+
className: 'custom-class'
|
|
220
|
+
};
|
|
221
|
+
<Heading {...props} />
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
However, TypeScript will show deprecation warnings in your IDE for better migration visibility.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Migration Checklist
|
|
229
|
+
|
|
230
|
+
Use this checklist to ensure a smooth migration:
|
|
231
|
+
|
|
232
|
+
- [ ] Find all `<Heading>` imports in your codebase
|
|
233
|
+
- [ ] Replace `import { Heading }` with `import { Title }`
|
|
234
|
+
- [ ] Replace all `<Heading>` tags with `<Title>`
|
|
235
|
+
- [ ] Replace all `type` props with `level`
|
|
236
|
+
- [ ] Review uses without explicit `type` prop (default changed from `h3` → `h2`)
|
|
237
|
+
- [ ] Test all migrated components
|
|
238
|
+
- [ ] Remove any `Heading` imports
|
|
239
|
+
- [ ] Search for any remaining references to `Heading` component
|
|
240
|
+
|
|
241
|
+
### Find and Replace Tips
|
|
242
|
+
|
|
243
|
+
**VS Code / IDE Search:**
|
|
244
|
+
|
|
245
|
+
```regex
|
|
246
|
+
# Find
|
|
247
|
+
<Heading\s+type="(h[1-6])"
|
|
248
|
+
|
|
249
|
+
# Replace with
|
|
250
|
+
<Title level="$1"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Command Line (ripgrep):**
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# Find all Heading usage
|
|
257
|
+
rg "Heading" --type tsx --type ts
|
|
258
|
+
|
|
259
|
+
# Find Heading imports
|
|
260
|
+
rg "import.*Heading.*from.*@fpkit/acss"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Related Components
|
|
266
|
+
|
|
267
|
+
- **[Title](?path=/docs/fp-react-components-title--docs)** - The recommended replacement component
|
|
268
|
+
- **Text** - For body text and paragraphs
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Support & Resources
|
|
273
|
+
|
|
274
|
+
- **Title Component Docs**: [View documentation](?path=/docs/fp-react-components-title--docs)
|
|
275
|
+
- **GitHub**: [fpkit/acss](https://github.com/fpkit/acss)
|
|
276
|
+
- **Migration Help**: Open an issue if you need assistance migrating
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
<div style={{ padding: '1.5rem', background: '#f0f9ff', border: '1px solid #0ea5e9', borderRadius: '0.5rem', marginTop: '2rem' }}>
|
|
281
|
+
<strong>💡 Migration Tip:</strong> The Title component maintains the same functionality
|
|
282
|
+
while providing better DX and accessibility. The migration is straightforward and can be done incrementally.
|
|
283
|
+
Start by migrating new code, then gradually update existing components.
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
<div style={{ padding: '1.5rem', background: '#fef3c7', border: '2px solid #f59e0b', borderRadius: '0.5rem', marginTop: '1rem' }}>
|
|
287
|
+
<strong style={{ color: '#92400e' }}>⚠️ Removal Timeline</strong>
|
|
288
|
+
<p style={{ marginTop: '0.5rem', color: '#78350f', marginBottom: 0 }}>
|
|
289
|
+
Plan to complete your migration before upgrading to v3.0.0.
|
|
290
|
+
This component will be completely removed in that release.
|
|
291
|
+
</p>
|
|
292
|
+
</div>
|