@charcuterie/ui 3.9.0 → 3.10.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 +10 -0
- package/dist/Badge/Badge.d.ts +2 -37
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +15 -30
- package/dist/Badge/Badge.js.map +1 -1
- package/dist/Badge/useBadgeShape.d.ts +57 -0
- package/dist/Badge/useBadgeShape.d.ts.map +1 -0
- package/dist/Badge/useBadgeShape.js +35 -0
- package/dist/Badge/useBadgeShape.js.map +1 -0
- package/dist/BadgeButton/BadgeButton.d.ts +59 -0
- package/dist/BadgeButton/BadgeButton.d.ts.map +1 -0
- package/dist/BadgeButton/BadgeButton.js +64 -0
- package/dist/BadgeButton/BadgeButton.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Badge/Badge.tsx +30 -113
- package/src/Badge/useBadgeShape.tsx +142 -0
- package/src/BadgeButton/BadgeButton.mdx +67 -0
- package/src/BadgeButton/BadgeButton.stories.tsx +199 -0
- package/src/BadgeButton/BadgeButton.test.tsx +164 -0
- package/src/BadgeButton/BadgeButton.tsx +129 -0
- package/src/index.ts +3 -0
- package/src/sourceRules.test.ts +8 -1
package/src/index.ts
CHANGED
|
@@ -65,6 +65,9 @@ export type {
|
|
|
65
65
|
export { Alert } from "./Alert/Alert.tsx"
|
|
66
66
|
export type { BadgeProps } from "./Badge/Badge.tsx"
|
|
67
67
|
export { Badge } from "./Badge/Badge.tsx"
|
|
68
|
+
export type { BadgeShapeProps } from "./Badge/useBadgeShape.tsx"
|
|
69
|
+
export type { BadgeButtonProps } from "./BadgeButton/BadgeButton.tsx"
|
|
70
|
+
export { BadgeButton } from "./BadgeButton/BadgeButton.tsx"
|
|
68
71
|
export type {
|
|
69
72
|
BoardMove,
|
|
70
73
|
BoardProps,
|
package/src/sourceRules.test.ts
CHANGED
|
@@ -452,7 +452,14 @@ test("the barrel is the only place components are re-exported", async () => {
|
|
|
452
452
|
// count by the `<Name>/<Name>.tsx` rule; it is not exported from the
|
|
453
453
|
// barrel either, because a consumer sets `min`/`max`/`step` and never
|
|
454
454
|
// does the arithmetic itself.
|
|
455
|
-
|
|
455
|
+
//
|
|
456
|
+
// `BadgeButton` — a `Badge` you can press — is +1 -> 53. It is to
|
|
457
|
+
// `Badge` what `ButtonLink` is to `Button`: a sibling element
|
|
458
|
+
// sharing one paint, here through `useBadgeShape`, which is a
|
|
459
|
+
// member of `Badge/` and so stays out of this count and out of the
|
|
460
|
+
// barrel as a component. Its PROPS type is exported, because a
|
|
461
|
+
// consumer writing a wrapper needs to name the visual half.
|
|
462
|
+
expect(componentNames.length).toBe(53)
|
|
456
463
|
|
|
457
464
|
for (const name of componentNames) {
|
|
458
465
|
expect(barrel).toContain(`export { ${name} }`)
|