@cuemath/leap 2.9.10 → 2.9.11

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 (44) hide show
  1. package/dist/features/post-game-stats/digital-meter/constants.js +12 -11
  2. package/dist/features/post-game-stats/digital-meter/constants.js.map +1 -1
  3. package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js +15 -16
  4. package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js.map +1 -1
  5. package/dist/features/post-game-stats/digital-meter/digital-meter.js +88 -86
  6. package/dist/features/post-game-stats/digital-meter/digital-meter.js.map +1 -1
  7. package/dist/features/post-game-stats/digital-meter/helper.js +3 -13
  8. package/dist/features/post-game-stats/digital-meter/helper.js.map +1 -1
  9. package/dist/features/ui/animated-arc/animated-arc-constants.js +6 -0
  10. package/dist/features/ui/animated-arc/animated-arc-constants.js.map +1 -0
  11. package/dist/features/ui/animated-arc/animated-arc-helpers.js +14 -0
  12. package/dist/features/ui/animated-arc/animated-arc-helpers.js.map +1 -0
  13. package/dist/features/ui/animated-arc/animated-arc-styled.js +33 -0
  14. package/dist/features/ui/animated-arc/animated-arc-styled.js.map +1 -0
  15. package/dist/features/ui/animated-arc/animated-arc.js +49 -0
  16. package/dist/features/ui/animated-arc/animated-arc.js.map +1 -0
  17. package/dist/features/ui/context-menu/context-menu.js +28 -18
  18. package/dist/features/ui/context-menu/context-menu.js.map +1 -1
  19. package/dist/features/ui/image/image.js +12 -12
  20. package/dist/features/ui/image/image.js.map +1 -1
  21. package/dist/features/ui/inputs/base-input/base-input-styled.js +77 -67
  22. package/dist/features/ui/inputs/base-input/base-input-styled.js.map +1 -1
  23. package/dist/features/ui/inputs/base-input/base-input.js +49 -47
  24. package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
  25. package/dist/features/ui/inputs/text-input/text-input.js +14 -12
  26. package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
  27. package/dist/features/ui/lottie-animation/lottie-animation.js +37 -28
  28. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  29. package/dist/features/ui/text/text.js +29 -27
  30. package/dist/features/ui/text/text.js.map +1 -1
  31. package/dist/features/ui/theme/button.js +17 -0
  32. package/dist/features/ui/theme/button.js.map +1 -1
  33. package/dist/features/ui/theme/input.js +67 -14
  34. package/dist/features/ui/theme/input.js.map +1 -1
  35. package/dist/index.d.ts +31 -2
  36. package/dist/index.js +229 -225
  37. package/dist/index.js.map +1 -1
  38. package/package.json +1 -1
  39. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.js +0 -17
  40. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.js.map +0 -1
  41. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.js +0 -50
  42. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.js.map +0 -1
  43. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/constants.js +0 -6
  44. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/constants.js.map +0 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "2.9.10",
