{"version":3,"file":"index-c2745310.js","sources":["../../../app/packs/src/design-system/components/pages/FrameworkPage/CategoryRow.tsx","../../../app/packs/src/design-system/components/pages/FrameworkPage/SkillBlobs.tsx","../../../app/packs/src/design-system/components/pages/FrameworkPage/RequirementCard.tsx","../../../app/packs/src/design-system/components/pages/FrameworkPage/SkillCard.tsx","../../../app/packs/src/design-system/components/pages/FrameworkPage/SkillRow.tsx","../../../app/packs/src/design-system/components/pages/FrameworkPage/CategorisedSkills.tsx","../../../app/packs/src/design-system/components/pages/FrameworkPage/UncategorisedSkills.tsx","../../../app/packs/src/design-system/components/pages/FrameworkPage/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport cn from 'classnames'\nimport styles from './CategoryRow.module.scss'\nimport { DivPropsWithoutChildren } from '../../../types/helpers'\nimport { useFramework } from '../../../hooks/use-framework'\n\ntype RootProps = {\n  children: React.ReactNode\n  uncategorised?: boolean\n} & DivPropsWithoutChildren\n\nconst Root: React.VFC<RootProps> = (props) => {\n  const { children, className, uncategorised, ...restProps } = props\n\n  const [sticky] = useFramework((hook) => [hook.sticky])\n\n  return (\n    <div\n      data-element-id=\"category-row\"\n      className={cn(styles.categoryRow, sticky && styles.collapsed, className)}\n      {...restProps}\n    >\n      {children}\n    </div>\n  )\n}\n\ntype TitleProps = {\n  children: React.ReactNode\n} & DivPropsWithoutChildren\n\nconst Title: React.VFC<TitleProps> = (props) => {\n  const { children, className, ...restProps } = props\n\n  return (\n    <h3 className={cn(styles.heading, className)} {...restProps}>\n      {children}\n    </h3>\n  )\n}\n\nexport { Root, Title }\n","import * as React from 'react'\nimport shallow from 'zustand/shallow'\nimport cn from 'classnames'\nimport type { TPosition, TRequirement, TSkill } from '../../../types/entities'\nimport type { DivPropsWithoutChildren } from '../../../types/helpers'\nimport { useFramework } from '../../../hooks/use-framework'\nimport styles from './SkillBlobs.module.scss'\n\nexport type SkillBlobsProps = {\n  requirement?: TRequirement\n  position: TPosition\n  skill: TSkill\n  temporaryLevel: number | null\n  setTemporaryLevel: (level: number | null) => void\n  setErrorMessage: (errorMessage: string | null) => void\n} & DivPropsWithoutChildren\n\nexport const SkillBlobs: React.VFC<SkillBlobsProps> = (props) => {\n  const {\n    position,\n    requirement,\n    skill,\n    temporaryLevel,\n    setTemporaryLevel,\n    setErrorMessage,\n    ...restProps\n  } = props\n\n  const [eventHandlers, permissions] = useFramework(\n    (s) => [s.eventHandlers, s.permissions],\n    shallow\n  )\n\n  const requirementLevel = requirement?.level || 0\n\n  const maxSkillLevel =\n    skill.skillLevels?.reduce((max, { level }) => Math.max(max, level), 0) || 0\n\n  if (!requirement && !permissions?.allowCreateRequirement) {\n    return null\n  }\n\n  return (\n    <div className={styles.wrapper} {...restProps}>\n      {Array.from({ length: maxSkillLevel }, (_, index) => {\n        let isFilled = false\n        const blobLevel = index + 1\n        const hasRequirementAtLevel = Boolean(\n          skill.skillLevels?.find((s) => s.level === blobLevel)\n        )\n\n        // if the current requirement level is higher than this blob's level, it should\n        // be filled, unless there is a temporary level set, in which case skip this check\n        if (requirementLevel >= blobLevel && !temporaryLevel) isFilled = true\n\n        // if a temporary level exists (ie hovering over a blob that's different to the\n        // existing requirement level, check to see if this is the same or greater than\n        // this blob's level, and if it is make sure it's filled\n        if (!!temporaryLevel && temporaryLevel >= blobLevel) isFilled = true\n\n        let canChangeRequirement = false\n\n        if (hasRequirementAtLevel && permissions?.allowChangeRequirement) {\n          canChangeRequirement = true\n        }\n\n        if (!requirement && permissions?.allowCreateRequirement) {\n          canChangeRequirement = true\n        }\n\n        const cursorStyles = {\n          [styles.notAllowed]: !hasRequirementAtLevel,\n          [styles.defaultCursor]: !canChangeRequirement,\n        }\n\n        return (\n          <div\n            className={cn(\n              styles.skillBlobWrapper,\n              !requirement && styles.empty,\n              cursorStyles\n            )}\n            onMouseOver={() => {\n              if (canChangeRequirement) setTemporaryLevel(blobLevel)\n            }}\n            onMouseOut={() => {\n              if (canChangeRequirement) setTemporaryLevel(null)\n            }}\n            key={index}\n          >\n            <button\n              type=\"button\"\n              className={cn(\n                styles.skillBlob,\n                {\n                  [styles.filled]: isFilled,\n                },\n                cursorStyles\n              )}\n              onFocus={() => {\n                if (canChangeRequirement) setTemporaryLevel(blobLevel)\n              }}\n              onBlur={() => {\n                if (canChangeRequirement) setTemporaryLevel(null)\n              }}\n              disabled={!canChangeRequirement}\n              onClick={async (e) => {\n                e.stopPropagation()\n\n                // if the user doesn't have permission to delete a requirement and the new level is the same\n                // as the existing one, clicking it shouldn't do anything\n                if (\n                  !permissions?.allowDeleteRequirement &&\n                  requirement &&\n                  blobLevel === requirement.level\n                ) {\n                  return\n                }\n\n                // prevent onBlur or onMouseOut from setting the temporary level to null\n                // value is set back when component is refreshed\n                canChangeRequirement = false\n                setTemporaryLevel(blobLevel)\n                setErrorMessage(null)\n\n                const existingRequirement = { ...requirement } as TRequirement\n\n                const error = await eventHandlers?.onChangeRequirementLevel?.({\n                  newLevel: blobLevel,\n                  requirement: existingRequirement,\n                  positionId: position.id as number,\n                  skillId: skill.id,\n                })\n\n                if (error) setErrorMessage(error)\n              }}\n              aria-label={\n                hasRequirementAtLevel\n                  ? `Change the requirement level for the ${skill.name} skill in the ${position.name} position to level ${blobLevel}`\n                  : `There is no level ${blobLevel} requirement for the ${skill.name} skill in the ${position.name} position`\n              }\n            />\n          </div>\n        )\n      })}\n    </div>\n  )\n}\n","import * as React from 'react'\nimport cn from 'classnames'\nimport { TPosition, TRequirement, TSkill } from '../../../types/entities'\nimport { DivPropsWithoutChildren } from '../../../types/helpers'\nimport { useFramework } from '../../../hooks/use-framework'\nimport styles from './RequirementCard.module.scss'\nimport { SkillBlobs } from './SkillBlobs'\nimport * as Card from './Card'\nimport shallow from 'zustand/shallow'\nimport { MinusCircle } from '@phosphor-icons/react'\n\nexport type RequirementCardProps = {\n  /**\n   * If a requirement id isn't passed, we can use that to apply empty card logic\n   */\n  requirement?: TRequirement\n  skill: TSkill\n  position: TPosition\n  uncategorised?: boolean\n} & DivPropsWithoutChildren\n\nexport const RequirementCard: React.VFC<RequirementCardProps> = (props) => {\n  const {\n    skill,\n    uncategorised,\n    requirement,\n    position,\n    className,\n    ...restProps\n  } = props\n\n  const [permissions, eventHandlers] = useFramework(\n    (s) => [s.permissions, s.eventHandlers],\n    shallow\n  )\n\n  const [temporaryLevel, setTemporaryLevel] = React.useState<number | null>(\n    null\n  )\n\n  const [errorMessage, setErrorMessage] = React.useState<string | null>(null)\n\n  const allowClickingRequirement = React.useMemo(() => {\n    if (!!requirement && permissions?.allowChangeRequirement) return true\n    if (!requirement && permissions?.allowCreateRequirement) return true\n    if (requirement?.level) return true\n  }, [requirement, permissions])\n\n  return (\n    <div\n      className={cn(styles.wrapper, 'group')}\n      data-element-id=\"requirement-card\"\n    >\n      <Card.Root\n        className={cn(\n          styles.requirementCard,\n          allowClickingRequirement && styles.showHover,\n          {\n            [styles.hovering]:\n              allowClickingRequirement &&\n              !!temporaryLevel &&\n              temporaryLevel !== requirement?.level,\n            [styles.empty]: !requirement,\n          },\n          className\n        )}\n        onClick={() => {\n          if (allowClickingRequirement) {\n            eventHandlers?.requirementClickHandler?.({\n              requirement,\n              position,\n              skill,\n            })\n          }\n        }}\n        tabIndex={allowClickingRequirement ? 0 : undefined}\n        showHover={allowClickingRequirement}\n        aria-label={`Requirement card for the ${skill.name} skill in the ${position.name} position.`}\n        {...restProps}\n      >\n        <Card.Header className={cn(styles.header, className)} {...restProps}>\n          <div className={styles.blobWrapper}>\n            <SkillBlobs\n              skill={skill}\n              position={position}\n              requirement={requirement}\n              temporaryLevel={temporaryLevel}\n              setTemporaryLevel={setTemporaryLevel}\n              setErrorMessage={setErrorMessage}\n            />\n            {requirement &&\n              eventHandlers?.onDeleteRequirement &&\n              permissions?.allowDeleteRequirement && (\n                <a\n                  className={styles.dismissLink}\n                  onClick={(e) => {\n                    e.stopPropagation()\n                    eventHandlers?.onDeleteRequirement?.(requirement)\n                  }}\n                >\n                  <span className=\"sr-only\">Delete requirement</span>\n                  <MinusCircle\n                    aria-hidden\n                    className={cn(\n                      styles.dismiss,\n                      'opacity-0',\n                      'group-hover:opacity-100',\n                      'focus-within:opacity-100'\n                    )}\n                  />\n                </a>\n              )}\n          </div>\n        </Card.Header>\n        <RequirementCardBody\n          skill={skill}\n          position={position}\n          requirement={requirement}\n          errorMessage={errorMessage}\n          temporaryLevel={temporaryLevel}\n          uncategorised={uncategorised}\n        />\n      </Card.Root>\n    </div>\n  )\n}\n\ntype RequirementCardBodyProps = {\n  uncategorised?: boolean\n  skill: TSkill\n  position: TPosition\n  level?: number\n  requirement?: TRequirement\n  temporaryLevel: number | null\n  errorMessage: string | null\n}\n\nconst RequirementCardBody: React.VFC<RequirementCardBodyProps> = (props) => {\n  const { skill, requirement, errorMessage, temporaryLevel } = props\n\n  const [permissions, getSkillLevelDescription] = useFramework(\n    (s) => [s.permissions, s.getSkillLevelDescription],\n    shallow\n  )\n\n  const content = () => {\n    if (errorMessage) {\n      return <p className={styles.description}>{errorMessage}</p>\n    }\n\n    if (\n      !requirement &&\n      !temporaryLevel &&\n      permissions?.allowCreateRequirement\n    ) {\n      return (\n        <p className={styles.addRequirement}>\n          Add requirement{' '}\n          <span className={styles.addRequirementIcon} aria-hidden>\n            +{' '}\n          </span>\n        </p>\n      )\n    }\n\n    if (temporaryLevel || (requirement && requirement.level)) {\n      const currentLevel = temporaryLevel || requirement?.level || 0\n      let description = getSkillLevelDescription(skill, currentLevel) || ''\n      const hasEmptyDescription = !description\n\n      if (hasEmptyDescription) description = 'Empty description'\n\n      return (\n        <div\n          className={cn(styles.description, {\n            [styles.emptyDescription]: hasEmptyDescription,\n          })}\n          dangerouslySetInnerHTML={{\n            __html: description,\n          }}\n        />\n      )\n    }\n  }\n\n  return <Card.Body>{content()}</Card.Body>\n}\n","import * as React from 'react'\nimport cn from 'classnames'\nimport styles from './SkillCard.module.scss'\nimport * as Card from './Card'\nimport type { TSkill } from '../../../types/entities'\n\nexport type SkillCardProps = {\n  skill: TSkill\n} & Omit<Card.RootProps, 'children'>\n\nexport const SkillCard: React.VFC<SkillCardProps> = (props) => {\n  const { skill, onClick, className, ...restProps } = props\n\n  return (\n    <Card.Root\n      onClick={onClick}\n      showHover={!!onClick}\n      className={cn(styles.skillCard, className)}\n      {...restProps}\n    >\n      <Card.Header className={styles.title}>\n        <h4>{skill.name}</h4>\n      </Card.Header>\n      {skill.description && (\n        <Card.Body\n          className={styles.description}\n          dangerouslySetInnerHTML={{ __html: skill.description }}\n        />\n      )}\n    </Card.Root>\n  )\n}\n","import * as React from 'react'\nimport cn from 'classnames'\nimport { DivPropsWithoutChildren } from '../../../types/helpers'\nimport { useFramework } from '../../../hooks/use-framework'\nimport { RequirementCard } from './RequirementCard'\nimport { TSkill } from '../../../types/entities'\nimport styles from './SkillRow.module.scss'\nimport { SkillCard } from './SkillCard'\nimport shallow from 'zustand/shallow'\nimport { Spacer } from './Spacer'\n\nexport type SkillRowProps = {\n  skill: TSkill\n  uncategorised?: boolean\n  /**\n   * Used for handling styles specific to the last skill in a category\n   */\n  lastInCategory?: boolean\n} & DivPropsWithoutChildren\n\nexport const SkillRow: React.VFC<SkillRowProps> = (props) => {\n  const {\n    skill,\n    className,\n    uncategorised = false,\n    lastInCategory = false,\n    ...restProps\n  } = props\n\n  const [\n    disciplines,\n    requirements,\n    getSortedPositionsByDiscipline,\n    eventHandlers,\n  ] = useFramework(\n    (s) => [\n      s.disciplines,\n      s.requirements,\n      s.getSortedPositionsByDiscipline,\n      s.eventHandlers,\n    ],\n    shallow\n  )\n\n  return (\n    <div\n      className={cn(\n        styles.skillRow,\n        { [styles.lastInCategory]: lastInCategory },\n        className\n      )}\n      {...restProps}\n    >\n      <SkillCard\n        skill={skill}\n        onClick={() => eventHandlers?.skillClickHandler?.(skill)}\n      />\n      {disciplines.map((discipline) => {\n        const sortedPositions = getSortedPositionsByDiscipline(discipline)\n\n        if (sortedPositions.length === 0)\n          return (\n            <React.Fragment key={`discipline-${discipline.id}`}>\n              {/* Width of a filled position card */}\n              <Spacer width=\"240px\" />\n              {/* 31px to include border, providing a gap between the empty spacer/next column */}\n              <Spacer width=\"31px\" />\n            </React.Fragment>\n          )\n\n        return (\n          <React.Fragment key={`discipline-${discipline.id}`}>\n            {sortedPositions.map((position, index) => {\n              const requirement = requirements?.find(\n                (req) =>\n                  req.skillId === skill.id && req.positionId === position.id\n              )\n\n              const key = requirement\n                ? `requirement-${requirement.id}`\n                : `empty-requirement-${index}`\n\n              return (\n                <RequirementCard\n                  key={key}\n                  requirement={requirement}\n                  skill={skill}\n                  position={position}\n                  uncategorised={uncategorised}\n                />\n              )\n            })}\n\n            {discipline !== disciplines[disciplines.length - 1] && <Spacer />}\n          </React.Fragment>\n        )\n      })}\n    </div>\n  )\n}\n","import * as React from 'react'\nimport { useFramework } from '../../../hooks/use-framework'\nimport * as CategoryRow from './CategoryRow'\nimport { SkillRow } from './SkillRow'\nimport shallow from 'zustand/shallow'\n\nexport const CategorisedSkills: React.VFC = () => {\n  const [categories] = useFramework(\n    (s) => [\n      s.categories,\n      s.uncategorisedSkills,\n      s.eventHandlers,\n      s.permissions,\n    ],\n    shallow\n  )\n\n  return (\n    <>\n      {categories.map((category, _categoryIndex) => (\n        <React.Fragment key={category.id}>\n          <CategoryRow.Root>\n            <CategoryRow.Title>{category.name}</CategoryRow.Title>\n          </CategoryRow.Root>\n          {category.skills?.map((skill, categorySkillIndex) => {\n            const lastInCategory = (categorySkillIndex: number) => {\n              return (\n                !!category.skills &&\n                categorySkillIndex === category.skills.length - 1\n              )\n            }\n\n            return (\n              <SkillRow\n                skill={skill}\n                key={`skill-${skill.id}`}\n                lastInCategory={lastInCategory(categorySkillIndex)}\n              />\n            )\n          })}\n        </React.Fragment>\n      ))}\n    </>\n  )\n}\n","import * as React from 'react'\nimport shallow from 'zustand/shallow'\nimport { useFramework } from '../../../hooks/use-framework'\nimport * as CategoryRow from './CategoryRow'\nimport { SkillRow } from './SkillRow'\n\nexport const UncategorisedSkills: React.VFC = () => {\n  const uncategorisedSkills = useFramework(\n    (s) => s.uncategorisedSkills,\n    shallow\n  )\n\n  if (uncategorisedSkills.length === 0) return null\n\n  const lastInCategory = (index: number) => {\n    return index === uncategorisedSkills.length - 1\n  }\n\n  return (\n    <>\n      <CategoryRow.Root uncategorised>\n        <CategoryRow.Title>Uncategorised skills</CategoryRow.Title>\n      </CategoryRow.Root>\n      {uncategorisedSkills.map((skill, index) => (\n        <SkillRow\n          uncategorised\n          skill={skill}\n          key={`skill-${skill.id}`}\n          lastInCategory={lastInCategory(index)}\n        />\n      ))}\n    </>\n  )\n}\n","import cn from 'classnames'\nimport * as React from 'react'\nimport { useFramework, UseFrameworkProps } from '../../../hooks/use-framework'\nimport { CategorisedSkills } from './CategorisedSkills'\nimport { DisciplinesRow } from './DisciplinesRow'\nimport styles from './FrameworkPage.module.scss'\nimport { UncategorisedSkills } from './UncategorisedSkills'\nimport { ScrollSync, ScrollSyncPane } from 'react-scroll-sync'\nimport shallow from 'zustand/shallow'\nimport { Plus } from '@phosphor-icons/react'\n\nexport type FrameworkPageProps = Pick<\n  UseFrameworkProps,\n  | 'categories'\n  | 'disciplines'\n  | 'eventHandlers'\n  | 'frameworkId'\n  | 'permissions'\n  | 'requirements'\n  | 'uncategorisedSkills'\n> & { className?: string }\n\nexport const FrameworkPage: React.VFC<FrameworkPageProps> = (props) => {\n  const scrollPosition = React.useRef(0)\n  const { className, ...frameworkProps } = props\n\n  const [setSticky] = useFramework((hook) => [hook.setSticky], shallow)\n\n  React.useEffect(() => {\n    const interval = setInterval(() => {\n      setSticky(scrollPosition.current > 10)\n    }, 200)\n\n    return () => clearInterval(interval)\n  }, [])\n\n  React.useEffect(() => {\n    // TODO: replace this with internal method so we can set state initially outside of use effect hook\n    useFramework.setState(frameworkProps)\n  }, [props])\n\n  return (\n    <ScrollSync\n      vertical={false}\n      onSync={(el) => {\n        if (el.id === 'framework-body') scrollPosition.current = el.scrollTop\n      }}\n    >\n      <div className={cn(styles.frameworkPage, className)}>\n        <ScrollSyncPane>\n          <DisciplinesRow disciplines={props.disciplines} />\n        </ScrollSyncPane>\n        <ScrollSyncPane>\n          <div className={styles.scrollWrapper} id=\"framework-body\">\n            <CategorisedSkills />\n            <UncategorisedSkills />\n            {props.permissions?.allowAddSkillCategory && (\n              <div className={cn('')}>\n                <div className={cn('')}>\n                  <button\n                    className={styles.cta}\n                    onClick={() =>\n                      props.eventHandlers?.onClickAddSkillCategory?.()\n                    }\n                    type=\"button\"\n                  >\n                    <Plus weight=\"bold\" className={styles.icon} aria-hidden />\n                    Add a category\n                  </button>\n                </div>\n              </div>\n            )}\n          </div>\n        </ScrollSyncPane>\n      </div>\n    </ScrollSync>\n  )\n}\n"],"names":["Root","props","children","className","uncategorised","restProps","sticky","useFramework","hook","jsx","cn","styles","Title","SkillBlobs","position","requirement","skill","temporaryLevel","setTemporaryLevel","setErrorMessage","eventHandlers","permissions","s","shallow","requirementLevel","maxSkillLevel","_a","max","level","_","index","isFilled","blobLevel","hasRequirementAtLevel","canChangeRequirement","cursorStyles","e","existingRequirement","error","RequirementCard","React.useState","errorMessage","allowClickingRequirement","React.useMemo","jsxs","Card.Root","Card.Header","MinusCircle","RequirementCardBody","getSkillLevelDescription","Card.Body","currentLevel","description","hasEmptyDescription","SkillCard","onClick","SkillRow","lastInCategory","disciplines","requirements","getSortedPositionsByDiscipline","discipline","sortedPositions","React.Fragment","Spacer","req","key","CategorisedSkills","categories","Fragment","category","_categoryIndex","CategoryRow.Root","CategoryRow.Title","categorySkillIndex","UncategorisedSkills","uncategorisedSkills","FrameworkPage","scrollPosition","React.useRef","frameworkProps","setSticky","React.useEffect","interval","ScrollSync","el","ScrollSyncPane","DisciplinesRow","_b","Plus"],"mappings":"2QAWA,MAAMA,EAA8BC,GAAU,CAC5C,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,cAAAC,EAAe,GAAGC,CAAc,EAAAJ,EAEvD,CAACK,CAAM,EAAIC,EAAcC,GAAS,CAACA,EAAK,MAAM,CAAC,EAGnD,OAAAC,EAAC,MAAA,CACC,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