@dcrackel/hematournamentui 1.0.707 → 1.0.709

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 (61) hide show
  1. package/AGENTS.md +118 -118
  2. package/README.md +132 -106
  3. package/dist/HemaTournamentUI-lib.es.js +7111 -7006
  4. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  5. package/dist/hematournamentui-tailwind.css +198 -412
  6. package/package.json +10 -10
  7. package/src/index.js +2 -0
  8. package/src/mocks/getDEBouts-42Fencers.js +4 -4
  9. package/src/mocks/getDEBouts-TableOf128.js +37 -0
  10. package/src/mocks/getDEBouts-TableOf64.js +35 -0
  11. package/src/stories/Atoms/Input/BaseInput.test.js +97 -85
  12. package/src/stories/Atoms/Input/BaseInput.vue +149 -150
  13. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -0
  14. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -0
  15. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -0
  16. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +3 -2
  17. package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +1 -1
  18. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -0
  19. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -0
  20. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -0
  21. package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -278
  22. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +60 -98
  23. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +103 -4
  24. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +256 -215
  25. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -92
  26. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -128
  27. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +14 -4
  28. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -20
  29. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -0
  30. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -133
  31. package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +2 -2
  32. package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +131 -3
  33. package/src/stories/Organisms/Containers/Tableau/Tableau.vue +287 -89
  34. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -0
  35. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -0
  36. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -0
  37. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -0
  38. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -0
  39. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -0
  40. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +57 -0
  41. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +65 -0
  42. package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +31 -29
  43. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +146 -18
  44. package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +52 -2
  45. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +53 -17
  46. package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +39 -0
  47. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -0
  48. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -0
  49. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +14 -0
  50. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -0
  51. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +13 -3
  52. package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -172
  53. package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -103
  54. package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -0
  55. package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -213
  56. package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -0
  57. package/src/stories/Util/Validations/PersonManagementValidations.js +45 -29
  58. package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +0 -111
  59. package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +0 -162
  60. package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +0 -21
  61. package/src/stories/Organisms/Containers/TableauLines/TableauLines.vue +0 -78