3
+ "version": "2.9.11",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,17 +0,0 @@
1
- import i from "styled-components";
2
- import { RAINBOW_COLOR_ANIMATION_DURATION as r } from "../../constants.js";
3
- import { rainbowColorAnimation as n } from "../../helper.js";
4
- import { ARC_Z_INDEX as s } from "./constants.js";
5
- const p = i.svg`
6
- position: absolute;
7
- z-index: ${s};
8
- `, A = i.path`
9
- stroke: ${({ theme: o, stroke: t }) => o.colors[t]};
10
- animation: ${({ $playRainbowColors: o }) => o ? n : "undefined"}
11
- ${r}s ease infinite forwards;
12
- `;
13
- export {
14
- A as Path,
15
- p as Svg
16
- };
17
- //# sourceMappingURL=animated-arc-styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"animated-arc-styled.js","sources":["../../../../../../src/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\n\nimport styled from 'styled-components';\n\nimport { RAINBOW_COLOR_ANIMATION_DURATION } from '../../constants';\nimport { rainbowColorAnimation } from '../../helper';\nimport { ARC_Z_INDEX } from './constants';\n\nexport const Svg = styled.svg`\n position: absolute;\n z-index: ${ARC_Z_INDEX};\n`;\n\nexport const Path = styled.path<{ stroke: TColorNames; $playRainbowColors: boolean }>`\n stroke: ${({ theme, stroke }) => theme.colors[stroke]};\n animation: ${({ $playRainbowColors }) =>\n $playRainbowColors ? rainbowColorAnimation : 'undefined'}\n ${RAINBOW_COLOR_ANIMATION_DURATION}s ease infinite forwards;\n`;\n"],"names":["Svg","styled","ARC_Z_INDEX","Path","theme","stroke","$playRainbowColors","rainbowColorAnimation","RAINBOW_COLOR_ANIMATION_DURATION"],"mappings":";;;;AAQO,MAAMA,IAAMC,EAAO;AAAA;AAAA,aAEbC,CAAW;AAAA,GAGXC,IAAOF,EAAO;AAAA,YACf,CAAC,EAAE,OAAAG,GAAO,QAAAC,EAAA,MAAaD,EAAM,OAAOC,CAAM,CAAC;AAAA,eACxC,CAAC,EAAE,oBAAAC,EAAA,MACZA,IAAqBC,IAAwB,WAAW;AAAA,MACxDC,CAAgC;AAAA;"}
@@ -1,50 +0,0 @@
1
- import { jsx as y } from "react/jsx-runtime";
2
- import { useRef as A, useMemo as u, useLayoutEffect as R } from "react";
3
- import { describeArc as k } from "../../helper.js";
4
- import { Svg as w, Path as D } from "./animated-arc-styled.js";
5
- import { ADJUSTED_START_ANGLE as L } from "./constants.js";
6
- const B = ({
7
- radius: e,
8
- strokeWidth: r,
9
- color: $,
10
- targetAngle: i,
11
- startAngle: a = 0,
12
- duration: c = 2,
13
- mode: o = "draw",
14
- delay: s = 0,
15
- playRainbowColors: g = !1
16
- }) => {
17
- const f = A(null), l = u(() => -L + a, [a]), n = e, m = e - r / 2, h = u(
18
- () => k(n, n, m, l, i),
19
- [i, l, m, n]
20
- );
21
- return R(() => {
22
- const t = f.current;
23
- if (t) {
24
- if (o === "draw") {
25
- const p = t.getTotalLength();
26
- t.style.strokeDasharray = `${p}`, t.style.strokeDashoffset = `${p}`, t.getBoundingClientRect(), requestAnimationFrame(() => {
27
- t.style.transition = `stroke-dashoffset ${c}s linear ${s}s`, t.style.strokeDashoffset = "0";
28
- });
29
- }
30
- o === "fade" && (t.style.opacity = "0", t.getBoundingClientRect(), requestAnimationFrame(() => {
31
- t.style.transition = `opacity 0s ease-in-out ${s}s`, t.style.opacity = "1";
32
- }));
33
- }
34
- }, [h, o, c, s]), /* @__PURE__ */ y(w, { width: 2 * e, height: 2 * e, viewBox: `0 0 ${2 * e} ${2 * e}`, children: /* @__PURE__ */ y(
35
- D,
36
- {
37
- ref: f,
38
- d: h,
39
- fill: "none",
40
- stroke: $,
41
- strokeWidth: r,
42
- strokeLinecap: "butt",
43
- $playRainbowColors: g
44
- }
45
- ) });
46
- };
47
- export {
48
- B as AnimatedArc
49
- };
50
- //# sourceMappingURL=animated-arc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"animated-arc.js","sources":["../../../../../../src/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.tsx"],"sourcesContent":["import type { IAnimatedArcProps } from './animated-arc-types';\n\nimport React, { useRef, useLayoutEffect, useMemo } from 'react';\n\nimport { describeArc } from '../../helper';\nimport * as Styled from './animated-arc-styled';\nimport { ADJUSTED_START_ANGLE } from './constants';\n\nexport const AnimatedArc: React.FC<IAnimatedArcProps> = ({\n radius,\n strokeWidth,\n color,\n targetAngle,\n startAngle = 0,\n duration = 2,\n mode = 'draw',\n delay = 0,\n playRainbowColors = false,\n}) => {\n const pathRef = useRef<SVGPathElement>(null);\n\n const adjustedStartAngle = useMemo(() => -ADJUSTED_START_ANGLE + startAngle, [startAngle]);\n const center = radius;\n const arcRadius = radius - strokeWidth / 2; // draw arc inside the visible bounds\n const arcPath = useMemo(\n () => describeArc(center, center, arcRadius, adjustedStartAngle, targetAngle),\n [targetAngle, adjustedStartAngle, arcRadius, center],\n );\n\n useLayoutEffect(() => {\n const path = pathRef.current;\n\n if (!path) return;\n\n if (mode === 'draw') {\n const length = path.getTotalLength();\n\n path.style.strokeDasharray = `${length}`;\n path.style.strokeDashoffset = `${length}`;\n path.getBoundingClientRect();\n\n requestAnimationFrame(() => {\n path.style.transition = `stroke-dashoffset ${duration}s linear ${delay}s`;\n path.style.strokeDashoffset = '0';\n });\n }\n\n if (mode === 'fade') {\n path.style.opacity = '0';\n path.getBoundingClientRect();\n\n requestAnimationFrame(() => {\n path.style.transition = `opacity 0s ease-in-out ${delay}s`;\n path.style.opacity = '1';\n });\n }\n }, [arcPath, mode, duration, delay]);\n\n return (\n <Styled.Svg width={2 * radius} height={2 * radius} viewBox={`0 0 ${2 * radius} ${2 * radius}`}>\n <Styled.Path\n ref={pathRef}\n d={arcPath}\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"butt\"\n $playRainbowColors={playRainbowColors}\n />\n </Styled.Svg>\n );\n};\n"],"names":["AnimatedArc","radius","strokeWidth","color","targetAngle","startAngle","duration","mode","delay","playRainbowColors","pathRef","useRef","adjustedStartAngle","useMemo","ADJUSTED_START_ANGLE","center","arcRadius","arcPath","describeArc","useLayoutEffect","path","length","Styled.Svg","jsx","Styled.Path"],"mappings":";;;;;AAQO,MAAMA,IAA2C,CAAC;AAAA,EACvD,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,mBAAAC,IAAoB;AACtB,MAAM;AACE,QAAAC,IAAUC,EAAuB,IAAI,GAErCC,IAAqBC,EAAQ,MAAM,CAACC,IAAuBT,GAAY,CAACA,CAAU,CAAC,GACnFU,IAASd,GACTe,IAAYf,IAASC,IAAc,GACnCe,IAAUJ;AAAA,IACd,MAAMK,EAAYH,GAAQA,GAAQC,GAAWJ,GAAoBR,CAAW;AAAA,IAC5E,CAACA,GAAaQ,GAAoBI,GAAWD,CAAM;AAAA,EAAA;AAGrD,SAAAI,EAAgB,MAAM;AACpB,UAAMC,IAAOV,EAAQ;AAErB,QAAKU,GAEL;AAAA,UAAIb,MAAS,QAAQ;AACb,cAAAc,IAASD,EAAK;AAEf,QAAAA,EAAA,MAAM,kBAAkB,GAAGC,CAAM,IACjCD,EAAA,MAAM,mBAAmB,GAAGC,CAAM,IACvCD,EAAK,sBAAsB,GAE3B,sBAAsB,MAAM;AAC1B,UAAAA,EAAK,MAAM,aAAa,qBAAqBd,CAAQ,YAAYE,CAAK,KACtEY,EAAK,MAAM,mBAAmB;AAAA,QAAA,CAC/B;AAAA,MACH;AAEA,MAAIb,MAAS,WACXa,EAAK,MAAM,UAAU,KACrBA,EAAK,sBAAsB,GAE3B,sBAAsB,MAAM;AACrB,QAAAA,EAAA,MAAM,aAAa,0BAA0BZ,CAAK,KACvDY,EAAK,MAAM,UAAU;AAAA,MAAA,CACtB;AAAA;AAAA,KAEF,CAACH,GAASV,GAAMD,GAAUE,CAAK,CAAC,qBAGhCc,GAAA,EAAW,OAAO,IAAIrB,GAAQ,QAAQ,IAAIA,GAAQ,SAAS,OAAO,IAAIA,CAAM,IAAI,IAAIA,CAAM,IACzF,UAAA,gBAAAsB;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAKd;AAAA,MACL,GAAGO;AAAA,MACH,MAAK;AAAA,MACL,QAAQd;AAAA,MACR,aAAAD;AAAA,MACA,eAAc;AAAA,MACd,oBAAoBO;AAAA,IAAA;AAAA,EAExB,EAAA,CAAA;AAEJ;"}
@@ -1,6 +0,0 @@
1
- const A = 1, _ = 150;
2
- export {
3
- _ as ADJUSTED_START_ANGLE,
4
- A as ARC_Z_INDEX
5
- };
6
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../../src/features/post-game-stats/digital-meter/comp/animated-arc/constants.ts"],"sourcesContent":["export const ARC_Z_INDEX = 1;\n\nexport const ADJUSTED_START_ANGLE = 150;\n"],"names":["ARC_Z_INDEX","ADJUSTED_START_ANGLE"],"mappings":"AAAO,MAAMA,IAAc,GAEdC,IAAuB;"}