@42-central/ui-react 0.22.0 → 0.23.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.
Files changed (59) hide show
  1. package/dist/{chunk-DJAXXLN6.js → chunk-F2FSHVO5.js} +3 -3
  2. package/dist/{chunk-DJAXXLN6.js.map → chunk-F2FSHVO5.js.map} +1 -1
  3. package/dist/components/camera/index.js +2 -2
  4. package/dist/components/data-table/index.js +1 -1
  5. package/dist/components/geodesic/a11y.d.ts +15 -0
  6. package/dist/components/geodesic/a11y.d.ts.map +1 -0
  7. package/dist/components/geodesic/activity-badge.d.ts +5 -0
  8. package/dist/components/geodesic/activity-badge.d.ts.map +1 -0
  9. package/dist/components/geodesic/badge-frame.d.ts +60 -0
  10. package/dist/components/geodesic/badge-frame.d.ts.map +1 -0
  11. package/dist/components/geodesic/exam-badge.d.ts +5 -0
  12. package/dist/components/geodesic/exam-badge.d.ts.map +1 -0
  13. package/dist/components/geodesic/geometry.d.ts +1089 -0
  14. package/dist/components/geodesic/geometry.d.ts.map +1 -0
  15. package/dist/components/geodesic/gift-box-badge.d.ts +5 -0
  16. package/dist/components/geodesic/gift-box-badge.d.ts.map +1 -0
  17. package/dist/components/geodesic/gift-token.d.ts +23 -0
  18. package/dist/components/geodesic/gift-token.d.ts.map +1 -0
  19. package/dist/components/geodesic/glyph-slot.d.ts +8 -0
  20. package/dist/components/geodesic/glyph-slot.d.ts.map +1 -0
  21. package/dist/components/geodesic/index.d.ts +12 -0
  22. package/dist/components/geodesic/index.d.ts.map +1 -0
  23. package/dist/components/geodesic/index.js +917 -0
  24. package/dist/components/geodesic/index.js.map +1 -0
  25. package/dist/components/geodesic/module-badge.d.ts +5 -0
  26. package/dist/components/geodesic/module-badge.d.ts.map +1 -0
  27. package/dist/components/geodesic/planet.d.ts +30 -0
  28. package/dist/components/geodesic/planet.d.ts.map +1 -0
  29. package/dist/components/geodesic/project-badge.d.ts +5 -0
  30. package/dist/components/geodesic/project-badge.d.ts.map +1 -0
  31. package/dist/components/geodesic/skill-badge.d.ts +5 -0
  32. package/dist/components/geodesic/skill-badge.d.ts.map +1 -0
  33. package/dist/components/geodesic/social-badge.d.ts +8 -0
  34. package/dist/components/geodesic/social-badge.d.ts.map +1 -0
  35. package/dist/components/geodesic/status.d.ts +80 -0
  36. package/dist/components/geodesic/status.d.ts.map +1 -0
  37. package/dist/components/geodesic/styles.css +146 -0
  38. package/dist/components/photo-capture/index.js +2 -2
  39. package/package.json +2 -1
  40. package/src/as-child.contract.test.tsx +2 -0
  41. package/src/components/geodesic/a11y.ts +10 -0
  42. package/src/components/geodesic/activity-badge.tsx +17 -0
  43. package/src/components/geodesic/badge-frame.tsx +324 -0
  44. package/src/components/geodesic/exam-badge.tsx +17 -0
  45. package/src/components/geodesic/geometry.test.ts +60 -0
  46. package/src/components/geodesic/geometry.ts +367 -0
  47. package/src/components/geodesic/gift-box-badge.tsx +17 -0
  48. package/src/components/geodesic/gift-token.tsx +104 -0
  49. package/src/components/geodesic/glyph-slot.tsx +28 -0
  50. package/src/components/geodesic/index.ts +13 -0
  51. package/src/components/geodesic/module-badge.tsx +17 -0
  52. package/src/components/geodesic/planet.tsx +131 -0
  53. package/src/components/geodesic/project-badge.tsx +17 -0
  54. package/src/components/geodesic/skill-badge.tsx +17 -0
  55. package/src/components/geodesic/social-badge.tsx +21 -0
  56. package/src/components/geodesic/status.test.ts +66 -0
  57. package/src/components/geodesic/status.ts +176 -0
  58. package/src/components/geodesic/styles.css +146 -0
  59. package/src/icon-stroke.test.tsx +5 -0
