@federball/components 0.0.22 → 0.0.23

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.
@@ -0,0 +1,4 @@
1
+ import type { DrawType, ScoringSystem } from "@federball/types";
2
+ export declare const getDescriptionForDrawType: (drawType: DrawType) => "Round robin draw" | "Elimination draw";
3
+ export declare const getDescriptionForScoringSystem: (scoringSystem: ScoringSystem) => "First to 11 points per set" | "First to 21 points per set";
4
+ //# sourceMappingURL=descriptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptions.d.ts","sourceRoot":"","sources":["../src/descriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEhE,eAAO,MAAM,yBAAyB,GAAI,UAAU,QAAQ,4CAS3D,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAC1C,eAAe,aAAa,gEAU5B,CAAC"}
@@ -0,0 +1,21 @@
1
+ export const getDescriptionForDrawType = (drawType) => {
2
+ switch (drawType) {
3
+ case "GROUP":
4
+ return "Round robin draw";
5
+ case "KNOCKOUT":
6
+ return "Elimination draw";
7
+ default:
8
+ throw new Error(`Unknown draw type: ${drawType}`);
9
+ }
10
+ };
11
+ export const getDescriptionForScoringSystem = (scoringSystem) => {
12
+ switch (scoringSystem) {
13
+ case "FIRST_TO_11":
14
+ return "First to 11 points per set";
15
+ case "FIRST_TO_21":
16
+ return "First to 21 points per set";
17
+ default:
18
+ throw new Error(`Unknown scoring system: ${scoringSystem}`);
19
+ }
20
+ };
21
+ //# sourceMappingURL=descriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../src/descriptions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAkB,EAAE,EAAE;IAC/D,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,OAAO;YACX,OAAO,kBAAkB,CAAC;QAC3B,KAAK,UAAU;YACd,OAAO,kBAAkB,CAAC;QAC3B;YACC,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAC;IACpD,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC7C,aAA4B,EAC3B,EAAE;IACH,QAAQ,aAAa,EAAE,CAAC;QACvB,KAAK,aAAa;YACjB,OAAO,4BAA4B,CAAC;QACrC,KAAK,aAAa;YACjB,OAAO,4BAA4B,CAAC;QACrC;YACC,MAAM,IAAI,KAAK,CAAC,2BAA2B,aAAa,EAAE,CAAC,CAAC;IAC9D,CAAC;AACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { DrawType } from "@federball/types";
2
+ type DrawTypeFieldProps = {
3
+ type: DrawType;
4
+ isReadonly?: boolean;
5
+ };
6
+ export declare const DrawTypeField: ({ type, isReadonly, }: DrawTypeFieldProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=DrawTypeField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawTypeField.d.ts","sourceRoot":"","sources":["../../src/fields/DrawTypeField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIjD,KAAK,kBAAkB,GAAG;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,uBAG3B,kBAAkB,4CAgBpB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Description, InputGroup, Label, TextField } from "@heroui/react";
3
+ import { getLabelForDrawType, Labels } from "../labels";
4
+ import { DrawTypeIcon } from "../icons/DrawTypeIcon";
5
+ import { getDescriptionForDrawType } from "../descriptions";
6
+ export const DrawTypeField = ({ type, isReadonly = false, }) => {
7
+ return (_jsxs(TextField, { type: "text", variant: "secondary", isReadOnly: isReadonly, children: [_jsx(Label, { children: Labels.DRAW_TYPE }), _jsxs(InputGroup, { children: [_jsx(InputGroup.Prefix, { children: _jsx(DrawTypeIcon, { type: type }) }), _jsx(InputGroup.Input, { "aria-label": Labels.DRAW_TYPE, value: getLabelForDrawType(type) })] }), _jsx(Description, { children: getDescriptionForDrawType(type) })] }));
8
+ };
9
+ //# sourceMappingURL=DrawTypeField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawTypeField.js","sourceRoot":"","sources":["../../src/fields/DrawTypeField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAO5D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC7B,IAAI,EACJ,UAAU,GAAG,KAAK,GACE,EAAE,EAAE;IACxB,OAAO,CACN,MAAC,SAAS,IAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,UAAU,EAAE,UAAU,aAChE,KAAC,KAAK,cAAE,MAAM,CAAC,SAAS,GAAS,EACjC,MAAC,UAAU,eACV,KAAC,UAAU,CAAC,MAAM,cACjB,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,GAAI,GACT,EACpB,KAAC,UAAU,CAAC,KAAK,kBACJ,MAAM,CAAC,SAAS,EAC5B,KAAK,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAC/B,IACU,EACb,KAAC,WAAW,cAAE,yBAAyB,CAAC,IAAI,CAAC,GAAe,IACjD,CACZ,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ScoringSystem } from "@federball/types";
2
+ type ScoringSystemFieldProps = {
3
+ scoringSystem: ScoringSystem;
4
+ isReadonly?: boolean;
5
+ };
6
+ export declare const ScoringSystemField: ({ scoringSystem, isReadonly, }: ScoringSystemFieldProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=ScoringSystemField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScoringSystemField.d.ts","sourceRoot":"","sources":["../../src/fields/ScoringSystemField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,KAAK,uBAAuB,GAAG;IAC9B,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,gCAGhC,uBAAuB,4CAgBzB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Description, InputGroup, Label, TextField } from "@heroui/react";
3
+ import { getLabelForScoringSystem, Labels } from "../labels";
4
+ import { getDescriptionForScoringSystem } from "../descriptions";
5
+ import { ScoringSystemIcon } from "../icons/ScoringSystemIcon";
6
+ export const ScoringSystemField = ({ scoringSystem, isReadonly = false, }) => {
7
+ return (_jsxs(TextField, { type: "text", variant: "secondary", isReadOnly: isReadonly, children: [_jsx(Label, { children: Labels.SCORING_SYSTEM }), _jsxs(InputGroup, { children: [_jsx(InputGroup.Prefix, { children: _jsx(ScoringSystemIcon, {}) }), _jsx(InputGroup.Input, { "aria-label": Labels.SCORING_SYSTEM, value: getLabelForScoringSystem(scoringSystem) })] }), _jsx(Description, { children: getDescriptionForScoringSystem(scoringSystem) })] }));
8
+ };
9
+ //# sourceMappingURL=ScoringSystemField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScoringSystemField.js","sourceRoot":"","sources":["../../src/fields/ScoringSystemField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAO/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAClC,aAAa,EACb,UAAU,GAAG,KAAK,GACO,EAAE,EAAE;IAC7B,OAAO,CACN,MAAC,SAAS,IAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,UAAU,EAAE,UAAU,aAChE,KAAC,KAAK,cAAE,MAAM,CAAC,cAAc,GAAS,EACtC,MAAC,UAAU,eACV,KAAC,UAAU,CAAC,MAAM,cACjB,KAAC,iBAAiB,KAAG,GACF,EACpB,KAAC,UAAU,CAAC,KAAK,kBACJ,MAAM,CAAC,cAAc,EACjC,KAAK,EAAE,wBAAwB,CAAC,aAAa,CAAC,GAC7C,IACU,EACb,KAAC,WAAW,cAAE,8BAA8B,CAAC,aAAa,CAAC,GAAe,IAC/D,CACZ,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { DrawTypeField } from "./DrawTypeField";
2
+ import { ScoringSystemField } from "./ScoringSystemField";
3
+ export { DrawTypeField, ScoringSystemField };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { DrawTypeField } from "./DrawTypeField";
2
+ import { ScoringSystemField } from "./ScoringSystemField";
3
+ export { DrawTypeField, ScoringSystemField };
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC"}
package/dist/labels.d.ts CHANGED
@@ -1,6 +1,11 @@
1
- import type { DrawStage, ScoringSystem } from "@federball/types";
1
+ import type { DrawStage, DrawType, ScoringSystem } from "@federball/types";
2
2
  import type { UserType } from "./types";
