trepur_components 2.3.4 → 2.3.6

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 (124) hide show
  1. package/archive/theme.ts +1 -1
  2. package/lib/components/Accordion/index.d.ts +1 -2
  3. package/lib/components/Accordion/index.js +8 -8
  4. package/lib/components/AlertBar/index.d.ts +1 -2
  5. package/lib/components/AlertBar/index.js +13 -13
  6. package/lib/components/index.d.ts +3 -3
  7. package/lib/index.js +4 -4
  8. package/lib/styles/{base.css → global.css} +1 -43
  9. package/lib/styles/themes/local.css +40 -0
  10. package/package.json +1 -1
  11. package/postcss.config.js +8 -0
  12. package/src/components/Accordion/Accordion.stories.tsx +1 -1
  13. package/src/components/Accordion/index.tsx +1 -3
  14. package/src/components/AlertBar/AlertBar.stories.tsx +1 -1
  15. package/src/components/AlertBar/index.tsx +2 -4
  16. package/src/components/index.ts +5 -5
  17. package/src/styles/{base.css → global.css} +1 -43
  18. package/src/styles/themes/local.css +40 -0
  19. package/tsconfig.json +1 -1
  20. package/storybook-build/assets/Accordion.stories-Cn994N1H.js +0 -103
  21. package/storybook-build/assets/AlertBar.stories-BkzNXFBh.js +0 -202
  22. package/storybook-build/assets/Avatar.stories-CpH6xVwM.js +0 -418
  23. package/storybook-build/assets/Color-6VNJS4EI-DQV2onvt.js +0 -1378
  24. package/storybook-build/assets/Colours-r29qjFlW.js +0 -324
  25. package/storybook-build/assets/DocsRenderer-NNNQARDV-OgWasCIs.js +0 -44
  26. package/storybook-build/assets/Introduction-Bs1PgnBZ.js +0 -40
  27. package/storybook-build/assets/WithTooltip-V3YHNWJZ-vi2V5TOO.js +0 -15
  28. package/storybook-build/assets/_commonjsHelpers-LQfde5yM.js +0 -35
  29. package/storybook-build/assets/axe-DnFZVv9V.js +0 -32561
  30. package/storybook-build/assets/chunk-EIRT5I3Z-DFD8udmD.js +0 -480
  31. package/storybook-build/assets/context-CIRBAiUz.js +0 -20
  32. package/storybook-build/assets/controls-DJSGrQKd.js +0 -23
  33. package/storybook-build/assets/entry-preview-DmlPV4-3.js +0 -41
  34. package/storybook-build/assets/entry-preview-docs-D46Drugi.js +0 -11861
  35. package/storybook-build/assets/formatter-SWP5E3XI-BWIasvKP.js +0 -14427
  36. package/storybook-build/assets/iframe-Dzzzanqi.js +0 -144
  37. package/storybook-build/assets/index-0FT4HXk-.js +0 -7222
  38. package/storybook-build/assets/index-B9Tccxv4.js +0 -107
  39. package/storybook-build/assets/index-BdOSk9or.js +0 -41
  40. package/storybook-build/assets/index-CU7cYjZD.js +0 -9604
  41. package/storybook-build/assets/index-Clz-aGG3.js +0 -39
  42. package/storybook-build/assets/index-CpyNLP69.js +0 -63
  43. package/storybook-build/assets/index-DM9bPmif.js +0 -319
  44. package/storybook-build/assets/index-ex9_VrIg.js +0 -3734
  45. package/storybook-build/assets/jsx-runtime-D2-sc1j1.js +0 -35
  46. package/storybook-build/assets/preview-3kSipVgK.js +0 -430
  47. package/storybook-build/assets/preview-B4rAxPmB.js +0 -27
  48. package/storybook-build/assets/preview-BMkwWyrh.js +0 -2920
  49. package/storybook-build/assets/preview-BeQelhbu.js +0 -204
  50. package/storybook-build/assets/preview-BiG-rflf.js +0 -2444
  51. package/storybook-build/assets/preview-BiYUJ7TP.js +0 -22
  52. package/storybook-build/assets/preview-C4ItOQzM.js +0 -34
  53. package/storybook-build/assets/preview-CWyhKACi.css +0 -886
  54. package/storybook-build/assets/preview-CtOV68TG.js +0 -10
  55. package/storybook-build/assets/preview-De9E9xaR.js +0 -140
  56. package/storybook-build/assets/preview-bL4x2zrN.js +0 -99
  57. package/storybook-build/assets/preview-gxqyGMHu.js +0 -323
  58. package/storybook-build/assets/react-18-B-gfo82w.js +0 -29
  59. package/storybook-build/assets/syntaxhighlighter-B5GMVT5T-DrY_Dc6-.js +0 -15
  60. package/storybook-build/favicon.svg +0 -7
  61. package/storybook-build/iframe.html +0 -458
  62. package/storybook-build/index.html +0 -163
  63. package/storybook-build/index.json +0 -1
  64. package/storybook-build/preview-stats.json +0 -172
  65. package/storybook-build/project.json +0 -1
  66. package/storybook-build/sb-addons/a11y-9/manager-bundle.js +0 -3
  67. package/storybook-build/sb-addons/a11y-9/manager-bundle.js.LEGAL.txt +0 -0
  68. package/storybook-build/sb-addons/essentials-actions-2/manager-bundle.js +0 -3
  69. package/storybook-build/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
  70. package/storybook-build/sb-addons/essentials-backgrounds-3/manager-bundle.js +0 -12
  71. package/storybook-build/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
  72. package/storybook-build/sb-addons/essentials-controls-1/manager-bundle.js +0 -63
  73. package/storybook-build/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -18
  74. package/storybook-build/sb-addons/essentials-measure-6/manager-bundle.js +0 -3
  75. package/storybook-build/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
  76. package/storybook-build/sb-addons/essentials-outline-7/manager-bundle.js +0 -3
  77. package/storybook-build/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
  78. package/storybook-build/sb-addons/essentials-toolbars-5/manager-bundle.js +0 -3
  79. package/storybook-build/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
  80. package/storybook-build/sb-addons/essentials-viewport-4/manager-bundle.js +0 -3
  81. package/storybook-build/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
  82. package/storybook-build/sb-addons/interactions-8/manager-bundle.js +0 -12
  83. package/storybook-build/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +0 -0
  84. package/storybook-build/sb-addons/links-0/manager-bundle.js +0 -3
  85. package/storybook-build/sb-addons/links-0/manager-bundle.js.LEGAL.txt +0 -0
  86. package/storybook-build/sb-addons/storybook-12/manager-bundle.js +0 -151
  87. package/storybook-build/sb-addons/storybook-12/manager-bundle.js.LEGAL.txt +0 -0
  88. package/storybook-build/sb-addons/storybook-react-i18next-11/manager-bundle.js +0 -3
  89. package/storybook-build/sb-addons/storybook-react-i18next-11/manager-bundle.js.LEGAL.txt +0 -0
  90. package/storybook-build/sb-addons/themes-10/register-bundle.js +0 -5
  91. package/storybook-build/sb-addons/themes-10/register-bundle.js.LEGAL.txt +0 -0
  92. package/storybook-build/sb-common-assets/fonts.css +0 -31
  93. package/storybook-build/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  94. package/storybook-build/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  95. package/storybook-build/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  96. package/storybook-build/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  97. package/storybook-build/sb-manager/WithTooltip-V3YHNWJZ-TRLNWEGW.js +0 -1
  98. package/storybook-build/sb-manager/chunk-4IYAVH3S.js +0 -348
  99. package/storybook-build/sb-manager/chunk-CXYKRFSY.js +0 -9
  100. package/storybook-build/sb-manager/chunk-KZYAAUOR.js +0 -406
  101. package/storybook-build/sb-manager/chunk-LVLAH4SI.js +0 -7
  102. package/storybook-build/sb-manager/chunk-ZEU7PDD3.js +0 -1
  103. package/storybook-build/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js +0 -156
  104. package/storybook-build/sb-manager/globals-module-info.js +0 -1
  105. package/storybook-build/sb-manager/globals.js +0 -1
  106. package/storybook-build/sb-manager/index.js +0 -1
  107. package/storybook-build/sb-manager/runtime.js +0 -1
  108. package/storybook-build/sb-manager/syntaxhighlighter-B5GMVT5T-EA5ASEYD.js +0 -1
  109. package/storybook-build/sb-preview/globals.js +0 -1
  110. package/storybook-build/sb-preview/runtime.js +0 -112
  111. package/storybook-build/src/components/Accordion/Accordion.stories.d.ts +0 -94
  112. package/storybook-build/src/components/Accordion/index.d.ts +0 -9
  113. package/storybook-build/src/components/AlertBar/AlertBar.stories.d.ts +0 -162
  114. package/storybook-build/src/components/AlertBar/index.d.ts +0 -13
  115. package/storybook-build/src/components/Avatar/Avatar.stories.d.ts +0 -44
  116. package/storybook-build/src/components/Avatar/index.d.ts +0 -4
  117. package/storybook-build/src/components/index.d.ts +0 -7
  118. package/storybook-build/src/index.d.ts +0 -1
  119. package/storybook-build/src/utils/controls.d.ts +0 -36
  120. package/storybook-build/src/utils/matchMedia.d.ts +0 -2
  121. package/storybook-build/src/utils/screens.d.ts +0 -7
  122. package/storybook-build/src/utils/theme.d.ts +0 -3
  123. package/storybook-build/stories.json +0 -1
  124. package/storybook-build/styles/base.css +0 -116
