@payfit/unity-illustrations 2.55.5 → 2.55.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.
@@ -0,0 +1,17 @@
1
+ export type IllustrationReferenceComponent = {
2
+ name: string;
3
+ type: string;
4
+ animated: boolean;
5
+ category?: string;
6
+ };
7
+ export declare const getIllustrationReferenceGroups: (components: IllustrationReferenceComponent[]) => {
8
+ category: string;
9
+ title: string;
10
+ components: IllustrationReferenceComponent[];
11
+ }[];
12
+ export declare const generateIllustrationsReference: (components: IllustrationReferenceComponent[]) => string;
13
+ export declare const generateIllustrationsAgentReferencesReadme: () => string;
14
+ export declare const writeIllustrationAgentReferences: ({ components, outputDir, }: {
15
+ components: IllustrationReferenceComponent[];
16
+ outputDir: string;
17
+ }) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/unity-illustrations",
3
- "version": "2.55.5",
3
+ "version": "2.55.6",
4
4
  "module": "./dist/esm/index.js",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -36,8 +36,7 @@
36
36
  },
37
37
  "files": [
38
38
  "dist",
39
- "src",
40
- "skills"
39
+ "src"
41
40
  ],
42
41
  "dependencies": {
43
42
  "image-size": "1.0.2",
@@ -51,7 +50,6 @@
51
50
  "@storybook/addon-mcp": "0.6.0",
52
51
  "@storybook/addon-themes": "10.4.6",
53
52
  "@storybook/react-vite": "10.4.6",
54
- "@tanstack/intent": "0.3.0",
55
53
  "@types/react": "18.3.18",
56
54
  "@types/react-dom": "18.3.5",
57
55
  "image-size": "1.0.2",
@@ -66,15 +64,12 @@
66
64
  "@payfit/hr-app-eslint": "0.0.0-use.local",
67
65
  "@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
68
66
  "@payfit/storybook-config": "0.0.0-use.local",
69
- "@payfit/unity-themes": "2.55.5",
67
+ "@payfit/unity-themes": "2.55.6",
70
68
  "@payfit/vite-configs": "0.0.0-use.local"
71
69
  },
72
70
  "peerDependencies": {
73
71
  "react": "18.3.1",
74
72
  "react-dom": "18.3.1",
75
- "@payfit/unity-themes": "2.55.5"
76
- },
77
- "keywords": [
78
- "tanstack-intent"
79
- ]
73
+ "@payfit/unity-themes": "2.55.6"
74
+ }
80
75
  }