3
3
  export declare const getLabelForDrawStage: (stage: DrawStage) => "Group" | "Round of 32" | "Round of 16" | "Quarterfinal" | "Semifinal" | "Final";
4
- export declare const getLabelForScoringSystem: (scoringSystem: ScoringSystem) => "11" | "21";
4
+ export declare const getLabelForDrawType: (drawType: DrawType) => "Group" | "Knockout";
5
+ export declare const getLabelForScoringSystem: (scoringSystem: ScoringSystem) => "11 points" | "21 points";
5
6
  export declare const getLabelForUserType: (userType: UserType) => "Admin" | "Member";
7
+ export declare enum Labels {
8
+ DRAW_TYPE = "Type of draw",
9
+ SCORING_SYSTEM = "Scoring system"
10
+ }
6
11
  //# sourceMappingURL=labels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,oBAAoB,GAAI,OAAO,SAAS,qFAiBpD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,eAAe,aAAa,gBASpE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,UAAU,QAAQ,uBASrD,CAAC"}
1
+ {"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,oBAAoB,GAAI,OAAO,SAAS,qFAiBpD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,UAAU,QAAQ,yBASrD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,eAAe,aAAa,8BASpE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,UAAU,QAAQ,uBASrD,CAAC;AAEF,oBAAY,MAAM;IACjB,SAAS,iBAAiB;IAC1B,cAAc,mBAAmB;CACjC"}
package/dist/labels.js CHANGED
@@ -16,12 +16,22 @@ export const getLabelForDrawStage = (stage) => {
16
16
  throw new Error(`Unknown draw stage: ${stage}`);
17
17
  }