package/AGENTS.md CHANGED
@@ -1,118 +1,118 @@
1
- # Agent Guide
2
-
3
- This project is `@dcrackel/hematournamentui`, the shared Vue 3 Storybook/UI package for Meyer Squared tournament screens. It owns reusable presentation components, visual structure, Storybook examples, Tailwind styling, and small UI-only state. The consuming admin/frontend app owns routing, API calls, sockets, auth, localStorage, persistence, and tournament workflow orchestration.
4
-
5
- ## Code Style
6
-
7
- - Prefer small, single-use, named functions over long inline blocks.
8
- - Prefer guard clauses and early returns over `else`.
9
- - Avoid `else if`. Use named predicate helpers, lookup maps, or dispatch tables when branching by type/status/action.
10
- - Prefer predicate dispatch tables over large `switch` statements or long conditional chains.
11
- - Use clear, boring names for important logic. Favor searchable names that describe the component intent or emitted action.
12
- - Keep comments sparse. Add comments for domain rules, accessibility choices, or non-obvious sequencing behavior, not for code that reads plainly.
13
- - Preserve existing component props, emitted events, slots, class contracts, and exported component names unless the change intentionally updates the package API.
14
- - Do not refactor unrelated files while fixing focused bugs or adding focused UI behavior.
15
-
16
- ## Component Boundary
17
-
18
- - Components in this package should stay dumb, reusable, and presentation-focused.
19
- - App-specific tournament behavior belongs in the consuming frontend, not in this shared UI package.
20
- - Components should receive data through props and emit user intent upward for the parent to handle.
21
- - Emit events for parent-owned work such as persistence, API calls, socket messages, navigation, auth-sensitive behavior, and cross-screen workflow rules.
22
- - Keep local component state only for UI-only behavior, such as folding/unfolding menus, open/closed modal state when locally controlled, transient hover/focus state, input draft display, and similar presentation concerns.
23
- - Do not add API clients, socket code, localStorage workflow state, or route-level orchestration to this package unless the explicit goal is to create a reusable UI API around those concerns.
24
- - Clone incoming objects before building emitted payloads when the component may add or reshape UI-specific fields.
25
- - Do not mutate incoming props or nested prop data. Clone arrays/objects into local UI state before adding UI-only fields such as `Promoted`, `customStatus`, local order, temporary scores, or modal draft state. Emit changed intent upward for the parent to persist.
26
- - Keep emitted payload shapes stable. If an event contract changes, update the related Storybook examples and consuming documentation.
27
-
28
- ## Atomic Design
29
-
30
- - Follow the existing atomic design structure as much as practical: `Atoms`, `Molecules`, `Organisms`, `Templates`, and `Skeletons`.
31
- - Put primitive, highly reusable controls in `Atoms`, such as base text, icons, inputs, tags, checkboxes, and radio groups.
32
- - Put small composed controls in `Molecules`, such as modals, filters, menus, button groups, titled inputs, indicators, and compact UI combinations.
33
- - Put larger reusable feature sections in `Organisms`, such as cards, containers, headers, forms, grids, complex inputs, wizards, and skeleton loaders.
34
- - Put page-shaped reusable layouts in `Templates`. Templates may compose many organisms, but should still avoid owning app orchestration, API calls, sockets, routing, or persistence.
35
- - Before creating a new component, check whether the behavior belongs in an existing atom, molecule, organism, or template instead of adding a near-duplicate.
36
- - Keep lower-level components generic. Do not make atoms or molecules depend on one tournament workflow when a prop, slot, or emitted event can keep them reusable.
37
-
38
- ## Interaction Pattern
39
-
40
- - Prefer optimistic UI for presentation-only edits: update the visible component state right away, then emit the change upward.
41
- - Do not optimistically change authoritative workflow fields such as bout status, referee identity, sequence data, or completion timestamps.
42
- - The parent should perform persistence/API work and pass authoritative data back down through props.
43
- - Reconcile prop updates cleanly so the component reflects parent-owned truth after save, refresh, or rollback.
44
- - Do not block simple visual feedback on API completion unless the user action cannot be represented safely before confirmation.
45
- - Missing or invalid input data should degrade gracefully in the UI instead of crashing a component.
46
-
47
- ## Vue Patterns
48
-
49
- - Use computed fields when derived data can be expressed declaratively.
50
- - Keep logic out of templates/JSX where practical. Move meaningful conditions, transformations, and class decisions into named computed values or helpers.
51
- - Keep Vue methods focused. Fetching, transforming, emitting, and local UI state updates should be separable when practical.
52
- - Prefer explicit `emits` declarations and prop definitions that document component contracts.
53
- - Keep emitted event names and payload fields aligned through wrapper components. When forwarding child events, use the same semantic event name, such as `penalty:add` for adding and `penalty:update` for updating, instead of compensating with swapped handlers.
54
- - Use watchers sparingly. Prefer computed values and direct event handlers unless side effects are truly needed.
55
- - Keep Storybook stories aligned with the public component API and use them to demonstrate meaningful states, variants, empty states, disabled states, and responsive behavior.
56
-
57
- ## Styling And Layout
58
-
59
- - Use Tailwind for layout, spacing, color, state, and responsive design whenever practical.
60
- - Prefer CSS/Tailwind responsive behavior over JavaScript-driven breakpoints or resize logic.
61
- - Keep layout behavior stable across mobile and desktop. Avoid text overlap, dynamic content shifting controls, or assumptions about fixed viewport sizes.
62
- - Preserve existing visual language and component hierarchy before introducing new style patterns.
63
- - Keep reusable components theme-friendly. Avoid hard-coding app-specific colors or one-off layout assumptions unless the component already owns that visual contract.
64
- - Prefer accessible native controls and semantic markup where possible.
65
-
66
- ## Data Ownership
67
-
68
- - Treat this package as a UI surface, not an authoritative data owner.
69
- - The consuming app owns persisted tournament state, live scoring truth, socket freshness, sequence handling, auth, routing, and recovery after reload/reconnect.
70
- - Scoreboards, cards, tables, menus, and forms in this package should display provided data and emit user intent; they should not invent tournament workflow state.
71
- - Keep tournament domain rules explicit when they are needed for rendering. Name conditions that depend on pool vs DE, completed vs active, visible vs hidden, or editable vs read-only.
72
- - If a rule requires backend knowledge or app workflow context, prefer making it a prop or emitted decision rather than embedding the rule in a shared component.
73
-
74
- ## Pool And Direct Elimination Boundaries
75
-
76
- - Pool and Direct Elimination workflows are intentionally different. Confirm the domain rule before reusing assignment behavior between them.
77
- - Pools may display available directors and emit pool, ring, or pool-work assignment intent. The consuming application persists that intent.
78
- - Do not change pool assignment behavior while implementing bracket behavior.
79
- - DE uses one shared collection of available bouts. The signed-in director claims a scheduled bout by selecting or starting it.
80
- - Bracket components must not accept `directors` or `currentUserId` for assignment behavior.
81
- - Bracket components must not expose director-selection modals, assignment buttons, or Assigned Bouts sections.
82
- - The consuming application supplies `RefereeId` and `RefName` from the signed-in user.
83
-
84
- ## Authoritative Bout Fields
85
-
86
- - The consuming application owns `Status`, `RefereeId`, `RefName`, `RingName`, `Seq`, `LastUpdateSeq`, `Ended`, `SubmissionId`, persistence, and socket broadcasts.
87
- - UI components may display authoritative fields and emit intent, but must not fabricate or authoritatively change them.
88
- - Clicking a bout must not mark it Active. Submitting presentation data must not mark it Completed or create `Ended`.
89
- - Closing a modal must not reset a bout to Scheduled or erase scores.
90
- - Sequence freshness, stale-update rejection, recovery, and broadcast behavior belong in the consuming application.
91
-
92
- ## Bracket Event Contract
93
-
94
- - Scheduled and active bout selections emit `update:directing-bout`.
95
- - Completed bout selections emit edit intent.
96
- - BYE and incomplete bouts cannot be directed.
97
- - List and tableau views must provide equivalent behavior.
98
- - Do not introduce `assign:director` or `action:assignBout` into bracket components.
99
- - Before adding a prop or event, search all component consumers and Storybook stories.
100
-
101
- ## Package Boundary
102
-
103
- - `src/index.js` is the package export surface. Keep exports intentional and stable.
104
- - `src/stories` contains reusable components and their Storybook-facing examples. Follow the existing atoms, molecules, organisms, templates, and skeletons structure.
105
- - `dist` is generated output. Do not edit it by hand.
106
- - Ignore `dist` and `node_modules` while searching unless debugging generated package output or dependency internals.
107
- - Do not add consuming-app-only dependencies to this package for one component. Prefer props, slots, events, or small local helpers.
108
-
109
- ## Validation
110
-
111
- - Run focused lint/build checks after UI changes when practical.
112
- - Useful commands include `npm run lint`, `npm run build-storybook`, `npm run build:tailwind`, and `npm run test`.
113
- - For component behavior changes, verify emitted events, optimistic display updates, prop reconciliation, empty states, disabled states, and responsive layout.
114
- - For public API changes, update Storybook stories and check the consuming app contract.
115
- - For bracket changes, test scheduled directing, active resume, completed editing, BYE rejection, modal-close state preservation, list/tableau consistency, and the absence of director-assignment UI.
116
- - Keep Storybook args aligned with component props. Stories should use `{ args: { ... } }`, include required props in every variant, and use correct control types for arrays, objects, booleans, and text.
117
- - Avoid running package version/publish flows unless explicitly requested. `npm run build` currently patches the package version as part of the script.
118
- - Use `npm run build:check` for routine package validation without changing the package version.
1
+ # Agent Guide
2
+
3
+ This project is `@dcrackel/hematournamentui`, the shared Vue 3 Storybook/UI package for Meyer Squared tournament screens. It owns reusable presentation components, visual structure, Storybook examples, Tailwind styling, and small UI-only state. The consuming admin/frontend app owns routing, API calls, sockets, auth, localStorage, persistence, and tournament workflow orchestration.
4
+
5
+ ## Code Style
6
+
7
+ - Prefer small, single-use, named functions over long inline blocks.
8
+ - Prefer guard clauses and early returns over `else`.
9
+ - Avoid `else if`. Use named predicate helpers, lookup maps, or dispatch tables when branching by type/status/action.
10
+ - Prefer predicate dispatch tables over large `switch` statements or long conditional chains.
11
+ - Use clear, boring names for important logic. Favor searchable names that describe the component intent or emitted action.
12
+ - Keep comments sparse. Add comments for domain rules, accessibility choices, or non-obvious sequencing behavior, not for code that reads plainly.
13
+ - Preserve existing component props, emitted events, slots, class contracts, and exported component names unless the change intentionally updates the package API.
14
+ - Do not refactor unrelated files while fixing focused bugs or adding focused UI behavior.
15
+
16
+ ## Component Boundary
17
+
18
+ - Components in this package should stay dumb, reusable, and presentation-focused.
19
+ - App-specific tournament behavior belongs in the consuming frontend, not in this shared UI package.
20
+ - Components should receive data through props and emit user intent upward for the parent to handle.
21
+ - Emit events for parent-owned work such as persistence, API calls, socket messages, navigation, auth-sensitive behavior, and cross-screen workflow rules.
22
+ - Keep local component state only for UI-only behavior, such as folding/unfolding menus, open/closed modal state when locally controlled, transient hover/focus state, input draft display, and similar presentation concerns.
23
+ - Do not add API clients, socket code, localStorage workflow state, or route-level orchestration to this package unless the explicit goal is to create a reusable UI API around those concerns.
24
+ - Clone incoming objects before building emitted payloads when the component may add or reshape UI-specific fields.
25
+ - Do not mutate incoming props or nested prop data. Clone arrays/objects into local UI state before adding UI-only fields such as `Promoted`, `customStatus`, local order, temporary scores, or modal draft state. Emit changed intent upward for the parent to persist.
26
+ - Keep emitted payload shapes stable. If an event contract changes, update the related Storybook examples and consuming documentation.
27
+
28
+ ## Atomic Design
29
+
30
+ - Follow the existing atomic design structure as much as practical: `Atoms`, `Molecules`, `Organisms`, `Templates`, and `Skeletons`.
31
+ - Put primitive, highly reusable controls in `Atoms`, such as base text, icons, inputs, tags, checkboxes, and radio groups.
32
+ - Put small composed controls in `Molecules`, such as modals, filters, menus, button groups, titled inputs, indicators, and compact UI combinations.
33
+ - Put larger reusable feature sections in `Organisms`, such as cards, containers, headers, forms, grids, complex inputs, wizards, and skeleton loaders.
34
+ - Put page-shaped reusable layouts in `Templates`. Templates may compose many organisms, but should still avoid owning app orchestration, API calls, sockets, routing, or persistence.
35
+ - Before creating a new component, check whether the behavior belongs in an existing atom, molecule, organism, or template instead of adding a near-duplicate.
36
+ - Keep lower-level components generic. Do not make atoms or molecules depend on one tournament workflow when a prop, slot, or emitted event can keep them reusable.
37
+
38
+ ## Interaction Pattern
39
+
40
+ - Prefer optimistic UI for presentation-only edits: update the visible component state right away, then emit the change upward.
41
+ - Do not optimistically change authoritative workflow fields such as bout status, referee identity, sequence data, or completion timestamps.
42
+ - The parent should perform persistence/API work and pass authoritative data back down through props.
43
+ - Reconcile prop updates cleanly so the component reflects parent-owned truth after save, refresh, or rollback.
44
+ - Do not block simple visual feedback on API completion unless the user action cannot be represented safely before confirmation.
45
+ - Missing or invalid input data should degrade gracefully in the UI instead of crashing a component.
46
+
47
+ ## Vue Patterns
48
+
49
+ - Use computed fields when derived data can be expressed declaratively.
50
+ - Keep logic out of templates/JSX where practical. Move meaningful conditions, transformations, and class decisions into named computed values or helpers.
51
+ - Keep Vue methods focused. Fetching, transforming, emitting, and local UI state updates should be separable when practical.
52
+ - Prefer explicit `emits` declarations and prop definitions that document component contracts.
53
+ - Keep emitted event names and payload fields aligned through wrapper components. When forwarding child events, use the same semantic event name, such as `penalty:add` for adding and `penalty:update` for updating, instead of compensating with swapped handlers.
54
+ - Use watchers sparingly. Prefer computed values and direct event handlers unless side effects are truly needed.
55
+ - Keep Storybook stories aligned with the public component API and use them to demonstrate meaningful states, variants, empty states, disabled states, and responsive behavior.
56
+
57
+ ## Styling And Layout
58
+
59
+ - Use Tailwind for layout, spacing, color, state, and responsive design whenever practical.
60
+ - Prefer CSS/Tailwind responsive behavior over JavaScript-driven breakpoints or resize logic.
61
+ - Keep layout behavior stable across mobile and desktop. Avoid text overlap, dynamic content shifting controls, or assumptions about fixed viewport sizes.
62
+ - Preserve existing visual language and component hierarchy before introducing new style patterns.
63
+ - Keep reusable components theme-friendly. Avoid hard-coding app-specific colors or one-off layout assumptions unless the component already owns that visual contract.
64
+ - Prefer accessible native controls and semantic markup where possible.
65
+
66
+ ## Data Ownership
67
+
68
+ - Treat this package as a UI surface, not an authoritative data owner.
69
+ - The consuming app owns persisted tournament state, live scoring truth, socket freshness, sequence handling, auth, routing, and recovery after reload/reconnect.
70
+ - Scoreboards, cards, tables, menus, and forms in this package should display provided data and emit user intent; they should not invent tournament workflow state.
71
+ - Keep tournament domain rules explicit when they are needed for rendering. Name conditions that depend on pool vs DE, completed vs active, visible vs hidden, or editable vs read-only.
72
+ - If a rule requires backend knowledge or app workflow context, prefer making it a prop or emitted decision rather than embedding the rule in a shared component.
73
+
74
+ ## Pool And Direct Elimination Boundaries
75
+
76
+ - Pool and Direct Elimination workflows are intentionally different. Confirm the domain rule before reusing assignment behavior between them.
77
+ - Pools may display available directors and emit pool, ring, or pool-work assignment intent. The consuming application persists that intent.
78
+ - Do not change pool assignment behavior while implementing bracket behavior.
79
+ - DE uses one shared collection of available bouts. The signed-in director claims a scheduled bout by selecting or starting it.
80
+ - Bracket components must not accept `directors` or `currentUserId` for assignment behavior.
81
+ - Bracket components must not expose director-selection modals, assignment buttons, or Assigned Bouts sections.
82
+ - The consuming application supplies `RefereeId` and `RefName` from the signed-in user.
83
+
84
+ ## Authoritative Bout Fields
85
+
86
+ - The consuming application owns `Status`, `RefereeId`, `RefName`, `RingName`, `Seq`, `LastUpdateSeq`, `Ended`, `SubmissionId`, persistence, and socket broadcasts.
87
+ - UI components may display authoritative fields and emit intent, but must not fabricate or authoritatively change them.
88
+ - Clicking a bout must not mark it Active. Submitting presentation data must not mark it Completed or create `Ended`.
89
+ - Closing a modal must not reset a bout to Scheduled or erase scores.
90
+ - Sequence freshness, stale-update rejection, recovery, and broadcast behavior belong in the consuming application.
91
+
92
+ ## Bracket Event Contract
93
+
94
+ - Scheduled and active bout selections emit `update:directing-bout`.
95
+ - Completed bout selections emit edit intent.
96
+ - BYE and incomplete bouts cannot be directed.
97
+ - List and tableau views must provide equivalent behavior.
98
+ - Do not introduce `assign:director` or `action:assignBout` into bracket components.
99
+ - Before adding a prop or event, search all component consumers and Storybook stories.
100
+
101
+ ## Package Boundary
102
+
103
+ - `src/index.js` is the package export surface. Keep exports intentional and stable.
104
+ - `src/stories` contains reusable components and their Storybook-facing examples. Follow the existing atoms, molecules, organisms, templates, and skeletons structure.
105
+ - `dist` is generated output. Do not edit it by hand.
106
+ - Ignore `dist` and `node_modules` while searching unless debugging generated package output or dependency internals.
107
+ - Do not add consuming-app-only dependencies to this package for one component. Prefer props, slots, events, or small local helpers.
108
+
109
+ ## Validation
110
+
111
+ - Run focused lint/build checks after UI changes when practical.
112
+ - Useful commands include `npm run lint`, `npm run build-storybook`, `npm run build:tailwind`, and `npm run test`.
113
+ - For component behavior changes, verify emitted events, optimistic display updates, prop reconciliation, empty states, disabled states, and responsive layout.
114
+ - For public API changes, update Storybook stories and check the consuming app contract.
115
+ - For bracket changes, test scheduled directing, active resume, completed editing, BYE rejection, modal-close state preservation, list/tableau consistency, and the absence of director-assignment UI.
116
+ - Keep Storybook args aligned with component props. Stories should use `{ args: { ... } }`, include required props in every variant, and use correct control types for arrays, objects, booleans, and text.
117
+ - Avoid running package version/publish flows unless explicitly requested. `npm run build` currently patches the package version as part of the script.
118
+ - Use `npm run build:check` for routine package validation without changing the package version.
package/README.md CHANGED
@@ -1,106 +1,132 @@
1
- # Vue 3 + Vite
2
-
3
- This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
-
5
- ## Recommended IDE Setup
6
-
7
- - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8
-
9
- ## Publishing a Storybook Library to NPM
10
-
11
- Follow this guide to publish your Storybook library to NPM, making it available for others to easily npm install.
12
-
13
- ## Shared CSS
14
-
15
- Build the package stylesheet as a separate step:
16
-
17
- ```bash
18
- npm run build:package-css
19
- ```
20
-
21
- The generated file is `dist/hematournamentui-tailwind.css`. Consuming apps should import it from the package instead of manually copying `tailwind/output.css`:
22
-
23
- ```js
24
- import '@dcrackel/hematournamentui/tailwind.css';
25
- ```
26
-
27
- Use `npm run build:tailwind` for Storybook's local `tailwind/output.css` workflow. Use `npm run build:package-css` when preparing CSS for the parent app or package publish.
28
-
29
- # 1. Setup & Prerequisites
30
-
31
- Ensure you have an account on npm. If not, you can create one for free.
32
- Verify node and npm installations:
33
-
34
- ```
35
- Copy code
36
- node -v
37
- npm -v
38
- ```
39
-
40
- # 2. Preparing Your Storybook Library
41
-
42
- a. Building the Library
43
- Compile your library with Vite or your bundler:
44
-
45
- ```
46
- vite build
47
- ```
48
-
49
- b. Update package.json
50
- Ensure the following fields are set:
51
-
52
- name: Name of your package.
53
- version: Version number.
54
- main: Main entry file (e.g., dist/index.js).
55
- files: Files to include, e.g., ["dist"].
56
-
57
- # 3. Logging in to NPM
58
-
59
- Login to npm (if you haven't already):
60
-
61
- ```
62
- npm login
63
- ```
64
-
65
- Provide your username, password, and email.
66
-
67
- # 4. Publishing to NPM
68
-
69
- a. Default (Private Package)
70
- For scoped private packages (@username/project-name):
71
-
72
- ```
73
- npm publish
74
- ```
75
-
76
- b. Public Package
77
- For public packages:
78
-
79
- ```
80
- npm publish --access=public
81
- ```
82
-
83
- # 5. Verifying Your Package
84
-
85
- Check on the npm website to verify your package's publication.
86
-
87
- Check the registry name
88
-
89
- ```
90
- npm get registry
91
- ```
92
-
93
- # 6. Installing and Using the Library
94
-
95
- To install the library:
96
-
97
- ```
98
- npm install your-library-name
99
- ```
100
-
101
- Users can then import and utilize your library's components.
102
-
103
- Notes:
104
-
105
- Always update the version in package.json before republishing.
106
- Ensure only necessary files are bundled to prevent package bloat.
1
+ # Vue 3 + Vite
2
+
3
+ This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8
+
9
+ ## Publishing a Storybook Library to NPM
10
+
11
+ Follow this guide to publish your Storybook library to NPM, making it available for others to easily npm install.
12
+
13
+ ## Shared CSS
14
+
15
+ Build the package stylesheet as a separate step:
16
+
17
+ ```bash
18
+ npm run build:package-css
19
+ ```
20
+
21
+ The generated file is `dist/hematournamentui-tailwind.css`. Consuming apps should import it from the package instead of manually copying `tailwind/output.css`:
22
+
23
+ ```js
24
+ import '@dcrackel/hematournamentui/tailwind.css';
25
+ ```
26
+
27
+ Use `npm run build:tailwind` for Storybook's local `tailwind/output.css` workflow. Use `npm run build:package-css` when preparing CSS for the parent app or package publish.
28
+
29
+ ## Person profile drafts and Save
30
+
31
+ `PersonManagement` edits a detached draft and emits `submit:person` with a detached snapshot only when the user saves a valid form. `BaseInput` emits `update:value` synchronously; consumers should debounce their own expensive searches or validation.
32
+
33
+ ```vue
34
+ <PersonManagement
35
+ :personProfile="person"
36
+ :saving="saving"
37
+ :disabled="readOnly"
38
+ :draftResetKey="profileRevision"
39
+ @submit:person="savePerson"
40
+ @update:image="handleDraftImage"
41
+ @error:image="handleImageError"
42
+ />
43
+ ```
44
+
45
+ The parent owns API calls, save failures, and authoritative reloads. After a successful reload, supply the refreshed `personProfile` and increment `draftResetKey` in the same update. Selecting a different `PersonId` resets the draft automatically. Updates for the same person preserve unsaved edits until the reset key changes; remounting with a versioned Vue `key` also works.
46
+
47
+ `saving` and `disabled` disable the form's native controls and prevent new edits and save/delete/merge actions. An upload started earlier may still finish updating the draft. Saving shows accessible busy feedback. Image uploads temporarily disable Save until they finish. Validation failures show a summary across tabs, with links back to the invalid fields' tabs.
48
+
49
+ Draft `LegalName` and `EmailAddress` take precedence over legacy names and email relations, including explicit empty strings. The library continues emitting `EmailAddress`; the parent maps it to backend `Email` and omits stale `PersonEmails` as required by its API. An explicit `HemaRatingsId: null` displays blank and never falls back to old ratings. Blank ID edits remain blank in the draft; the parent converts them to `null` and normalizes valid positive integer IDs.
50
+
51
+ Successful uploads update the same draft's `ProfileImage` and emit `update:image` with the URL. That event is a draft notification and should not automatically persist the profile. `ImageCropper` emits successful edits as `update:url`, busy state as `update:uploading`, and failures separately as `error:load` or `error:upload`. `PersonManagement` displays image failures and forwards them as `error:image` with `{ type: 'load' | 'upload', message, url?, status? }`; failures never emit a null image edit.
52
+
53
+ UI regression tests cover the draft and event contracts. Live backend save/reload checks for email, HR ID changes/clears, first-time profiles, and images remain the consuming application's responsibility; a skipped ratings refresh is separate from profile save success.
54
+
55
+ # 1. Setup & Prerequisites
56
+
57
+ Ensure you have an account on npm. If not, you can create one for free.
58
+ Verify node and npm installations:
59
+
60
+ ```
61
+ Copy code
62
+ node -v
63
+ npm -v
64
+ ```
65
+
66
+ # 2. Preparing Your Storybook Library
67
+
68
+ a. Building the Library
69
+ Compile your library with Vite or your bundler:
70
+
71
+ ```
72
+ vite build
73
+ ```
74
+
75
+ b. Update package.json
76
+ Ensure the following fields are set:
77
+
78
+ name: Name of your package.
79
+ version: Version number.
80
+ main: Main entry file (e.g., dist/index.js).
81
+ files: Files to include, e.g., ["dist"].
82
+
83
+ # 3. Logging in to NPM
84
+
85
+ Login to npm (if you haven't already):
86
+
87
+ ```
88
+ npm login
89
+ ```
90
+
91
+ Provide your username, password, and email.
92
+
93
+ # 4. Publishing to NPM
94
+
95
+ a. Default (Private Package)
96
+ For scoped private packages (@username/project-name):
97
+
98
+ ```
99
+ npm publish
100
+ ```
101
+
102
+ b. Public Package
103
+ For public packages:
104
+
105
+ ```
106
+ npm publish --access=public
107
+ ```
108
+
109
+ # 5. Verifying Your Package
110
+
111
+ Check on the npm website to verify your package's publication.
112
+
113
+ Check the registry name
114
+
115
+ ```
116
+ npm get registry
117
+ ```
118
+
119
+ # 6. Installing and Using the Library
120
+
121
+ To install the library:
122
+
123
+ ```
124
+ npm install your-library-name
125
+ ```
126
+
127
+ Users can then import and utilize your library's components.
128
+
129
+ Notes:
130
+
131
+ Always update the version in package.json before republishing.
132
+ Ensure only necessary files are bundled to prevent package bloat.