@@ -0,0 +1,17 @@
1
+ import { Meta } from '@storybook/addon-docs/blocks'
2
+
3
+ <Meta title="Agent References/Illustrations Overview" />
4
+
5
+ # Unity Illustrations Agent References
6
+
7
+ {/* AUTO-GENERATED FILE. DO NOT EDIT.
8
+ Generated by unity-illustrations:pre-build.
9
+ Source: Unity illustration asset metadata.
10
+ */}
11
+
12
+
13
+ This directory contains generated Storybook docs references for Unity illustrations. These files are intended for Storybook MCP, MCP indexers, and AI agents.
14
+
15
+ Storybook includes these MDX files through the shared `../src/**/*.mdx` stories glob, and `@storybook/addon-mcp` exposes docs content to MCP clients.
16
+
17
+ - [Illustrations](./illustrations.mdx)
@@ -0,0 +1,74 @@
1
+ import { Meta } from '@storybook/addon-docs/blocks'
2
+
3
+ <Meta title="Agent References/Illustrations" />
4
+
5
+ # Illustrations
6
+
7
+ {/* AUTO-GENERATED FILE. DO NOT EDIT.
8
+ Generated by unity-illustrations:pre-build.
9
+ Source: Unity illustration asset metadata.
10
+ */}
11
+
12
+
13
+ Agent reference. Exact illustration names are grouped by variant to reduce context.
14
+
15
+ Lazy: `<LazyIllustration name="ExactName" variant="icon|picture" alt="..." />`.
16
+
17
+ Eager: `import Asset from "@payfit/unity-illustrations/ExactName"`, then `<Illustration src={Asset} variant="icon|picture" alt="..." />`.
18
+
19
+ Animations use `variant="picture"`.
20
+
21
+ ## Illustrated icons (icon)
22
+
23
+ - AdministrativeDocument, AdministrativeDocumentWithBackground, AnnualTaxes, BabyBottle, BabyBottleWithBackground, Bell, BellWithBackground, Bicycle
24
+ - BicycleWithBackground, BlankPayslip, BlankPayslipWithBackground, Box, BoxWithBackground, Buoy, BuoyWithBackground, Calculator
25
+ - CalculatorWithBackground, Card, CardWithBackground, CharacterHeadphone, CharacterHeadphoneWithBackground, Checkbox, CheckboxWithBackground, Clock
26
+ - ClockWithBackground, ClosedLock, ClosedLockWithBackground, ComputerDocumentation, ComputerDocumentationWithBackground, Confettis, ConfettisWithBackground, Contact
27
+ - Conversation, ConversationWithBackground, Data, DataWithBackground, Discount, DiscountWithBackground, Document, DocumentError
28
+ - DocumentFiling, DocumentWithBackground, EmailNotification, EmailNotificationWithBackground, EmergencyContact, EmploymentContract, EmploymentContractWithBackground, EmptyDocument
29
+ - EmptyDocumentWithBackground, EmptyState, EmptyStateWithBackground, ESignature, ExceedingThreshold, ExceptionalCompensation, ExceptionalCompensationWithBackground, Expenses
30
+ - FAQ, FAQWithBackground, FieldGlasses, FieldGlassesWithBackground, FreeShare, FreeShareWithBackground, FullCalendar, FullCalendarWithBackground
31
+ - Gear, GearWithBackground, Gift, GiftWithBackground, GoldenRibbon, GoldenRibbonWithBackground, Graph, GraphWithBackground
32
+ - HalfCalendar, HalfCalendarWithBackground, Hammer, HammerWithBackground, HandHello, HandHelloWithBackground, HappyCharacter, HappyCharacterWithBackground
33
+ - Health, HealthInsurance, HolidayVoucher, HolidayVoucherWithBackground, IdentityCard, InformationUpdate, InformationUpdateWithBackground, JEIJEUJEC
34
+ - Kanoon, Kpmg, LegalHelp, LetterBox, LetterBoxWithBackground, LightBulb, LightBulbWithBackground, LittleRocket
35
+ - LittleRocketWithBackground, LunchVoucher, MagnifyingGlass, MagnifyingGlassWithBackground, MealPlate, MealPlateWithBackground, MealVoucher, MealVoucherCard
36
+ - MealVoucherCardWithBackground, MealVoucherWithBackground, Mobility, MoneyLending, MoneyLendingWithBackground, Notes, OfficialLetter, OfficialLetterWithBackground
37
+ - OpenLock, OpenLockWithBackground, OrganismesPayment, PaidLeave, PaymentInformation, Payslip, PayslipCoins, PayslipCoinsWithBackground
38
+ - PayslipWithBackground, Pen, PenWithBackground, People, PeopleWithBackground, Performance, PersonalDetails, PersonHeadphone
39
+ - PersonHeadphoneWithBackground, PiggyBank, PiggyBankCoins, PiggyBankCoinsWithBackground, PiggyBankWithBackground, Plant, PlantWithBackground, ProvidentScheme
40
+ - RemoteWork, Report, ReportWithBackground, Salary, SalaryAdvance, SalaryPayment, SalarySeizure, SalarySeizureWithBackground
41
+ - SandCastle, SandCastleWithBackground, Schedule, ScheduleWithBackground, SettingSlider, SettingSliderWithBackground, SetUpTask, SickLeave
42
+ - SmallPuzzle, SmallPuzzleWithBackground, SmilingCharacter, SmilingCharacterWithBackground, Spreadsheet, SpreadsheetWithBackground, Stethoscope, StethoscopeWithBackground
43
+ - StockOptions, StockOptionsWithBackground, Stopwatch, StopwatchWithBackground, Sunshade, SunshadeWithBackground, TaskToDo, TaskToDoWithBackground
44
+ - Template, TemplateWithBackground, Thumbtack, ThumbtackWithBackground, TimeTracking, TipsJar, TipsJarWithBackground, TokenCoin
45
+ - TokenCoinWithBackground, ValidationWindow, ValidationWindowWithBackground, WorkExpense, WorkExpenseWithBackground, WorkingTime
46
+
47
+ ## Illustrated pictures (picture)
48
+
49
+ - Accounting, AddEmployee, AlphabetCube, Analysis, AutomationInProgress, BigIdea, Binoculars, Biscuit
50
+ - BiscuitCrumbs, Book, Brainstorming, Calendar, Chat, ChristmasSock, ChristmasSockAndConfettis, Collaboration
51
+ - CollectiveResearch, ComputerMail, ConfettiCannon, ContractSignature, CrossLegged, CupOfCoffee, Dancing, DancingPeople
52
+ - DancingSkier, Dialogue, Discussion, Doctor, DocumentCreation, DocumentScan, DocumentScanning, EmailLogin
53
+ - EmptyStateActivationButton, EmptyStateActivationToggle, EmptyStateDesert, EmptyStateEmptyFolder, EmptyStateIncidentPanel, EmptyStateMaintenance, EmptyStateMoon, EmptyStateResearch
54
+ - EmptyStateToDo, Evaluation, FilingDocuments, Flowchart, Graphic, Hands, HighFive, HighlightBooks
55
+ - Idea, IndicateSomething, JetlangCalculator, Library, Marteler, Mug, Panel, PaperPlane
56
+ - Party, PayfittersWithBadge, PayrollError, Person, PhoneMessage, Planet, PostIt, Progression
57
+ - Promotion, Puzzle, PuzzlePiece, ReadingABook, ReceivingPay, RehireEmployee, Remote, Rocket
58
+ - SafeDepositBox, Sale, SecurityFields, Signature, SittingOnTheSofa, SolveProblem, SpeakerFingertips, SpeakerWelcome
59
+ - SpeakerWithMicrophone, StackOfBook2, StairTreads, TakingNote, Target, TeamBuilding, Telescope, TemplateForm
60
+ - Thumbsup, Timer, ToggleOff, ToggleOn, Trophy, TrophyWon, VisuallyImpaired, VisuallyImpairedWinter
61
+ - WalkingPeople, WinterParty, WorkAtOffice, WorkFromAnywhere, Wrench, WriteBook
62
+
63
+ ## Animations (picture; animated)
64
+
65
+ - AccountingAnimation, BinocularsAnimation, CardAnimation, ClockAnimation, ConfettisAnimation, DocumentAnimation, HandsAnimation, KpmgAnimation
66
+ - PanelAnimation, PaperPlaneAnimation, PartyAnimation, PayslipFlipAnimation, PeopleAnimation, PiggyBankAnimation, PlantAnimation, ScheduleAnimation
67
+ - ThumbsupAnimation, WinterPartyAnimation
68
+
69
+ ## Other illustrations (picture)
70
+
71
+ - AccountingWithBackground, AlphabetCubeWithBackground, BinocularsWithBackground, BookWithBackground, CalendarWithBackground, ComputerMailWithBackground, ConfettiCannonWithBackground, DialogueWithBackground
72
+ - DocumentCreationWithBackground, DocumentScanWithBackground, ExpensesWithBackground, FlowchartWithBackground, HighFiveWithBackground, HighlightBooksWithBackground, IncidentPanel, MartelerWithBackground
73
+ - PanelWithBackground, PaperPlaneWithBackground, PayrollErrorWithBackground, PerformanceDiscussion, PerformanceWithBackground, PostItWithBackground, SecurityFieldsWithBackground, SignatureWithBackground
74
+ - StackOfBook2WithBackground, TemplateFormWithBackground, ToggleOffWithBackground, ToggleOnWithBackground, TrophyWithBackground, WriteBookWithBackground
@@ -0,0 +1,100 @@
1
+ import { describe, expect, it } from 'vitest'
2
+
3
+ import {
4
+ generateIllustrationsReference,
5
+ getIllustrationReferenceGroups,
6
+ } from './illustration-reference.js'
7
+
8
+ describe('illustration agent references', () => {
9
+ it('groups illustrations by category with stable name sorting', () => {
10
+ expect(
11
+ getIllustrationReferenceGroups([
12
+ {
13
+ name: 'WriteBook',
14
+ type: 'svg',
15
+ animated: false,
16
+ category: 'picture',
17
+ },
18
+ {
19
+ name: 'FAQAnimation',
20
+ type: 'image',
21
+ animated: true,
22
+ category: 'animation',
23
+ },
24
+ {
25
+ name: 'Accounting',
26
+ type: 'svg',
27
+ animated: false,
28
+ category: 'picture',
29
+ },
30
+ { name: 'Baby', type: 'svg', animated: false, category: 'icon' },
31
+ ]),
32
+ ).toEqual([
33
+ {
34
+ category: 'icon',
35
+ title: 'Illustrated icons',
36
+ components: [
37
+ { name: 'Baby', type: 'svg', animated: false, category: 'icon' },
38
+ ],
39
+ },
40
+ {
41
+ category: 'picture',
42
+ title: 'Illustrated pictures',
43
+ components: [
44
+ {
45
+ name: 'Accounting',
46
+ type: 'svg',
47
+ animated: false,
48
+ category: 'picture',
49
+ },
50
+ {
51
+ name: 'WriteBook',
52
+ type: 'svg',
53
+ animated: false,
54
+ category: 'picture',
55
+ },
56
+ ],
57
+ },
58
+ {
59
+ category: 'animation',
60
+ title: 'Animations',
61
+ components: [
62
+ {
63
+ name: 'FAQAnimation',
64
+ type: 'image',
65
+ animated: true,
66
+ category: 'animation',
67
+ },
68
+ ],
69
+ },
70
+ ])
71
+ })
72
+
73
+ it('generates a compact Storybook MDX list with lazy and eager usage', () => {
74
+ const markdown = generateIllustrationsReference([
75
+ {
76
+ name: 'FAQAnimation',
77
+ type: 'image',
78
+ animated: true,
79
+ category: 'animation',
80
+ },
81
+ ])
82
+
83
+ expect(markdown).toContain('{/* AUTO-GENERATED FILE. DO NOT EDIT.')
84
+ expect(markdown).toContain(
85
+ '<Meta title="Agent References/Illustrations" />',
86
+ )
87
+ expect(markdown).toContain('## Animations (picture; animated)')
88
+ expect(markdown).not.toContain('| Name | Variant | Type | Animated |')
89
+ expect(markdown).toContain('- FAQAnimation')
90
+ expect(markdown).toContain(
91
+ 'Lazy: `<LazyIllustration name="ExactName" variant="icon|picture" alt="..." />`',
92
+ )
93
+ expect(markdown).toContain(
94
+ 'Eager: `import Asset from "@payfit/unity-illustrations/ExactName"`',
95
+ )
96
+ expect(markdown).not.toContain(
97
+ '`<LazyIllustration name="FAQAnimation" variant="picture" />`',
98
+ )
99
+ })
100
+ })
@@ -0,0 +1,140 @@
1
+ import fs from 'fs'
2
+ import path from 'path'
3
+
4
+ export type IllustrationReferenceComponent = {
5
+ name: string
6
+ type: string
7
+ animated: boolean
8
+ category?: string
9
+ }
10
+
11
+ const GENERATED_NOTICE = `{/* AUTO-GENERATED FILE. DO NOT EDIT.
12
+ Generated by unity-illustrations:pre-build.
13
+ Source: Unity illustration asset metadata.
14
+ */}\n`
15
+
16
+ const STORYBOOK_META = `import { Meta } from '@storybook/addon-docs/blocks'\n\n<Meta title="Agent References/Illustrations" />\n`
17
+ const README_STORYBOOK_META = `import { Meta } from '@storybook/addon-docs/blocks'\n\n<Meta title="Agent References/Illustrations Overview" />\n`
18
+
19
+ const CATEGORY_ORDER = ['icon', 'picture', 'animation', 'other']
20
+
21
+ const CATEGORY_TITLES: Record<string, string> = {
22
+ icon: 'Illustrated icons',
23
+ picture: 'Illustrated pictures',
24
+ animation: 'Animations',
25
+ other: 'Other illustrations',
26
+ }
27
+
28
+ const getCategory = (component: IllustrationReferenceComponent) =>
29
+ component.category ?? 'other'
30
+
31
+ const chunk = <T>(items: T[], size: number) => {
32
+ const chunks: T[][] = []
33
+
34
+ for (let index = 0; index < items.length; index += size) {
35
+ chunks.push(items.slice(index, index + size))
36
+ }
37
+
38
+ return chunks
39
+ }
40
+
41
+ export const getIllustrationReferenceGroups = (
42
+ components: IllustrationReferenceComponent[],
43
+ ) => {
44
+ const knownCategories = new Set(CATEGORY_ORDER)
45
+ const categories = [
46
+ ...CATEGORY_ORDER,
47
+ ...Array.from(new Set(components.map(getCategory))).filter(
48
+ category => !knownCategories.has(category),
49
+ ),
50
+ ]
51
+
52
+ return categories
53
+ .map(category => ({
54
+ category,
55
+ title: CATEGORY_TITLES[category] ?? category,
56
+ components: components
57
+ .filter(component => getCategory(component) === category)
58
+ .slice()
59
+ .sort((a, b) => a.name.localeCompare(b.name)),
60
+ }))
61
+ .filter(group => group.components.length > 0)
62
+ }
63
+
64
+ export const generateIllustrationsReference = (
65
+ components: IllustrationReferenceComponent[],
66
+ ) => {
67
+ const lines = [
68
+ STORYBOOK_META,
69
+ '# Illustrations',
70
+ '',
71
+ GENERATED_NOTICE,
72
+ '',
73
+ 'Agent reference. Exact illustration names are grouped by variant to reduce context.',
74
+ '',
75
+ 'Lazy: `<LazyIllustration name="ExactName" variant="icon|picture" alt="..." />`.',
76
+ '',
77
+ 'Eager: `import Asset from "@payfit/unity-illustrations/ExactName"`, then `<Illustration src={Asset} variant="icon|picture" alt="..." />`.',
78
+ '',
79
+ 'Animations use `variant="picture"`.',
80
+ '',
81
+ ]
82
+
83
+ for (const group of getIllustrationReferenceGroups(components)) {
84
+ const variant = group.category === 'icon' ? 'icon' : 'picture'
85
+ const animated = group.category === 'animation' ? '; animated' : ''
86
+
87
+ lines.push(
88
+ `## ${group.title} (${variant}${animated})`,
89
+ '',
90
+ ...chunk(
91
+ group.components.map(component => component.name),
92
+ 8,
93
+ ).map(names => `- ${names.join(', ')}`),
94
+ '',
95
+ )
96
+ }
97
+
98
+ return `${lines.join('\n').trimEnd()}\n`
99
+ }
100
+
101
+ export const generateIllustrationsAgentReferencesReadme =
102
+ () => `${README_STORYBOOK_META}
103
+ # Unity Illustrations Agent References
104
+
105
+ ${GENERATED_NOTICE}
106
+
107
+ This directory contains generated Storybook docs references for Unity illustrations. These files are intended for Storybook MCP, MCP indexers, and AI agents.
108
+
109
+ Storybook includes these MDX files through the shared \`../src/**/*.mdx\` stories glob, and \`@storybook/addon-mcp\` exposes docs content to MCP clients.
110
+
111
+ - [Illustrations](./illustrations.mdx)
112
+ `
113
+
114
+ export const writeIllustrationAgentReferences = ({
115
+ components,
116
+ outputDir,
117
+ }: {
118
+ components: IllustrationReferenceComponent[]
119
+ outputDir: string
120
+ }) => {
121
+ try {
122
+ fs.mkdirSync(outputDir, { recursive: true })
123
+ fs.writeFileSync(
124
+ path.join(outputDir, 'README.mdx'),
125
+ generateIllustrationsAgentReferencesReadme(),
126
+ 'utf8',
127
+ )
128
+ fs.writeFileSync(
129
+ path.join(outputDir, 'illustrations.mdx'),
130
+ generateIllustrationsReference(components),
131
+ 'utf8',
132
+ )
133
+ } catch (error) {
134
+ throw new Error(
135
+ `Failed to write illustration agent references to ${outputDir}: ${
136
+ error instanceof Error ? error.message : String(error)
137
+ }`,
138
+ )
139
+ }
140
+ }
@@ -20,12 +20,14 @@ import {
20
20
  } from './templates/assetTemplate'
21
21
  import { generateBaseTypes } from './templates/baseTypes'
22
22
  import { generateIndexFile } from './templates/indexTemplate'
23
+ import { writeIllustrationAgentReferences } from './agent-references/illustration-reference'
23
24
 
24
25
  // Configuration
25
26
  const illustrationsSvgDir = path.resolve('./assets/')
26
27
  const srcRoot = path.resolve('./src')
27
28
  const outputDir = path.join(srcRoot, 'generated')
28
29
  const assetsOutputDir = path.join(outputDir, 'assets') // Optimized assets go here
30
+ const agentReferencesOutputDir = path.resolve('./src/agent-references')
29
31
  const configPath = path.resolve('./.figma-sync.json')
30
32
 
31
33
  const verboseFromArg = process.argv.some(
@@ -592,6 +594,10 @@ async function main() {
592
594
  indexContent,
593
595
  'utf8',
594
596
  )
597
+ writeIllustrationAgentReferences({
598
+ components,
599
+ outputDir: agentReferencesOutputDir,
600
+ })
595
601
 
596
602
  // Summary
597
603
  const totalSizeBefore = components.reduce((sum, c) => sum + c.sizeBefore, 0)