18
18
  };
19
+ export const getLabelForDrawType = (drawType) => {
20
+ switch (drawType) {
21
+ case "GROUP":
22
+ return "Group";
23
+ case "KNOCKOUT":
24
+ return "Knockout";
25
+ default:
26
+ throw new Error(`Unknown draw type: ${drawType}`);
27
+ }
28
+ };
19
29
  export const getLabelForScoringSystem = (scoringSystem) => {
20
30
  switch (scoringSystem) {
21
31
  case "FIRST_TO_11":
22
- return "11";
32
+ return "11 points";
23
33
  case "FIRST_TO_21":
24
- return "21";
34
+ return "21 points";
25
35
  default:
26
36
  throw new Error(`Unknown scoring system: ${scoringSystem}`);
27
37
  }
@@ -36,4 +46,9 @@ export const getLabelForUserType = (userType) => {
36
46
  throw new Error(`Unknown user type: ${userType}`);
37
47
  }
38
48
  };
49
+ export var Labels;
50
+ (function (Labels) {
51
+ Labels["DRAW_TYPE"] = "Type of draw";
52
+ Labels["SCORING_SYSTEM"] = "Scoring system";
53
+ })(Labels || (Labels = {}));
39
54
  //# sourceMappingURL=labels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"labels.js","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAgB,EAAE,EAAE;IACxD,QAAQ,KAAK,EAAE,CAAC;QACf,KAAK,OAAO;YACX,OAAO,OAAO,CAAC;QAChB,KAAK,UAAU;YACd,OAAO,aAAa,CAAC;QACtB,KAAK,UAAU;YACd,OAAO,aAAa,CAAC;QACtB,KAAK,cAAc;YAClB,OAAO,cAAc,CAAC;QACvB,KAAK,WAAW;YACf,OAAO,WAAW,CAAC;QACpB,KAAK,OAAO;YACX,OAAO,OAAO,CAAC;QAChB;YACC,MAAM,IAAI,KAAK,CAAC,uBAAuB,KAAK,EAAE,CAAC,CAAC;IAClD,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,aAA4B,EAAE,EAAE;IACxE,QAAQ,aAAa,EAAE,CAAC;QACvB,KAAK,aAAa;YACjB,OAAO,IAAI,CAAC;QACb,KAAK,aAAa;YACjB,OAAO,IAAI,CAAC;QACb;YACC,MAAM,IAAI,KAAK,CAAC,2BAA2B,aAAa,EAAE,CAAC,CAAC;IAC9D,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAkB,EAAE,EAAE;IACzD,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,OAAO;YACX,OAAO,OAAO,CAAC;QAChB,KAAK,QAAQ;YACZ,OAAO,QAAQ,CAAC;QACjB;YACC,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAC;IACpD,CAAC;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"labels.js","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAgB,EAAE,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Y,MAGX;AAHD,WAAY,MAAM;IACjB,oCAA0B,CAAA;IAC1B,2CAAiC,CAAA;AAClC,CAAC,EAHW,MAAM,KAAN,MAAM,QAGjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@federball/components",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "type": "module",
5
5
  "description": "Component library for federball.app",
6
6
  "source": "src/index.ts",
@@ -23,6 +23,11 @@
23
23
  "import": "./dist/chips/index.js",
24
24
  "require": "./dist/chips/index.js"
25
25
  },
26
+ "./fields": {
27
+ "types": "./dist/fields/index.d.ts",
28
+ "import": "./dist/fields/index.js",
29
+ "require": "./dist/fields/index.js"
30
+ },
26
31
  "./styles.css": "./dist/styles.css"
27
32
  },
28
33
  "files": [