@axinom/mosaic-ui 0.78.0-rc.10 → 0.78.0-rc.12
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": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.78.0-rc.
|
|
3
|
+
"version": "0.78.0-rc.12",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.19.0"
|
|
6
6
|
},
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"publishConfig": {
|
|
120
120
|
"access": "public"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "550394b75aabb4700d8d7c05c5363e4af64906ba"
|
|
123
123
|
}
|
|
@@ -24,6 +24,25 @@ const meta: Meta<typeof Badge> = {
|
|
|
24
24
|
</div>
|
|
25
25
|
),
|
|
26
26
|
],
|
|
27
|
+
argTypes: {
|
|
28
|
+
// `content` is `string | number`, so Storybook would infer a number control
|
|
29
|
+
// from the default arg. A text control allows both kinds of input.
|
|
30
|
+
content: { control: 'text' },
|
|
31
|
+
},
|
|
32
|
+
// The text control always yields strings, so numeric input is converted back
|
|
33
|
+
// to a number to keep `max` (which only caps numbers) working.
|
|
34
|
+
render: ({ content, ...args }) => (
|
|
35
|
+
<Badge
|
|
36
|
+
{...args}
|
|
37
|
+
content={
|
|
38
|
+
typeof content === 'string' &&
|
|
39
|
+
content.trim() !== '' &&
|
|
40
|
+
!isNaN(Number(content))
|
|
41
|
+
? Number(content)
|
|
42
|
+
: content
|
|
43
|
+
}
|
|
44
|
+
/>
|
|
45
|
+
),
|
|
27
46
|
args: {
|
|
28
47
|
content: 5,
|
|
29
48
|
position: 'top-right',
|
|
@@ -38,6 +57,10 @@ export const MultiDigitCapped: StoryObj<typeof Badge> = {
|
|
|
38
57
|
args: { content: 1000, max: 99 },
|
|
39
58
|
};
|
|
40
59
|
|
|
60
|
+
export const StringContent: StoryObj<typeof Badge> = {
|
|
61
|
+
args: { content: 'New' },
|
|
62
|
+
};
|
|
63
|
+
|
|
41
64
|
export const BottomLeftFlush: StoryObj<typeof Badge> = {
|
|
42
65
|
args: { position: 'bottom-left', overlap: false },
|
|
43
66
|
};
|