@@ -0,0 +1,60 @@
1
+ import { type CSSProperties } from "react";
2
+ import type { WithTestId } from "../../lib/test-id";
3
+ import { type BadgeStatus, type Hue, type Tone } from "./status";
4
+ /** The shape every generated solid has (see `packages/react/scripts/generate-geometry.ts`). */
5
+ export type SolidData = {
6
+ readonly facets: readonly {
7
+ readonly points: string;
8
+ readonly tone: Tone;
9
+ readonly rank: number;
10
+ }[];
11
+ readonly edges: string;
12
+ readonly hidden: string;
13
+ readonly hull: string;
14
+ readonly details: string;
15
+ };
16
+ export type BadgeTile = {
17
+ readonly kind: "circle";
18
+ } | {
19
+ readonly kind: "polygon";
20
+ readonly points: string;
21
+ };
22
+ /** Props every badge shares. */
23
+ export type BadgeBaseProps = WithTestId & {
24
+ status: BadgeStatus;
25
+ /**
26
+ * Completion while `in-progress`, 0–100: fills the solid from the bottom
27
+ * up, each face from its own base through a soft gradient, animating
28
+ * between values. 0–100 is drawn as 15–100% of the fill, so
29
+ * started work always shows light. Ignored in other statuses. Defaults to 50.
30
+ */
31
+ progress?: number;
32
+ /** Rendered width and height, in px. */
33
+ size?: number;
34
+ /** Accessible name. Without one the badge is decorative and hidden from assistive tech. */
35
+ label?: string;
36
+ className?: string;
37
+ style?: CSSProperties;
38
+ };
39
+ type BadgeFrameProps = BadgeBaseProps & {
40
+ tile: BadgeTile;
41
+ solids: readonly SolidData[];
42
+ doneHue: Hue;
43
+ /**
44
+ * How a locked badge shows its solid: the module keeps its wireframe, the
45
+ * other shapes collapse to a dotted silhouette.
46
+ */
47
+ locked: "wire" | "silhouette";
48
+ /** Dotted connectors drawn between the solids (the social badge). */
49
+ links?: string;
50
+ };
51
+ /** Starts at `from` and moves to `target` on the next frame, so CSS can transition it. */
52
+ export declare function useSettled<T>(from: T, target: T): T;
53
+ /**
54
+ * Draws any statused badge: a tile, one or more solids, and what the status
55
+ * adds (lock, glow). The per-shape components only pick the geometry
56
+ * and the done hue.
57
+ */
58
+ export declare function BadgeFrame({ status, size, label, className, style, testId, tile, solids, doneHue, progress, locked, links, }: BadgeFrameProps): import("react").JSX.Element;
59
+ export {};
60
+ //# sourceMappingURL=badge-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge-frame.d.ts","sourceRoot":"","sources":["../../../src/components/geodesic/badge-frame.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAA6C,MAAM,OAAO,CAAA;AAGrF,OAAO,KAAK,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AAG,YAAY,CAAA;IAC7B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAoID,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAO/C;AAiCD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,IAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAa,EACb,MAAM,EACN,KAAK,GACN,EAAE,eAAe,+BAmEjB"}
@@ -0,0 +1,5 @@
1
+ import { type BadgeBaseProps } from "./badge-frame";
2
+ export type ExamBadgeProps = BadgeBaseProps;
3
+ /** An exam: the tetrahedron in a triangle. Validated, gold. */
4
+ export declare function ExamBadge(props: ExamBadgeProps): import("react").JSX.Element;
5
+ //# sourceMappingURL=exam-badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exam-badge.d.ts","sourceRoot":"","sources":["../../../src/components/geodesic/exam-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAc,MAAM,eAAe,CAAA;AAG/D,MAAM,MAAM,cAAc,GAAG,cAAc,CAAA;AAE3C,+DAA+D;AAC/D,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAU9C"}