@gridui/text-morph 1.1.0 → 1.1.2
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 +2 -0
- package/docs/catalog.json +6 -2
- package/docs/reference/README.md +4 -0
- package/docs/reference/text-morph.md +125 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -98,3 +98,5 @@ that disables accessibility preferences are outside GridUI's React contract.
|
|
|
98
98
|
|
|
99
99
|
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md)
|
|
100
100
|
and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/text-morph/.changeset/history).
|
|
101
|
+
|
|
102
|
+
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
package/docs/catalog.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/text-morph",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"category": "core",
|
|
6
6
|
"description": "GridUI React text and number transitions",
|
|
7
7
|
"usage": "`children` accepts a string or number. Numbers use `Intl.NumberFormat`; strings retain their formatting. The host owns `locale` and formatting policy. Supply the same locale on the server and client when formatting numbers.",
|
|
8
8
|
"documentation": [
|
|
9
|
-
"README.md"
|
|
9
|
+
"README.md",
|
|
10
|
+
"docs/reference/README.md",
|
|
11
|
+
"docs/reference/text-morph.md"
|
|
10
12
|
],
|
|
11
13
|
"exports": [
|
|
12
14
|
{
|
|
@@ -40,6 +42,8 @@
|
|
|
40
42
|
"@gridui/text-morph/styles.css"
|
|
41
43
|
],
|
|
42
44
|
"examples": [
|
|
45
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/text-morph/stories/custom-transitions.mdx",
|
|
46
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/text-morph/stories/labels-values.mdx",
|
|
43
47
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/text-morph/stories/text-morph.stories.tsx"
|
|
44
48
|
]
|
|
45
49
|
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# TextMorph
|
|
3
|
+
|
|
4
|
+
Animates changes to text and numbers while preserving readable content. Use it for changing labels, counters, and status values.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/text-morph`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { TextMorph } from "@gridui/text-morph";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/text-morph/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/text-morph/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/text-morph/stories/text-morph.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### onFocus
|
|
23
|
+
|
|
24
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
25
|
+
|
|
26
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
27
|
+
|
|
28
|
+
### onBlur
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onChange
|
|
35
|
+
|
|
36
|
+
``(event: ChangeEvent<HTMLSpanElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onSubmit
|
|
41
|
+
|
|
42
|
+
``(event: SubmitEvent<HTMLSpanElement>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onClick
|
|
47
|
+
|
|
48
|
+
``(event: MouseEvent<HTMLSpanElement, MouseEvent>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### locale
|
|
53
|
+
|
|
54
|
+
``string | undefined`` · Optional
|
|
55
|
+
|
|
56
|
+
### formatOptions
|
|
57
|
+
|
|
58
|
+
``Intl.NumberFormatOptions | undefined`` · Optional
|
|
59
|
+
|
|
60
|
+
### numbers
|
|
61
|
+
|
|
62
|
+
``boolean | undefined`` · Optional
|
|
63
|
+
|
|
64
|
+
### cursorIndex
|
|
65
|
+
|
|
66
|
+
``number | undefined`` · Optional
|
|
67
|
+
|
|
68
|
+
UTF-16 caret position after an edit. Disables numeric place matching.
|
|
69
|
+
|
|
70
|
+
### disabled
|
|
71
|
+
|
|
72
|
+
``boolean | undefined`` · Optional
|
|
73
|
+
|
|
74
|
+
Prevents interaction when enabled.
|
|
75
|
+
|
|
76
|
+
### respectReducedMotion
|
|
77
|
+
|
|
78
|
+
``boolean | undefined`` · Optional
|
|
79
|
+
|
|
80
|
+
### duration
|
|
81
|
+
|
|
82
|
+
``number | undefined`` · Optional
|
|
83
|
+
|
|
84
|
+
### ease
|
|
85
|
+
|
|
86
|
+
``string | TextMorphSpring | undefined`` · Optional
|
|
87
|
+
|
|
88
|
+
### scale
|
|
89
|
+
|
|
90
|
+
``boolean | undefined`` · Optional
|
|
91
|
+
|
|
92
|
+
### debug
|
|
93
|
+
|
|
94
|
+
``boolean | undefined`` · Optional
|
|
95
|
+
|
|
96
|
+
### onAnimationStart
|
|
97
|
+
|
|
98
|
+
``(): void`` · Optional
|
|
99
|
+
|
|
100
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
101
|
+
|
|
102
|
+
### onAnimationComplete
|
|
103
|
+
|
|
104
|
+
``(): void`` · Optional
|
|
105
|
+
|
|
106
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
107
|
+
|
|
108
|
+
### onAnimationCancel
|
|
109
|
+
|
|
110
|
+
``(): void`` · Optional
|
|
111
|
+
|
|
112
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
113
|
+
|
|
114
|
+
### children
|
|
115
|
+
|
|
116
|
+
``string | number`` · Required
|
|
117
|
+
|
|
118
|
+
Content rendered inside the component.
|
|
119
|
+
|
|
120
|
+
### as
|
|
121
|
+
|
|
122
|
+
``"div" | "em" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "strong" | undefined`` · Optional
|
|
123
|
+
|
|
124
|
+
Default: ``"span"``
|
|
125
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/text-morph",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "GridUI React text and number transitions",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-dom": "^19.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gridui/style-utils": "^
|
|
30
|
+
"@gridui/style-utils": "^4.0.0",
|
|
31
31
|
"@gridui/theme": "^2.5.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|