@@ -1,202 +0,0 @@
1
- var _a, _b, _c;
2
- import { i as idAndClassName } from "./controls-DJSGrQKd.js";
3
- import { j as jsxRuntimeExports } from "./jsx-runtime-D2-sc1j1.js";
4
- import { r as reactExports } from "./index-DM9bPmif.js";
5
- import { c as classNames } from "./index-CpyNLP69.js";
6
- import "./_commonjsHelpers-LQfde5yM.js";
7
- const AlertBar = ({
8
- id,
9
- className,
10
- type = "warning",
11
- text,
12
- // leftIconProps,
13
- // rightIconProps,
14
- textCenter = false,
15
- isDismissable = false,
16
- onDismissClick
17
- }) => {
18
- const [alertBarStatus, setAlertBarStatus] = reactExports.useState({
19
- state: "open",
20
- display: true
21
- });
22
- const bgColor = classNames({
23
- "bg-success": type === "success",
24
- "bg-warning": type === "warning",
25
- "bg-error": type === "error",
26
- "bg-info-light": type === "info"
27
- });
28
- const alertBarState = classNames({
29
- "opacity-100": alertBarStatus.state === "open",
30
- "opacity-0": alertBarStatus.state === "closed",
31
- hidden: !alertBarStatus.display
32
- });
33
- const classList = classNames(
34
- className,
35
- bgColor,
36
- alertBarState,
37
- "flex py-2 text-white duration-700 theme-local w-parent transition-opactiy"
38
- );
39
- const textClassList = classNames(
40
- {
41
- "text-center": textCenter
42
- // 'pl-20': !textCenter && leftIconProps !== null,
43
- // 'pl-4': !textCenter && leftIconProps === null,
44
- },
45
- "w-full py-3"
46
- );
47
- classNames(
48
- {
49
- "hover:cursor-pointer": isDismissable
50
- },
51
- "absolute right-0 pr-8 pt-3"
52
- );
53
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id, className: classList, children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: textClassList, children: text }) });
54
- };
55
- try {
56
- AlertBar.displayName = "AlertBar";
57
- AlertBar.__docgenInfo = { "description": "", "displayName": "AlertBar", "props": { "id": { "defaultValue": null, "description": "", "name": "id", "required": false, "type": { "name": "string" } }, "className": { "defaultValue": null, "description": "", "name": "className", "required": false, "type": { "name": "string" } }, "type": { "defaultValue": { value: "warning" }, "description": "", "name": "type", "required": false, "type": { "name": "enum", "value": [{ "value": '"success"' }, { "value": '"warning"' }, { "value": '"error"' }, { "value": '"info"' }] } }, "text": { "defaultValue": null, "description": "", "name": "text", "required": false, "type": { "name": "string" } }, "textCenter": { "defaultValue": { value: "false" }, "description": "", "name": "textCenter", "required": false, "type": { "name": "boolean" } }, "isDismissable": { "defaultValue": { value: "false" }, "description": "", "name": "isDismissable", "required": false, "type": { "name": "boolean" } }, "onDismissClick": { "defaultValue": null, "description": "", "name": "onDismissClick", "required": false, "type": { "name": "MouseEventHandler" } } } };
58
- } catch (__react_docgen_typescript_loader_error) {
59
- }
60
- const meta = {
61
- title: "Components/Alert Bar",
62
- component: AlertBar,
63
- argTypes: {
64
- ...idAndClassName,
65
- type: {
66
- type: {
67
- name: "string",
68
- required: false
69
- },
70
- options: ["success", "warning", "error", "info"],
71
- description: "The type of alert to render",
72
- table: {
73
- type: {
74
- summary: "warning"
75
- },
76
- defaultValue: {
77
- summary: "warning"
78
- }
79
- },
80
- defaultValue: "warning",
81
- control: {
82
- type: "radio"
83
- }
84
- },
85
- text: {
86
- type: {
87
- name: "string",
88
- required: false
89
- },
90
- description: "The text to display in the component",
91
- table: {
92
- type: {
93
- summary: "string"
94
- },
95
- defaultValue: {
96
- summary: "undefined"
97
- }
98
- }
99
- },
100
- leftIconProps: {
101
- description: "The icon props for the icon to display aligned to the left",
102
- table: {
103
- category: "",
104
- type: {
105
- summary: "string"
106
- },
107
- defaultValue: {
108
- summary: "undefined"
109
- }
110
- }
111
- },
112
- rightIconProps: {
113
- description: "The icon props for the icon to display aligned to the right",
114
- table: {
115
- category: "",
116
- type: {
117
- summary: "string"
118
- },
119
- defaultValue: {
120
- summary: "undefined"
121
- }
122
- }
123
- },
124
- textCenter: {
125
- type: {
126
- name: "boolean",
127
- required: false
128
- },
129
- description: "Aligns the text in the center of the component",
130
- table: {
131
- type: {
132
- summary: "boolean"
133
- },
134
- defaultValue: {
135
- summary: "false"
136
- }
137
- },
138
- defaultValue: "false"
139
- },
140
- isDismissable: {
141
- type: {
142
- name: "boolean",
143
- required: false
144
- },
145
- description: "Enables the component to be closed when set to true",
146
- table: {
147
- type: {
148
- summary: "boolean"
149
- },
150
- defaultValue: {
151
- summary: "false"
152
- }
153
- },
154
- defaultValue: "false"
155
- },
156
- onDismissClick: {
157
- type: {
158
- name: "function",
159
- required: false
160
- },
161
- description: "The action to perform when the component is closed",
162
- action: "onClick",
163
- table: {
164
- type: {
165
- summary: "function"
166
- },
167
- defaultValue: {
168
- summary: "undefined"
169
- }
170
- }
171
- }
172
- },
173
- args: {
174
- text: "This is an alert bar message",
175
- leftIconProps: {
176
- type: "heart",
177
- colour: "white",
178
- hollow: true
179
- },
180
- rightIconProps: {
181
- type: "heart",
182
- colour: "white"
183
- }
184
- }
185
- };
186
- const Default = {};
187
- Default.parameters = {
188
- ...Default.parameters,
189
- docs: {
190
- ...(_a = Default.parameters) == null ? void 0 : _a.docs,
191
- source: {
192
- originalSource: "{}",
193
- ...(_c = (_b = Default.parameters) == null ? void 0 : _b.docs) == null ? void 0 : _c.source
194
- }
195
- }
196
- };
197
- const __namedExportsOrder = ["Default"];
198
- export {
199
- Default,
200
- __namedExportsOrder,
201
- meta as default
202
- };
@@ -1,418 +0,0 @@
1
- var _a, _b, _c;
2
- import { i as idAndClassName } from "./controls-DJSGrQKd.js";
3
- import { j as jsxRuntimeExports } from "./jsx-runtime-D2-sc1j1.js";
4
- import { r as reactExports } from "./index-DM9bPmif.js";
5
- import "./_commonjsHelpers-LQfde5yM.js";
6
- let Snap;
7
- if (typeof window !== "undefined") {
8
- Snap = require("snapsvg-cjs");
9
- }
10
- const Avatar = () => {
11
- const [s, setS] = reactExports.useState(null);
12
- let rightEyeWhite, rightEyePupil, leftEyeWhite, leftEyePupil, avatar, armless, torso, face, legs, rightArm, leftArm, rightHand, leftHand, arms, straps, hands, leftThigh, rightThigh, leftShoe, rightShoe;
13
- const leftShoulderRotationPoints = "175, 202";
14
- const rightShoulderRotationPoints = "94, 202";
15
- const svgContainerHeight = 400;
16
- const svgContainerWidth = 265;
17
- const skinColour = "#FFCC9A";
18
- const zipColour = "#315107";
19
- const eyeColour = "#1389BF";
20
- const hairColour = "#F1B452";
21
- const beardColour = "#F1B452";
22
- const rucksackColour = "#072765";
23
- const trouserColour = "#D3D3D3";
24
- const jacketColour = "#416E0A";
25
- const mouthColour = "#DC7144";
26
- const shoeColour = "#000000";
27
- const eyebrowColour = "#F1B452";
28
- const noseColour = "#F1B452";
29
- const createAvatar = (s2, callBack) => {
30
- var _a2, _b2, _c2, _d;
31
- if (typeof window === "undefined")
32
- return;
33
- const head = s2 == null ? void 0 : s2.rect(103, 90, 68, 87, 50).attr({ fill: skinColour });
34
- const leftEyebrow = s2 == null ? void 0 : s2.rect(146, 122, 12, 3, 2);
35
- const rightEyebrow = s2 == null ? void 0 : s2.rect(115, 122, 12, 3, 2);
36
- leftEyeWhite = s2 == null ? void 0 : s2.ellipse(152, 132, 6, 4);
37
- rightEyeWhite = s2 == null ? void 0 : s2.ellipse(121, 132, 6, 4);
38
- leftEyePupil = s2 == null ? void 0 : s2.ellipse(152, 132, 3, 3).attr({ fill: eyeColour });
39
- rightEyePupil = s2 == null ? void 0 : s2.ellipse(121, 132, 3, 3).attr({ fill: eyeColour });
40
- const leftEye = s2 == null ? void 0 : s2.group(leftEyeWhite, leftEyePupil);
41
- const rightEye = s2 == null ? void 0 : s2.group(rightEyeWhite, rightEyePupil);
42
- const outerBeard = s2 == null ? void 0 : s2.rect(103, 90, 68, 87, 50).attr({ fill: "white" });
43
- const innerBeard = s2 == null ? void 0 : s2.rect(106, 105, 62, 62, 50);
44
- const beardGroup = s2 == null ? void 0 : s2.group(outerBeard, innerBeard);
45
- const beard = s2 == null ? void 0 : s2.rect(103, 140, 68, 60).attr({
46
- mask: beardGroup,
47
- fill: beardColour,
48
- opacity: 0.6
49
- });
50
- const outerHair = s2 == null ? void 0 : s2.rect(103, 90, 68, 60, 25).attr({ fill: "white" });
51
- const innerHair = s2 == null ? void 0 : s2.rect(109, 105, 56, 40, 10);
52
- const hairGroup = s2 == null ? void 0 : s2.group(outerHair, innerHair);
53
- const baseHair = s2 == null ? void 0 : s2.rect(103, 90, 68, 40).attr({
54
- mask: hairGroup,
55
- fill: hairColour
56
- });
57
- const hairLevel1 = s2 == null ? void 0 : s2.rect(113, 88, 50, 16, 10).attr({ fill: hairColour }).transform("r0");
58
- const hair = s2 == null ? void 0 : s2.group(baseHair, hairLevel1);
59
- const outerNose = (_a2 = s2 == null ? void 0 : s2.rect(129, 140, 12, 10, 30)) == null ? void 0 : _a2.attr({ fill: "white" });
60
- const innerNose = s2 == null ? void 0 : s2.rect(130, 142, 10, 12, 30);
61
- const noseGroup = s2 == null ? void 0 : s2.group(outerNose, innerNose);
62
- const nose = (_b2 = s2 == null ? void 0 : s2.rect(129, 140, 12, 10)) == null ? void 0 : _b2.attr({
63
- mask: noseGroup,
64
- fill: noseColour
65
- });
66
- const leftEar = (_c2 = s2 == null ? void 0 : s2.circle(103, 135, 5)) == null ? void 0 : _c2.attr({ fill: "white" });
67
- const leftEarMask = s2 == null ? void 0 : s2.rect(89, 120, 15, 30).attr({
68
- mask: leftEar,
69
- fill: skinColour
70
- }).transform("r-2");
71
- const rightEar = (_d = s2 == null ? void 0 : s2.circle(171, 135, 5)) == null ? void 0 : _d.attr({ fill: "white" });
72
- const rightEarMask = s2 == null ? void 0 : s2.rect(170, 120, 15, 30).attr({
73
- mask: rightEar,
74
- fill: skinColour
75
- }).transform("r2");
76
- const body = s2 == null ? void 0 : s2.rect(100, 188, 73, 105, 16, 16).attr({ fill: jacketColour });
77
- const hood = s2 == null ? void 0 : s2.ellipse(136, 182, 24, 10).attr({ fill: jacketColour });
78
- const rightShoulder = s2 == null ? void 0 : s2.rect(87, 190, 27, 14, 10);
79
- rightArm = s2 == null ? void 0 : s2.rect(84, 195, 16, 90, 10, 10);
80
- const leftShoulder = s2 == null ? void 0 : s2.rect(155, 190, 27, 14, 10);
81
- leftArm = s2 == null ? void 0 : s2.rect(170, 195, 16, 90, 10, 10);
82
- leftHand = s2 == null ? void 0 : s2.circle(178, 278, 8);
83
- rightHand = s2 == null ? void 0 : s2.circle(92, 278, 8);
84
- const wasteBand = s2 == null ? void 0 : s2.rect(98, 277, 74, 33, 0, 0);
85
- leftThigh = s2 == null ? void 0 : s2.rect(142, 300, 30, 90, 0, 0);
86
- rightThigh = s2 == null ? void 0 : s2.rect(98, 300, 30, 90, 0, 0);
87
- const bag = s2 == null ? void 0 : s2.rect(99, 180, 74, 78, 10);
88
- const rightStrap = s2 == null ? void 0 : s2.rect(101, 185, 5, 100, 10).transform("r4.5");
89
- const leftStrap = s2 == null ? void 0 : s2.rect(163, 185, 5, 100, 10).transform("r-4.5");
90
- const mouth = s2 == null ? void 0 : s2.circle(136, 155, 10).attr({ fill: "white" });
91
- const mouthCutOff = s2 == null ? void 0 : s2.rect(120, 155, 30, 15).attr({ fill: mouthColour });
92
- const leftShoeTop = s2 == null ? void 0 : s2.rect(142, 370, 30, 20, 10);
93
- const leftShoeSole = s2 == null ? void 0 : s2.rect(142, 378, 30, 12);
94
- const rightShoeTop = s2 == null ? void 0 : s2.rect(98, 370, 30, 20, 10);
95
- const rightShoeSole = s2 == null ? void 0 : s2.rect(98, 378, 30, 12);
96
- const mainZip = s2 == null ? void 0 : s2.rect(135, 199, 3, 94);
97
- const leftZip = s2 == null ? void 0 : s2.rect(141, 188, 2, 15).transform("r44.5");
98
- const rightZip = s2 == null ? void 0 : s2.rect(130, 188, 2, 15).transform("r-44.5");
99
- const centerNeck = s2 == null ? void 0 : s2.rect(128, 170, 17, 21);
100
- const leftNeck = s2 == null ? void 0 : s2.rect(139, 181, 10, 10).transform("r-33");
101
- const rightNeck = s2 == null ? void 0 : s2.rect(124, 181, 10, 10).transform("r33");
102
- const frontNeck = s2 == null ? void 0 : s2.rect(129, 182, 15, 15).transform("r45");
103
- const neck = s2 == null ? void 0 : s2.group(centerNeck, leftNeck, rightNeck, frontNeck).attr({ fill: skinColour });
104
- const zip = s2 == null ? void 0 : s2.group(mainZip, leftZip, rightZip).attr({ fill: zipColour });
105
- leftShoe = s2 == null ? void 0 : s2.group(leftShoeTop, leftShoeSole);
106
- rightShoe = s2 == null ? void 0 : s2.group(rightShoeTop, rightShoeSole);
107
- const rucksack = s2 == null ? void 0 : s2.group(leftStrap, rightStrap, bag).attr({ fill: rucksackColour });
108
- const eyes = s2 == null ? void 0 : s2.group(leftEye, rightEye).attr({ fill: "white" });
109
- const eyebrows = s2 == null ? void 0 : s2.group(leftEyebrow, rightEyebrow).attr({ fill: eyebrowColour });
110
- const shoes = s2 == null ? void 0 : s2.group(leftShoe, rightShoe).attr({ fill: shoeColour });
111
- const ears = s2 == null ? void 0 : s2.group(leftEarMask, rightEarMask);
112
- arms = s2 == null ? void 0 : s2.group(rightShoulder, leftShoulder, leftArm, rightArm).attr({ fill: jacketColour });
113
- hands = s2 == null ? void 0 : s2.group(leftHand, rightHand).attr({ fill: skinColour });
114
- straps = s2 == null ? void 0 : s2.group(leftStrap, rightStrap).attr({ fill: rucksackColour });
115
- face = s2 == null ? void 0 : s2.group(
116
- head,
117
- eyes,
118
- eyebrows,
119
- nose,
120
- mouth,
121
- mouthCutOff,
122
- ears,
123
- hair,
124
- beard
125
- );
126
- torso = s2 == null ? void 0 : s2.group(rucksack, hood, body, neck, zip);
127
- legs = s2 == null ? void 0 : s2.group(leftThigh, rightThigh, wasteBand, shoes).attr({ fill: trouserColour });
128
- armless = s2 == null ? void 0 : s2.group(legs, torso, face);
129
- avatar = s2 == null ? void 0 : s2.group(armless, arms, straps, hands);
130
- mouthCutOff == null ? void 0 : mouthCutOff.attr({
131
- mask: mouth
132
- });
133
- callBack(avatar);
134
- };
135
- const nextFrame = (s2, frameArray, frame) => {
136
- if (frame >= frameArray.length) {
137
- return;
138
- }
139
- Snap.animate(
140
- frameArray[frame].from,
141
- frameArray[frame].to,
142
- frameArray[frame].funct,
143
- frameArray[frame].dur,
144
- null,
145
- nextFrame.bind(null, Snap, frameArray, frame + 1)
146
- );
147
- };
148
- const rightWave = [
149
- {
150
- funct: function(val) {
151
- rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
152
- rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
153
- },
154
- from: 0,
155
- to: 170,
156
- dur: 100
157
- },
158
- {
159
- funct: function(val) {
160
- rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
161
- rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
162
- },
163
- from: 170,
164
- to: 120,
165
- dur: 100
166
- },
167
- {
168
- funct: function(val) {
169
- rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
170
- rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
171
- },
172
- from: 120,
173
- to: 170,
174
- dur: 100
175
- },
176
- {
177
- funct: function(val) {
178
- rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
179
- rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
180
- },
181
- from: 170,
182
- to: 120,
183
- dur: 100
184
- },
185
- {
186
- funct: function(val) {
187
- rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
188
- rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
189
- },
190
- from: 120,
191
- to: 170,
192
- dur: 100
193
- },
194
- {
195
- funct: function(val) {
196
- rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
197
- rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
198
- },
199
- from: 170,
200
- to: 120,
201
- dur: 100
202
- },
203
- {
204
- funct: function(val) {
205
- rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
206
- rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
207
- },
208
- from: 120,
209
- to: 0,
210
- dur: 100
211
- }
212
- ];
213
- const leftWave = [
214
- {
215
- funct: function(val) {
216
- leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
217
- leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
218
- },
219
- from: 0,
220
- to: -150,
221
- dur: 100
222
- },
223
- {
224
- funct: function(val) {
225
- leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
226
- leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
227
- },
228
- from: -150,
229
- to: -120,
230
- dur: 100
231
- },
232
- {
233
- funct: function(val) {
234
- leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
235
- leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
236
- },
237
- from: -120,
238
- to: -150,
239
- dur: 100
240
- },
241
- {
242
- funct: function(val) {
243
- leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
244
- leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
245
- },
246
- from: -150,
247
- to: -120,
248
- dur: 100
249
- },
250
- {
251
- funct: function(val) {
252
- leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
253
- leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
254
- },
255
- from: -120,
256
- to: -150,
257
- dur: 100
258
- },
259
- {
260
- funct: function(val) {
261
- leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
262
- leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
263
- },
264
- from: -150,
265
- to: -120,
266
- dur: 100
267
- },
268
- {
269
- funct: function(val) {
270
- leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
271
- leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
272
- },
273
- from: -120,
274
- to: 0,
275
- dur: 100
276
- }
277
- ];
278
- const jump = () => {
279
- torso.animate({ transform: "t0,20" }, 500);
280
- arms.animate({ transform: "t0,20" }, 500);
281
- straps.animate({ transform: "t0,20" }, 500);
282
- hands.animate({ transform: "t0,20" }, 500);
283
- face.animate({ transform: "t0,20" }, 500, function() {
284
- face.animate({ transform: "t0,-70" }, 200);
285
- torso.animate({ transform: "t0,-70" }, 200);
286
- arms.animate({ transform: "t0,-70" }, 200);
287
- straps.animate({ transform: "t0,-70" }, 200);
288
- hands.animate({ transform: "t0,-70" }, 200);
289
- legs.animate({ transform: "t0,-70" }, 200, function() {
290
- face.animate({ transform: "t0,0" }, 200);
291
- torso.animate({ transform: "t0,0" }, 200);
292
- arms.animate({ transform: "t0,0" }, 200);
293
- straps.animate({ transform: "t0,0" }, 200);
294
- hands.animate({ transform: "t0,0" }, 200);
295
- legs.animate({ transform: "t0,0" }, 200);
296
- });
297
- });
298
- };
299
- const eyesLeft = (duration) => {
300
- leftEyePupil.animate({ transform: "t2,0" }, duration);
301
- rightEyePupil.animate({ transform: "t2,0" }, duration);
302
- };
303
- const eyesRight = (duration) => {
304
- leftEyePupil.animate({ transform: "t-2,0" }, duration);
305
- rightEyePupil.animate({ transform: "t-2,0" }, duration);
306
- };
307
- const eyesCenter = (duration) => {
308
- leftEyePupil.animate({ transform: "t0,0" }, duration);
309
- rightEyePupil.animate({ transform: "t0,0" }, duration);
310
- };
311
- const blink = (times) => {
312
- if (times < 1)
313
- return;
314
- [...Array(times)].forEach((_) => {
315
- leftEyeWhite == null ? void 0 : leftEyeWhite.animate({ ry: 0 }, 120);
316
- leftEyePupil.animate({ ry: 0 }, 120);
317
- rightEyeWhite == null ? void 0 : rightEyeWhite.animate({ ry: 0 }, 120);
318
- rightEyePupil.animate({ ry: 0 }, 120, function() {
319
- leftEyeWhite == null ? void 0 : leftEyeWhite.animate({ ry: 4 }, 200);
320
- leftEyePupil == null ? void 0 : leftEyePupil.animate({ ry: 3 }, 200);
321
- rightEyeWhite == null ? void 0 : rightEyeWhite.animate({ ry: 4 }, 200);
322
- rightEyePupil == null ? void 0 : rightEyePupil.animate({ ry: 3 }, 200, () => {
323
- blink(times - 1);
324
- });
325
- });
326
- });
327
- };
328
- const animate = (s2, animation) => {
329
- nextFrame(s2, animation, 0);
330
- };
331
- reactExports.useEffect(() => {
332
- if (typeof window === "undefined")
333
- return;
334
- if (Snap) {
335
- setS(Snap("#svg"));
336
- }
337
- const makeBlinkHappen = () => {
338
- const randNum = Math.floor(Math.random() * 2) + 1;
339
- blink(randNum);
340
- };
341
- const loadActions = () => {
342
- if (!avatar)
343
- return;
344
- setTimeout(() => {
345
- animate(s, leftWave);
346
- }, 1e3);
347
- setInterval(makeBlinkHappen, 3500);
348
- rightArm == null ? void 0 : rightArm.click(() => animate(s, rightWave));
349
- rightHand == null ? void 0 : rightHand.click(() => animate(s, rightWave));
350
- leftArm == null ? void 0 : leftArm.click(() => animate(s, leftWave));
351
- leftHand == null ? void 0 : leftHand.click(() => animate(s, leftWave));
352
- armless == null ? void 0 : armless.click(jump);
353
- leftArm == null ? void 0 : leftArm.hover(() => {
354
- eyesLeft(200);
355
- });
356
- leftThigh == null ? void 0 : leftThigh.hover(() => {
357
- eyesLeft(200);
358
- });
359
- leftShoe == null ? void 0 : leftShoe.hover(() => {
360
- eyesLeft(200);
361
- });
362
- torso == null ? void 0 : torso.hover(() => {
363
- eyesCenter(200);
364
- });
365
- rightArm == null ? void 0 : rightArm.hover(() => {
366
- eyesRight(200);
367
- });
368
- rightThigh == null ? void 0 : rightThigh.hover(() => {
369
- eyesRight(200);
370
- });
371
- rightShoe == null ? void 0 : rightShoe.hover(() => {
372
- eyesRight(200);
373
- });
374
- };
375
- createAvatar(s, loadActions);
376
- }, [s]);
377
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
378
- "svg",
379
- {
380
- id: "svg",
381
- className: "mx-auto",
382
- height: `${svgContainerHeight.toString()}px`,
383
- width: `${svgContainerWidth.toString()}px`,
384
- version: "1.1",
385
- xmlns: "http://www.w3.org/2000/svg"
386
- }
387
- );
388
- };
389
- try {
390
- Avatar.displayName = "Avatar";
391
- Avatar.__docgenInfo = { "description": "", "displayName": "Avatar", "props": {} };
392
- } catch (__react_docgen_typescript_loader_error) {
393
- }
394
- const meta = {
395
- title: "Components/Avatar",
396
- component: Avatar,
397
- argTypes: {
398
- ...idAndClassName
399
- },
400
- args: {}
401
- };
402
- const Default = {};
403
- Default.parameters = {
404
- ...Default.parameters,
405
- docs: {
406
- ...(_a = Default.parameters) == null ? void 0 : _a.docs,
407
- source: {
408
- originalSource: "{}",
409
- ...(_c = (_b = Default.parameters) == null ? void 0 : _b.docs) == null ? void 0 : _c.source
410
- }
411
- }
412
- };
413
- const __namedExportsOrder = ["Default"];
414
- export {
415
- Default,
416
- __namedExportsOrder,
417
- meta as default
418
- };